Sample
int-1709a123f261-I11
Split eligible integer literals into pairs of short-named intermediate variables
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.832 | 0–1; higher is more readable |
| Dorn | 0.219 | 0–1; higher is more readable |
| Mi | 0.56 | 0–1; higher is more readable |
| LLOC | 47 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 7.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 14 | 0–20; mean of three runs |
| BTTF | 0.257 | 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. | 2768.857 | −91.372 |
| Source linesThe number of non-empty source lines. | 106 | +42.4 |
| 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.45 | −6.675 |
Intercept 8.87 + feature contributions = -46.777 (log-odds).
Score = sigmoid(-46.777) = 0.
| Score | 0.832 |
|---|
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. | 106 | −2.717 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 95 | +2.549 |
| 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.963 | −2.263 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 95 | −1.759 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 139.972 | +1.454 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 105.872 | +1.07 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.064 | +0.323 |
Intercept 0.07 + feature contributions = -1.273 (log-odds).
Score = sigmoid(-1.273) = 0.219.
| Score | 0.56 |
|---|
| Score | 47 |
|---|
Run 1
The code has a clear class structure with reasonable documentation, but it is severely undermined by obfuscated constants and needless arithmetic. The developer introduced variables like 'a', 'b', 'c', 'd', etc., and then calculates simple values (e.g., a+b for 1, c+d for 2). This obscures intent, increases code length, and violates the principle of action granularity. The fromCode method should map codes directly to enum values; the constructor should simply compare maxVersionLevel < 0 or maxVersionLevel == 0. The rest of the class (equals, hashCode, toString, accessors) is readable and well-structured, but the central logic is unnecessarily tangled, making the code hard to follow and maintain.
Run 2
The code is unnecessarily obfuscated by replacing simple constants with arbitrary variables. For example, `final int a = 2; final int b = -1;` then `if (code == (a + b))` instead of simply `if (code == 1)`. This pattern is repeated throughout the constructor, making it very hard to understand the logic. The excessive and meaningless variable names (`g`, `h`, `i`, `j`) obscure the intent of the boundary checks (e.g., `maxVersionLevel == 0` or `maxVersionLevel < 0`). While the class structure itself is standard and the Javadocs are detailed, the core logic is deeply flawed in terms of clarity. The reader must perform mental arithmetic to deduce basic integer comparisons. This severely impacts readability, negating the benefits of the otherwise logical organization and proper method names. The intent is hidden behind pointless indirection.
Run 3
The code has a clear structure with proper encapsulation and documentation, but readability is severely undermined by obfuscated comparisons. The 'fromCode' method uses meaningless variables (a, b, c, d, e, f) and arithmetic operations (e.g., a + b) instead of direct numeric constants, obscuring intent. Similarly, the constructor uses meaningless variables (g, h, i, j) and arithmetic (g + h, i + j) instead of literals like 0 or -1. These patterns force readers to perform mental arithmetic to understand simple checks. The nested if-else chain in 'fromCode' is shallow but confusing due to variable naming. While the code is concise and well-organized, the deliberate obfuscation of logic makes it unnecessarily difficult to read and maintain. The action granularity and flow are acceptable, but clarity of intent is compromised.
Run 1
Code Structure: The class is logically organized into fields, an enum, constructor validation, accessors, and standard overrides. Nesting: Shallow conditionals and early returns keep complexity low. Clarity of intent: Descriptive API names and documentation explain the feature update, but meaningless variables a–j and arithmetic expressions obscure straightforward numeric comparisons. Code length: Most methods are concise, although unnecessary constant declarations inflate fromCode and the constructor. Action granularity: Statements generally perform one action per line, with conventional compound conditions. Reading flow: The overall progression is natural, but readers must mentally evaluate artificial arithmetic to understand mappings and validation. Direct numeric comparisons or meaningful constants would substantially improve readability.
Run 2
Code Structure: Fields, enum, constructor, accessors, and standard overrides are logically organized. Nesting: Shallow conditionals and early returns keep complexity low. Clarity of intent: Descriptive API names and documentation explain the class, but meaningless variables a–j and arithmetic expressions obscure straightforward numeric comparisons. Code length: Mostly concise, although unnecessary constants inflate fromCode and constructor validation. Action granularity: Statements generally perform one action per line; compound comparisons remain manageable. Reading flow: Conventional Java layout supports natural reading, but repeated arithmetic indirection interrupts comprehension, and long documentation and exception-message lines reduce scanability.
Run 3
Code Structure: Fields, enum, constructor, accessors, and standard overrides are logically organized. Nesting: Shallow conditionals and early returns keep control flow easy to follow. Clarity of intent: Descriptive API names and documentation explain the class, but meaningless variables a–j and arithmetic expressions obscure simple constants and validation rules. Code length: Mostly compact, though unnecessary constant declarations inflate fromCode and the constructor. Action granularity: Statements generally perform one action per line, with conventional compound conditions. Reading flow: Familiar Java conventions support natural reading, but scattered arithmetic setup interrupts otherwise straightforward logic. Direct comparisons against literal values or named constants would substantially improve readability.