Sample
int-1db5f1d2fbdb-I06
Invert eligible conditions and exchange their branches
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.637 | 0–1; higher is more readable |
| Dorn | 0.228 | 0–1; higher is more readable |
| Mi | 0.119 | 0–1; higher is more readable |
| LLOC | 22 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 16.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 17 | 0–20; mean of three runs |
| BTTF | 0.528 | 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. | 2140.737 | −70.644 |
| Source linesThe number of non-empty source lines. | 63 | +25.2 |
| 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.689 | −7.034 |
Intercept 8.87 + feature contributions = -43.608 (log-odds).
Score = sigmoid(-43.608) = 0.
| Score | 0.637 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| 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. | 150 | −2.688 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 149.953 | +1.615 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 62 | −1.159 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 51 | +1.027 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 51 | −0.749 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 62.848 | +0.469 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.077 | +0.197 |
Intercept 0.07 + feature contributions = -1.219 (log-odds).
Score = sigmoid(-1.219) = 0.228.
| Score | 0.119 |
|---|
| Score | 22 |
|---|
Run 1
The code is well-structured and readable. It uses clear class and method names, concise comments explaining purpose, and follows a logical flow. The tryComplete method is slightly verbose with an unnecessary if-else and a redundant double negation, but it remains clear. Nesting is minimal, and each action is on its own line, aiding readability. The use of streams and lambda expressions is appropriate and concise. Overall, the code is easy to follow and maintain, with only minor stylistic improvements possible.
Run 2
The code is generally readable and well-structured. It follows a clear class hierarchy with a single responsibility. Naming is meaningful (e.g., tryComplete, onComplete, futures). The class is concise and avoids unnecessary verbosity. However, readability is slightly reduced by a few issues: the condition `if (!((pending == 0)))` is awkward and could be simplified to `if (pending != 0)`. The logging messages are somewhat repetitive, and the `onComplete` method performs multiple logical actions (filtering, logging, timing out futures, invoking callback) with minimal separation, which slightly hinders action granularity. The `onExpiration` method has an empty body with just a comment, which is acceptable but adds minor noise. Overall, the intent is clear, the code is flat, and the reading flow is natural, but minor syntactic and structural cleanups would improve clarity.
Run 3
The code is well-structured with clear separation of concerns and logical organization. Import statements are minimal and relevant. Nesting is flat, with no deeply nested blocks. The class and method purposes are documented with clear Javadoc, and method names are descriptive (tryComplete, onComplete, onExpiration). The code length is appropriate, with concise methods that avoid unnecessary verbosity. Each line in the lambda expressions and stream operations performs a single action, maintaining good action granularity. The reading flow is natural - the tryComplete method checks completion status, then onComplete handles timeout/finalization logically. Minor improvements possible: the condition `!((pending == 0))` could be simplified to `pending != 0`, and the empty onExpiration method could be justified with a comment explaining the override is required by the abstract method pattern.
Run 1
Code Structure: Well-organized class with clearly separated initialization, completion checking, completion handling, and expiration handling. Nesting: Shallow, though the else after an early return is unnecessary. Clarity of intent: Descriptive names and method documentation explain the lifecycle; the negated, redundantly parenthesized condition !((pending == 0)) is less clear than pending > 0. Code length: Generally concise, with minor redundancy in the expiration comment and conditional structure. Action granularity: Mostly one action per line; the long completeExceptionally lambda combines exception construction and completion, making it harder to scan. Reading flow: Methods follow a natural lifecycle order, and logging supports comprehension. Long stream expressions and minimal separation around imports slightly reduce readability.
Run 2
Code Structure: Fields, constructor, and lifecycle methods are logically organized with focused responsibilities. Nesting: Shallow nesting keeps control flow easy to follow, although the else after an early return is unnecessary. Clarity of intent: Descriptive names, logging, and documentation explain completion and timeout behavior; the negated, redundantly parenthesized condition !((pending == 0)) is less clear than pending != 0. Code length: Generally concise, with minor redundancy in comments and conditional syntax. Action granularity: Statements largely perform one action each; stream pipelines are cohesive, though the long exceptional-completion lambda would benefit from line wrapping. Reading flow: The progression from initialization through completion checks, completion handling, and expiration is natural. Dense stream lines and tightly grouped imports slightly reduce scanability.
Run 3
Code Structure: Fields, constructor, and lifecycle methods are logically organized, with focused responsibilities. Nesting: Shallow, although the else after an early return is unnecessary. Clarity of intent: Descriptive names, documentation, and logging make completion and timeout behavior clear; the negated, over-parenthesized condition obscures a simple pending != 0 check. Code length: Generally concise, but repeated documentation in onExpiration adds redundancy. Action granularity: Statements mostly perform one action each; stream expressions compactly represent related operations, though the long exceptional-completion lambda is harder to scan. Reading flow: Natural progression from initialization to completion checks and callbacks, slightly weakened by tightly grouped imports and long lines.