Sample
int-382a2d9faa4e-I01
Remove line comments, block comments, and Javadoc
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.759 | 0–1; higher is more readable |
| Dorn | 0.028 | 0–1; higher is more readable |
| Mi | 0.554 | 0–1; higher is more readable |
| LLOC | 58 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 15.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 14.67 | 0–20; mean of three runs |
| BTTF | 0.59 | 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. | 4600.914 | −151.83 |
| Source linesThe number of non-empty source lines. | 291 | +116.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.558 | −6.838 |
Intercept 8.87 + feature contributions = -33.398 (log-odds).
Score = sigmoid(-33.398) = 0.
| Score | 0.759 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 291 | +9.328 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 292 | −9.302 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 291 | −6.257 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 290.897 | +3.656 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| 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. | 95.945 | −0.399 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.082 | +0.142 |
Intercept 0.07 + feature contributions = -3.565 (log-odds).
Score = sigmoid(-3.565) = 0.028.
| Score | 0.554 |
|---|
| Score | 58 |
|---|
Run 1
The code demonstrates good structure with clear separation between the abstract ComparisonChain and its concrete implementations. The nesting depth is minimal - only one level in the anonymous ACTIVE class and one in InactiveComparisonChain. Method names clearly express intent (compareTrueFirst, compareFalseFirst, classify). Each line performs a single action, and the reading flow is natural with logical method ordering. However, the code has issues: excessive blank lines (100+ empty lines at the top and bottom) significantly hurt readability, making the file unnecessarily long. The @SuppressWarnings('unchecked') annotation requires explanation. Some methods like the deprecated compare(Boolean, Boolean) wrapper add complexity that could be confusing. The classify method's ternary chain, while concise, could be more explicit. The abstract method declarations are well-documented with Javadoc-style comments explaining the 'chain' behavior. Overall, the code is well-organized but the excessive whitespace and some compressed logic prevent a higher score.
Run 2
The code is generally well-structured and readable. It uses a clear class hierarchy (active vs inactive comparison chains) and flat method bodies with minimal nesting. Each compare method performs a single action (delegating to a comparator or primitive comparison), and the classify method cleanly handles the ternary logic. The anonymous ACTIVE implementation and InactiveComparisonChain subclass are logical and avoid duplication where appropriate. However, readability is slightly reduced by the unusually large number of blank lines between the package/import declarations and the class definition, which disrupts the natural reading flow. Additionally, the use of anonymous inner classes and the presence of numerous overridden methods with identical return-this bodies in InactiveComparisonChain could be seen as repetitive, though this is a common pattern for such fluent APIs. Overall, the intent is clear, and the code is concise, but the formatting inconsistency and repetition prevent a higher score.
Run 3
The code follows a clear, logical structure with a well-defined class hierarchy: an abstract ComparisonChain with active and inactive implementations. Each comparison method is concise and delegates to a common classify method, flattening nesting and maintaining one action per line. This design is idiomatic and elegant for the domain. However, readability is notably reduced by large blocks of blank lines and placeholder comments (e.g., around the private constructor and before abstract methods), which break the visual flow and suggest unfinished documentation. Deep generic and annotation syntax in signatures (e.g., Comparator<T> with @Nullable) adds complexity for readers unfamiliar with Guava conventions. Still, the core logic remains straightforward and the class's intent is obvious.
Run 1
Code Structure: Active and inactive comparison states are logically separated, with consistent overload implementations. Nesting: Mostly shallow; the anonymous class and nested ternary add modest complexity. Clarity of intent: Descriptive names communicate comparison ordering and state transitions, though short-circuit behavior and reversed arguments in compareTrueFirst lack explanation. Code length: Repeated overloads are largely justified by the API, but excessive blank lines substantially inflate the listing. Action granularity: Methods generally perform one clear action per line; classify compresses three outcomes into a single expression. Reading flow: Consistent formatting within methods helps, but large whitespace gaps and placing abstract API declarations after implementations interrupt navigation.
Run 2
Code Structure: Active and inactive comparison states are logically separated, with consistently grouped overloads, although implementation details precede most public API declarations. Nesting: Generally shallow; the anonymous class and nested ternary introduce modest complexity. Clarity of intent: Descriptive method names and state constants convey comparison behavior, but missing documentation leaves short-circuit semantics and reversed arguments in compareTrueFirst less immediately obvious. Code length: Overload repetition is largely justified, but excessive blank lines substantially inflate the code and an unused import adds clutter. Action granularity: Statements generally perform one clear action per line; classify compresses multiple decisions into one expression. Reading flow: Consistent formatting within methods helps, but large whitespace gaps interrupt navigation and separate related declarations unnecessarily.
Run 3
Code Structure: Active and inactive comparison states are logically separated, with consistent overloads, though implementation precedes much of the public API. Nesting: Generally shallow; the anonymous class adds modest nesting, and the nested ternary slightly complicates classification. Clarity of intent: Descriptive names and short methods convey comparison chaining, but missing documentation makes short-circuit behavior and reversed boolean ordering less immediately obvious. Code length: Numerous overloads require repetition, while excessive blank lines unnecessarily inflate the listing. Action granularity: Statements generally perform one action per line, with compact comparison-and-classification expressions remaining understandable. Reading flow: Consistent formatting and method patterns help, but large whitespace gaps interrupt navigation, and readers must move between the active implementation, inactive implementation, and abstract declarations.