Sample
int-09532fc3687b-I01
Remove line comments, block comments, and Javadoc
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.533 | 0–1; higher is more readable |
| Dorn | 0.43 | 0–1; higher is more readable |
| Mi | 0.63 | 0–1; higher is more readable |
| LLOC | 16 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 17.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 17 | 0–20; mean of three runs |
| BTTF | 0.466 | 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. | 1376.306 | −45.418 |
| Source linesThe number of non-empty source lines. | 45 | +18 |
| 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.674 | −7.01 |
Intercept 8.87 + feature contributions = -25.558 (log-odds).
Score = sigmoid(-25.558) = 0.
| Score | 0.533 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 45 | +0.819 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 46 | −0.592 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 44.783 | +0.216 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.118 | −0.201 |
| 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. | 91 | −0.189 |
Intercept 0.07 + feature contributions = -0.283 (log-odds).
Score = sigmoid(-0.283) = 0.43.
| Score | 0.63 |
|---|
| Score | 16 |
|---|
Run 1
The code is highly readable with clear structure and intent. The class is focused on sorted collection utilities, with a private constructor indicating utility-only usage. The hasSameComparator method is logically structured but has moderate nesting with two instance checks and an early return. The comparator method is flat and clean, though the wildcard generics slightly increase mental overhead. Code length is appropriate, and most lines perform a single action. The reading flow is natural: validation checks occur first, followed by type checking and comparison logic. The use of static imports and proper annotations maintains clarity. Minor deductions are for the moderate branching in hasSameComparator and the potential ambiguity around the purpose of the SortedIterable interface check, which may require developer familiarity with Guava internals.
Run 2
The code is well-structured and highly readable. It has a clear logical organization, with two static utility methods separated by a private constructor. Nesting is minimal, using flat if-else branching rather than deeply nested logic. The intent is clear: determine if a comparator matches a sorted collection's comparator and obtain a default comparator when needed. Code length is concise and appropriate, without redundant code. Action granularity is good, with one meaningful operation per line. The reading flow is natural, progressing from null checks to type checks to comparison. The use of blank lines and package-private access is idiomatic. Minor issues include a stray blank line and the @SuppressWarnings annotation, but these are negligible.
Run 3
The code is highly readable with clear structure, minimal nesting, and explicit intent. The class is well-organized with a private constructor and two static utility methods. Nesting is shallow (max one level of if-else). Each method has a single responsibility: checking comparator consistency and retrieving a comparator with natural ordering as fallback. Variable names are descriptive ('comparator2', 'result', 'sortedSet'). The use of 'instanceof' checks with distinct branches is clean. Minor deductions: several blank lines and an empty comment block create slight visual noise, and the null-annotation generic syntax adds a bit of complexity, but overall clarity and flow are excellent.
Run 1
Code Structure: Two focused utility methods are logically organized within a non-instantiable class. Nesting: Shallow conditionals and an early return keep control flow simple. Clarity of intent: Method names clearly convey comparator comparison and retrieval, although comparator2 is a generic variable name and the natural-order fallback could benefit from a brief explanation. Code length: The implementation is concise, but excessive blank lines add unnecessary visual space. Action granularity: Each statement performs a single action, making operations easy to follow. Reading flow: Validation, comparator selection, and comparison proceed naturally; inconsistent whitespace and the unchecked generic cast slightly interrupt readability.
Run 2
Code Structure: Two small, focused utility methods provide logical organization. Nesting: Shallow conditional branches make control flow easy to follow. Clarity of intent: Method names clearly describe comparator comparison and retrieval, though comparator2 is a generic name and the natural-order fallback could benefit from a brief comment. Code length: The implementation is concise, but excessive blank lines add visual noise. Action granularity: Each statement performs one clear action. Reading flow: Null checks, type-based comparator selection, and equality comparison follow a natural sequence; inconsistent whitespace slightly disrupts presentation.
Run 3
Code Structure: Two small, focused utility methods are logically organized. Nesting: Shallow conditional branches keep control flow easy to follow. Clarity of intent: Method names clearly describe comparator retrieval and comparison, although comparator2 is a generic variable name and the unchecked natural-order cast requires some Java knowledge. Code length: Implementation is concise, but excessive blank lines add visual clutter. Action granularity: Each statement performs one clear action, with validation and assignments on separate lines. Reading flow: Input checks, comparator selection, and equality comparison follow a natural sequence; inconsistent whitespace around imports and annotations slightly disrupts scanning.