Sample
int-a827712a2348-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.681 | 0–1; higher is more readable |
| Dorn | 0.5 | 0–1; higher is more readable |
| Mi | 0.577 | 0–1; higher is more readable |
| LLOC | 20 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 6.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 14 | 0–20; mean of three runs |
| BTTF | 0.395 | 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. | 1588.828 | −52.431 |
| Source linesThe number of non-empty source lines. | 52 | +20.8 |
| 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.725 | −7.087 |
Intercept 8.87 + feature contributions = -29.848 (log-odds).
Score = sigmoid(-29.848) = 0.
| Score | 0.681 |
|---|
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. | 53 | −0.84 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 99.943 | +0.808 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 44 | +0.785 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 44 | −0.589 |
| 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. | 100 | −0.57 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 51.693 | +0.313 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.095 | +0.023 |
Intercept 0.07 + feature contributions = -0.001 (log-odds).
Score = sigmoid(-0.001) = 0.5.
| Score | 0.577 |
|---|
| Score | 20 |
|---|
Run 1
The code has several readability issues. The most severe is a block of dead code that computes 'featureEnabled' by toggling a boolean three times, which has no purpose and is confusingly placed inside the 'comparator' method. The 'hasSameComparator' method has moderate nesting and branching that could be flattened, but its intent is generally clear. The 'comparator' method has an unnecessary extra level of indentation and the @SuppressWarnings comment lacks clarity. While the code is fairly concise and follows consistent formatting, the presence of meaningless code drastically reduces clarity of intent. The overall structure and naming are acceptable, but the dead block and indentation issues would make a reader question the code's correctness and purpose.
Run 2
The code has a clear class structure with a private constructor and static utility methods, but contains a highly confusing block of dead code that toggles a boolean three times, serving no purpose and severely hurting readability. The hasSameComparator method flows reasonably with type checks, but the separate comparator method’s null-handling is straightforward for experienced readers. The unused featureEnabled loop is deeply confusing and adds unnecessary length. Action granularity is mostly one action per line. Nesting is minimal aside from the pointless for loop. Import ordering and documentation are good. Overall, the dead code drops the score significantly and obscures the intent.
Run 3
The code has several readability issues. The most severe is a dead code block with a pointless loop that toggles a boolean variable, which is completely unrelated to the method's purpose and is confusing. The method 'hasSameComparator' has moderate nesting and branching, but is generally clear. The use of the recursive type cast and wildcard generics makes the comparator method somewhat hard to read. The code lacks explanatory comments for non-obvious type manipulations. The dead code significantly harms clarity of intent and adds unnecessary length. The overall structure is decent, but the presence of unrelated code in the comparator method and complex generics make the intent ambiguous.
Run 1
Code Structure: The utility class and two focused methods are logically organized, but an unrelated toggle block disrupts the comparator method. Nesting: Most logic is shallow; the extra block and loop add unnecessary nesting. Clarity of intent: Documentation, null checks, and comparator handling clearly convey the main purpose, while featureEnabled and toggleCount have no meaningful connection to it. Code length: Generally concise, but the unused toggle loop adds avoidable code. Action granularity: Each statement performs a single action, making individual lines easy to follow. Reading flow: The comparator-selection branches flow naturally, but the poorly indented standalone block interrupts the transition from method declaration to comparator retrieval.
Run 2
Code Structure: The utility class and two focused methods are logically organized, but an unrelated toggle block disrupts the comparator method. Nesting: Generally shallow; the unnecessary standalone block and loop add avoidable nesting. Clarity of intent: Documentation, null checks, and comparator handling communicate the main purpose clearly, while featureEnabled and toggleCount introduce unexplained behavior with no effect on the result. Code length: Mostly concise, but the toggle block is entirely unnecessary. Action granularity: Statements generally perform one action per line, making individual operations easy to follow. Reading flow: hasSameComparator flows naturally through type checks to comparison; comparator is interrupted by poorly indented, irrelevant code before returning to its actual task.
Run 3
Code Structure: The utility class and its two focused methods are logically organized, but an unrelated toggle block disrupts the comparator method. Nesting: Most code is shallow; the extra block and loop introduce unnecessary nesting. Clarity of intent: Documentation, null checks, and comparator handling clearly communicate purpose, while comparator2 is generic and featureEnabled has no observable role. Code length: The implementation is mostly concise, but the unused toggle loop adds needless lines. Action granularity: Statements generally perform one action per line, with conventional loop syntax. Reading flow: hasSameComparator reads naturally, but the poorly indented inserted block interrupts the second method and forces readers to investigate irrelevant logic.