Sample
int-c39f8c139e10-I11
Split eligible integer literals into pairs of short-named intermediate variables
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.649 | 0–1; higher is more readable |
| Dorn | 0.226 | 0–1; higher is more readable |
| Mi | 0.171 | 0–1; higher is more readable |
| LLOC | 24 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 16 | 0–20; mean of three runs |
| GPT-6.1 Sol | 16.33 | 0–20; mean of three runs |
| BTTF | 0.465 | 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. | 2240.604 | −73.94 |
| Source linesThe number of non-empty source lines. | 65 | +26 |
| 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.675 | −7.013 |
Intercept 8.87 + feature contributions = -46.083 (log-odds).
Score = sigmoid(-46.083) = 0.
| Score | 0.649 |
|---|
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. | 149.955 | −2.686 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 150 | +1.616 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 64 | −1.23 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 53 | +1.096 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 53 | −0.795 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 64.762 | +0.495 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.076 | +0.2 |
Intercept 0.07 + feature contributions = -1.234 (log-odds).
Score = sigmoid(-1.234) = 0.226.
| Score | 0.171 |
|---|
| Score | 24 |
|---|
Run 1
The code demonstrates clear intent through good method and class naming, and overall structure is logical with a standard class layout. However, readability suffers from a few issues. The tryComplete method includes an unnecessary and confusing construct: declaring 'final int a = 1; final int b = -1;' and then checking 'pending == (a + b)' to mean 'pending == 0'. This is unnecessarily indirect and should simply use 'pending == 0'. Additionally, the 'onExpiration' method contains only a comment, which is redundant and adds clutter. The code is concise and generally avoids deep nesting, but the unclear arithmetic in tryComplete and redundant comments prevent a higher score. Overall, the code is readable but could be improved with more direct logic and removal of unnecessary elements.
Run 2
The code is well-structured and readable. It has a clear class purpose, minimal nesting, and a logical flow. However, the `tryComplete()` method introduces unnecessary confusion: `final int a = 1; final int b = -1; if (pending == (a + b))` is an indirect way of checking `pending == 0`. This obscures intent. Otherwise, the code is concise, with appropriate logging and clear method responsibilities. The use of streams for counting pending futures is clean. The `onComplete()` method clearly handles timeouts and invokes the callback. The empty `onExpiration()` method is well-documented. Overall, the code is easy to follow, with only the odd integer arithmetic detracting from clarity.
Run 3
The code demonstrates good structure with clear class purpose, logical method organization, and meaningful Javadoc. Nesting is minimal, and each method performs focused actions. The use of Java streams and method references improves readability. However, there are a few issues: the variables 'a' and 'b' in tryComplete() are poorly named and add unnecessary complexity to what should be a simple comparison (pending == 0). The logging levels could be more precise (e.g., using debug vs trace appropriately). The class lacks proper documentation for constructor parameters. Overall, the code is readable but could be improved with better variable naming and simplification of condition checks.
Run 1
Code Structure: Fields, constructor, and lifecycle methods are logically organized with helpful documentation. Nesting: Shallow conditionals and simple stream pipelines make control flow easy to follow. Clarity of intent: Descriptive names and logging explain completion and timeout behavior, but arbitrary constants a and b obscure the straightforward pending == 0 check. Code length: Mostly concise, though these constants, the unnecessary else after a return, and repeated expiration commentary add clutter. Action granularity: Statements generally perform one action each; the long exceptional-completion lambda combines exception construction and future completion, slightly reducing scanability. Reading flow: The progression from initialization to completion checks and callbacks is natural, but long lines and tightly packed imports weaken visual readability.
Run 2
Code Structure: Fields, constructor, and lifecycle methods are logically organized, with clear separation of responsibilities. Nesting: Minimal nesting; only a straightforward if/else branch. Clarity of intent: Descriptive names, documentation, and logging explain completion and timeout behavior, but arbitrary constants a and b obscure the simple pending == 0 condition. Code length: Mostly concise, though these constants, the unnecessary else after a return, and duplicated expiration commentary add clutter. Action granularity: Statements generally perform one action each; the long stream and exceptional-completion expressions combine several operations and require more parsing. Reading flow: The lifecycle progression is natural and easy to follow, although long lines and tightly grouped imports slightly reduce scanability.
Run 3
Code Structure: Fields, constructor, and lifecycle methods are logically organized, with helpful documentation. Nesting: Minimal nesting; only a simple if/else makes control flow easy to follow. Clarity of intent: Descriptive names and logging explain completion and timeout behavior, but the arbitrary constants a and b obscure a straightforward pending == 0 check. Code length: Generally concise, though those constants and the duplicated expiration explanation add unnecessary text. Action granularity: Most lines perform one clear action; the long exceptional-completion lambda combines iteration, exception construction, and completion in a visually dense statement. Reading flow: Methods follow a natural lifecycle sequence, but tightly packed imports and long stream/lambda lines slightly reduce scanability.