Sample
int-430df6bd3557-I12
Inline all eligible single-use intermediate local variables
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.72 | 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 | 29 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 15.67 | 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. | 2151.378 | −70.995 |
| 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.513 | −6.77 |
Intercept 8.87 + feature contributions = -24.896 (log-odds).
Score = sigmoid(-24.896) = 0.
| Score | 0.72 |
|---|
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.891 | +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.973 | −0.569 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.045 | +0.507 |
Intercept 0.07 + feature contributions = -0.441 (log-odds).
Score = sigmoid(-0.441) = 0.391.
| Score | 0.478 |
|---|
| Score | 29 |
|---|
Run 1
The code is well-structured with clear class responsibilities and good documentation. The package organization and imports are clean. The nesting depth is minimal (one level in findRedundantOffset), and each method performs a single logical action. The intent is clearly communicated through meaningful names like lastRedundantOffset and updateState. However, there are minor readability issues: an unnecessary blank line in updateState, the comment structure in findRedundantOffset could be more concise, and the example in comments slightly interrupts flow. The code is reasonably concise but the lengthy comments in findRedundantOffset could be trimmed. Overall, it's highly readable with clear purpose and good action granularity.
Run 2
The code is generally well-structured with clear intent, good documentation, and logical organization. It uses flat control flow and avoids deep nesting. However, there are several readability issues: the findRedundantOffset() method contains an ineffective early-return condition (soFar == lastRedundantOffset) that doesn't actually skip remaining iterations, and the logic comments are somewhat verbose. The updateState() method performs multiple actions per line (set, put, conditional removal), which slightly reduces action granularity. Variable naming is clear, and the class has a single responsibility. The redundant offset calculation logic could be simplified for better clarity. Overall, the code is maintainable and understandable but could benefit from minor refactoring to improve action separation and method clarity.
Run 3
The code is moderately readable but has several issues. The class has a clear purpose and good documentation comments explaining the timeline objects and redundant offset logic. However, the findRedundantOffset() method contains confusing logic with an early return inside a loop that appears to defeat the purpose of iterating through all offsets. The comment block inside the loop is lengthy and disrupts flow, and the logic comparing soFar to lastRedundantOffset is unclear. There are also minor issues like the stray blank line before findRedundantOffset() call, and the method name curState() is vague. The updateState method mixes multiple concerns (setting offset, calculating minimum, handling delete) which reduces clarity. While the code is relatively flat and each line performs a single action, the intent of the redundant offset calculation is hard to follow without deeper analysis.
Run 1
Code Structure: Well-organized class with focused methods and clearly separated state, updates, calculations, and accessors. Nesting: Shallow control flow; the loop contains only one conditional, and early returns simplify reading. Clarity of intent: Descriptive names and documentation explain offset tracking and snapshot behavior, though 'lastRedundantOffset' versus 'smallest necessary offset' creates some conceptual ambiguity, and 'soFar' is vague. Code length: Implementation is concise, but several comments are verbose or repeat the code. Action granularity: Statements generally perform one action per line; the minimum-update expression is compact and understandable. Reading flow: Mostly natural, with initialization followed by updates and queries. Extra blank lines, unnecessary parentheses around findRedundantOffset(), and calculating redundancy before removing deleted keys introduce minor reading friction.
Run 2
Code Structure: Well-organized class with focused methods and clearly separated state, updates, calculations, and queries. Nesting: Shallow conditionals and a single loop keep control flow easy to follow. Clarity of intent: Descriptive names and documentation explain offset tracking and snapshot behavior, though lastRedundantOffset versus smallest necessary offset introduces boundary ambiguity, and soFar is generic. Code length: Implementation is concise, but lengthy comments repeat concepts and interrupt scanning. Action granularity: Each statement generally performs one action; the Math.min updates and method reference remain understandable. Reading flow: Methods follow a natural progression, with early returns simplifying traversal. Minor distractions include inconsistent whitespace, unnecessary parentheses around findRedundantOffset(), and the need to reason carefully about calculating the minimum before removing a deleted key.
Run 3
Code Structure: Fields, initialization, updates, calculation, and accessors are logically separated into focused methods. Nesting: Shallow conditionals and a single loop keep control flow easy to follow. Clarity of intent: Descriptive method names and documentation explain offset tracking and snapshot behavior, though lastRedundantOffset describes a boundary rather than an obviously redundant record, and soFar is vague. Code length: Implementation is compact, but lengthy comments repeat concepts and interrupt scanning. Action granularity: Each statement generally performs one clear action. Reading flow: Organization and early returns support natural reading, while redundant parentheses, extra blank space, and computing the minimum before removing a deleted key require additional interpretation.