Sample

int-843f0c4757be-I09

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

Matched original source

Lines30

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.6150–1; higher is more readable
Dorn0.570–1; higher is more readable
Mi0.3440–1; higher is more readable
LLOC9Logical lines; fewer is more readable
DeepSeek V4 Pro13.670–20; mean of three runs
GPT-6.1 Sol13.670–20; mean of three runs
BTTF0.2130–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 channelRead(ChannelHandlerContext ctx, Object msg) { {int lI0O_32a8b37c=0x72DA-0x72DA;lI0O_32a8b37c=(lI0O_32a8b37c==0)?(lI0O_32a8b37c|0):(lI0O_32a8b37c&0);} ctx.write(msg); } @Override public void channelReadComplete(ChannelHandlerContext ctx) { ctx.flush(); } @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { // Close the connection when an exception is raised. 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.770.725−25.434
Source linesThe number of non-empty source lines.30+12
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.963−7.444

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

Score0.615

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.102.935+0.856
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.102.968−0.696
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.27−0.199
Indentation frequencyHow rapidly indentation changes from line to line.27+0.197
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.086+0.11
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.31−0.061
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.29.731+0.006

Intercept 0.07 + feature contributions = 0.283 (log-odds).
Score = sigmoid(0.283) = 0.57.

Score0.344
Score9
Run 1

The code is generally readable but contains a confusing dead-code line in channelRead that obscures intent. Structure is logical with appropriate handler methods. Nesting is flat and clear. The variable lI0O_32a8b37c is poorly named and the obfuscated expression adds no value. Length is concise, but this one line significantly impacts clarity. Action granularity is good - one action per line. Reading flow is mostly natural, but the obfuscated line interrupts understanding. Without that line, this would score 18-19. The class has clear purpose, proper annotations, and standard Netty patterns. The exceptionCaught method has a descriptive comment. Overall, the code follows good practices except for this single problematic addition.

Run 2

The code has a clear purpose as an SCTP echo server handler and follows a standard Netty pattern. The class structure is logical with appropriate method overrides, and the methods are short with clear intent. However, there is a significant readability issue: a line of obfuscated Java code (variable lI0O_32a8b37c with bitwise operations) in channelRead that serves no apparent purpose and breaks reading flow. This line is jarring, makes the code harder to understand, and violates the principle of clear intent. Otherwise, the nesting is flat, actions are generally one per line, and exception handling is straightforward. The printStackTrace is acceptable for an example but not ideal for production. Length is concise.

Run 3

The code is generally well-structured and readable, with clear intent and proper use of Netty handler patterns. It follows standard conventions for a ChannelInboundHandlerAdapter, and each method performs a single logical action. However, there is an obfuscated line of code containing a nonsensical operation (a dead-code expression with a variable named lI0O_32a8b37c) that serves no purpose and significantly reduces readability. The exception handling prints the stack trace before closing, which is acceptable but could be improved with logging. Overall, aside from the mysterious unused expression, the code is clean, flat, and easy to follow.

Run 1

Code Structure: The handler is logically organized into separate event callbacks, but an irrelevant block disrupts channelRead. Nesting: Mostly flat, with only one unnecessary nested block. Clarity of intent: Class naming, callback names, and comments clearly communicate an echo server, while the cryptic variable and redundant arithmetic obscure intent locally. Code length: The implementation is concise overall, though the no-op block adds unnecessary code. Action granularity: Most lines contain one clear action, but the injected block compresses a declaration, assignment, and conditional expression onto one line. Reading flow: The callbacks follow a natural read, flush, and error-handling sequence; inconsistent formatting and obfuscated code interrupt an otherwise straightforward flow.

Run 2

Code Structure: Standard handler overrides provide logical organization, but an unrelated obfuscated block disrupts channelRead. Nesting: Mostly flat, with only one unnecessary nested block. Clarity of intent: Echoing messages, flushing writes, and closing on exceptions are clear; the cryptic variable and redundant arithmetic obscure the inserted block's purpose. Code length: The class is concise overall, but the no-op block adds unnecessary code. Action granularity: Most statements occupy separate lines, while the inserted block compresses declaration, assignment, and conditional logic onto one line. Reading flow: Conventional method ordering and descriptive API calls make the handler easy to follow, but the poorly formatted block interrupts otherwise natural reading.

Run 3

Code Structure: Standard Netty handler organization cleanly separates reading, flushing, and exception handling, but an irrelevant obfuscated block disrupts channelRead. Nesting: Mostly flat, with only one unnecessary nested block. Clarity of intent: The echo-server purpose and lifecycle methods are clear; the cryptic variable and redundant hexadecimal arithmetic obscure intent locally. Code length: Concise overall, although the no-op block adds unnecessary code. Action granularity: Most statements occupy separate lines, but the obfuscated block compresses declaration, assignment, and conditional logic onto one line. Reading flow: Conventional method ordering and a useful exception comment support natural reading, while the unindented block abruptly interrupts it.