Sample
int-6a503d9e1759-I06
Invert eligible conditions and exchange their branches
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.667 | 0–1; higher is more readable |
| Dorn | 0.313 | 0–1; higher is more readable |
| Mi | 0.034 | 0–1; higher is more readable |
| LLOC | 51 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 8.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 14 | 0–20; mean of three runs |
| BTTF | 0.462 | 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. | 3444.441 | −113.667 |
| Source linesThe number of non-empty source lines. | 98 | +39.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.676 | −7.014 |
Intercept 8.87 + feature contributions = -72.611 (log-odds).
Score = sigmoid(-72.611) = 0.
| Score | 0.667 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 96 | +2.583 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 99 | −2.469 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 96 | −1.782 |
| 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. | 115.99 | −1.248 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 116 | +1.067 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 97.88 | +0.958 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.094 | +0.033 |
Intercept 0.07 + feature contributions = -0.786 (log-odds).
Score = sigmoid(-0.786) = 0.313.
| Score | 0.034 |
|---|
| Score | 51 |
|---|
Run 1
The code has several readability issues. First, inverted empty block if statements like `if (!((bndAddr != null))) {} else { ... }` are confusing and should be simplified to `if (bndAddr == null) { ... } else { ... }`. This pattern also makes the code unnecessarily long. Second, the constructor has deep nesting with multiple levels of if-else chains, making it harder to follow. Third, some validation logic could be extracted into helper methods to improve action granularity and structure. The toString method has a similar inverted condition with empty block that obscures intent. However, the class is well-structured, fields are final, and getters are straightforward. The code follows Java conventions for naming and organization. Overall, it's functional but unnecessarily convoluted, reducing readability significantly.
Run 2
The code structure and field organization are clear, and method names communicate intent well. However, readability is significantly damaged by inverted conditionals that create awkward, non-natural flow (e.g., `if (!((bndAddr != null))) {} else { ... }`). Nesting is moderate but made worse by these inverted checks. Action granularity is mostly acceptable, though the constructor is long and mixes validation logic. The `toString()` method suffers from the same inverted conditional problem, making its logic unnecessarily confusing. Concise naming is good, but unnecessarily wrapped or negated conditions hurt clarity.
Run 3
The code has a clear class structure and standard getter/setter methods, but readability is significantly harmed by inverted logic patterns like `if (!condition) {} else { ... }` and double-negated conditions. The constructor validation flow is convoluted: the null/address type checks are nested awkwardly, making intent hard to follow. The `toString` method also uses an unnecessary empty if-block with inverted condition, disrupting natural reading. Action granularity is generally okay, but the overall nesting and inversion creates confusion. Code length is reasonable, but the unusual conditional style adds cognitive overhead. The class structure is logical, but the implementation choices obscure clarity.
Run 1
Code Structure: Fields, constructors, accessors, and string formatting are logically organized. Nesting: Address validation reaches three conditional levels, adding moderate complexity. Clarity of intent: Types, validation messages, and method names convey purpose, but redundant parentheses, negated conditions, and empty if branches obscure straightforward checks. Code length: Mostly appropriate for a response object, though verbose conditionals and repeated append calls add bulk. Action granularity: Statements generally perform one action per line, making operations easy to follow; empty if/else constructs are awkward exceptions. Reading flow: The overall sequence is natural, but inverted validation branches and the double-negative success check interrupt comprehension. Direct positive conditions would substantially improve readability.
Run 2
Code Structure: Fields, constructors, accessors, and string formatting are logically organized. Nesting: Address validation has moderate nesting that could be simplified. Clarity of intent: Class purpose and validation messages are clear, but redundant parentheses, negated conditions, and empty if branches obscure straightforward checks. Code length: Mostly appropriate for a small response class, though validation and string-building boilerplate add verbosity. Action granularity: Most lines perform a single action; the empty-if/else constructs unnecessarily combine control-flow elements on one line. Reading flow: Conventional method ordering and consistent formatting help, but inverted validation branches and the double negation in toString interrupt natural reading.
Run 3
Code Structure: Fields, constructors, accessors, and string formatting are logically organized, with validation localized to the main constructor. Nesting: Address validation has moderate nesting, made unnecessarily awkward by an empty if branch followed by else. Clarity of intent: Types, validation messages, and method names communicate purpose, but redundant parentheses, negated conditions, and double negation obscure straightforward checks. Code length: Generally appropriate for the class, though empty branches and repetitive formatting statements add clutter. Action granularity: Most lines perform a single operation, making validation and assignments easy to follow; the inline empty branches are exceptions. Reading flow: The progression from validation to initialization and accessors is natural, but inverted conditions interrupt comprehension and require mentally simplifying expressions.