Sample
int-911dbd2c6ab1-I05
Rewrite eligible decimal integer literals in hexadecimal notation
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.825 | 0–1; higher is more readable |
| Dorn | 0.241 | 0–1; higher is more readable |
| Mi | 0.116 | 0–1; higher is more readable |
| LLOC | 37 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 17.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs |
| BTTF | 0.461 | 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. | 2222.984 | −73.358 |
| Source linesThe number of non-empty source lines. | 96 | +38.4 |
| 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.529 | −6.794 |
Intercept 8.87 + feature contributions = -32.882 (log-odds).
Score = sigmoid(-32.882) = 0.
| Score | 0.825 |
|---|
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. | 97 | −2.398 |
| 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. | 139.959 | −2.263 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 85 | +2.203 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 85 | −1.53 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 139.969 | +1.454 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 95.816 | +0.929 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.057 | +0.385 |
Intercept 0.07 + feature contributions = -1.149 (log-odds).
Score = sigmoid(-1.149) = 0.241.
| Score | 0.116 |
|---|
| Score | 37 |
|---|
Run 1
The code is well-structured and highly readable. It follows a logical organization with clear separation of concerns: constants, enum, constructor, getters, and standard object methods. Nesting is minimal, with only simple if-else branches in fromCode and constructor validation. Intent is clear through descriptive naming and thorough Javadoc comments. The constructor validation is straightforward and error messages are informative. Action granularity is appropriate—each line performs a single logical operation. Reading flow is natural, with the enum defined before its usage and getters/overrides properly ordered. Minor improvements could include using switch in fromCode for better readability and using 'instanceof pattern matching' for equals, but these are stylistic preferences rather than readability issues.
Run 2
The code is generally clear and well-structured. The FeatureUpdate class is logically organized with fields, constructor, accessors, and standard methods in a predictable order. The enum UpgradeType is simple and flat, using straightforward if-else in fromCode. The constructor contains two validation checks that are easy to follow; no deep nesting is present. Method length is concise, and actions are generally one per line. The Javadoc explains the intent of parameters clearly. Minor deductions: the validation error message is slightly verbose, the equals method uses `instanceof` followed by a cast, and some conditions (like `upgradeType.equals(...)`) could be simplified. Overall, the code reads naturally and requires little effort to understand.
Run 3
The code is highly readable with clear structure and purpose. It uses a logical organization: class fields, enum, constructor, accessors, and standard overrides. Nesting is minimal—only simple if-checks and an else-if chain in the enum. Intent is explicit through Javadoc and method names. The constructor validation is clear and well-documented. Lines are concise and perform one logical action, though a few lines (like the exception message) are slightly long but still readable. Reading flow is natural, moving from type definition to behavior. Minor improvements could include using '==' instead of .equals() for enum comparison in the constructor, and replacing the if-else chain in fromCode with a switch expression for slightly better clarity.
Run 1
Code Structure: Logically organized into fields, an enum, constructor validation, accessors, and standard object methods. Nesting: Shallow, with straightforward conditionals and early returns. Clarity of intent: Descriptive names and documentation clearly explain feature updates and downgrade modes; hexadecimal version comparisons and slightly awkward documentation reduce clarity. Code length: Generally concise, although the enum lookup chain and long exception message could be simplified. Action granularity: Each statement performs a single clear action, with conventional compound expressions in validation and equality checks. Reading flow: Natural and consistent, supported by formatting and predictable method ordering; long lines and uneven Javadoc alignment introduce minor friction.
Run 2
Code Structure: Well-organized value object with an associated enum, constructor validation, accessors, and standard overrides. Nesting: Shallow throughout; early returns keep equals easy to follow. Clarity of intent: Descriptive names and useful documentation explain feature updates and downgrade behavior, though hexadecimal literals for ordinary version comparisons are unnecessarily obscure. Code length: Appropriately concise overall, with some repetition in fromCode and a lengthy validation message. Action granularity: Statements generally perform one action per line; wrapped exception construction remains understandable. Reading flow: Natural progression from fields and enum to construction and object methods, supported by consistent formatting. Minor weaknesses include cramped package/import spacing, uneven Javadoc alignment, and a validation message referring to '< 1' when its condition specifically checks zero.
Run 3
Code Structure: Logically organized into immutable fields, a related enum, constructor validation, accessors, and standard object methods. Nesting: Shallow conditionals and early returns keep control flow easy to follow. Clarity of intent: Descriptive names and documentation clearly explain feature updates and downgrade modes; hexadecimal literals for ordinary version comparisons slightly obscure meaning. Code length: Appropriately concise overall, although fromCode could use a switch for a more compact mapping. Action granularity: Each statement performs a distinct action, with no crowded multi-statement lines. Reading flow: Consistent formatting and conventional method ordering support natural reading. Minor distractions include lengthy documentation and an error message describing values below one when its condition specifically checks zero.