Sample
int-d6f085afb06a-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.801 | 0–1; higher is more readable |
| Dorn | 0.228 | 0–1; higher is more readable |
| Mi | 0.654 | 0–1; higher is more readable |
| LLOC | 41 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 9.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 15 | 0–20; mean of three runs |
| BTTF | 0.431 | 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. | 2377.045 | −78.442 |
| Source linesThe number of non-empty source lines. | 103 | +41.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.53 | −6.795 |
Intercept 8.87 + feature contributions = -35.168 (log-odds).
Score = sigmoid(-35.168) = 0.
| Score | 0.801 |
|---|
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. | 103 | −2.611 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 92 | +2.445 |
| 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. | 139.971 | −2.263 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 92 | −1.69 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 139.971 | +1.454 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 102.823 | +1.027 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.061 | +0.35 |
Intercept 0.07 + feature contributions = -1.218 (log-odds).
Score = sigmoid(-1.218) = 0.228.
| Score | 0.654 |
|---|
| Score | 41 |
|---|
Run 1
The code contains a misplaced block of unrelated code (a factorial loop) inside the UpgradeType enum constructor, which severely harms readability and indicates a copy-paste or editing error. Otherwise, the class structure is mostly logical: fields, enum, constructor, accessors, equals, hashCode, and toString are in a standard order. Nesting is generally flat, with only simple guard clauses and if-else chains. Intent is clear for most methods, but the random factorial loop confuses purpose. Code length is reasonable and methods are concise. Action granularity is mostly one action per line. Reading flow is natural except for the injected loop, which disrupts the entire file's coherence.
Run 2
The code contains a critical structural flaw: an irrelevant and improperly nested code block (a factorial computation) inserted inside the UpgradeType enum constructor. This creates a syntax error or at best confusing and nonsensical structure, severely undermining readability. The class otherwise follows clear Java conventions with good naming, documentation, and reasonable method organization. However, the misplaced block breaks logical structure, nesting, clarity of intent, and reading flow. The constructor's invalid insertion and incorrect brace matching make the code unreadable and non-functional. Despite concise methods and appropriate granularity elsewhere, the structural defect dominates the evaluation.
Run 3
The code is generally well-structured with a clear class, enum, and methods, but readability is undermined by a serious defect: a random block of code ({ int factorial = 1; for (...) ... }) appears inside the enum constructor, likely inserted by mistake. This breaks logical organization and clarity of intent. The class otherwise has good flat nesting, concise methods, clear parameter documentation, and appropriate action granularity. The fromCode method uses a simple if-else chain which is readable, and equals/hashCode/toString are straightforward. However, the stray block is a major disruption and would confuse any reader. Without it the score would be around 17-18, but as written the code cannot be considered highly readable because the unintended code fragment makes the actual behavior ambiguous and the structure inconsistent.
Run 1
Code Structure: Fields, enum, constructor, accessors, and standard overrides are logically organized, but an unrelated factorial block disrupts the enum constructor. Nesting: Generally shallow, with straightforward guards; the extra block and loop add unnecessary nesting. Clarity of intent: Descriptive names and documentation explain feature updates well, but the unused factorial computation is confusing. Code length: Mostly concise, though the irrelevant computation and repetitive fromCode conditional chain add avoidable length. Action granularity: Statements generally perform one action per line. Reading flow: Conventional method ordering supports natural reading, but inconsistent indentation in the factorial block and long documentation and exception-message lines interrupt the flow.
Run 2
Code Structure: Fields, enum, validation, accessors, and standard overrides are logically organized, but the unrelated factorial block disrupts the enum constructor. Nesting: Most methods are shallow, with guard clauses supporting readability; the extra block and loop introduce unnecessary nesting. Clarity of intent: Descriptive names and documentation explain feature updates and upgrade types, while the unused factorial calculation has no apparent purpose. Code length: Generally concise, though the factorial block adds dead weight and fromCode uses a somewhat repetitive conditional chain. Action granularity: Statements generally perform one action per line. Reading flow: Conventional Java organization makes the class easy to follow, but inconsistent indentation in the factorial block and long documentation and exception-message lines interrupt the flow.
Run 3
Code Structure: Fields, enum, constructor, accessors, and standard overrides are logically organized, but an unrelated factorial calculation disrupts the enum constructor. Nesting: Mostly shallow, with straightforward conditionals and early returns; the unnecessary factorial block adds avoidable nesting. Clarity of intent: Descriptive names and documentation explain feature updates well, while the unused factorial calculation has no apparent purpose. Code length: Generally concise, though the factorial block is extraneous and fromCode is somewhat repetitive. Action granularity: Statements consistently perform one action per line. Reading flow: Conventional Java organization makes most of the class easy to follow, but inconsistent indentation in the inserted block and long documentation and exception-message lines interrupt readability.