Sample
int-45d397472a3e-I13
Lower every eligible classic and enhanced for loop to a while loop
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 is well-structured as a small, focused class with clear imports and a concise Javadoc. Nesting is minimal—only a single constructor and three overridden methods, each simple and flat. The intent of representing a long integer literal in an AST is immediately apparent from the class name, field names, and method purposes. Code length is appropriate: no redundant or boilerplate-heavy blocks. Action granularity is good, with one logical action per line, such as assigning the TypedValue or pushing the descriptor. The reading flow is natural, following a standard order: fields, constructor, then overridden methods in a logical sequence. Minor deductions are only for the lack of inline comments on the code generation method, which could clarify the bytecode operation, and for the slightly terse variable name "mv" though it is a common convention in this context.
Run 3
The code is highly readable, with a clear and logical structure. The class extends a fitting parent, fields are private and final, and constructor parameters are meaningful. Nesting is minimal; methods are flat and concise. Each method expresses a single purpose clearly, e.g., isCompilable returning true and generateCode performing two distinct actions on separate lines. Action granularity is appropriate—no line packs multiple unrelated operations. Reading flow is natural: package, imports, class-level Javadoc, field declaration, constructor, then overridden methods in a logical order. The code is concise without sacrificing clarity, and naming is explicit (e.g., exitTypeDescriptor). The only minor point preventing a perfect score is the lack of Javadoc on the constructor or methods, though the class-level comment and method names sufficiently convey intent.
Run 1
Code Structure: Clearly organized class with a field, constructor, and focused overridden methods. Nesting: Flat implementation with no nested control flow. Clarity of intent: Class documentation and descriptive method names make its purpose clear; the JVM descriptor "J" and abbreviation "mv" require some domain knowledge. Code length: Concise, with no unnecessary logic, though extra blank lines add minor visual space. Action granularity: Each statement performs one action on its own line. Reading flow: Natural progression from initialization to value access, compilability, and bytecode generation.
Run 2
Code Structure: Clearly organized into a field, constructor, and small overridden methods. Nesting: Flat, with no conditional branches or nested blocks. Clarity of intent: The class documentation and method names clearly identify a long-literal AST node; the "J" type descriptor and abbreviated parameters require some JVM/domain knowledge. Code length: Concise, with no unnecessary implementation logic, though extra blank lines add minor visual spacing. Action granularity: Each statement performs one distinct action on its own line. Reading flow: Natural progression from initialization to value access, compilability, and code generation, supported by consistent formatting.
Run 3
Code Structure: The class is logically organized into a field, constructor, and focused overrides. Nesting: Methods are flat, with no nested control flow. Clarity of intent: The class documentation, descriptive names, and simple implementations clearly communicate its role as a long-literal AST node; the JVM descriptor "J" and abbreviation "cf" require some domain knowledge. Code length: The implementation is concise, with only minor excess whitespace. Action granularity: Each statement performs a single action on its own line. Reading flow: The progression from initialization to value access, compilation eligibility, and code generation is natural and easy to follow.