Sample
int-78d8f43aebf7-I12
Inline all eligible single-use intermediate local variables
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: the enum, constructor, accessors, and standard object methods are logically organized. Nesting is minimal and readable. Field and parameter names communicate intent effectively, supported by thorough Javadoc. The code is concise without sacrificing clarity, though the Javadoc is somewhat verbose. Each method performs a single action per line, contributing to strong readability. The fromCode method uses a simple if-else chain rather than a switch, which is slightly less elegant but still clear. Constructor validation is straightforward and well-ordered. Overall, the code is highly readable, with only minor opportunities for improvement such as using a switch expression or Objects.equals for consistency.
Run 2
The code demonstrates strong readability through clear structure, logical organization, and well-documented intent. The class has a single responsibility and follows standard Java conventions. The constructor includes validation with helpful error messages. Methods are concise and names clearly express their purpose. The enum is properly encapsulated with clean conversion logic. Minor deductions: the 'fromCode' method uses if-else chains that could be a switch statement for slightly better clarity, and the enum field 'code' could be more descriptive as 'value' or 'typeCode'. The Javadoc is thorough but slightly verbose. Overall, the code maintains flat nesting, natural reading flow, and one action per line, making it quite maintainable.
Run 3
The code demonstrates strong readability through logical organization of a simple class representing a feature update. The enum is clear with sensible ordering, and the fromCode method, while using sequential if-else, is flat and easy to follow. Javadoc is comprehensive and explains edge cases well, particularly around the special zero value. Validation logic in the constructor is placed early, creating a clear contract. Methods are concise and single-purpose. The equals method follows standard patterns and avoids excessive nesting. Minor deductions: fromCode could use a switch statement for slightly better readability, and the constructor's first validation check contains a somewhat long condition expression and verbose error message. Overall, the code is well-structured, maintains flat nesting, and clearly communicates intent with appropriate granularity. The reading flow is natural from type definition to validation to accessors to standard object methods.
Run 1
Code Structure: Well-organized value class with an embedded enum, constructor validation, accessors, and standard object methods. Nesting: Shallow control flow; guard clauses keep validation and equality checks easy to follow. Clarity of intent: Descriptive names and constructor documentation explain feature updates and downgrade modes. Minor ambiguity arises from an error message describing '< 1' when its condition checks only zero, and implicit null handling for upgradeType. Code length: Appropriately concise overall, though fromCode uses a slightly repetitive conditional chain. Action granularity: Statements generally perform one action per line; compound boolean expressions remain understandable. Reading flow: Natural progression from fields and enum to construction, accessors, and object methods. Long documentation and exception-message lines slightly reduce scanning ease.
Run 2
Code Structure: Well-organized value class with fields, a related enum, constructor validation, accessors, and standard object methods. Nesting: Shallow conditionals and early returns keep complexity low. Clarity of intent: Descriptive names and helpful documentation explain feature updates and downgrade behavior; the error message's '< 1' wording is slightly inconsistent with its zero-only condition. Code length: Appropriately concise, though fromCode's repetitive conditional chain could be simplified with a switch. Action granularity: Statements generally perform one action per line; longer expressions remain understandable. Reading flow: Logical ordering and consistent formatting make the class easy to follow, with minor distractions from long documentation and exception-message lines.
Run 3
Code Structure: Fields, the related enum, constructor, accessors, and standard object methods are logically organized. Nesting: Shallow conditionals and early returns keep complexity low. Clarity of intent: Descriptive names and constructor documentation clearly explain feature updates and downgrade modes, although the error message says '< 1' when its condition checks only zero. Code length: Appropriately concise overall; the enum lookup's if/else chain is slightly repetitive. Action granularity: Each statement performs a single clear action, with only some long expressions and strings reducing scanability. Reading flow: Conventional Java layout provides a natural progression, though missing spacing between package and imports, uneven Javadoc alignment, and long lines slightly detract from readability.