Sample
int-ad3eb6bc6e6f-I06
Invert eligible conditions and exchange their branches
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.394 | 0–1; higher is more readable |
| Dorn | 0.057 | 0–1; higher is more readable |
| Mi | 0.331 | 0–1; higher is more readable |
| LLOC | 26 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 11.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 13 | 0–20; mean of three runs |
| BTTF | 0.386 | 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. | 3743.723 | −123.543 |
| Source linesThe number of non-empty source lines. | 69 | +27.6 |
| 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.696 | −7.044 |
Intercept 8.87 + feature contributions = -94.117 (log-odds).
Score = sigmoid(-94.117) = 0.
| Score | 0.394 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 69 | +1.65 |
| 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. | 123.971 | −1.586 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 70 | −1.442 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 69 | −1.163 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 68.904 | +0.553 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.106 | −0.084 |
Intercept 0.07 + feature contributions = -2.806 (log-odds).
Score = sigmoid(-2.806) = 0.057.
| Score | 0.331 |
|---|
| Score | 26 |
|---|
Run 1
The code is logically organized as a test class, but several patterns harm readability. The `register()` call before `connect()` is an unusual and potentially confusing approach for Netty client setup, obscuring intent. The `finally` block uses inverted empty-if patterns (`if (!condition) {} else { action; }`) which are unnecessarily convoluted and should be simple null checks. Similarly, `newFactories()` contains an inverted empty-if that makes the filter logic harder to follow. Naming is mostly clear (`sc`/`cc` are short but conventional here), and the test method structure is straightforward. The code length is appropriate for the task, but action granularity suffers from the awkward conditional structures. Reading flow is disrupted by those inverted conditionals and the repeated `syncUninterruptibly()` calls. Overall, functional but with avoidable readability obstacles.
Run 2
The code is reasonably structured with clear separation of test setup and execution. However, it has a notable readability problem: the cleanup code uses a bizarre conditional pattern (e.g., `if (!((cc != null))) {} else { cc.close(); }`) which is confusing and violates clarity of intent. This pattern also appears in `newFactories()`. The `if`/`else` construct with a no-op `if` branch is worse than a simple null check with early return. Nesting is moderate — the anonymous inner `Runner` class adds a layer but is acceptable. Action granularity is generally good, with one meaningful operation per line. Most lines are concise but some exceed 100 characters (`List` declaration, `if` condition for instance check). The `instanceof` check in `newFactories()` mishandles null and uses a non-idiomatic pattern. Overall the code is functional but the unusual conditional style and excessive line length hinder readability.
Run 3
The code has several readability issues. The structure is moderately organized, but nesting and convoluted conditional expressions harm clarity. For example, the odd `if (!((cc != null))) {} else { cc.close(); }` pattern is a confusing way to write `if (cc != null) cc.close();`. This doubles the length and obscures intent. The same pattern appears in `newFactories()` with `if (!((group instanceof IoEventLoopGroup && ...))) {} else { ... }`, which is hard to parse. These constructs reduce the overall readability score. The test method itself is reasonably straightforward, but the `finally` block and the factory method are unnecessarily verbose and hard to follow. The use of multiple actions per line (e.g., `sb.bind(...).syncUninterruptibly().channel()`) is common in Netty tests but slightly reduces line-level clarity. There is moderate nesting in the anonymous Runner class and factory loop, though not extreme. Overall, the code is functional but would benefit from simpler conditional logic and clearer null checks.
Run 1
Code Structure: Methods logically separate test invocation, connection testing, and factory selection. Nesting: Mostly shallow, although the anonymous runner and try/finally add layers. Clarity of intent: The repeated-connect assertion is clear, but abbreviated names (sb, cb, sc, cc) and negated conditions with empty if branches obscure straightforward cleanup and filtering. Code length: Reasonably compact, though verbose generic declarations and redundant parentheses add unnecessary text. Action granularity: Statements generally perform one action per line; fluent call chains remain understandable. Reading flow: Setup, execution, assertion, and cleanup follow a natural sequence, but the unusual empty-if/else pattern repeatedly interrupts comprehension.
Run 2
Code Structure: Test execution, connection verification, and factory selection are logically separated into methods. Nesting: Mostly shallow, but the anonymous runner and inverted conditions with empty branches add unnecessary complexity. Clarity of intent: The test name and AlreadyConnectedException assertion clearly communicate the purpose; abbreviated variables and negated, over-parenthesized conditions obscure details. Code length: Reasonably compact, though verbose generic declarations and empty if branches introduce avoidable clutter. Action granularity: Most statements perform one coherent action; fluent call chains remain understandable. Reading flow: Setup, connection attempts, assertion, and cleanup follow a natural sequence, but unconventional cleanup and filtering conditions interrupt scanning. Direct positive conditions, descriptive variable names, and simpler generic syntax would improve readability.
Run 3
Code Structure: Test execution, connection checks, and factory filtering are logically separated into methods. Nesting: Mostly shallow, although the anonymous runner and awkward conditional branches add complexity. Clarity of intent: The test name and AlreadyConnectedException assertion clearly communicate the purpose, but abbreviated variables and double-negated conditions with empty branches obscure cleanup and filtering. Code length: Reasonably compact, though verbose generic declarations and unnecessary conditional syntax inflate it. Action granularity: Statements generally perform one logical action per line; fluent chains remain understandable. Reading flow: Setup, connection attempts, assertion, and cleanup follow a natural sequence, but the inverted if/else patterns interrupt reading and require mental simplification.