Sample
int-d14caab1c0b9-I05
Rewrite eligible decimal integer literals in hexadecimal notation
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.682 | 0–1; higher is more readable |
| Dorn | 0.716 | 0–1; higher is more readable |
| Mi | 0.577 | 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 | 19 | 0–20; mean of three runs |
| BTTF | 0.531 | 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.703 | −7.054 |
Intercept 8.87 + feature contributions = -25.602 (log-odds).
Score = sigmoid(-25.602) = 0.
| Score | 0.682 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 100 | +0.809 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 46 | −0.592 |
| 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. | 99.978 | −0.569 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 37 | +0.543 |
| 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.782 | +0.216 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.092 | +0.052 |
Intercept 0.07 + feature contributions = 0.926 (log-odds).
Score = sigmoid(0.926) = 0.716.
| Score | 0.577 |
|---|
| Score | 16 |
|---|
Run 1
The code is highly readable with clear structure, flat nesting, and concise methods. The class has a well-defined single purpose: utilities for sorted collections. Each method performs one logical action per line, and the reading flow is natural. The `hasSameComparator` method uses a clear if-else chain to check different collection types before comparing comparators. Javadoc documentation explains intent precisely. The code is appropriately concise without unnecessary verbosity. Minor deductions could be made for the type cast and null-handling in the comparator method requiring a comment for clarity, but overall the code exemplifies strong readability practices.
Run 2
This code is highly readable. The structure is logical: a private constructor for a utility class, two focused static methods, and clear JavaDoc explaining each method's intent. Nesting is minimal—only a simple if-else chain and a single null check. The purpose of each method is unambiguous, especially with the documentation. The code is concise without sacrificing clarity; no unnecessary lines are present. Each action is appropriately separated, with one core action per line (e.g., null checks, type checks, return statements). The reading flow is natural: validation first, then type-based branching, then null handling fallback. Type casts and generics are handled cleanly, with a suppression annotation explained by an inline comment. Overall, this is well-structured, maintainable code that balances brevity with clarity.
Run 3
The code is well-structured with clear separation of public utility methods and a private constructor preventing instantiation. Nesting is minimal—only a single if-else chain in hasSameComparator and a null check in comparator. Intent is evident from method names and Javadoc. The code is concise, avoiding unnecessary verbosity. Each line generally performs one action, though the if-else chain and type casts require some attention. Reading flow is natural: validation first, then type checks, then comparison. The static imports and usage of checkNotNull improve readability. Minor deductions: the hasSameComparator method's branching could be slightly clearer, and the type cast in comparator is non-obvious without its explanatory comment. Overall, this is highly readable production-quality code.
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: Descriptive method names, documentation, and the natural-ordering comment clearly explain behavior; comparator2 is slightly generic. Code length: Compact without unnecessary repetition or abstraction. Action granularity: Each statement performs one clear action. Reading flow: Validation, collection-type detection, and comparator comparison follow a natural sequence. Minor formatting issues, such as missing separation between the package declaration and imports, slightly reduce polish.
Run 2
Code Structure: A focused utility class cleanly separates comparator equivalence checking from comparator retrieval. Nesting: Shallow conditional branches and an early return keep complexity low. Clarity of intent: Descriptive method names, Javadoc, and the natural-ordering comment clearly explain behavior; comparator2 is slightly generic. Code length: Concise, with no unnecessary logic or duplication. Action granularity: Each statement performs a single clear action. Reading flow: Preconditions, type checks, comparator selection, and comparison follow a natural sequence. Generic casts and the wrapped method signature add minor reading friction, but overall readability is excellent.
Run 3
Code Structure: A focused utility class with two small, logically separated methods. Nesting: Shallow conditional branches and an early return keep control flow simple. Clarity of intent: Descriptive method names, documentation, and the natural-ordering comment explain behavior clearly; comparator2 is slightly less descriptive. Code length: Concise, with no unnecessary logic or repetition. Action granularity: Each statement performs a single clear action, and null checks are separate. Reading flow: Validation, comparator selection, and comparison follow a natural sequence. Generic types and unchecked casts add minor reading complexity, but their purpose is clear.