Sample
int-bb0032bfcb30-I06
Invert eligible conditions and exchange their branches
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.688 | 0–1; higher is more readable |
| Dorn | 0.378 | 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 | 10.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 13.33 | 0–20; mean of three runs |
| BTTF | 0.374 | 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. | 2407.842 | −79.459 |
| 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.535 | −6.802 |
Intercept 8.87 + feature contributions = -33.391 (log-odds).
Score = sigmoid(-33.391) = 0.
| Score | 0.688 |
|---|
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.871 | +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.051 | +0.451 |
Intercept 0.07 + feature contributions = -0.498 (log-odds).
Score = sigmoid(-0.498) = 0.378.
| Score | 0.478 |
|---|
| Score | 30 |
|---|
Run 1
The code has a clear class-level purpose and comments explaining intent, but several patterns significantly hurt readability. The most serious issue is the inverted boolean conditionals with empty true branches: `if (!((isDelete))) {} else { ... }` and similar constructs in `findRedundantOffset` and `lastRedundantOffset`. This forces the reader to mentally negate conditions and breaks natural reading flow. The `updateState` method performs multiple actions (setting timeline min, putting offset, finding redundant offset, conditional removal) without clear separation, and its logic appears flawed—it removes the offset after calculating redundancy, potentially invalidating the calculation order. The algorithm's core maintenance (minimum across offsets and early exit when equal to lastRedundantOffset) is not immediately obvious. Comments are verbose but sometimes add confusion rather than clarity (e.g., the deletion comment contradicts the code order). Nesting is flat, which is good, but action granularity is mixed. Overall, the code is functional but not naturally readable.
Run 2
The code has a clear overall purpose and is logically organized around two main data structures: offsets map and lastRedundantOffset tracker. However, readability suffers due to several factors. The custom TimelineHashMap and TimelineLong abstractions obscure state management without explanatory comments. Redundant logic appears in multiple places — for example, calling findRedundantOffset() after updating lastRedundantOffset is redundant since the method already calculates the minimum. The conditional blocks using `if (!((condition))) {} else { ... }` are unnecessarily awkward and hard to read. Action granularity is acceptable overall, but method names like `curState()` and `lastRedundantOffset()` are ambiguous. Nesting is shallow, and the findRedundantOffset method is mostly readable, though the early-return patterns could be cleaner using standard guard clauses. Overall, the code is maintainable but needs refactoring for clarity and less convoluted conditionals.
Run 3
The code has reasonable structure and documentation but suffers from awkward control flow constructs. Multiple conditional blocks use inverted conditions with empty branches (e.g., `if (!((isDelete))) {} else { ... }`), which deeply harms readability and obscures intent. Such patterns are confusing and should be rewritten as straightforward positive conditions. Nesting is generally shallow, and actions are mostly one per line, which is good. However, variable names like `soFar` are vague, and the method `findRedundantOffset` is difficult to follow due to unclear logic and the inverted condition style. Comments are present and helpful in places, but some are verbose relative to the complexity. Overall, the code is maintainable but unnecessarily convoluted in key control statements, significantly reducing clarity and readability.
Run 1
Code Structure: The class is logically organized into state, initialization, updates, calculation, and accessors. Nesting: Methods remain shallow, with only a loop and simple branches. Clarity of intent: Descriptive names and documentation explain offset tracking, though soFar is vague and the redundant-offset terminology requires careful reading. Code length: Implementation is reasonably compact, but lengthy comments and empty branches add unnecessary bulk. Action granularity: Most statements perform one action per line, but inline empty branches obscure control flow. Reading flow: Method sequencing is natural; however, repeated negated conditions with excessive parentheses and empty if bodies followed by meaningful else blocks force readers to mentally invert straightforward tests. Replacing these with direct conditions would substantially improve readability.
Run 2
Code Structure: The class is logically organized into state, initialization, updates, calculation, and accessors, with focused methods. Nesting: Generally shallow, although empty if branches followed by else blocks create unnecessary control-flow complexity. Clarity of intent: Descriptive method names and comments explain offset tracking, but the repeated negated, heavily parenthesized conditions obscure simple checks. The name soFar is vague, and lastRedundantOffset terminology is less precise than its smallest-necessary-offset description. Code length: Methods are concise, but extensive comments and awkward conditionals add avoidable length. Action granularity: Most statements perform one action per line; empty branches and else placement reduce visual clarity. Reading flow: The overall sequence is natural, but inverted conditions force readers to mentally simplify expressions, and lengthy explanatory comments interrupt the calculation logic.
Run 3
Code Structure: Fields, initialization, state updates, calculation, and accessors are logically separated into focused methods. Nesting: Generally shallow, with only a loop and conditional checks. Clarity of intent: Descriptive names and documentation explain offset tracking, but repeated negated conditions with excessive parentheses and empty if branches obscure simple decisions. Code length: Methods are concise, though verbose comments and redundant conditional syntax add unnecessary length. Action granularity: Most lines perform one action, but inline empty if/else constructs compress control flow awkwardly. Reading flow: The overall organization is natural, but readers must mentally invert conditions to understand deletion, empty-state handling, early returns, and validation. Straightforward positive conditions and removal of empty branches would substantially improve readability.