Sample
int-5738c6b5c269-I06
Invert eligible conditions and exchange their branches
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.493 | 0–1; higher is more readable |
| Dorn | 0.304 | 0–1; higher is more readable |
| Mi | 0.467 | 0–1; higher is more readable |
| LLOC | 38 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 9.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 13.33 | 0–20; mean of three runs |
| BTTF | 0.541 | 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. | 3939.97 | −130.019 |
| Source linesThe number of non-empty source lines. | 105 | +42 |
| 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.944 | −7.416 |
Intercept 8.87 + feature contributions = -86.565 (log-odds).
Score = sigmoid(-86.565) = 0.
| Score | 0.493 |
|---|
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. | 106 | −2.717 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 89 | +2.341 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 89 | −1.621 |
| 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. | 111.953 | −1.077 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 104.858 | +1.056 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 109.849 | +0.968 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.081 | +0.151 |
Intercept 0.07 + feature contributions = -0.829 (log-odds).
Score = sigmoid(-0.829) = 0.304.
| Score | 0.467 |
|---|
| Score | 38 |
|---|
Run 1
The code has a clear class structure but suffers from poor readability due to unconventional boolean checks written as `if (!(...)) {} else { ... }`, which breaks natural reading flow and obscures intent. These inverted empty-if blocks appear multiple times, increasing cognitive load. Nesting is moderate, but `getTarget` and `generate` methods are awkwardly structured. Action granularity is generally one action per line, but the boolean-condition style harms clarity. Code length is reasonable, though some methods could be shorter. The class-level Javadoc is helpful, but method-level Javadoc is uneven. Overall, the logic is understandable but unnecessarily obfuscated by reversed conditionals, making the code harder to follow than it should be.
Run 2
The code has several readability issues. The most significant problem is the inverted boolean conditions throughout, such as 'if (!((this.cacheKeyGenerator != null))) {} else { return ... }' - this double negative with empty if-block is confusing and should be a simple null check. Similar patterns appear in generate() and doGenerate() methods. The negation of complex conditions like '!((param.getParameterPosition() == context.getAllParameters().length - 1 && context.getMethod().isVarArgs()))' adds unnecessary cognitive load. The getTarget() method also uses this inverted pattern with an odd empty if-block. While the class has a clear purpose and follows Spring conventions with proper annotations and documentation, the control flow is unnecessarily tangled. The code could be significantly improved by expressing conditions positively with standard if-else statements. Method names and variable names are generally good, and the code is not deeply nested, but the bizarre condition inversions make it harder to read than necessary.
Run 3
The code is moderately readable but contains several issues. The inverted if-else conditions like `if (!((this.cacheKeyGenerator != null))) {} else { ... }` are confusing and unnatural - normal positive conditions would be much clearer. The empty if-blocks with logic in else-branches violate the principle of clear intent. There are also awkward null checks with double negatives throughout. Variable naming is generally good and the class has a clear purpose with decent documentation. The method structure is logical but the conditional logic makes reading flow disorganized. Some methods use unnecessary wrapper conditions that add nesting complexity. The code length is reasonable and actions are mostly granular, but the unusual conditional patterns significantly reduce readability despite the otherwise clean structure.
Run 1
Code Structure: Well-organized adapter with separate constructors and focused helper methods, though empty conditional branches introduce needless complexity. Nesting: Mostly shallow, with only a loop containing a conditional. Clarity of intent: Descriptive names, documentation, and assertions explain the purpose, but excessive parentheses, negated conditions, and a double negation obscure straightforward checks. Code length: Generally reasonable, although duplicated constructor validation and verbose conditionals add clutter. Action granularity: Each statement performs a single clear action; no compressed multi-action lines. Reading flow: Method ordering and delegation are natural, but empty if blocks followed by meaningful else branches force readers to mentally invert conditions. Straightforward positive checks and guard clauses would substantially improve readability.
Run 2
Code Structure: Fields, constructors, delegation logic, and helpers are logically organized. Nesting: Mostly shallow, with only a loop containing a conditional. Clarity of intent: Descriptive names and documentation explain the adapter's purpose, but redundant parentheses, negated conditions, double negation, and empty if branches obscure straightforward checks. Code length: Reasonably concise overall, though unnecessary conditional scaffolding adds noise. Action granularity: Statements generally perform one action per line, making individual operations easy to follow. Reading flow: Method ordering and consistent formatting support navigation, but inverted branch logic and empty branches repeatedly interrupt natural reading. Simplifying conditions and using direct guard clauses would substantially improve readability.
Run 3
Code Structure: The adapter is logically organized into constructors, delegation methods, and context creation, with clear separation of responsibilities. Nesting: Depth is shallow, but empty if branches and unnecessary else blocks complicate simple decisions. Clarity of intent: Descriptive names, documentation, and assertions explain the purpose, while redundant parentheses and double/triple negations obscure conditions, especially the operation-type check. Code length: Mostly concise, although duplicated constructor setup and verbose conditional syntax add avoidable bulk. Action granularity: Statements generally perform one action per line, making assignments and parameter handling easy to follow. Reading flow: Method ordering and formatting are consistent, but inverted conditions and empty branches interrupt the otherwise natural flow and require readers to mentally simplify the logic.