Sample
int-0dedd576ece6-I02
Shorten method, parameter, and local names without collisions
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.585 | 0–1; higher is more readable |
| Dorn | 0.283 | 0–1; higher is more readable |
| Mi | 0.578 | 0–1; higher is more readable |
| LLOC | 37 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 16 | 0–20; mean of three runs |
| GPT-6.1 Sol | 14.67 | 0–20; mean of three runs |
| BTTF | 0.472 | 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. | 3347.954 | −110.482 |
| Source linesThe number of non-empty source lines. | 129 | +51.6 |
| 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.722 | −7.083 |
Intercept 8.87 + feature contributions = -57.095 (log-odds).
Score = sigmoid(-57.095) = 0.
| Score | 0.585 |
|---|
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. | 130 | −3.567 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 86 | +2.238 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 86 | −1.553 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 128.634 | +1.388 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 97.631 | +0.771 |
| 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.969 | −0.569 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.067 | +0.29 |
Intercept 0.07 + feature contributions = -0.931 (log-odds).
Score = sigmoid(-0.931) = 0.283.
| Score | 0.578 |
|---|
| Score | 37 |
|---|
Run 1
The code is generally well-organized, with a clear class hierarchy and sensible separation of directed and undirected iteration logic. The use of Javadoc, especially the example in Undirected, enhances clarity. The main readability weaknesses are the repeated null-checks with explanatory comments, the somewhat opaque method names (`adv`, `gra2`/`gra3`), and a moderate level of nesting inside the compute methods. The field declarations and the overall control flow are understandable, but the mixing of state management (advance method) with traversal logic adds minor cognitive overhead. The code is concise for what it does, and each line generally performs a single logical action, but the reliance on comments to justify non-obvious null safety reduces clarity. Overall, it's readable but could be improved with better naming and clearer state management.
Run 2
The code demonstrates good structure with clear inheritance hierarchy, appropriate use of inner classes, and informative Javadoc comments. Nesting is reasonably flat except for the while loops with nested conditionals in compute() methods. Intent is mostly clear, though null-handling logic (requiring requireNonNull with comments) adds complexity and potential confusion. Code length is appropriate, but action granularity varies—some lines combine multiple operations. The field naming (gra2, gra3, gra4) is awkward and reduces readability. The class comments and method documentation aid understanding, but the null-safety reasoning requires careful reading. Overall, the code is maintainable and follows good practices, but could be improved with better parameter naming and simplification of null-handling patterns.
Run 3
The code is well-structured, with clear separation between directed and undirected iteration logic via inner classes. Nesting is moderate — the Undirected.compute method has two levels of loops, but it's manageable and avoids deeper entanglement. Intent is mostly clear: field and method names explain their roles, and comments clarify non-obvious null-safety and algorithmic choices. Code length is reasonable, though the verbose Javadoc for the undirected example adds some bulk. Action granularity is good: most lines perform a single logical operation. Reading flow is natural, aided by thoughtful comments and consistent formatting. Minor deductions for the slightly awkward null handling (e.g., null in visitedNodes) and the need for explanatory comments around it, which could confuse readers unfamiliar with the pattern.
Run 1
Code Structure: Shared traversal state and separate directed/undirected implementations provide logical organization. Nesting: Mostly shallow, although undirected traversal uses nested loops and a conditional. Clarity of intent: Descriptive class and field names plus detailed comments explain traversal, duplicate suppression, and self-loops. However, gra/gra2/gra3/gra4 and adv are vague; calls to advance() do not match adv(), and compute() does not match AbstractIterator's expected computeNext(), disrupting understanding. Code length: Implementation is reasonably concise, though the lengthy example and repeated null-safety comments increase reading time. Action granularity: Statements generally perform one action per line. Reading flow: Initialization, traversal, and termination follow a natural sequence, but naming inconsistencies and nullable state handling require extra mental effort.
Run 2
Code Structure: Shared iterator state and separate directed/undirected implementations provide logical organization. Nesting: Directed traversal is shallow; undirected traversal has moderately nested loops and conditions but remains manageable. Clarity of intent: Descriptive class names and detailed comments explain traversal, duplicate suppression, and self-loops. However, gra/gra2/gra3/gra4 and adv are weak names, and calls to advance() conflict with the declared adv(); compute() also appears inconsistent with AbstractIterator's expected computeNext() override. These inconsistencies interrupt understanding. Code length: Implementation is reasonably concise, though the lengthy example comment adds substantial reading overhead. Action granularity: Statements generally perform one action per line, with conventional constructor and return expressions. Reading flow: Fields, factory, shared helper, and specialized implementations follow a natural sequence, but inconsistent naming and nullable-state bookkeeping require extra attention.
Run 3
Code Structure: Shared iterator state and separate directed/undirected subclasses provide logical organization. Nesting: Directed traversal is shallow; undirected traversal has moderately nested loops and conditions but remains manageable. Clarity of intent: Descriptive class names and detailed comments explain traversal, duplicate suppression, and self-loops. However, gra/gra2/gra3/gra4 and adv are unclear names, and calls to advance() do not match the declared adv() method. The compute() override also obscures the expected AbstractIterator computeNext() contract. Code length: Implementation is reasonably concise, although the extensive undirected example adds substantial reading length. Action granularity: Statements generally perform one action per line, making state changes easy to identify. Reading flow: Factory, shared advancement logic, and specialized traversal follow a natural sequence, but naming inconsistencies and nullable-state bookkeeping interrupt comprehension.