Sample

int-c89b80b26a42-I09

Select one of ten low-readability unrelated code templates per class

Matched original source

Lines57

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.3960–1; higher is more readable
Dorn0.0270–1; higher is more readable
Mi0.4940–1; higher is more readable
LLOC29Logical lines; fewer is more readable
DeepSeek V4 Pro9.670–20; mean of three runs
GPT-6.1 Sol12.330–20; mean of three runs
BTTF0.0610–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) { {int lI0O_01a958b3=0,lI0O_add133d8=0;while(lI0O_add133d8<2){lI0O_01a958b3^=(lI0O_add133d8<<1)^0x2;lI0O_add133d8++;}lI0O_01a958b3^=lI0O_01a958b3;} 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.2674.205−88.249
Source linesThe number of non-empty source lines.57+22.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.715−7.072

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

Score0.396

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.145−2.476
Indentation frequencyHow rapidly indentation changes from line to line.57+1.234
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.57−0.982
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.57−0.887
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.56.897+0.385
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.11−0.125

Intercept 0.07 + feature contributions = -3.585 (log-odds).
Score = sigmoid(-3.585) = 0.027.

Score0.494
Score29
Run 1

The handler has a logical two-branch structure (HttpResponse vs HttpContent) with no deep nesting, and helper methods like HttpUtil.isTransferEncodingChunked clarify intent. However, it mixes response parsing and content printing in one method, leading to multiple responsibilities per line and fragmented reading flow. The abrupt closure of a brace in exceptionCaught via an injected obfuscated while loop is completely unreadable and appears to be malicious or accidental placeholder code. Header iteration uses nested loops that add noise. The code is not overly long, but lacks separation of concerns (e.g., header printing, content buffering). Action granularity is mostly one per line, but the obfuscation severely damages overall clarity and trustworthiness. Score reflects solid core structure undermined by critical readability failure.

Run 2

The code is generally structured with clear intent, but readability is severely compromised by an obfuscated block of dead code in the exceptionCaught method. This random loop with meaningless variable names serves no purpose and breaks the reading flow. The main handler method is mostly readable with reasonable nesting and action granularity, but the dead code represents a critical flaw in code quality and maintainability.

Run 3

The code is generally well-structured with clear intent, flat nesting, and concise implementation. However, it contains a suspicious obfuscated line in the exceptionCaught method that significantly harms readability and would fail code review. The handler method channelRead0 flows logically, handling HTTP response metadata and content separately with appropriate instanceof checks. Nesting depth is minimal (max 2-3 levels). Action granularity is mostly one operation per line. The variable naming (msg, ctx, content) is conventional but could be more descriptive. The main issue is the injected dead code block with meaningless variable names (lI0O_01a958b3, lI0O_add133d8) and a while loop doing nothing useful, which suggests either malicious code or a copy-paste error, making the overall code untrustworthy and confusing.

Run 1

Code Structure: Response and content handling are logically grouped, but exceptionCaught contains an unrelated obfuscated block. Nesting: Most nesting is manageable, although header output uses nested loops inside two conditionals. Clarity of intent: Descriptive names and output messages make HTTP processing clear; cryptic variables and pointless bitwise operations obscure exception handling. Code length: The main logic is reasonably concise, but the injected computation adds unnecessary code. Action granularity: Most statements occupy separate lines; the obfuscated block compresses declarations, looping, increments, and assignments onto one line. Reading flow: HTTP handling proceeds naturally from metadata to content and closure, but the abrupt, densely formatted block disrupts the otherwise consistent flow.

Run 2

Code Structure: Response, content, and exception handling are logically separated, but an unrelated computation disrupts the exception handler. Nesting: Mostly manageable, though header printing uses nested loops within conditionals. Clarity of intent: Descriptive names and output labels make HTTP processing clear; the obfuscated variables and meaningless computation obscure exception handling. Code length: The main logic is reasonably concise, but the extraneous computation adds unnecessary code. Action granularity: Most statements perform one action per line; the injected block compresses declarations, a loop, and multiple operations onto one line. Reading flow: HTTP processing follows a natural sequence with consistent formatting, but the unindented, dense block abruptly breaks that flow.

Run 3

Code Structure: HTTP response and content handling are logically separated, but exceptionCaught contains an unrelated, obfuscated block. Nesting: Mostly manageable, though header printing uses three nested levels and the injected block adds a loop. Clarity of intent: Descriptive class names, types, and output labels clarify normal processing; cryptic variables and pointless bitwise operations obscure exception handling. Code length: The handler is reasonably concise, except for unnecessary arithmetic code. Action granularity: Most statements occupy separate lines, but the injected block compresses declarations, iteration, and assignments into one line. Reading flow: Normal event handling reads naturally from metadata to content and closure, while the unindented block abruptly disrupts formatting and comprehension.