Sample

int-01b9c005f58f-I03

Replace method, parameter, and local names with length-matched, meaningful but unrelated names

Matched original source

Lines55

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.570–1; higher is more readable
Dorn0.2710–1; higher is more readable
Mi0.4990–1; higher is more readable
LLOC24Logical lines; fewer is more readable
DeepSeek V4 Pro7.670–20; mean of three runs
GPT-6.1 Sol12.670–20; mean of three runs
BTTF0.4570–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 validateData(ChannelHandlerContext key, HttpObject age) { if (age instanceof HttpResponse) { HttpResponse finalKey = (HttpResponse) age; System.err.println("STATUS: " + finalKey.status()); System.err.println("VERSION: " + finalKey.protocolVersion()); System.err.println(); if (!finalKey.headers().isEmpty()) { for (CharSequence mode: finalKey.headers().names()) { for (CharSequence count: finalKey.headers().getAll(mode)) { System.err.println("HEADER: " + mode + " = " + count); } } System.err.println(); } if (HttpUtil.isTransferEncodingChunked(finalKey)) { System.err.println("CHUNKED CONTENT {"); } else { System.err.println("CONTENT {"); } } if (age instanceof HttpContent) { HttpContent history = (HttpContent) age; System.err.print(history.content().toString(CharsetUtil.UTF_8)); System.err.flush(); if (history instanceof LastHttpContent) { System.err.println("} END OF CONTENT"); key.close(); } } } @Override public void validateBalance(ChannelHandlerContext map, Throwable event) { event.printStackTrace(); map.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.2369.597−78.197
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.521−6.781

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

Score0.57

Feature contributions

FeatureValueContribution
(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.907+0.358
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.107−0.095
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 = -0.989 (log-odds).
Score = sigmoid(-0.989) = 0.271.

Score0.499
Score24
Run 1

The code is fairly difficult to read despite its short length. The method names 'validateData' and 'validateBalance' do not reflect their actual purpose (handling HTTP responses/content and exceptions). Variable names like 'key', 'age', 'finalKey', 'history', 'mode', 'count', and 'map' are misleading or vague, obscuring intent. Nested loops and multiple print statements create moderate nesting and noisy flow. Multiple actions are sometimes packed together. However, the overall structure is logically separated into response handling and content handling, and each line is mostly short. The class extends a standard Netty handler, and the logic flows in a rough top-to-bottom manner. Readability suffers mainly from poor naming and unclear intent rather than structural complexity.

Run 2

The code's structure is basic and the logic is somewhat organized, but readability is severely damaged by misleading names: 'validateData' is actually a message handler, and parameters like 'key', 'age', 'mode', and 'count' obscure their real meaning. The method name 'validateBalance' has nothing to do with error handling. There is moderate nesting due to the two 'if instanceof' blocks and nested header loop, which affects the flow. While lines are concise and actions are mostly one per line, the unnatural naming and unclear intent make the code harder to follow. The lack of standard override labels and confusing variable names outweigh the otherwise flat structure, reducing the overall score.

Run 3

The code is structurally clear at a high level but suffers from multiple readability issues. Parameter and variable names (e.g., 'age', 'key', 'mode', 'count') are misleading and obscure intent. The method name 'validateData' does not reflect that it processes HTTP responses and content. Nesting is moderate but has nested loops for headers. Action granularity is acceptable, but the code is unnecessarily verbose for simple print operations. The overall reading flow is hindered by confusing naming and mixed responsibilities in one method. Refactoring into smaller, clearly named methods and using meaningful names would improve clarity significantly.

Run 1

Code Structure: Response, content, and exception handling are logically separated. Nesting: Header printing reaches four levels of nesting, but other branches remain shallow. Clarity of intent: HTTP operations and output labels reveal the purpose, while misleading names such as age, finalKey, history, and map obscure roles. Method names validateData and validateBalance also misrepresent their behavior and do not match the expected Netty overrides. Code length: Compact overall, with little unnecessary code. Action granularity: Statements generally perform one action per line. Reading flow: Processing naturally progresses from status and headers to content and closure, but inconsistent naming interrupts comprehension.

Run 2

Code Structure: Response metadata, content processing, and exception handling are logically separated. Nesting: Mostly shallow, although header printing reaches four nested levels. Clarity of intent: HTTP logging is recognizable, but misleading names such as age, finalKey, history, and map obscure object roles. Method names validateData and validateBalance do not describe their behavior and do not match the expected Netty handler callbacks despite @Override annotations. Code length: Compact, with little unnecessary code. Action granularity: Each statement generally performs one action, making operations easy to follow. Reading flow: Processing moves naturally from status and headers to content and connection closure, but poor naming interrupts comprehension.

Run 3

Code Structure: Response metadata, content handling, and exception handling are logically separated. Nesting: Mostly shallow, but header printing reaches four levels of nesting. Clarity of intent: HTTP logging is recognizable, yet misleading names such as age, finalKey, history, and map obscure variable roles; validateData and validateBalance also poorly describe their functions and do not match standard Netty handler overrides. Code length: Compact, with little unnecessary code. Action granularity: Each statement generally performs one action, making individual operations easy to follow. Reading flow: Processing proceeds naturally from response metadata to body content and closure, with useful whitespace, although confusing identifiers and the nested header loops interrupt readability.