Sample
int-1d520c07ffae-I13
Lower every eligible classic and enhanced for loop to a while loop
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.614 | 0–1; higher is more readable |
| Dorn | 0.381 | 0–1; higher is more readable |
| Mi | 0.507 | 0–1; higher is more readable |
| LLOC | 35 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 16.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs |
| BTTF | 0.46 | 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. | 3171.581 | −104.662 |
| 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.805 | −7.207 |
Intercept 8.87 + feature contributions = -65.799 (log-odds).
Score = sigmoid(-65.799) = 0.
| Score | 0.614 |
|---|
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.856 | +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.989 | −0.401 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.109 | −0.12 |
Intercept 0.07 + feature contributions = -0.485 (log-odds).
Score = sigmoid(-0.485) = 0.381.
| Score | 0.507 |
|---|
| Score | 35 |
|---|
Run 1
The code is well-structured and readable. It uses a logical class hierarchy, clear method names, and descriptive Javadoc. The `EdgeType` enum improves clarity. Methods are concise, and code is mostly flat with minimal nesting. The main readability concern is in `contains` and `size`, which have slightly complex boolean logic and repeated calls to helper methods. Additionally, the ternary in `size` and the mixed concerns in `contains` make the intent slightly harder to parse at a glance. Overall, the structure and naming are strong, but a few expressions could be extracted for even better clarity.
Run 2
The code is well-structured and readable. It has a clear class purpose, good documentation, and logical organization. The nesting is shallow, with simple if-else branches and no deep indentation. Method names like `predecessorsOrEmpty` clearly convey intent. The code is concise without being overly dense. Each line generally performs a single action, and the reading flow is natural. Minor deductions: the `size()` method has a complex ternary expression that could be extracted for clarity, and the `contains()` method has a long boolean expression that slightly reduces readability. Overall, the code is maintainable and understandable.
Run 3
The code is well-structured with clear class and method organization. The edge type enum helps clarify intent. Methods are small and focused, generally one action per line. Nesting is minimal in most methods, though 'contains' has two levels with boolean logic across multiple lines. The ternary in 'size' with method calls inside is slightly dense but understandable. Javadoc comments on private helper methods are good. The 'contains' method has multiple conditions and object casting that add complexity but remain readable. Overall, the code is concise and follows good practices, though some expressions could use explanatory variables.
Run 1
Code Structure: Fields, enum, constructor, overrides, and focused helpers are logically organized. Nesting: Shallow conditionals and early validation returns keep complexity low. Clarity of intent: Descriptive names, enum comments, and helper documentation make edge filtering clear; the self-loop adjustment in size() could use an explanatory comment. Code length: Compact and appropriately scoped, although repeated predecessor lookups and explicit else branches add minor verbosity. Action granularity: Statements generally perform one action each; compound boolean expressions remain manageable, but size() combines several calculations. Reading flow: Consistent formatting and a natural progression from public behavior to private helpers make the class easy to follow, with slightly denser expressions in size() and contains().
Run 2
Code Structure: Well-organized class with focused overrides, an explicit edge-type enum, and small helper methods. Nesting: Shallow conditionals and early validation returns keep control flow easy to follow. Clarity of intent: Descriptive names and helper documentation clearly explain edge filtering; the self-loop subtraction in size() would benefit from a comment. Code length: Concise overall, though repeated predecessor lookups and unnecessary else branches add minor verbosity. Action granularity: Statements generally perform one action per line; compound return expressions remain reasonably readable. Reading flow: Fields, constructor, public methods, and private helpers follow a natural order. Directed and undirected cases are cleanly separated, although the multiline arithmetic and Boolean expressions require slightly more attention.
Run 3
Code Structure: Fields, enum, constructor, overrides, and private helpers are logically organized, with edge-selection logic isolated in helpers. Nesting: Shallow conditionals and early validation returns keep branching easy to follow. Clarity of intent: Descriptive names, enum comments, and helper documentation clearly convey graph-edge behavior; the self-loop subtraction in size() would benefit from a brief explanation. Code length: Compact and appropriate, though repeated predecessor lookups and explicit else branches add minor verbosity. Action granularity: Statements generally perform one action each; compound boolean expressions and the size calculation require slightly more attention. Reading flow: Validation precedes membership checks, and directed versus undirected behavior is clearly separated. Overall, the code is highly readable, with only modest complexity in its arithmetic and membership expressions.