Sample
int-c144d93d1385-I06
Invert eligible conditions and exchange their branches
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.59 | 0–1; higher is more readable |
| Dorn | 0.357 | 0–1; higher is more readable |
| Mi | 0.472 | 0–1; higher is more readable |
| LLOC | 35 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 9 | 0–20; mean of three runs |
| GPT-6.1 Sol | 12 | 0–20; mean of three runs |
| BTTF | 0.428 | 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. | 3404.12 | −112.336 |
| Source linesThe number of non-empty source lines. | 93 | +37.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.819 | −7.229 |
Intercept 8.87 + feature contributions = -73.495 (log-odds).
Score = sigmoid(-73.495) = 0.
| Score | 0.59 |
|---|
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. | 94 | −2.292 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 81 | +2.065 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 81 | −1.438 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 92.845 | +0.888 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 95.894 | +0.743 |
| 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. | 95.968 | −0.4 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.12 | −0.224 |
Intercept 0.07 + feature contributions = -0.588 (log-odds).
Score = sigmoid(-0.588) = 0.357.
| Score | 0.472 |
|---|
| Score | 35 |
|---|
Run 1
The code structure is acceptable, but readability is severely hampered by confusing control flow and unnatural boolean expressions. Many conditionals use double negatives and empty if-blocks, e.g., `if (!((!(obj instanceof EndpointPair)))) {} else { ... }`, which obscures intent and disrupts reading flow. The `size()` method has a complex multi-line expression that is hard to parse. Nesting is moderate but combined with awkward logic becomes difficult to follow. While methods like `predecessorsOrEmpty` are clear, the overall clarity of intent is low due to inconsistent and convoluted checks. Action granularity is generally one action per line, but some lines are unnecessarily complex. Code length is reasonable, but the unnatural condition ordering and redundant parentheses make it feel longer. Overall, the code works but reads poorly.
Run 2
The code has reasonable class structure and naming but suffers from several readability issues. The most severe problem is the inverted boolean conditions with empty bodies and double negations, such as `if (!((graph.isDirected())))` and `if (!((!(obj instanceof EndpointPair)))) {} else { return false; }`. These make the intent confusing and the control flow harder to follow than necessary. The `contains` method is particularly tangled, mixing instanceof checks and boolean comparisons inside double negatives. The `size` method has moderate nesting with a conditional expression that is somewhat compact but acceptable. Helper methods like `predecessorsOrEmpty` and `successorsOrEmpty` are clear, but the surrounding braces and negations reduce overall clarity. The enum and field organization are fine, but the style choices force readers to mentally invert conditions repeatedly.
Run 3
The code has clear naming, a logical class structure, and good documentation. However, readability is hurt by awkward inverted conditionals like `if (!((graph.isDirected())))` and `if (!((!(obj instanceof EndpointPair)))) {} else { ... }` with empty blocks, which obscure intent. Nesting is generally shallow, but boolean expressions in `contains()` and `size()` are dense and hard to parse. The `size()` method mixes several concerns in one arithmetic expression. Methods mostly perform one action per line, but some lines pack multiple conditions. The required JSON output is provided.
Run 1
Code Structure: Fields, enum, constructor, overrides, and focused helper methods are logically organized. Nesting: Depth is shallow, but unnecessary else blocks and empty if branches complicate otherwise simple control flow. Clarity of intent: Descriptive names and documentation explain the graph operations, while repeated negations and excessive parentheses obscure conditions, especially the type and ordering checks in contains(). Code length: Generally compact, though redundant branching adds avoidable noise. Action granularity: Most statements perform one action; the size calculation combines degree counts and self-loop correction into a dense expression. Reading flow: Method organization is natural, but inverted guards with empty bodies interrupt comprehension and require mentally simplifying Boolean expressions. Straightforward early returns and simpler conditions would substantially improve readability.
Run 2
Code Structure: Fields, enum, constructor, overrides, and helper methods are logically organized. Nesting: Depth is shallow, but empty if blocks and unnecessary else branches complicate otherwise simple guards. Clarity of intent: Descriptive names and documentation explain the graph operations, while repeated negations and excessive parentheses obscure conditions. Code length: Generally compact, though redundant branching and repeated predecessor lookups add avoidable complexity. Action granularity: Most statements perform one action; compound return expressions are cohesive but require careful reading, especially the self-loop adjustment in size(). Reading flow: Method ordering is natural, but inverted conditions and empty branches interrupt comprehension and force readers to mentally simplify boolean expressions.
Run 3
Code Structure: The class is logically organized into fields, an enum, and focused methods, with helper methods separating edge-direction logic. Nesting: Depth is low, but unnecessary else branches and empty if blocks complicate control flow. Clarity of intent: Descriptive names and documentation help, while repeated negations and excessive parentheses obscure otherwise straightforward conditions. The self-loop adjustment in size() requires careful interpretation. Code length: Reasonably compact overall, though redundant conditional syntax adds avoidable verbosity. Action granularity: Most statements perform one action; compound boolean expressions remain manageable, but the empty if/else constructs on single lines are awkward. Reading flow: Method ordering and consistent formatting support navigation, but inverted checks, empty branches, and repeated helper calls interrupt natural reading.