Sample
int-b5a50d433750-I06
Invert eligible conditions and exchange their branches
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.613 | 0–1; higher is more readable |
| Dorn | 0.634 | 0–1; higher is more readable |
| Mi | 0.684 | 0–1; higher is more readable |
| LLOC | 10 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 8.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 12.67 | 0–20; mean of three runs |
| BTTF | 0.573 | 0–1; higher is more readable |
Views
Loading feature diagnosis…
Source regions
Feature contributions
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones. | 1131.297 | −37.333 |
| Source linesThe number of non-empty source lines. | 48 | +19.2 |
| Byte entropyHow varied the bytes in the source text are. Repeated bytes give a lower value; a more even mixture gives a higher value. | 4.98 | −7.47 |
Intercept 8.87 + feature contributions = -16.733 (log-odds).
Score = sigmoid(-16.733) = 0.
| Score | 0.613 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 49 | −0.699 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 81.265 | +0.507 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 30 | +0.301 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 30 | −0.268 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 47.798 | +0.258 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.073 | +0.229 |
| Identifier layout (horizontal)How rapidly the visual pattern of identifier characters changes from left to right. It measures spatial frequency, not the meaning of the names. | 82.98 | +0.151 |
Intercept 0.07 + feature contributions = 0.549 (log-odds).
Score = sigmoid(0.549) = 0.634.
| Score | 0.684 |
|---|
| Score | 10 |
|---|
Run 1
The code's structure and public API are reasonable, but the logic in `generateKey` is heavily obscured by deliberately awkward and unnatural conditional constructs — specifically the empty `if` blocks paired with `else` branches. This inverts standard readability expectations and forces the reader to mentally 'reverse' every condition. Multi-line conditionals with excessive parentheses further reduce clarity. While the method is short and actions are generally one per line, the flow of reading is disorganized and the intent is ambiguous. The class-level Javadocs are helpful, but the method-level logic negates that advantage. Overall, the code is functionally concise but conceptually tangled, earning a low readability score.
Run 2
The code is mostly well-structured with clear class-level documentation and sensible method separation. However, readability suffers significantly in the generateKey method. The conditional logic is awkwardly inverted: 'if (!(condition)) {} else { return ... }' is a confusing pattern that obscures intent. Nesting is minimal and each action is generally on its own line, which is good. The Kotlin detection logic in the generate method is clear but slightly verbose. The method-level Javadoc for generateKey is sparse. Overall, the code has good bones but the bizarre conditional style and empty if-blocks make it harder to read than necessary. A simple 'if (params.length == 0) return SimpleKey.EMPTY;' would dramatically improve clarity.
Run 3
The code exhibits several readability issues. The generateKey method contains inverted and unnecessarily convoluted conditionals like 'if (!((params.length == 0))) {} else { return SimpleKey.EMPTY; }' which force readers to reverse logic mentally. Empty if blocks with logic in else clauses obscure intent and break natural reading flow. The method mixes multiple actions and checks across lines, reducing clarity. While the class-level Javadoc is helpful and imports are clean, the core logic is tangled and verbose for such a simple task. Nesting is shallow but the conditional style harms comprehension. The KotlinDetector array truncation uses a ternary within a method call, adding minor complexity. Action granularity is acceptable but overall structure and clarity suffer significantly from deliberate inversion of standard boolean logic and empty conditional branches.
Run 1
Code Structure: Responsibilities are logically separated between generate and generateKey, but empty if branches with logic in else blocks obscure standard guard clauses. Nesting: Mostly shallow, with one nested check for a single parameter. Clarity of intent: Names and documentation clearly describe key generation, while negated conditions and redundant parentheses make simple length checks unnecessarily confusing. Code length: Compact overall, though empty branches add avoidable syntax. Action granularity: Most lines contain one action, but the inline empty branches reduce visual clarity. Reading flow: The delegation and final fallback are natural; inverted branching interrupts the flow, and the Kotlin-specific ternary requires additional interpretation.
Run 2
Code Structure: The class is logically divided into delegation and key-generation methods, but empty if branches with inverted conditions obscure otherwise straightforward logic. Nesting: Mostly shallow, with one nested check; unnecessary else blocks add avoidable nesting. Clarity of intent: Documentation, descriptive names, and explicit return values clarify the purpose, while double parentheses, negations, and empty branches make parameter-count checks harder to interpret. Code length: Compact overall, though redundant syntax adds clutter without functionality. Action granularity: Statements generally perform one action per line; the ternary expression combines detection and parameter adjustment but remains manageable. Reading flow: Method order and early returns support natural reading, but the unusual conditional structure interrupts the flow and requires mentally reversing conditions.
Run 3
Code Structure: The class is logically divided into delegation and key-generation methods, but empty if branches with operative else blocks obscure otherwise simple logic. Nesting: Depth is modest, though the inverted conditionals introduce avoidable nesting. Clarity of intent: Documentation, method names, and constants clearly explain key generation; redundant parentheses and negations make parameter-count checks unnecessarily confusing. Code length: Overall concise, but the empty branches add needless syntax. Action granularity: Most statements perform one action, although inline empty branches and else clauses reduce visual clarity. Reading flow: The methods follow a sensible sequence, but inverted conditions interrupt natural reading, and the multiline ternary requires extra attention. Direct checks for zero and one parameter would substantially improve readability.