Sample

int-d5b2272659e1-I01

Remove line comments, block comments, and Javadoc

Matched original source

Lines28

Scores

MethodScoreScale
Posnett0.0060–1; higher is more readable
Scalabrino0.710–1; higher is more readable
Dorn0.5980–1; higher is more readable
Mi0.7810–1; higher is more readable
LLOC7Logical lines; fewer is more readable
DeepSeek V4 Pro18.330–20; mean of three runs
GPT-6.1 Sol190–20; mean of three runs
BTTF0.6760–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; @Sharable public class SctpEchoServerHandler extends ChannelInboundHandlerAdapter { @Override public void channelRead(ChannelHandlerContext ctx, Object msg) { ctx.write(msg); } @Override public void channelReadComplete(ChannelHandlerContext ctx) { ctx.flush(); } @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.553.182−18.255
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.622−6.933

Intercept 8.87 + feature contributions = -5.118 (log-odds).
Score = sigmoid(-5.118) = 0.006.

Score0.71

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
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.76.897+0.408
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
Indentation frequencyHow rapidly indentation changes from line to line.28+0.231
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.086+0.109
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.27.705−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 = 0.399 (log-odds).
Score = sigmoid(0.399) = 0.598.

Score0.781
Score7
Run 1

The code is highly readable. It has a clear, logical structure with a single class focused on echoing SCTP messages. Nesting is minimal, with only three short methods. Intent is obvious from the class and method names, and the behavior follows standard Netty handler patterns. Code length is concise, only implementing necessary overrides without redundant logic. Action granularity is appropriate—each method performs one clear action per line (write, flush, print/close). Reading flow is natural, following the typical lifecycle order of Netty handler callbacks. Minor deductions: the blank lines before @Sharable are slightly excessive and the exceptionCaught method contains an empty line before printStackTrace, which is harmless but unnecessary. These are trivial formatting issues, not structural problems.

Run 2

The code is highly readable. It follows a clear, logical structure with a simple class declaration and three overridden methods. Nesting is minimal, with flat method bodies and no conditional or looping constructs. Intent is obvious: an echo handler that writes incoming messages and flushes them. Code length is concise and appropriate—no unnecessary code or boilerplate. Each method performs a single action per line, maintaining good action granularity. Reading flow is natural: the class declaration, channel read handling, completion flushing, and exception handling appear in a logical order. Minor deductions: the blank line before cause.printStackTrace() is slightly unusual but not harmful, and the import statements could be grouped with a space after the package line for slightly improved formatting.

Run 3

The code is highly readable. It follows a clear, logical structure with a single class extending a well-named base adapter. Nesting is minimal and action granularity is one action per line. The intent of each method is obvious from its name and concise body. Formatting and naming conventions are consistent with Java/Netty standards. Minor deductions for the blank line in exceptionCaught and the lack of logging over printStackTrace, which slightly reduce clarity in a production context.

Run 1

Code Structure: Logically organized into three focused event-handler methods. Nesting: Flat, with no nested control flow. Clarity of intent: The class name and standard callback names clearly communicate an SCTP echo server that writes received messages, flushes completed reads, and closes on errors. Code length: Concise, without unnecessary logic, though excess blank lines add minor visual noise. Action granularity: Each statement performs one action on its own line. Reading flow: Natural progression from receiving data to completing reads and handling exceptions; inconsistent whitespace is the only notable readability issue.

Run 2

Code Structure: Well-organized class with separate methods for reading, flushing, and exception handling. Nesting: Flat method bodies with no nested control flow. Clarity of intent: The class name and lifecycle methods clearly convey an SCTP echo handler; writing received messages and flushing on read completion are straightforward. Code length: Concise, with no unnecessary logic, though excess blank lines add minor visual clutter. Action granularity: Each statement performs one action on its own line. Reading flow: Natural progression from message processing to completion and error handling. Minor spacing inconsistencies prevent a perfect score.

Run 3

Code Structure: Clearly organized into three event-handler methods with standard overrides. Nesting: Flat method bodies with no nested control flow. Clarity of intent: The class name and straightforward write, flush, and exception-handling calls clearly convey an echo server handler. Code length: Concise, with no unnecessary logic, though excess blank lines add minor visual clutter. Action granularity: Each statement performs one action on its own line. Reading flow: Imports, annotation, class declaration, and methods follow a natural Java layout. Minor whitespace inconsistencies prevent a perfect score.