Sample
int-b2a9391e9b0a-SRC
Unmodified source class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.566 | 0–1; higher is more readable |
| Dorn | 0.903 | 0–1; higher is more readable |
| Mi | 0.776 | 0–1; higher is more readable |
| LLOC | 53 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 17.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs |
| BTTF | 0.448 | 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. | 4612.687 | −152.219 |
| Source linesThe number of non-empty source lines. | 147 | +58.8 |
| 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.812 | −7.218 |
Intercept 8.87 + feature contributions = -91.766 (log-odds).
Score = sigmoid(-91.766) = 0.
| Score | 0.566 |
|---|
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. | 148 | −4.204 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 141 | +4.14 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 146.673 | +1.64 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 95.676 | +0.739 |
| 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. | 96.919 | −0.44 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.108 | −0.109 |
Intercept 0.07 + feature contributions = 2.235 (log-odds).
Score = sigmoid(2.235) = 0.903.
| Score | 0.776 |
|---|
| Score | 53 |
|---|
Run 1
The code is generally well-structured and readable. It follows a clear logical organization with methods grouped by functionality. The class has a single responsibility: implementing a descending view of a multiset. Nesting is minimal — only one inner class exists with flat, simple methods. The lazy initialization pattern for `comparator`, `elementSet`, and `entrySet` is consistent and clear. Method names accurately describe their intent, and the delegation pattern makes the code's purpose obvious. However, some lines (like the ternary with assignment in `entrySet()`) combine multiple actions, slightly reducing clarity. The return type with assignment (`return elementSet = new ...`) is terse but potentially confusing. Overall, the code maintains strong readability with only minor opportunities for improvement in action granularity and expression clarity.
Run 2
The code demonstrates excellent readability with clear structure and intent. It follows a logical organization with related methods grouped together (comparator, elementSet, entry operations, delegation). Nesting is minimal, with only one inner class implementation. Each method has a single, clear purpose and is concise. Lazy initialization patterns are consistently applied and easy to follow. The naming is descriptive and follows Java conventions. Reading flow is natural—methods delegate cleanly to forwardMultiset() with reversed semantics. Action granularity is appropriate, with one logical operation per line. Comments and annotations provide useful context without clutter. The abstract contract is well-defined at the top, making the implementation's purpose immediately clear. Minor deductions for slight complexity in null-check ternaries and the inner EntrySetImpl class placement, but overall this represents production-quality, maintainable code that balances conciseness with clarity.
Run 3
The code demonstrates clear structure with logical method grouping: comparators, element sets, entry manipulation, range views, and collection operations. Nesting is minimal—only one inner class with three straightforward methods. Intent is unambiguous: each method name clearly expresses its purpose, and the descending multiset wrapper pattern is consistently applied via delegation to forwardMultiset(). Lazy initialization fields with @LazyInit annotations are idiomatically handled with clear null checks. Code length is appropriate—no redundant methods; each override implements a distinct SortedMultiset contract. Action granularity is mostly one action per line, particularly in delegation methods like pollFirstEntry() and headMultiset(). Reading flow is natural: related operations are adjacent, and the delegation pattern makes the reversal logic immediately apparent. Minor deductions: the ternary in entrySet() slightly reduces readability compared to if/else style used elsewhere, and the @WeakOuter annotation and nullness annotation noise (though standard for Google's codebase) adds visual clutter for general readers.
Run 1
Code Structure: Well-organized skeleton implementation with focused overrides and related cached fields near their accessors. Nesting: Mostly flat; lazy initialization and the local entry-set class add only modest nesting. Clarity of intent: Descriptive names, documentation, and explicit first/last and head/tail reversals clearly communicate descending-view behavior, though framework-specific helpers require familiarity. Code length: Concise methods avoid unnecessary logic; repeated delegation is appropriate for the interface. Action granularity: Most statements perform one action, but assignments embedded in returns and the entrySet ternary combine caching with result selection. Reading flow: Consistent formatting and straightforward delegation make the class easy to follow, although differing lazy-initialization styles and scattered entry-related methods slightly reduce consistency.
Run 2
Code Structure: Well-organized implementation with small methods and clear delegation, though cached fields are interspersed with methods. Nesting: Mostly flat, with simple conditionals and one manageable local class. Clarity of intent: Descriptive names and the class documentation clearly communicate the descending-view behavior; reversed operations are easy to recognize. Code length: Concise, with little unnecessary logic despite numerous interface overrides. Action granularity: Most statements perform one action, but assignment within a return and a ternary combines caching and returning, slightly reducing clarity. Reading flow: Consistent formatting and straightforward delegation support smooth reading; annotations, generic types, and differing lazy-initialization styles introduce minor visual complexity.
Run 3
Code Structure: Well-organized overrides and small methods clearly implement a descending view through delegation, although grouping all related operations together would improve organization. Nesting: Mostly flat, with only simple cache checks and a modest local class. Clarity of intent: Descriptive names, documentation, and explicit first/last and head/tail reversals make the purpose clear; framework-specific annotations and helpers require background knowledge. Code length: Concise for the functionality provided, with little unnecessary code. Action granularity: Most statements perform one action, but assignment within returns and the caching ternary combine operations. Reading flow: Consistent formatting and straightforward delegation support smooth reading, slightly interrupted by scattered cache fields and differing lazy-initialization styles.