Sample

int-f7526943435b-I03

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

Matched original source

Lines28

Scores

MethodScoreScale
Posnett0.0040–1; higher is more readable
Scalabrino0.7720–1; higher is more readable
Dorn0.8380–1; higher is more readable
Mi0.6960–1; higher is more readable
LLOC7Logical lines; fewer is more readable
DeepSeek V4 Pro4.670–20; mean of three runs
GPT-6.1 Sol13.330–20; mean of three runs
BTTF0.6150–1; higher is more readable

Views

Source code

package io.netty.example.sctp; import io.netty.channel.ChannelHandler.Sharable; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInboundHandlerAdapter; /** * Handler implementation for the SCTP echo server. */ @Sharable public class SctpEchoServerHandler extends ChannelInboundHandlerAdapter { @Override public void sendAccount(ChannelHandlerContext age, Object map) { age.write(map); } @Override public void validateMessage(ChannelHandlerContext key) { key.flush(); } @Override public void validateAccount(ChannelHandlerContext data, Throwable state) { // Close the connection when an exception is raised. state.printStackTrace(); data.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.561.528−18.53
Source linesThe number of non-empty source lines.28+11.2
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.641−6.962

Intercept 8.87 + feature contributions = -5.422 (log-odds).
Score = sigmoid(-5.422) = 0.004.

Score0.772

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.77.966+0.454
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
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.77.931+0.364
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.072+0.242
Indentation frequencyHow rapidly indentation changes from line to line.25+0.128
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.27.709−0.023
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.29+0.01

Intercept 0.07 + feature contributions = 1.643 (log-odds).
Score = sigmoid(1.643) = 0.838.

Score0.696
Score7
Run 1

The code has severe structural and clarity issues. The package and imports are present, but the class methods do not logically correspond to typical Netty handler patterns. Method names like sendAccount, validateMessage, and validateAccount suggest business logic unrelated to a channel handler, while the actual operations (write, flush, close) are standard channel operations. This creates ambiguity around intent. The parameter names are misleading—'age' for a ChannelHandlerContext, 'map' for a write object, 'key' for a context, and 'data' for a context—further reducing readability. Nesting is flat and action granularity is mostly one per line, which are positives. However, the logical organization and naming conventions are poor, making the code confusing despite its brevity. The reading flow is disrupted by inconsistent and inaccurate naming. Overall, the code fails to clearly communicate its purpose or align with expected patterns.

Run 2

The code appears to be a modified version of a typical Netty SCTP echo server handler, but several issues drastically reduce readability. The method names (sendAccount, validateMessage, validateAccount) do not align with their actual purposes: writing data, flushing, and handling exceptions. Parameter names like 'age', 'map', 'key', 'data', and 'state' are misleading and unclear. The class inherits from ChannelInboundHandlerAdapter yet does not override the expected channelRead, channelReadComplete, or exceptionCaught methods, making the intent ambiguous. Structure is simple and nesting is flat, which is positive, but the disconnect between names and functionality creates confusion. Code length is concise, but clarity of intent is severely compromised. Action granularity is fine—one action per line—but reading flow suffers due to nonsensical naming. Overall, the code is syntactically clean but semantically unreadable.

Run 3

The code is severely unreadable due to misleading naming and broken semantics. Method names like sendAccount and validateAccount do not reflect their actual operations (write/flush/exception handling), obscuring intent. The class claims to be an echo server handler but implements no echo logic. Parameters are named confusingly (age, map, key, data, state), making the flow hard to follow. Although the structure is minimal and nesting is low, clarity of intent is almost nonexistent. The code is concise, but conciseness is undermined by incorrect abstraction. Reading flow is disrupted by meaningless names. Action granularity is acceptable, but without meaningful context it doesn't improve readability. Overall, the code appears obfuscated or poorly refactored, scoring very low on the readability scale despite its simple layout.

Run 1

Code Structure: The class is logically organized into three small methods, with standard imports and annotations. Nesting: No nested control flow makes it easy to scan. Clarity of intent: The echo-server description and write, flush, and close operations are understandable, but names such as sendAccount, validateMessage, validateAccount, age, map, and state misleadingly suggest unrelated purposes. The method names also do not match the expected ChannelInboundHandlerAdapter callbacks, making the @Override annotations confusing. Code length: The implementation is concise without unnecessary logic. Action granularity: Each statement performs one action. Reading flow: Formatting and method order are natural, though misleading identifiers interrupt comprehension and obscure the intended event-handling lifecycle.

Run 2

Code Structure: Clean class organization with three short methods, though the declared overrides do not match ChannelInboundHandlerAdapter callbacks. Nesting: Flat method bodies make execution easy to follow. Clarity of intent: The echo-server comment and write, flush, and close calls suggest the intended behavior, but names such as sendAccount, validateMessage, age, and map are misleading and obscure parameter roles. Code length: Concise, with no unnecessary implementation. Action granularity: Each statement performs one action on its own line. Reading flow: Imports, documentation, and methods follow a natural order, but inconsistent domain terminology interrupts understanding. Overall, the simple layout is readable, while misleading naming and invalid overrides significantly weaken comprehension.

Run 3

Code Structure: The class is logically organized into three small handler methods. Nesting: There is no nested control flow, making it easy to scan. Clarity of intent: The class documentation identifies an SCTP echo handler, but method names such as sendAccount and validateAccount misleadingly suggest account operations; parameter names such as age, map, key, and state obscure their roles. The methods also do not match the usual inbound-handler callback names, making the @Override annotations confusing. Code length: The implementation is concise without unnecessary logic. Action granularity: Each statement performs a single action on its own line. Reading flow: Formatting and method ordering support straightforward reading, although the inconsistent naming interrupts understanding.