Sample
int-5e22f0c87899-I06
Invert eligible conditions and exchange their branches
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.815 | 0–1; higher is more readable |
| Dorn | 0.223 | 0–1; higher is more readable |
| Mi | 0.081 | 0–1; higher is more readable |
| LLOC | 37 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 8 | 0–20; mean of three runs |
| GPT-6.1 Sol | 11.67 | 0–20; mean of three runs |
| BTTF | 0.513 | 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. | 2401.652 | −79.255 |
| Source linesThe number of non-empty source lines. | 96 | +38.4 |
| 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.531 | −6.796 |
Intercept 8.87 + feature contributions = -38.781 (log-odds).
Score = sigmoid(-38.781) = 0.
| Score | 0.815 |
|---|
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. | 97 | −2.398 |
| 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. | 139.938 | −2.262 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 85 | +2.203 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 85 | −1.53 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 139.969 | +1.454 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 95.766 | +0.929 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.067 | +0.287 |
Intercept 0.07 + feature contributions = -1.247 (log-odds).
Score = sigmoid(-1.247) = 0.223.
| Score | 0.081 |
|---|
| Score | 37 |
|---|
Run 1
The code has a clear overall structure with a single class, enum, fields, constructor, and standard methods, but several readability issues significantly hurt the score. The `fromCode` method uses deeply nested if-else logic with inverted conditions, making it hard to follow. The constructor similarly uses awkward negated conditions with empty branches, obscuring validation intent. The `equals` method also suffers from inverted boolean logic that disrupts natural reading flow. While the code is concise and each line generally performs a single action, the unnatural conditionals and nesting reduce clarity. Javadoc is present and helpful. Overall, the structure is logical, but the control-flow style makes the code harder to read than necessary.
Run 2
The code has clear intent and good Javadoc, but readability is severely hindered by unnatural control flow. Conditions are written as negated statements with empty 'if' blocks and logic in 'else' blocks (e.g., 'if (!condition) {} else { throw ... }'), which inverts normal reading flow and obscures intent. The 'fromCode' method is nested and convoluted, using an unnecessary negated pattern. While the code is concise and each line performs one action, the unusual conditional structures make it harder to follow than standard 'if (condition) { ... } else { ... }' patterns. The class structure and encapsulation are good, but the repeated use of inverted conditionals drags the readability down significantly.
Run 3
The code is severely hampered by unnatural inverted conditional structures like `if (!((x))) {} else { ... }`, which obscure intent and disrupt reading flow. The `fromCode` method is deeply nested and convoluted, making a simple mapping hard to follow. Validation logic using empty if-blocks with else clauses is confusing and violates action granularity. While class structure is reasonably organized and naming is clear, these readability issues dominate. The logic could be significantly simplified with straightforward conditionals and switch statements, reducing length and improving clarity.
Run 1
1. Code Structure: The class is logically organized into fields, an enum, constructor, accessors, and standard overrides. 2. Nesting: Most methods are flat, but fromCode introduces unnecessary nesting and awkward brace placement. 3. Clarity of intent: Descriptive names and documentation communicate the domain purpose, while negated conditions, redundant parentheses, and empty branches obscure straightforward checks. 4. Code length: Overall length is reasonable, but inverted if/else statements add unnecessary syntax and lines. 5. Action granularity: Most lines perform one action, although multiple control-flow constructs and braces share lines in fromCode. 6. Reading flow: The member ordering is natural, but readers must repeatedly mentally invert conditions, especially the double negation in equals. Direct guard clauses and a switch for code mapping would substantially improve readability.
Run 2
Code Structure: The class is logically organized into fields, an enum, a constructor, accessors, and standard overrides. Nesting: Most methods are shallow, but fromCode introduces unnecessary nesting and awkward brace placement. Clarity of intent: Descriptive names and documentation explain the feature-update model, while negated conditions, redundant parentheses, and empty if branches obscure straightforward checks. Code length: Overall length is reasonable, though conventional guard clauses and a switch would express the same logic more concisely. Action granularity: Most lines contain one action, but multiple conditional statements and braces on single lines reduce scanability. Reading flow: Method ordering is natural, but repeatedly placing meaningful behavior in else branches forces readers to mentally invert conditions, especially in constructor validation and equals.
Run 3
Code Structure: The class is logically organized into fields, an enum, validation, accessors, and standard object methods. Nesting: Most methods are shallow, but fromCode introduces unnecessary nesting and cramped braces. Clarity of intent: Descriptive names and documentation explain the purpose, while negated conditions, redundant parentheses, and empty branches obscure straightforward checks. Code length: Overall compact, but artificial if/else constructs add unnecessary syntax and could be replaced with direct guard clauses or a switch. Action granularity: Most lines contain one action, but multiple conditions and braces on the same line in fromCode reduce readability. Reading flow: The overall method order is natural, yet repeatedly placing meaningful behavior in else branches forces readers to mentally invert conditions and interrupts the flow.