Sample
int-aabd54435597-SRC
Unmodified source class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.826 | 0–1; higher is more readable |
| Dorn | 0.24 | 0–1; higher is more readable |
| Mi | 0.115 | 0–1; higher is more readable |
| LLOC | 37 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 17 | 0–20; mean of three runs |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs |
| BTTF | 0.532 | 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. | 2160.249 | −71.288 |
| 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.51 | −6.765 |
Intercept 8.87 + feature contributions = -30.783 (log-odds).
Score = sigmoid(-30.783) = 0.
| Score | 0.826 |
|---|
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.787 | +0.929 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.058 | +0.382 |
Intercept 0.07 + feature contributions = -1.153 (log-odds).
Score = sigmoid(-1.153) = 0.24.
| Score | 0.115 |
|---|
| Score | 37 |
|---|
Run 1
The code is well-structured with clear separation of concerns: an enum, constructor, getters, and object method overrides are logically organized. Nesting is minimal—only the enum and validation checks introduce shallow depth. Intent is explicitly documented with Javadoc, especially for constructor parameters and upgrade types. The code is concise but not overly compact, maintaining readability. Action granularity is mostly one action per line, though the constructor validation could be slightly more spaced. Reading flow is natural, following a top-down progression from type definitions to behavior. Minor deductions: the enum's fromCode uses an if-else chain that could be a switch for clarity, and the constructor's validation logic slightly condenses multiple concerns. Overall, highly readable with only small opportunities for refinement.
Run 2
The code is well-structured with clear separation of concerns: enum definition, constructor validation, accessors, and standard object overrides. Nesting is minimal, with only flat conditional checks in the constructor and equals method. Intent is clearly documented via Javadoc and descriptive names. The code is concise without being terse, though the UpgradeType.fromCode method could be simplified with a switch statement or map lookup. Action granularity is appropriate—one logical operation per line. Reading flow is natural: fields, enum, constructor, getters, then overrides. The validation logic in the constructor is clear and defensive. Overall, this is highly readable production-quality code that follows Java conventions well.
Run 3
The code is well-structured and highly readable. It follows a clear logical organization: fields, enum, constructor, accessors, and standard object method overrides. Nesting is minimal, with only a few flat if-else branches and simple validation checks. Intent is clearly expressed through descriptive names and thorough Javadoc comments. Code length is appropriate—no unnecessary verbosity or redundancy. Each action is generally confined to one line, and the reading flow follows a natural top-down progression from type definition to behavior. Minor improvements could include using a switch in `fromCode` to avoid chained if-else, and ensuring null-safety in `upgradeType.equals(...)`, but these do not significantly detract from readability.
Run 1
Code Structure: Well-organized value class with an embedded 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 useful documentation clearly explain feature updates and downgrade modes; the validation message's '< 1' wording is slightly inconsistent with its zero-only condition. Code length: Generally concise, though fromCode's if/else chain and lengthy constructor documentation add minor verbosity. Action granularity: Statements generally perform one action per line, with readable compound conditions. Reading flow: Natural progression from fields and enum to construction and object behavior; long lines and uneven documentation alignment slightly reduce scanability.
Run 2
Code Structure: Well-organized value class with fields, a related enum, constructor validation, accessors, and standard overrides. Nesting: Shallow conditionals and early returns keep complexity low. Clarity of intent: Descriptive names and documentation clearly explain feature updates and downgrade modes; the error message's '< 1' wording is slightly inconsistent with its zero-only condition. Code length: Mostly concise, though fromCode's if/else chain is somewhat repetitive and some documentation and strings are long. Action granularity: Statements generally perform one action per line, with only straightforward compound conditions. Reading flow: Conventional method ordering and consistent formatting support natural reading; missing spacing around imports and lengthy lines slightly reduce scanability.
Run 3
Code Structure: Logically organized into fields, an enum, constructor validation, accessors, and standard object methods. Nesting: Shallow conditionals and early returns keep control flow simple. Clarity of intent: Descriptive names and Javadoc clearly explain feature updates and downgrade behavior; the error message's '< 1' wording is slightly inconsistent with its zero-only condition. Code length: Appropriately concise overall, although fromCode's repetitive conditional chain could be simplified. Action granularity: Each statement performs a single clear action, with no crowded multi-statement lines. Reading flow: Conventional Java ordering and consistent formatting make the class easy to scan; long documentation and exception-message lines slightly interrupt the flow.