Sample
int-b1f024ec6fcf-I06
Invert eligible conditions and exchange their branches
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.543 | 0–1; higher is more readable |
| Dorn | 0.26 | 0–1; higher is more readable |
| Mi | 0.437 | 0–1; higher is more readable |
| LLOC | 24 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 6 | 0–20; mean of three runs |
| GPT-6.1 Sol | 14 | 0–20; mean of three runs |
| BTTF | 0.525 | 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. | 2455.436 | −81.029 |
| Source linesThe number of non-empty source lines. | 55 | +22 |
| 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.503 | −6.754 |
Intercept 8.87 + feature contributions = -56.913 (log-odds).
Score = sigmoid(-56.913) = 0.
| Score | 0.543 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 55 | +1.165 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 55 | −0.911 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 55 | −0.841 |
| 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. | 54.895 | +0.357 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.112 | −0.151 |
| 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. | 84.911 | +0.069 |
Intercept 0.07 + feature contributions = -1.046 (log-odds).
Score = sigmoid(-1.046) = 0.26.
| Score | 0.437 |
|---|
| Score | 24 |
|---|
Run 1
The code has poor readability due to inverted conditionals with empty blocks (`if (!(x instanceof Y)) {} else { ... }`), which obscures intent and creates unnatural reading flow. It also performs multiple actions per line in several places and has unnecessary nesting inside pre-existing conditional blocks. The structure is somewhat logical but undermined by these patterns. Variable names are clear, and the overall length is acceptable, but the bizarre conditional structure, mixed granularity, and awkward flow significantly reduce clarity. A simpler `if (msg instanceof HttpResponse)` would drastically improve readability and reduce nesting.
Run 2
The code has a clear high-level purpose but suffers from several readability issues. The structure is awkward due to empty if-blocks with inverted logic (`if (!condition) {} else { ... }`), which obscures intent and adds unnecessary nesting. The method contains multiple responsibilities (status printing, header iteration, content handling) without clear separation, and the reading flow is unnatural. Nested loops for headers add depth, though not excessively. Action granularity is generally one operation per line, which is good. Variable naming is clear, and imports are organized. However, the excessive use of System.err throughout, repetitive blank lines, and lack of helper methods reduce clarity. The inverted conditionals are the biggest drawback - they force readers to parse double negatives rather than straightforward positive checks. Overall, the code is functional but requires mental translation to understand its flow.
Run 3
The code has several readability issues. The most severe problem is the use of empty if blocks with else clauses (if (!condition) {} else {...}), which inverts logic and forces readers to mentally reverse conditions. This pattern is both confusing and unnecessarily verbose. The method channelRead0 is overly long and performs multiple logical operations: handling HTTP responses, headers, content types, and content chunks. Nesting is moderate but the inverted conditionals make the flow unnatural. While naming is generally clear and line-level actions are reasonably granular, the structure lacks a clean separation of concerns - printing headers, status, and content are all interleaved. The overall design could be significantly improved by using early returns, positive conditionals, and extracting helper methods for distinct parts of the HTTP message processing.
Run 1
Code Structure: Response metadata, content processing, and exception handling are logically separated, although the main method could use clearer conditional forms. Nesting: Moderate nesting, with header iteration reaching four levels inside the response branch. Clarity of intent: Descriptive types, variables, and output labels make the HTTP logging purpose clear, but negated instanceof checks with empty branches obscure otherwise straightforward logic. Code length: Mostly concise, though redundant parentheses and empty branches add unnecessary syntax. Action granularity: Statements generally perform one action per line; empty if branches and else openings compressed onto one line reduce readability. Reading flow: Metadata precedes body output and completion handling naturally, while the inverted conditions interrupt the flow. Conventional positive instanceof checks would substantially improve readability.
Run 2
Code Structure: Response handling, content handling, and exception handling are logically separated within standard Netty callbacks. Nesting: Header processing reaches several levels of nesting, while empty negated if branches unnecessarily place the main logic inside else blocks. Clarity of intent: Descriptive class and variable names and explicit output labels make the HTTP logging purpose clear, but double parentheses and inverted type checks obscure otherwise simple conditions. Code length: Reasonably concise, with some repetitive printing and avoidable conditional syntax. Action granularity: Each statement generally performs one action, although the empty if/else constructs compress control-flow elements onto one line. Reading flow: Processing naturally progresses from response metadata to content and completion, followed by exception handling; unconventional conditionals interrupt that flow.
Run 3
Code Structure: Response metadata, content handling, and exception handling are logically separated. Nesting: Header printing uses nested loops within conditionals, creating moderate depth. Clarity of intent: Descriptive names and output labels make the HTTP logging purpose clear, but negated instanceof checks with empty branches and redundant parentheses obscure straightforward conditions. Code length: Mostly concise, though empty branches add unnecessary syntax. Action granularity: Most lines perform one action; the compact empty-if/else statements reduce visual clarity. Reading flow: Metadata precedes content, followed by cleanup, which is natural. However, unconventional conditional formatting interrupts scanning and makes the main method harder to follow.