Sample
int-edb453be61c5-I08
Select one of ten high-readability unrelated code templates per class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.501 | 0–1; higher is more readable |
| Dorn | 0.463 | 0–1; higher is more readable |
| Mi | 0.48 | 0–1; higher is more readable |
| LLOC | 30 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 7 | 0–20; mean of three runs |
| GPT-6.1 Sol | 13.33 | 0–20; mean of three runs |
| BTTF | 0.326 | 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. | 2634.98 | −86.954 |
| Source linesThe number of non-empty source lines. | 78 | +31.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.991 | −7.486 |
Intercept 8.87 + feature contributions = -54.37 (log-odds).
Score = sigmoid(-54.37) = 0.
| Score | 0.501 |
|---|
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. | 79 | −1.761 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 69 | +1.65 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 69 | −1.163 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 95.911 | +0.743 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 77.825 | +0.678 |
| 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.937 | −0.398 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.093 | +0.034 |
Intercept 0.07 + feature contributions = -0.147 (log-odds).
Score = sigmoid(-0.147) = 0.463.
| Score | 0.48 |
|---|
| Score | 30 |
|---|
Run 1
The code is fundamentally well-structured, with clear class responsibility and logical method organization. However, it suffers from several readability issues: (1) a bizarre, unrelated block of code about temperatures is inexplicably embedded in the toString() method before the return statement, which is dead code and severely damages clarity and reading flow; (2) the generic type signatures and raw-type casts add significant noise to otherwise simple methods like nullsFirst(), nullsLast(), and reverse(); (3) the @SuppressWarnings annotations with TODO comments about uncertain explanations signal unresolved design debt that readers must mentally skip. The lazy-initialization pattern for nullsFirst/nullLast is clear and concise, and the readResolve() comment is helpful. Nesting is minimal, and action granularity is generally one action per line. Overall, the accidental method pollution and type-casting noise outweigh the solid structure, yielding a score below average for readability.
Run 2
The code mostly follows logical structure for Guava's NaturalOrdering singleton, with reasonable method granularity and some flat nesting. However, a major readability flaw is a completely unrelated block of code (temperature variables) embedded inside the toString() method before the return statement. This is disorienting and breaks reading flow, making the intent unclear. Additionally, the class has heavy type annotations, unchecked casts with TODO comments, and lazy initialization logic that adds complexity. The transient fields and readResolve for singleton preservation are standard but require familiarity with serialization patterns. Overall, while the surrounding structure is maintainable if you know Guava patterns, the stray unrelated code block and annotation noise significantly reduce clarity.
Run 3
The code has several readability issues. There is a completely unrelated block of code (temperature variables and an if statement) injected inside the toString() method, which severely breaks logical organization and clarity of intent. The nesting is generally flat, which is positive, but the mysterious TODO comments and excessive @SuppressWarnings annotations with 'the right way to explain this??' create ambiguity about the code's purpose. Type signatures with generics and nullability annotations are verbose and hard to parse. The lazy initialization pattern in nullsFirst() and nullsLast() is somewhat clear but made harder to follow by the complex generic casts. The singleton pattern and readResolve() method are reasonably clear. Action granularity is mostly acceptable except for the injected temperature block which performs multiple unrelated actions. The reading flow is completely disrupted by this foreign code block.
Run 1
Code Structure: Most methods are logically organized, but an unrelated temperature-calculation block inside toString() disrupts cohesion. Nesting: Generally shallow, with simple conditionals; the extra block in toString() adds unnecessary nesting. Clarity of intent: Naming and documentation clearly convey natural ordering and singleton behavior, but complex annotated generics, unexplained casts, and the irrelevant temperature variables obscure parts of the implementation. Code length: Mostly concise, though repeated TODO comments and the unused temperature calculation add clutter. Action granularity: Most lines perform one action, but chained assignments in the lazy initialization methods combine local assignment and cache updates. Reading flow: The ordering methods follow a natural sequence, but inconsistent indentation in toString() and densely packed annotations interrupt scanning.
Run 2
Code Structure: Most methods are logically organized, but an unrelated temperature-calculation block disrupts toString(). Nesting: Generally shallow, with simple conditionals; the extra block in toString() adds unnecessary nesting. Clarity of intent: Natural ordering, null handling, and singleton preservation are clear, but the unused temperature calculation is confusing, and dense generic annotations require effort to parse. Code length: Mostly concise, though irrelevant statements and repeated suppression TODOs add clutter. Action granularity: Most lines perform one action, but chained assignments combine local updates and cache initialization. Reading flow: Consistent method patterns help navigation, while the poorly indented temperature block sharply interrupts the flow.
Run 3
Code Structure: Most methods are logically organized, but the unrelated temperature calculation inside toString() disrupts cohesion. Nesting: Generally shallow, although the extra block and conditional in toString() add unnecessary nesting. Clarity of intent: Natural ordering, null handling, and singleton preservation are clear; dense generic annotations, unchecked casts, and irrelevant temperature variables obscure parts of the implementation. Code length: Mostly concise, but the unused temperature calculation and repeated TODO comments add noise. Action granularity: Most lines perform one action, though chained assignments in the lazy initialization methods combine local assignment and cache updates. Reading flow: Consistent method patterns help navigation, but the poorly indented temperature block abruptly interrupts the flow and distracts from toString()'s simple purpose.