Sample
int-9bb8f4c5cedd-I06
Invert eligible conditions and exchange their branches
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.628 | 0–1; higher is more readable |
| Dorn | 0.7 | 0–1; higher is more readable |
| Mi | 0.628 | 0–1; higher is more readable |
| LLOC | 16 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 9.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 12 | 0–20; mean of three runs |
| BTTF | 0.508 | 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. | 1470.823 | −48.537 |
| Source linesThe number of non-empty source lines. | 45 | +18 |
| 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.718 | −7.078 |
Intercept 8.87 + feature contributions = -28.745 (log-odds).
Score = sigmoid(-28.745) = 0.
| Score | 0.628 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 100 | +0.809 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 46 | −0.592 |
| 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. | 99.978 | −0.569 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 37 | +0.543 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 44.861 | +0.217 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.1 | −0.03 |
Intercept 0.07 + feature contributions = 0.845 (log-odds).
Score = sigmoid(0.845) = 0.7.
| Score | 0.628 |
|---|
| Score | 16 |
|---|
Run 1
The code structure has a clear purpose but suffers from poor readability due to unnecessary complexity. Key issues include: inverted conditional logic with empty if-blocks (e.g., 'if (!((result == null))) {} else {'), awkward one-line nested conditionals with inconsistent brace placement, and action granularity problems where multiple statements occupy single lines. The 'hasSameComparator' method uses nested if-else inside a single line, making flow hard to follow. While method names are descriptive and documentation exists, the implementation obscures clarity. Action granularity is inconsistent—some lines contain multiple operations while others are unnecessarily fragmented. Reading flow feels disorganized due to mixed brace styles and inverted conditions with empty blocks. The code would benefit from flat, straightforward conditionals without empty branches or double negatives.
Run 2
The code is moderately readable but suffers from several issues. The structure is mostly logical but contains awkward conditionals and inconsistent formatting. The nesting is shallow but the `hasSameComparator` method uses a compressed if-else chain where multiple conditions are placed on single lines, hurting readability. The intent is somewhat clear due to Javadoc comments, but the boolean negations like `if (!((result == null))) {} else {` and `if (!((elements instanceof SortedSet)))` are confusing and should be inverted. The method named `comparator` shadows a parameter and has unclear naming. Multiple statements on one line violate action granularity, and reading flow is disrupted by unusual brace placement and negated conditions. While the code is short, it could be clearer with better conditionals, whitespace, and naming.
Run 3
The code has clear intent and is moderately structured, but suffers from poor readability due to awkward nested conditional formatting, inverted boolean checks, and inconsistent line breaks. The `hasSameComparator` method compresses multiple actions and nested blocks into single lines, making the control flow difficult to follow. The `if (!condition) {} else {}` pattern is counterintuitive and adds cognitive overhead. Action granularity is inconsistent, and the reading flow is disrupted by dense formatting and non-standard style choices. While the code is concise and logically functional, it could be significantly improved with better formatting, flatter nesting, and more natural conditional expressions.
Run 1
Code Structure: The utility class separates comparator detection and retrieval into focused methods, but awkward conditionals obscure otherwise logical organization. Nesting: Nesting is modest, yet placing an inner if on the same line as the outer branch makes it harder to follow. Clarity of intent: Method names, documentation, and null checks communicate purpose; double negations, redundant parentheses, an empty branch, and the vague name comparator2 reduce clarity. Code length: The code is short, but unnecessarily complicated conditions add visual noise. Action granularity: Most statements occupy separate lines, though compressed branch boundaries violate this consistency. Reading flow: Imports, documentation, and methods follow a natural order, but inverted checks and irregular formatting interrupt local comprehension.
Run 2
Code Structure: The class is logically organized into two focused utility methods, but awkward conditionals obscure their otherwise simple logic. Nesting: hasSameComparator introduces unnecessary nesting that straightforward positive checks would avoid. Clarity of intent: Documentation, method names, and null checks communicate purpose well; double negations, redundant parentheses, an empty branch, and the generic name comparator2 reduce clarity. Code length: The implementation is short, but unnecessary conditional scaffolding makes it less concise than it could be. Action granularity: Most statements perform one action per line, although placing two conditional openings on one line hurts readability. Reading flow: The overall progression is understandable, but inverted conditions, compressed braces, and an empty if branch interrupt natural reading.
Run 3
Code Structure: The utility class has two focused methods, but awkward conditionals obscure otherwise logical organization. Nesting: Depth is modest, yet the nested if placed on the same line and compressed braces make branches harder to follow. Clarity of intent: Method names, documentation, and null checks explain the purpose well; comparator2, double negations, and an empty branch reduce clarity. Code length: The code is short, though redundant parentheses and empty conditional logic add unnecessary clutter. Action granularity: Most statements occupy separate lines, but multiple control-flow constructs share a line. Reading flow: Imports, documentation, and method ordering are natural; reversed conditions and inconsistent formatting interrupt the flow. Straightforward positive conditions and consistent branch formatting would substantially improve readability.