Sample
int-2fa7148a9ed1-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.512 | 0–1; higher is more readable |
| Dorn | 0.311 | 0–1; higher is more readable |
| Mi | 0.467 | 0–1; higher is more readable |
| LLOC | 40 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 15.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 17 | 0–20; mean of three runs |
| BTTF | 0.415 | 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. | 3908.413 | −128.978 |
| Source linesThe number of non-empty source lines. | 109 | +43.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.94 | −7.41 |
Intercept 8.87 + feature contributions = -83.918 (log-odds).
Score = sigmoid(-83.918) = 0.
| Score | 0.512 |
|---|
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. | 110 | −2.858 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 93 | +2.48 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 93 | −1.713 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 108.858 | +1.112 |
| 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. | 111.964 | −1.077 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 111.855 | +1 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.077 | +0.191 |
Intercept 0.07 + feature contributions = -0.796 (log-odds).
Score = sigmoid(-0.796) = 0.311.
| Score | 0.467 |
|---|
| Score | 40 |
|---|
Run 1
The code is generally well-structured and readable. It has clear class responsibilities, logical method separation, and good Javadoc comments. The nesting level is shallow, and most methods are concise. However, the score is reduced due to the confusing expression in doGenerate: `context.getAllParameters().length - (a + b)` with unexplained variables `a` and `b` (values 2 and -1). This obscures intent. Additionally, the method `doGenerate` mixes logic (varargs check) with collection building in a single block, slightly reducing action granularity. The adapter constructors are clear, but the dual state fields (`keyGenerator` vs `cacheKeyGenerator`) introduce minor ambiguity. Overall, it is maintainable and clean but has localized readability issues.
Run 2
The code is generally well-structured, with clear class responsibilities, good use of constructors, and meaningful method names. Imports are organized, and Javadocs explain intent. However, readability is hindered by a few issues: the `doGenerate` method contains magic numbers and unclear logic (`a` and `b` constants) that obscure the varargs handling; the method has moderate nesting and mixes conditionals with collection logic. While most actions are one per line, some expressions are dense. The `generate` method has a slightly tangled flow due to nested if/else and casting. Overall, the structure and intent are clear, but the presence of unexplained constants and somewhat complex control flow reduces readability from excellent to good.
Run 3
The code is generally well-structured with clear class responsibilities, logical method organization, and good use of Javadoc. It reads naturally: constructors, getters, core logic, then private helpers. Nesting is shallow, and most lines perform one clear action. However, readability is reduced by a few issues: the magic numbers 'a' and 'b' in the varargs check are unintuitive and obscure the logic (e.g., why 'length - (2 + -1)'?). The conditional logic for handling varargs parameters could be extracted into a named method to improve intent clarity. Additionally, the null-check and exception messages are clear, but the dual key generator fields (keyGenerator vs cacheKeyGenerator) require careful reading to understand their mutual exclusivity. Overall, the code is professional and maintainable but would benefit from clearer varargs handling and eliminating magic numbers.
Run 1
Code Structure: Well-organized adapter with distinct constructors and focused helper methods; minor constructor duplication. Nesting: Shallow conditionals and a single loop keep control flow manageable. Clarity of intent: Descriptive names, documentation, and explicit assertions explain delegation and parameter handling. However, constants a = 2 and b = -1 obscure a simple last-parameter check, and varargs expansion lacks an explanatory comment. Code length: Generally concise, though redundant constants and repeated initialization add unnecessary lines. Action granularity: Statements consistently perform one action per line. Reading flow: Methods progress naturally from construction to delegation and context creation, with consistent formatting; the multiline varargs condition and generic cast introduce modest reading friction.
Run 2
Code Structure: Well-organized adapter with focused constructors and helper methods separating delegation, parameter processing, and context creation. Nesting: Generally shallow; the loop with an embedded conditional remains easy to follow. Clarity of intent: Descriptive names, documentation, and assertions communicate the purpose clearly, but the unexplained constants a and b and expression (a + b) obscure a simple last-parameter check. Code length: Mostly concise, with minor constructor duplication and unnecessary constants. Action granularity: Statements generally perform one action per line, making execution easy to trace. Reading flow: Methods follow a natural progression from initialization to delegation and supporting helpers; the compound varargs condition and generic cast introduce modest cognitive overhead.
Run 3
Code Structure: Constructors, delegation, parameter processing, and context creation are cleanly separated into focused methods. Nesting: Control flow remains shallow, with only a conditional inside the parameter loop. Clarity of intent: Descriptive class and method names, documentation, and assertions clearly communicate the adapter's purpose; however, the arbitrary constants a = 2 and b = -1 obscure the straightforward last-parameter check. Code length: Mostly concise, though those constants and some repeated validation add minor verbosity. Action granularity: Statements generally perform one action per line, making execution easy to follow. Reading flow: The progression from construction to target selection, generation, and helpers is natural. The multiline varargs condition and generic cast introduce modest cognitive overhead, but the unexplained arithmetic is the main readability weakness.