Sample
int-4493be52e271-I06
Invert eligible conditions and exchange their branches
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.631 | 0–1; higher is more readable |
| Dorn | 0.407 | 0–1; higher is more readable |
| Mi | 0.051 | 0–1; higher is more readable |
| LLOC | 21 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 7.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 13.33 | 0–20; mean of three runs |
| BTTF | 0.486 | 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. | 2512.181 | −82.902 |
| Source linesThe number of non-empty source lines. | 61 | +24.4 |
| 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.646 | −6.969 |
Intercept 8.87 + feature contributions = -56.601 (log-odds).
Score = sigmoid(-56.601) = 0.
| Score | 0.631 |
|---|
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. | 117.952 | −1.331 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 56 | +1.2 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 62 | −1.159 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 117.871 | +1.097 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 56 | −0.864 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 60.874 | +0.441 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.079 | +0.17 |
Intercept 0.07 + feature contributions = -0.376 (log-odds).
Score = sigmoid(-0.376) = 0.407.
| Score | 0.051 |
|---|
| Score | 21 |
|---|
Run 1
The code has reasonable structure and mostly flat nesting, but readability is hurt by inverted conditionals with empty if blocks (e.g., `if (!(...)) {} else { ... }`), which obscure intent and disrupt natural reading flow. Method names are clear, and action granularity is mostly one action per line, but unnecessary return-null fallbacks and duplicated null checks add length and ambiguity. The reflective logic is inherently complex, but clearer conditionals and comments would improve clarity.
Run 2
This code is difficult to read due to inverted conditional logic with empty if blocks and code in else branches, which obscures intent. Lines like `if (!((PlatformDependent.javaVersion() >= 15))) {} else {` force readers to mentally invert conditions, hurting flow. Nesting is moderate but awkward. The method `findOpenMethod` is reasonably short, but lack of early returns adds noise. Action granularity is mostly clear, but the conditional constructs combine multiple actions logically into one confusing statement. Comments exist but are not sufficient to offset the structural problems. Overall, the style is verbose, non-idiomatic, and forces extra cognitive effort.
Run 3
The code has several readability issues. The inverted if-else conditions with empty if blocks (`if (!(...)) {} else { ... }`) are confusing and should be positive conditions with early returns. This pattern appears three times creating unnecessary nesting and obscuring intent. The first method `findOpenMethod` has a redundant PlatformDependent version check with empty block. Method overloading creates ambiguity between `newChannel` variants. The `newDomainSocketChannel` method uses reflection to create a UNIX socket via `valueOf` which is non-obvious. The unused SuppressWarnings annotation adds noise. The private constructor at the end is good practice but misplaced after methods. While methods are relatively short and each performs one action per line, the control flow is convoluted. Comments are helpful but the code structure itself is tangled. Overall, it reads like decompiled or poorly refactored code requiring significant mental effort to understand the logic flow.
Run 1
Code Structure: The utility class is logically organized into focused methods, with a private constructor and centralized reflective channel creation. Nesting: Nesting is moderate, but empty if branches followed by else blocks add unnecessary complexity. Clarity of intent: Method names, types, and documentation generally communicate purpose; negated conditions with redundant parentheses obscure straightforward null and version checks. Code length: The code is reasonably concise, although awkward conditionals and repeated null-return patterns add avoidable noise. Action granularity: Most lines perform one action, making individual operations easy to follow. Reading flow: Imports, helper methods, and exception handling follow familiar Java conventions, but inconsistent parameter indentation and unnatural conditional structure interrupt the flow. Positive checks or early returns would substantially improve readability.
Run 2
Code Structure: A small, cohesive utility class with logically separated methods, although overloaded methods require some cross-reading. Nesting: Generally shallow, but empty if branches followed by else blocks add unnecessary nesting. Clarity of intent: Descriptive names, logging, and documentation explain the purpose; negated conditions with redundant parentheses obscure straightforward checks. Code length: Mostly concise, though empty branches and a temporary return variable add avoidable verbosity. Action granularity: Statements generally perform one action per line; compact empty branches slightly weaken consistency. Reading flow: Methods follow a sensible progression from method discovery to channel creation, but inverted conditions, uneven parameter indentation, and the lack of spacing after the package declaration interrupt otherwise natural reading.
Run 3
Code Structure: Cohesive utility class with small, logically separated methods, though overloaded newChannel methods require some tracing. Nesting: Mostly shallow, but empty if branches followed by else blocks add unnecessary nesting. Clarity of intent: Descriptive names, types, logging, and documentation explain the purpose; redundant parentheses and negated conditions obscure otherwise simple checks. Code length: Generally concise, with avoidable conditional boilerplate and a temporary variable. Action granularity: Statements mostly perform one action per line, although inline empty branches reduce visual clarity. Reading flow: Method organization is reasonable, but inverted conditions, empty blocks, and inconsistent parameter indentation interrupt natural reading.