Sample
int-efb60b654502-I05
Rewrite eligible decimal integer literals in hexadecimal notation
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.806 | 0–1; higher is more readable |
| Dorn | 0.842 | 0–1; higher is more readable |
| Mi | 0.768 | 0–1; higher is more readable |
| LLOC | 11 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 18 | 0–20; mean of three runs |
| GPT-6.1 Sol | 19 | 0–20; mean of three runs |
| BTTF | 0.716 | 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. | 867.881 | −28.64 |
| Source linesThe number of non-empty source lines. | 40 | +16 |
| 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.974 | −7.46 |
Intercept 8.87 + feature contributions = -11.23 (log-odds).
Score = sigmoid(-11.23) = 0.
| Score | 0.806 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| 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. | 74.976 | +0.49 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 35 | +0.473 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 41 | −0.415 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 74.927 | +0.404 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 39.684 | +0.145 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.085 | +0.111 |
Intercept 0.07 + feature contributions = 1.676 (log-odds).
Score = sigmoid(1.676) = 0.842.
| Score | 0.768 |
|---|
| Score | 11 |
|---|
Run 1
The code is highly readable. It has a clear, logical structure with a single class, well-named fields, and a straightforward constructor. Nesting is minimal; there are no deeply nested control structures. The intent of each method is explicit: retrieving the literal value, checking compilability, and generating bytecode. Code length is concise and appropriate for the functionality. Action granularity is sensible, with one logical action per line in the generateCode method. Reading flow is natural, with the class definition, field, constructor, and methods arranged in a conventional order. Minor deductions would only reflect the lack of explicit null or bounds checks, but for a literal AST node this is acceptable and idiomatic.
Run 2
The code is highly readable. It has clear structure with a single class, concise constructors, and simple overridden methods. Nesting is minimal, and each method performs a single action. The purpose of the class and each method is obvious from naming and annotations. Code length is appropriate for the functionality. The only minor drawback is the slight redundancy in setting `exitTypeDescriptor` in the constructor while using it later in `generateCode`, but this doesn't significantly affect readability.
Run 3
The code is highly readable. It has a clear, logical structure with a single class, a single field, a straightforward constructor, and three simple overridden methods. Nesting is minimal, with no conditional blocks or loops. The intent is explicit: represent a long literal in an expression language AST. Code length is concise, with each method performing a single, well-defined action. Action granularity is appropriate—each line performs one operation, such as setting a field, returning a value, or invoking a visitor method. Reading flow is natural, progressing from field declaration to constructor to getters and code generation. Naming conventions are clear and consistent with Spring's style. The only minor deduction is that the `getLiteralValue` method's name could be slightly more explicit, but it is conventional within this codebase. Overall, it is clean, maintainable, and exemplary for a simple AST node implementation.
Run 1
Code Structure: The class is logically organized into a field, constructor, and small overridden methods. Nesting: There are no nested conditionals or loops, making the code easy to scan. Clarity of intent: The class documentation and method names clearly identify its purpose as a long-integer literal AST node; the JVM descriptor "J" and abbreviated parameters mv and cf require some domain knowledge. Code length: The implementation is concise, with no unnecessary logic, though extra blank lines slightly dilute compactness. Action granularity: Each statement performs a single clear action. Reading flow: Initialization, value access, compilation support, and code generation appear in a natural sequence.
Run 2
Code Structure: The class is logically organized into a field, constructor, and focused overridden methods. Nesting: There is no nested control flow, making the code easy to scan. Clarity of intent: The class documentation and method names clearly identify its purpose as a long literal AST node; the JVM descriptor "J" and abbreviated parameters mv and cf require some domain knowledge. Code length: The implementation is concise, with no unnecessary logic. Action granularity: Each statement performs one clear action on its own line. Reading flow: Initialization precedes value access and compilation methods, creating a natural progression. Minor excess blank lines do not materially impair readability.
Run 3
Code Structure: The class is logically organized, with a field, constructor, and focused overridden methods. Nesting: All methods are flat, with no conditional or loop nesting. Clarity of intent: The class documentation, descriptive method names, and straightforward implementations clearly convey its role as a long literal AST node; the descriptor "J" and abbreviation "cf" require some domain knowledge. Code length: The implementation is concise, with no unnecessary logic. Action granularity: Each statement performs one distinct action on its own line. Reading flow: The progression from initialization to value retrieval, compilability, and code generation is natural. Minor excess blank lines slightly reduce visual compactness.