Sample
int-bccf97d3e6a2-I05
Rewrite eligible decimal integer literals in hexadecimal notation
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.603 | 0–1; higher is more readable |
| Dorn | 0.654 | 0–1; higher is more readable |
| Mi | 0.686 | 0–1; higher is more readable |
| LLOC | 10 | 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.335 | 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. | 1059.847 | −34.975 |
| Source linesThe number of non-empty source lines. | 48 | +19.2 |
| 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.991 | −7.486 |
Intercept 8.87 + feature contributions = -14.391 (log-odds).
Score = sigmoid(-14.391) = 0.
| Score | 0.603 |
|---|
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. | 49 | −0.699 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 81.265 | +0.507 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.065 | +0.313 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 30 | +0.301 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 30 | −0.268 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 47.774 | +0.258 |
| 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. | 82.918 | +0.153 |
Intercept 0.07 + feature contributions = 0.635 (log-odds).
Score = sigmoid(0.635) = 0.654.
| Score | 0.686 |
|---|
| Score | 10 |
|---|
Run 1
The code is well-structured and readable, with clear separation of concerns between the generate() and generateKey() methods. Nesting is minimal, with only one level of conditional logic in generateKey(). The intent is clear: generate a cache key from method parameters, with special handling for single non-array values. Action granularity is good, with one operation per line. The use of hex literals like '0x0' and '0x1' is unusual in Java code where 0 and 1 would be more conventional, slightly reducing readability. The ternary operator in generate() could be written more explicitly for better clarity. Overall, the code follows Spring framework conventions well, has appropriate Javadoc, and would be easily understood by experienced Java developers. Points deducted for unconventional hex literals and the compact ternary expression.
Run 2
The code is generally well-structured and follows Spring conventions with clear class documentation. The generate method has a clear purpose and delegates to a testable static method. However, readability suffers slightly from the use of hexadecimal notation (0x1, 0x0) for array indices and lengths, which is unusual and forces readers to mentally convert values. The ternary expression in generate() crams multiple operations into a single line, reducing clarity. The nested condition inside generateKey adds one level of nesting but remains manageable. Variable names are clear and the overall flow is logical. Could improve by using standard decimal notation and breaking the ternary into a clearer if-else block.
Run 3
The code is generally well-structured with clear separation of concerns and minimal nesting. The class has a single responsibility, and the methods are short. Intent is mostly clear, though the hexadecimal literals (0x0, 0x1) are unusual and reduce immediate readability. The suspending-function handling with Arrays.copyOf is a bit opaque without deeper Spring/Kotlin knowledge. Reading flow is natural: public API method delegates to a static utility method. Action granularity is good, with simple conditions and returns. The Javadoc is helpful but could be more concise. Overall, it's readable but slightly hindered by hexadecimal numeric literals and the Kotlin-specific conditional logic.
Run 1
Code Structure: Two focused methods clearly separate invocation handling from key generation. Nesting: Shallow conditionals and early returns keep complexity low. Clarity of intent: Descriptive names and documentation explain the main behavior, though hexadecimal constants obscure ordinary counts and indices, and removing the final parameter for Kotlin suspending functions lacks explanation. Code length: The implementation is concise, with proportionate documentation. Action granularity: Each statement performs a focused action; the ternary combines detection and parameter adjustment but remains manageable. Reading flow: Key generation proceeds naturally through empty, single-value, and fallback cases. Minor distractions include redundant parentheses around the ternary and limited spacing between package and import declarations.
Run 2
Code Structure: Two focused methods cleanly separate parameter preparation from key generation. Nesting: Mostly flat, with early returns and only one nested conditional. Clarity of intent: Descriptive names and documentation explain the key-selection rules, but hexadecimal literals for zero and one add unnecessary cognitive overhead, and removing the final parameter for Kotlin suspending functions lacks explanation. Code length: Concise implementation; most additional length is useful documentation. Action granularity: Statements generally perform one action, although the ternary inside generateKey combines detection, parameter copying, and delegation. Reading flow: The empty, single-value, and fallback cases follow a natural sequence. Extra parentheses around the ternary and tightly grouped package/import declarations slightly reduce visual clarity.
Run 3
Code Structure: Two focused methods cleanly separate parameter adjustment from key generation. Nesting: Early returns keep control flow mostly flat, with only one shallow nested conditional. Clarity of intent: Descriptive names and documentation explain key generation, but hexadecimal literals for zero and one are distracting, and removing the Kotlin suspension parameter lacks an explanatory comment. Code length: The implementation is concise without unnecessary logic. Action granularity: Statements generally perform one action each, though the ternary inside the generateKey call combines parameter selection, copying, and delegation. Reading flow: The methods follow a natural sequence, and fallback behavior is easy to identify; extra parentheses and the wrapped ternary slightly interrupt readability.