Sample
int-91744f7cc7ab-I05
Rewrite eligible decimal integer literals in hexadecimal notation
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.512 | 0–1; higher is more readable |
| Dorn | 0.314 | 0–1; higher is more readable |
| Mi | 0.467 | 0–1; higher is more readable |
| LLOC | 38 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 16.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 17.33 | 0–20; mean of three runs |
| BTTF | 0.366 | 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. | 3777.695 | −124.664 |
| 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.937 | −7.405 |
Intercept 8.87 + feature contributions = -80.399 (log-odds).
Score = sigmoid(-80.399) = 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. | 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 (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 106.85 | +1.084 |
| 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.981 | −1.078 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 110.907 | +0.985 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.076 | +0.203 |
Intercept 0.07 + feature contributions = -0.781 (log-odds).
Score = sigmoid(-0.781) = 0.314.
| Score | 0.467 |
|---|
| Score | 38 |
|---|
Run 1
The code is generally readable with clear class structure, logical method organization, and good naming conventions. The constructors are well-documented with meaningful Javadoc. Most methods follow the single-responsibility principle and maintain flat nesting levels. The main generate() method has a clear flow: validate operation type, create context, then delegate to either cacheKeyGenerator or keyGenerator. The doGenerate() method effectively handles varargs with a reasonable if-else block. Minor readability issues include: the magic number '0x1' in the varargs check (should be a named constant or simple '1'), the somewhat dense parameter validation in generate(), and the unchecked cast requiring @SuppressWarnings. The getTarget() method has slightly awkward null-checking logic but remains understandable. Overall, the code demonstrates good Spring framework conventions and maintains clear separation of concerns, though a few minor improvements could enhance clarity further.
Run 2
The code is well-structured, with clear separation of concerns and a logical organization into two constructors, a public API method, and private helper methods. Nesting is generally shallow; the only slightly complex block is the varargs handling in doGenerate, but it remains readable. Intent is clearly expressed through descriptive method and variable names, javadoc, and Spring's Assert usage. Code length is moderate and mostly concise, though some null-state checks are repeated. Action granularity is good—most lines perform a single operation. Reading flow is natural, with methods ordered from public API to private helpers. Minor deductions: repeated null/state assertions could be simplified, and the varargs check (length - 0x1) is slightly less clear than using - 1 or a helper.
Run 3
The code is well-structured with clear class organization, logical method separation, and meaningful naming that makes intent obvious. Nesting is minimal, with only one level of conditional logic in generate() and doGenerate(). Each method has a single responsibility, and actions are generally one per line. The constructor validation and field declarations are clean. Minor readability issues include the cryptic '0x1' expression (should be '1' for clarity), the slightly awkward boolean expression in generate() that could use 'instanceof' with pattern matching or negated logic, and the multi-line boolean condition wrapped without obvious line-break reasoning. Import ordering and vertical spacing are good. The Javadoc could more explicitly explain the varargs handling edge case. Overall the code is concise, maintainable, and follows Spring conventions well, with only a few small clarity improvements possible.
Run 1
Code Structure: Well-organized adapter with distinct constructors, delegation logic, parameter preparation, and context creation. Nesting: Shallow overall; the loop with an inner conditional is easy to follow. Clarity of intent: Descriptive names, Javadoc, and assertions explain the purpose and invariants. However, the hexadecimal 0x1 unnecessarily obscures a simple last-parameter check, and varargs flattening could benefit from a brief comment. Code length: Reasonably concise, although constructors duplicate validation and initialization, and generate contains an avoidable else after an early return. Action granularity: Statements generally perform one action per line; the compound conditional remains manageable. Reading flow: Methods progress naturally from construction to delegation and supporting helpers. Consistent formatting helps, though tightly grouped imports and occasional extra blank lines slightly reduce polish.
Run 2
Code Structure: Well-organized adapter with clearly separated constructors, delegation logic, parameter handling, and context creation. Nesting: Shallow overall; the loop with an inner conditional is easy to follow. Clarity of intent: Descriptive names, documentation, and explicit assertions explain the purpose, although hexadecimal 0x1 unnecessarily obscures a simple last-parameter check, and two nullable delegate fields require understanding an implicit invariant. Code length: Appropriately concise, with minor repetition in constructor validation and delegate checks. Action granularity: Statements generally perform one action per line; chained calls remain manageable. Reading flow: Natural progression from initialization to public behavior and private helpers, supported by consistent formatting. Long type names and the multiline varargs condition slightly slow reading.
Run 3
Code Structure: Constructors, delegation logic, and context creation are logically separated into focused methods. Nesting: Mostly shallow, with only a loop containing an if/else in parameter handling. Clarity of intent: Descriptive names, documentation, and assertions clearly explain the adapter's purpose; however, two nullable generator fields imply an exclusive-choice invariant rather than expressing it directly, and hexadecimal 0x1 unnecessarily obscures a simple subtraction. Code length: Reasonably concise, though constructor validation and generator checks repeat slightly. Action granularity: Statements generally perform one action per line, making execution easy to follow. Reading flow: The progression from initialization to target selection, generation, and helper methods is natural. Long generic declarations, the multiline varargs condition, and an unchecked cast introduce minor reading friction.