Sample
int-5ac824f11b22-I12
Inline all eligible single-use intermediate local variables
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.517 | 0–1; higher is more readable |
| Dorn | 0.279 | 0–1; higher is more readable |
| Mi | 0.467 | 0–1; higher is more readable |
| LLOC | 37 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 16.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs |
| BTTF | 0.506 | 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. | 3715.733 | −122.619 |
| Source linesThe number of non-empty source lines. | 107 | +42.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.936 | −7.404 |
Intercept 8.87 + feature contributions = -78.353 (log-odds).
Score = sigmoid(-78.353) = 0.
| Score | 0.517 |
|---|
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. | 108 | −2.788 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 91 | +2.41 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 91 | −1.667 |
| 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. | 117.981 | −1.332 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 106.882 | +1.084 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 116.889 | +1.081 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.077 | +0.193 |
Intercept 0.07 + feature contributions = -0.948 (log-odds).
Score = sigmoid(-0.948) = 0.279.
| Score | 0.467 |
|---|
| Score | 37 |
|---|
Run 1
The code is well-structured with clear class and method organization. The constructor overloads are logical and use appropriate assertion checks. Nesting is minimal except in the doGenerate method, which has a single conditional but is still readable. Variable and method names clearly convey intent (e.g., getTarget, doGenerate, cacheKeyGenerator). Code length is appropriate for the functionality — no unnecessary verbosity. Action granularity is mostly good, with each line performing one logical operation, though the condition in doGenerate spans multiple concerns (position check, varargs logic) in a single if. Reading flow is natural: field declarations, constructors, public methods, then private helpers. Minor style issues: unused imports (ArrayList is used but listed, List also, though both appear used), and a stray blank line before the return in createCacheKeyInvocationContext. Overall, this is clean, maintainable Spring framework code.
Run 2
The code is generally readable with clear intent, good structure, and appropriate method naming. It has flat nesting with only one level of conditionals inside methods, and each line performs one logical action. The class has a clear purpose as an adapter between Spring and JSR-107 key generators. However, readability is slightly reduced by a few factors: the unused method `getTarget()` appears to be dead code, the ternary-style conditional for varargs handling could be clearer, and the `createCacheKeyInvocationContext` method includes unnecessary whitespace and a type cast that obscures intent. The imports are slightly long but typical for Spring. Overall, the code follows clean code practices well but has minor clarity issues.
Run 3
The code is well-structured and readable. It follows Spring conventions, has clear field and method names, and uses constructor overloading effectively. The class responsibilities are cohesive, and the logic is relatively flat with only two conditional branches in generate(). Intent is generally clear — adapting between Spring and JCache key generators — but the createCacheKeyInvocationContext method contains an unused SuppressWarnings and a redundant cast, slightly reducing clarity. The doGenerate method handles varargs and non-varargs cases in a single loop, which slightly increases cognitive load. Overall, it is maintainable and professional code, with minor areas for improvement in explicitness and dead code removal.
Run 1
Code Structure: Constructors, delegation logic, parameter processing, and context creation are separated into focused methods. Nesting: Mostly shallow, with only a conditional inside the parameter loop. Clarity of intent: Descriptive names, Javadocs, and explicit assertions clearly communicate the adapter's purpose; mutually exclusive nullable generators and an unchecked cast add some mental overhead. Code length: Appropriately concise overall, though constructor validation is duplicated and the context-creation helper is minimal. Action granularity: Statements generally perform one action per line; the final context construction combines a cast and instantiation but remains understandable. Reading flow: Methods follow a natural progression from initialization to generation and supporting helpers. Excess blank lines, a long return statement, and minor documentation grammar issues slightly reduce polish.
Run 2
Code Structure: Constructors, delegation, parameter processing, and context creation are separated into focused methods. Nesting: Shallow overall, with only a loop containing an if/else in doGenerate. Clarity of intent: Descriptive names, documentation, and explicit assertions make the adapter's purpose clear; nullable alternative generators and an unchecked cast add minor complexity. Code length: Mostly concise, though constructor validation is duplicated and the context-creation helper is somewhat verbose for a single return. Action granularity: Each statement generally performs one action, with no crowded multi-statement lines. Reading flow: Methods follow a natural progression from initialization to delegation and helpers. Excess blank lines, the long context-construction expression, and a compound varargs condition slightly interrupt otherwise consistent formatting.
Run 3
Code Structure: Well-organized adapter with distinct constructors and focused helper methods. Nesting: Shallow overall; the loop with an inner conditional is easy to follow. Clarity of intent: Descriptive names, documentation, and explicit validation clearly explain delegation and parameter handling, though mutually exclusive nullable generators and an unchecked cast add complexity. Code length: Appropriately concise, with minor repetition in constructor validation and generator checks. Action granularity: Generally one action per line; the final context construction combines casting and instantiation but remains understandable. Reading flow: Natural progression from initialization to delegation and helpers, slightly weakened by excessive blank lines, a long return statement, and an unnecessary else after an early return.