Sample
int-518914a9d93c-I08
Select one of ten high-readability unrelated code templates per class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.107 | 0–1; higher is more readable |
| Mi | 0.127 | 0–1; higher is more readable |
| LLOC | 24 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 11.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 14 | 0–20; mean of three runs |
| BTTF | 0.515 | 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. | 1672.05 | −55.178 |
| Source linesThe number of non-empty source lines. | 59 | +23.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.735 | −7.102 |
Intercept 8.87 + feature contributions = -29.809 (log-odds).
Score = sigmoid(-29.809) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 59 | +1.304 |
| 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. | 112.967 | −1.12 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 60 | −1.088 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 59 | −0.933 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 58.868 | +0.413 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.093 | +0.039 |
Intercept 0.07 + feature contributions = -2.12 (log-odds).
Score = sigmoid(-2.12) = 0.107.
| Score | 0.127 |
|---|
| Score | 24 |
|---|
Run 1
The code is generally structured and readable, with clear enum constants, a static initializer, and simple methods. However, it has significant issues that reduce readability: a stray empty while-loop block inside the version() method adds unnecessary nesting and confusion. The static block could be simplified using streams. Method and constant names are clear, but the overall flow is disrupted by the dead code block. The class is concise and each line generally performs one action, but the unexpected nested block violates clarity of intent and reading flow. These problems make the code harder to read and maintain than it should be.
Run 2
The code has a clear enum structure and generally good naming, but it contains a serious flaw: an extraneous block with a useless while loop inside the version() method. This breaks the reading flow and clarity of intent. The static initializer is reasonable but could be streamlined. Nesting is minimal and action granularity is mostly one action per line. Overall, the code is understandable but the stray loop significantly harms readability and suggests carelessness.
Run 3
The code has decent structure with a clear enum pattern, but several issues hurt readability. The static block for building SUB_PROTOCOLS is slightly convoluted; could be a simple stream join. There is a bizarre dead-code block inside the version() method that creates a meaningless while loop, which severely damages clarity. Nesting is acceptable (one level in findBySubProtocol), and action granularity is mostly fine. However, the presence of the unused loop breaks intent and reading flow — it appears to be accidental or leftover code. Naming and overall organization are logical, and the class is concise, but the dead code and minor inefficiencies prevent a higher score.
Run 1
Code Structure: The enum logically groups versions, constants, initialization, and lookup methods, but an unrelated block disrupts the version getter. Nesting: Generally shallow, though the lookup has three nested control levels and the getter adds unnecessary block and loop nesting. Clarity of intent: Names and immutable fields clearly express STOMP version metadata; the countdown loop has no observable purpose and creates confusion. Code length: Mostly concise, with needless lines in version() and a lookup that could use an early null check. Action granularity: Statements generally perform one action per line. Reading flow: Declaration order and straightforward methods support natural reading, but the poorly indented countdown block abruptly interrupts it.
Run 2
Code Structure: The enum logically groups constants, initialization, fields, and lookup methods, but an unrelated loop disrupts the version getter. Nesting: Generally shallow, although the lookup uses three nested control structures and the getter adds an unnecessary block. Clarity of intent: Descriptive names make version and subprotocol handling clear; the remainingSteps loop has no useful effect and obscures the getter's purpose. Code length: Mostly concise, with avoidable boilerplate in the getter. Action granularity: Statements generally perform one action per line. Reading flow: Conventional enum organization supports natural reading, but inconsistent indentation and the extraneous getter block noticeably interrupt it.
Run 3
Code Structure: The enum logically groups protocol constants, initialization, fields, and lookup methods, but an unrelated block disrupts version(). Nesting: Generally shallow, although the lookup has three nested control structures and version() contains an unnecessary block and loop. Clarity of intent: Descriptive names make protocol handling clear; the countdown loop has no useful effect and obscures a simple getter. Code length: Mostly concise, with avoidable lines in the getter. Action granularity: Statements generally perform one action per line. Reading flow: Conventional organization supports natural reading, but inconsistent indentation and the misplaced countdown block interrupt it.