Sample
int-2a182ca24c95-I06
Invert eligible conditions and exchange their branches
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.885 | 0–1; higher is more readable |
| Dorn | 0.339 | 0–1; higher is more readable |
| Mi | 0.726 | 0–1; higher is more readable |
| LLOC | 28 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 12.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 13.67 | 0–20; mean of three runs |
| BTTF | 0.519 | 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. | 2299.558 | −75.885 |
| Source linesThe number of non-empty source lines. | 112 | +44.8 |
| 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.458 | −6.687 |
Intercept 8.87 + feature contributions = -28.903 (log-odds).
Score = sigmoid(-28.903) = 0.
| Score | 0.885 |
|---|
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. | 166.982 | −3.408 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 113 | −2.965 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 166.982 | +1.89 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 71 | +1.719 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 111.851 | +1.154 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.048 | +0.475 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
Intercept 0.07 + feature contributions = -0.667 (log-odds).
Score = sigmoid(-0.667) = 0.339.
| Score | 0.726 |
|---|
| Score | 28 |
|---|
Run 1
The code is well-structured with clear interfaces, helpful Javadoc, and reasonable method decomposition. Intent is generally clear, and most operations are concise. However, readability is reduced by awkward inverted conditionals in `waitObject` and `waitForFuture` (e.g., `if (!((condition.get()))) {} else { return; }`), which disrupt the natural reading flow and add unnecessary nesting. The empty blocks with `else` create visual noise and make the logic harder to follow than a simple negated condition with an early return or throw. The `waitForFuture` method also uses a loop with a captured `TimeoutException` pattern that, while functional, is less straightforward than it could be. These issues lower the score despite the overall strong documentation and organization. Improvements would include rewriting conditions in a direct style and flattening control flow.
Run 2
The code has a clear purpose and good Javadoc comments, but readability suffers due to several factors. The `waitObject` method is convoluted: it uses a `while (true)` loop with awkward empty-if blocks (`if (!((condition.get()))) {} else { return; }`) instead of straightforward boolean expressions, making intent ambiguous. Similarly, `waitForFuture` uses inverted conditionals with empty blocks and a time-out exception variable, which obscures logical flow. Nesting levels are moderate but some methods could be simplified. Action granularity is reasonable, with generally one action per line, but the unusual conditional style creates extra noise. The code length is concise but at the expense of clarity. Reading flow is disrupted by the unnatural `if (!(...)) {} else { ... }` patterns, which should be rewritten as `if (condition) { return; }` and `if (deadlineNs <= nowNs) { throw ...; }` to improve comprehension. Packing and interface design are otherwise clean, with good separation of concerns.
Run 3
The code has good structure and documentation, with clear intent in method signatures and Javadoc. However, readability is significantly harmed by the awkward conditional style in waitObject() and waitForFuture(), using `if (!(condition)) {} else { ... }` instead of idiomatic `if (!condition) { ... }`. This pattern obscures the logic and breaks natural reading flow. The waitObject() method uses a `while (true)` loop with conditions embedded in empty if-blocks, making the control flow harder to follow. Nesting is generally flat, which is positive, and action granularity is mostly one action per line. Variable naming is clear, and method purposes are well-documented. The interface is concise overall, but the unnatural conditional formatting and non-idiomatic boolean checks reduce readability to below average.
Run 1
Code Structure: The interface is logically organized into clock, sleep, timer, and waiting operations, with helpful documentation. Nesting: Most methods are flat, but waiting methods introduce moderate nesting through synchronization, loops, conditionals, and exception handling. Clarity of intent: Descriptive names and Javadocs explain purpose well; however, negated conditions with empty branches obscure straightforward return and timeout checks. Code length: Generally concise, though redundant parentheses and empty branches add unnecessary syntax. Action granularity: Most statements perform one action per line, but inline conditional blocks compress control flow and actions together. Reading flow: Method ordering and spacing are mostly natural, but the inverted if/else patterns interrupt comprehension and require mental simplification.
Run 2
Code Structure: The interface is logically organized into clock access, waiting, and timer methods, with useful documentation. Nesting: Most methods are flat, but waitObject combines synchronization, a loop, and conditional branches; waitForFuture adds a try/catch inside a loop. Clarity of intent: Descriptive method names and explicit time units clarify purpose, but negated conditions with empty branches and redundant parentheses obscure straightforward checks. Code length: Generally concise, although verbose documentation and unnecessarily elaborate conditionals increase reading effort. Action granularity: Most lines express one action, but inline empty branches, returns, and throws compress control flow awkwardly. Reading flow: Method ordering and documentation support natural navigation, while unconventional conditional formatting and the long timeout-throw line interrupt comprehension.
Run 3
Code Structure: The interface logically groups clock operations and related waiting utilities into focused methods. Nesting: Most methods are flat, but synchronized loops, conditionals, and try/catch blocks add moderate nesting. Clarity of intent: Descriptive names and useful documentation explain time units and behavior; however, negated conditions with empty branches obscure straightforward return and timeout checks. Code length: Generally concise, although redundant parentheses and empty branches add unnecessary syntax. Action granularity: Most lines perform one action, but inline if/else statements combine conditions and control-flow actions, reducing scanability. Reading flow: Method organization and documentation provide a natural progression, interrupted by awkward conditional formatting and long exception statements. Replacing empty-branch conditionals with direct positive checks would substantially improve readability.