Sample

int-6537e33aa153-I10

Remove about 40% of line-break groups while retaining structure

Matched original source

Lines35

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.2660–1; higher is more readable
Dorn0.0060–1; higher is more readable
Mi0.0160–1; higher is more readable
LLOC24Logical lines; fewer is more readable
DeepSeek V4 Pro4.670–20; mean of three runs
GPT-6.1 Sol100–20; mean of three runs
BTTF0.2960–1; higher is more readable

Views

Source code

package io.netty.example.http.snoop; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.SimpleChannelInboundHandler; import io.netty.handler.codec.http.HttpContent; import io.netty.handler.codec.http.HttpUtil; import io.netty.handler.codec.http.HttpObject; import io.netty.handler.codec.http.HttpResponse; import io.netty.handler.codec.http.LastHttpContent; import io.netty.util.CharsetUtil; public class HttpSnoopClientHandler extends SimpleChannelInboundHandler<HttpObject> { @Override public void channelRead0(ChannelHandlerContext ctx, HttpObject msg) { if (msg instanceof HttpResponse) { HttpResponse response = (HttpResponse) msg; System.err.println("STATUS: " + response.status()); System.err.println("VERSION: " + response.protocolVersion()); System.err.println(); if (!response.headers().isEmpty()) { for (CharSequence name: response.headers().names()) { for (CharSequence value: response.headers().getAll(name)) { System.err.println("HEADER: " + name + " = " + value); } } System.err.println(); } if (HttpUtil.isTransferEncodingChunked(response)) { System.err.println("CHUNKED CONTENT {"); } else { System.err.println("CONTENT {"); } } if (msg instanceof HttpContent) { HttpContent content = (HttpContent) msg; System.err.print(content.content().toString(CharsetUtil.UTF_8)); System.err.flush(); if (content instanceof LastHttpContent) { System.err.println("} END OF CONTENT"); ctx.close(); } } } @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { cause.printStackTrace(); ctx.close(); } }

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(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.2355.469−77.73
Source linesThe number of non-empty source lines.35+14
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.709−7.064

Intercept 8.87 + feature contributions = -61.925 (log-odds).
Score = sigmoid(-61.925) = 0.

Score0.266

Feature contributions

FeatureValueContribution
(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.184−4.128
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
Indentation frequencyHow rapidly indentation changes from line to line.35+0.473
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.35−0.382
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.35−0.203
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.118−0.2
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.34.914+0.078

Intercept 0.07 + feature contributions = -5.097 (log-odds).
Score = sigmoid(-5.097) = 0.006.

Score0.016
Score24
Run 1

The code is extremely difficult to read. Structure is tangled with multiple statements and blocks crammed onto single lines. Nesting is excessive - three levels deep in the header iteration logic, made worse by the formatting. Intent is obscured by the chaotic layout despite the relatively simple purpose of logging HTTP responses. Code length is unnecessarily long due to verbosity in type casting and explicit null-like checks. Action granularity is violated frequently - multiple actions per line make parsing mentally taxing. Reading flow is completely disrupted by inconsistent indentation, missing line breaks, and compressed code blocks. While the underlying logic is straightforward, the formatting destroys readability. Proper formatting and breaking statements onto separate lines would dramatically improve comprehension.

Run 2

The code has major readability problems across multiple criteria. Structure is tangled with multiple statements crammed onto single lines, making it hard to distinguish logical blocks. Several imports are combined on one line, violating typical Java conventions. Nesting depth is moderate (3-4 levels) but becomes confusing due to poor formatting and brace placement. Intent is somewhat clear (HTTP snoop client handler) but gets lost in the formatting chaos. Code length is concise in terms of functionality but the compression reduces clarity rather than improving it. Action granularity is poor - multiple actions per line make debugging and reading difficult (e.g., 'System.err.println(); if...' on same line). Reading flow is severely disrupted by inconsistent spacing and line breaks. While the logic itself is straightforward, the formatting makes it unnecessarily hard to read and maintain.

Run 3

The code has severe readability issues. The import block is compressed onto one line, making it difficult to scan dependencies. Multiple statements are crammed together without line breaks, violating the 'one action per line' principle. The nested if statements and for loops lack indentation and spacing, creating visual clutter. The logic for handling HTTP responses and content is tangled and hard to follow. While the class structure follows a basic pattern, the lack of white space, proper formatting, and clear separation of concerns makes this code extremely difficult to read and maintain. The intent is discernible but requires significant effort to parse.

Run 1

Code Structure: Response handling, content handling, and exception handling are logically separated, but compressed formatting obscures their boundaries. Nesting: The header-processing block has moderately deep nesting, made harder to follow by inline loops and closing braces. Clarity of intent: Descriptive class, method, and variable names plus explicit output labels make the HTTP logging purpose clear. Code length: The implementation is concise and avoids unnecessary abstractions, though excessive line compression reduces readability. Action granularity: Multiple imports, print calls, conditionals, and cleanup actions share lines, violating one-action-per-line conventions. Reading flow: Processing follows a natural response-to-content sequence, but inconsistent indentation, crowded annotations, and misplaced braces repeatedly interrupt scanning.

Run 2

Code Structure: The handler has logically separated response, content, and exception handling, but compressed formatting obscures those boundaries. Nesting: Depth is moderate, with nested header loops inside conditionals; crowded braces make it harder to follow. Clarity of intent: Descriptive names, familiar Netty types, and explicit output labels clearly convey the purpose of logging HTTP responses. Code length: The implementation is appropriately short with little unnecessary code, though compression sacrifices readability rather than reducing complexity. Action granularity: Several lines combine imports, print statements, conditionals, loops, or closing braces, violating one-action-per-line conventions. Reading flow: Processing follows a natural response-to-content sequence, but inconsistent indentation and inline method boundaries interrupt scanning.

Run 3

Code Structure: The class and two handler methods provide logical organization, but compressed imports, statements, and braces obscure boundaries. Nesting: Depth is moderate, with nested header loops inside a response check; inline formatting makes it harder to follow. Clarity of intent: Descriptive names, familiar HTTP types, and explicit output labels clearly convey response logging and connection closure. Code length: The implementation is appropriately short with little unnecessary code, though excessive compression sacrifices readability. Action granularity: Multiple imports, print calls, conditionals, and closing braces share lines, undermining one-action-per-line readability. Reading flow: Processing response metadata before content is natural, but inconsistent indentation and crowded method transitions interrupt scanning.