Sample
int-cff01a377579-SRC
Unmodified source class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.71 | 0–1; higher is more readable |
| Dorn | 0.391 | 0–1; higher is more readable |
| Mi | 0.478 | 0–1; higher is more readable |
| LLOC | 30 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 16 | 0–20; mean of three runs |
| GPT-6.1 Sol | 17 | 0–20; mean of three runs |
| BTTF | 0.391 | 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. | 2195.46 | −72.45 |
| Source linesThe number of non-empty source lines. | 110 | +44 |
| 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.518 | −6.777 |
Intercept 8.87 + feature contributions = -26.357 (log-odds).
Score = sigmoid(-26.357) = 0.
| Score | 0.71 |
|---|
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. | 110 | −2.858 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 66 | +1.546 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 109.842 | +1.126 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 65 | −1.071 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 99.964 | +0.808 |
| 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.991 | −0.57 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.045 | +0.508 |
Intercept 0.07 + feature contributions = -0.441 (log-odds).
Score = sigmoid(-0.441) = 0.391.
| Score | 0.478 |
|---|
| Score | 30 |
|---|
Run 1
The code is generally well-structured with clear Javadoc and reasonable method separation, but has several readability issues. The updateState method performs multiple actions: setting offsets, calculating redundant offset, conditionally removing keys, and handling deletes—violating single-action granularity. The findRedundantOffset method contains confusing logic with a lengthy inline comment explaining a non-obvious early return condition, making intent unclear. The lastRedundantOffset initialization to Long.MAX_VALUE is a hidden sentinel value requiring comments to understand. The package declaration and imports could benefit from blank lines for separation. Overall nesting is shallow and the reading flow is acceptable, but the redundant offset calculation logic is unnecessarily complex and would benefit from refactoring into smaller, better-named methods with clearer explanation of the edge case handling.
Run 2
The code is well-structured and readable. It has a clear class purpose with a concise Javadoc, and methods are logically organized. Nesting is minimal, with only one level in the loop. Intent is clear throughout, aided by descriptive method names and useful inline comments explaining non-obvious logic. The code is concise without excessive verbosity, and each line generally performs a single action. However, a few points slightly reduce readability: the `findRedundantOffset` method mixes state mutation with its calculation, and some comments are longer than necessary. Overall, the reading flow is natural, and the code is easy to follow.
Run 3
The code is generally well-structured with clear separation of concerns, a single public mutator, and focused private helpers. Javadoc comments explain the purpose and non-obvious behavior. Nesting is minimal, with no deep conditional blocks. Each line performs one logical action. However, readability is slightly reduced by the ambiguous logic in findRedundantOffset: the early return on equality with lastRedundantOffset is not intuitive and relies heavily on comments. Additionally, the field name offsets is vague—it stores the latest offset per key, not a collection of offsets. The initial set of lastRedundantOffset to Long.MAX_VALUE as a sentinel is explained but still a subtle pattern. Overall, the code is readable but would benefit from clearer naming and a more explicit algorithm description.
Run 1
Code Structure: Fields, initialization, state updates, minimum calculation, and accessors are logically separated into focused methods. Nesting: Shallow loops and conditionals, with early returns, keep complexity low. Clarity of intent: Descriptive types, method names, and comments explain offset tracking and snapshot rollback; however, lastRedundantOffset is described as the smallest necessary offset, creating boundary ambiguity, and soFar is vague. Code length: Implementation is compact, but lengthy and occasionally repetitive comments interrupt readability. Action granularity: Statements generally perform one action per line, with straightforward assignments and collection operations. Reading flow: The class progresses naturally from setup to updates and queries. However, calculating the redundant offset before removing a deleted key requires careful interpretation, and its ordering could be explained more explicitly. Overall, the code is readable and well organized, with minor terminology and documentation issues.
Run 2
Code Structure: A focused class with well-separated initialization, state updates, minimum-offset calculation, and accessors. Nesting: Shallow control flow and early returns make methods easy to follow. Clarity of intent: Descriptive names and documentation explain snapshot handling and deletion behavior, but lastRedundantOffset ambiguously denotes a boundary versus an actually redundant offset, and soFar is generic. Code length: Executable code is concise; several comments are repetitive or disproportionately long. Action granularity: Statements generally perform one action per line, with straightforward expressions. Reading flow: Methods follow a natural progression and formatting is consistent, though the subtle ordering of minimum calculation before deletion requires careful reading. The lengthy inline example interrupts the otherwise smooth calculation loop.
Run 3
Code Structure: Fields, constructor, state updates, calculation helper, and accessors are logically organized with clear separation of responsibilities. Nesting: Shallow conditionals and a single loop make control flow easy to follow; early returns avoid unnecessary nesting. Clarity of intent: Descriptive method names and documentation explain snapshot rollback and offset tracking, though lastRedundantOffset versus smallest necessary offset introduces terminology ambiguity, and deletion after calculation requires careful reading. Code length: Implementation is concise, but several comments and accessor documentation are verbose or repetitive. Action granularity: Statements generally perform one action per line; composed Math.min calls remain straightforward. Reading flow: State updates lead naturally into minimum-offset calculation and querying. However, tightly grouped imports, the vague accumulator name soFar, and a lengthy comment inside the loop slightly interrupt readability.