Sample
int-85af80336a05-I01
Remove line comments, block comments, and Javadoc
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.789 | 0–1; higher is more readable |
| Dorn | 0.029 | 0–1; higher is more readable |
| Mi | 0.588 | 0–1; higher is more readable |
| LLOC | 37 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 16.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 17 | 0–20; mean of three runs |
| BTTF | 0.519 | 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.596 | −6.894 |
Intercept 8.87 + feature contributions = -30.913 (log-odds).
Score = sigmoid(-30.913) = 0.
| Score | 0.789 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 96 | +2.583 |
| 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 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 96 | −1.782 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 95.787 | +0.929 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.079 | +0.171 |
Intercept 0.07 + feature contributions = -3.494 (log-odds).
Score = sigmoid(-3.494) = 0.029.
| Score | 0.588 |
|---|
| Score | 37 |
|---|
Run 1
The code is highly readable with clear structure: fields, enum, constructor, accessors, equals, hashCode, and toString are logically organized. Nesting is minimal except for a slightly verbose fromCode method that could use a switch statement for better flow. Intent is clear throughout, especially in constructor validation messages. Code length is appropriate for a value class with proper immutability and validation. Action granularity is good—one logical operation per line. Reading flow is natural, though the scattered blank lines between fields and constructor slightly disrupt flow. The enum's fromCode method uses multiple if-else branches that are readable but a switch expression would improve clarity and reduce nesting. Error messages are descriptive and precise. Overall, the code demonstrates strong readability with only minor improvements possible.
Run 2
The code is well-structured and readable overall. The class has a clear single responsibility, with clean separation between the data model, enum, and helper methods. Nesting is minimal, with flat conditional checks and straightforward control flow. Intent is clear: the constructor validates version and upgrade type constraints, and methods like maxVersionLevel(), upgradeType(), equals(), hashCode(), and toString() have obvious purposes. Code length is appropriate for the functionality, avoiding unnecessary verbosity. Action granularity is good—most lines perform a single logical action, improving debugging and readability. Reading flow is natural, with fields, enum, constructor, accessors, and standard object overrides in a conventional order. Minor deductions: the constructor’s error message uses 'String.format' for a single interpolation, which could be simpler, and there are some blank lines that slightly disrupt visual flow. Overall, this is clean, maintainable code.
Run 3
The code is generally well-structured with a clear purpose, evident in the FeatureUpdate class and UpgradeType enum. It uses standard patterns for equals, hashCode, and toString. However, readability is slightly reduced by scattered blank lines, especially before the constructor, which disrupts visual flow. The constructor's validation logic is clear but has a minor issue: checking upgradeType.equals(UPGRADE) when maxVersionLevel is 0 could be simpler using the enum's code. The enum's fromCode method is a chain of if-else, which is acceptable for three cases but could be a switch for clarity. Nesting is minimal, but action granularity is sometimes mixed—like the combined condition and exception throwing. Overall, the code is concise and readable, with only minor formatting and organizational improvements needed.
Run 1
Code Structure: Fields, enum, constructor, accessors, and standard object methods are logically organized. Nesting: Shallow conditionals and early returns keep complexity low. Clarity of intent: Descriptive names make version updates and upgrade types understandable, although the constructor's error message describes a broader condition than its corresponding check. Code length: Methods are concise, but excessive blank lines add unnecessary visual length, and fromCode uses a somewhat repetitive conditional chain. Action granularity: Statements generally perform one action per line; wrapped expressions remain readable. Reading flow: The class follows a familiar Java layout, but large whitespace gaps and long validation and equality expressions slightly interrupt scanning.
Run 2
Code Structure: Fields, the related enum, constructor, accessors, and object-method overrides are logically organized. Nesting: Shallow conditionals and early returns keep control flow easy to follow. Clarity of intent: Descriptive names make version updates and upgrade types understandable, although numeric enum mappings and the constructor's validation rules require some interpretation. Code length: Mostly concise, but excessive blank lines add visual clutter, and fromCode uses a repetitive conditional chain. Action granularity: Statements generally perform one action per line; wrapped expressions remain readable. Reading flow: Conventional Java organization supports natural top-to-bottom reading, interrupted slightly by inconsistent spacing and a lengthy validation message.
Run 3
Code Structure: Fields, the enum, constructor, accessors, and standard overrides are logically organized. Nesting: Shallow conditionals and early returns keep control flow easy to follow. Clarity of intent: Descriptive names make version updates and upgrade types understandable, though numeric enum mappings require interpretation and the validation message describes '< 1' while its condition checks zero. Code length: Methods are concise, but excessive blank lines add unnecessary visual length, and fromCode is somewhat repetitive. Action granularity: Statements generally perform one action per line; wrapped expressions remain readable. Reading flow: Conventional Java organization supports natural reading, but large whitespace gaps and long exception and return expressions interrupt the flow.