Sample
int-8242fdd8ec19-SRC
Unmodified source class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.53 | 0–1; higher is more readable |
| Dorn | 0.482 | 0–1; higher is more readable |
| Mi | 0.48 | 0–1; higher is more readable |
| LLOC | 25 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 16.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 17 | 0–20; mean of three runs |
| BTTF | 0.463 | 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. | 2415.477 | −79.711 |
| Source linesThe number of non-empty source lines. | 69 | +27.6 |
| Byte entropyHow varied the bytes in the source text are. Repeated bytes give a lower value; a more even mixture gives a higher value. | 5.008 | −7.513 |
Intercept 8.87 + feature contributions = -50.753 (log-odds).
Score = sigmoid(-50.753) = 0.
| Score | 0.53 |
|---|
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. | 70 | −1.442 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 60 | +1.338 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 60 | −0.956 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 95.914 | +0.743 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 68.835 | +0.552 |
| 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.957 | −0.399 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.095 | +0.021 |
Intercept 0.07 + feature contributions = -0.073 (log-odds).
Score = sigmoid(-0.073) = 0.482.
| Score | 0.48 |
|---|
| Score | 25 |
|---|
Run 1
The code is well-structured and readable overall. The class has a clear single responsibility and uses sensible method ordering. Method names like nullsFirst(), nullsLast(), and reverse() clearly convey intent. The lazy initialization pattern for nullsFirst and nullsLast follows a consistent, recognizable structure. Indentation is consistent, and nesting is minimal. The @SuppressWarnings annotations with TODO comments are somewhat noisy but explain why the suppressions exist. The compare() method includes null checks with comments for GWT compatibility, clarifying intent. One minor readability drawback is the repeated @SuppressWarnings("unchecked") pattern with identical TODO comments, which adds visual clutter. Variable names like left, right, and result are clear. The class is concise, with no unnecessary code. Action granularity is reasonable—one logical operation per line in most cases. The serialization field placement at the bottom with annotations is logical. Overall, the code is maintainable and easy to follow for a developer familiar with Guava patterns.
Run 2
The code is well-structured with clear logical organization and consistent formatting. Nesting is minimal, with only single-level if statements for lazy initialization. The intent of each method is clear, though the multiple @SuppressWarnings annotations with unresolved TODO comments reduce clarity. Code length is appropriate with no unnecessary verbosity. Each line performs a single action, maintaining good granularity. Reading flow is natural and follows a logical progression from fields to methods, ending with utility methods. The main readability issues are the repetitive nullsFirst/nullsLast pattern and the unclear type-casting suppressions that leave ambiguity about why unchecked warnings are acceptable.
Run 3
The code is well-structured and highly readable for an experienced Java developer. It follows a logical organization with clear class declaration, fields, and methods. The nesting is minimal—only simple null checks within methods. Intent is clear: a singleton natural ordering implementation. The code is concise and avoids unnecessary complexity. Each line generally performs one action, maintaining good action granularity. Reading flow is natural, with methods ordered logically (compare, nullsFirst, nullsLast, reverse, readResolve, toString). The use of comments explains non-obvious decisions like lazy initialization and GWT compatibility. Some minor readability costs come from the generic type declarations (e.g., 'Ordering<@Nullable Comparable<?>>') and the pervasive 'TODO(kevinb)' comments, but these are inherent to the codebase's complexity rather than poor style. Overall, it's a clean implementation that would be straightforward to maintain for developers familiar with the codebase.
Run 1
Code Structure: Logically organized around a singleton ordering, with small, focused methods; placing serialization metadata and the constructor last slightly weakens grouping. Nesting: Very shallow, with only single-level conditionals for lazy initialization. Clarity of intent: Descriptive names and the class comment make natural ordering and null handling clear, although complex generic annotations, unchecked casts, and unresolved TODOs require extra interpretation. Code length: Concise overall; parallel nullsFirst and nullsLast implementations are reasonable duplication. Action granularity: Most lines perform one action, but chained assignments combine local assignment and cache updates, while several annotations share declaration lines. Reading flow: Methods follow a natural progression from comparison to ordering variants and singleton support, though dense type signatures and repeated suppression comments interrupt scanning.
Run 2
Code Structure: Logically organized around a singleton natural ordering, with small, focused methods. Nesting: Minimal; caching methods contain only one conditional level. Clarity of intent: Descriptive names and the class documentation explain the purpose, although complex generic types, unchecked casts, and repeated unresolved TODOs add cognitive overhead. Code length: Concise overall; duplicated caching patterns are limited and understandable. Action granularity: Most statements perform one action, but chained assignments update both the cache and local variable on one line, and compressed annotation declarations reduce scanability. Reading flow: Methods follow a coherent progression from comparison to ordering variants and singleton support; dense type annotations and minor formatting inconsistencies occasionally interrupt the flow.
Run 3
Code Structure: Well-organized class with focused methods and clear singleton implementation. Nesting: Minimal, with only single-level conditionals for lazy initialization. Clarity of intent: Descriptive names and comments establish natural ordering, null handling, and singleton preservation; complex generic types, unchecked casts, and unresolved TODOs add friction. Code length: Concise overall, though repeated suppression comments and similar caching methods introduce minor repetition. Action granularity: Most statements perform one action, but chained assignments combine local assignment and cache updates. Reading flow: Methods follow a sensible progression from comparison to ordering variants and serialization support; dense annotations, tightly packed imports, and the trailing serialization constant slightly interrupt the flow.