Sample

int-14a2204a714c-I01

Remove line comments, block comments, and Javadoc

Matched original source

Lines50

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.6080–1; higher is more readable
Dorn0.2560–1; higher is more readable
Mi0.6660–1; higher is more readable
LLOC12Logical lines; fewer is more readable
DeepSeek V4 Pro16.330–20; mean of three runs
GPT-6.1 Sol16.670–20; mean of three runs
BTTF0.5390–1; higher is more readable

Views

Source code

package io.netty.example.sctp; import io.netty.bootstrap.ServerBootstrap; import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelOption; import io.netty.channel.EventLoopGroup; import io.netty.channel.MultiThreadIoEventLoopGroup; import io.netty.channel.nio.NioIoHandler; import io.netty.channel.sctp.SctpChannel; import io.netty.channel.sctp.nio.NioSctpServerChannel; import io.netty.handler.logging.LogLevel; import io.netty.handler.logging.LoggingHandler; public final class SctpEchoServer { static final int PORT = Integer.parseInt(System.getProperty("port", "8007")); public static void main(String[] args) throws Exception { EventLoopGroup group = new MultiThreadIoEventLoopGroup(NioIoHandler.newFactory()); final SctpEchoServerHandler serverHandler = new SctpEchoServerHandler(); try { ServerBootstrap b = new ServerBootstrap(); b.group(group) .channel(NioSctpServerChannel.class) .option(ChannelOption.SO_BACKLOG, 100) .handler(new LoggingHandler(LogLevel.INFO)) .childHandler(new ChannelInitializer<SctpChannel>() { @Override public void initChannel(SctpChannel ch) throws Exception { ch.pipeline().addLast( serverHandler); } }); ChannelFuture f = b.bind(PORT).sync(); f.channel().closeFuture().sync(); } finally { group.shutdownGracefully(); } } }

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.1868.13−61.648
Source linesThe number of non-empty source lines.50+20
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.782

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

Score0.608

Feature contributions

FeatureValueContribution
(log-odds)
Indentation frequencyHow rapidly indentation changes from line to line.50+0.992
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.50−0.734
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.50−0.727
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.49.956+0.288
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.90−0.147
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.098−0.006

Intercept 0.07 + feature contributions = -1.067 (log-odds).
Score = sigmoid(-1.067) = 0.256.

Score0.666
Score12
Run 1

The code demonstrates clear structure and follows Netty conventions well. The main method is logically organized with a try-finally block ensuring resource cleanup. Nesting is minimal, limited to the anonymous ChannelInitializer class, which is a standard pattern. Intent is clear - setting up an SCTP echo server with proper bootstrap configuration. Code length is appropriate and concise without unnecessary verbosity. Action granularity is good, with each line performing a single meaningful operation. Reading flow is natural, progressing from setup to binding to shutdown. Minor deductions: several blank lines with comments appear to have stray spaces or are empty, and the anonymous inner class could be replaced with a lambda for slightly better readability in newer Java versions. The static PORT initialization via System.getProperty is a common pattern but could be documented. Overall, highly readable code that follows established patterns.

Run 2

The code is highly readable with a clear, logical structure: imports are organized, the main method flows naturally, and the try-finally block ensures proper resource cleanup. Nesting is minimal, with only one inner class for channel initialization. Intent is evident — setting up an SCTP echo server — and the code is concise without unnecessary verbosity. Each action is on its own line, and the chained builder pattern improves clarity. Minor issues include a few blank lines and a stray comment placeholder that slightly disrupt the reading flow, but overall it is well-structured and easy to understand.

Run 3

The code is generally readable: it has a clear top-level structure, straightforward naming, and a single responsibility. Imports are grouped, and the flow follows a standard Netty bootstrap pattern. The fluent builder chain is reasonably flat and uses indentation well. However, readability is reduced by empty comments (`// ...`) that hint at missing documentation, a variable named `b` that could be more descriptive (e.g., `bootstrap`), and an anonymous inner `ChannelInitializer` that adds one more nesting level without necessity. Some blank lines are inconsistent. The logging and child handler setup is fine, but the static `PORT` initialization from system property is slightly dense. Overall, the code is easy to follow for a developer familiar with Netty but could benefit from clearer variable names and consistent comments or removal of placeholder comments.

Run 1

Code Structure: Logically organizes server configuration, binding, waiting, and cleanup, with resource shutdown in a finally block. Nesting: Mostly shallow, though the anonymous ChannelInitializer introduces moderate nesting. Clarity of intent: Class and API names clearly convey an SCTP echo server, but abbreviated variables b and f reduce clarity. Code length: Concise overall, although excessive blank lines and the unnecessarily split addLast call add visual clutter. Action granularity: Statements generally perform one action each; the fluent configuration chain separates options onto individual lines. Reading flow: Execution follows a natural setup-to-shutdown sequence, but inconsistent whitespace and indentation interrupt scanning.

Run 2

Code Structure: Logically organized into configuration, server startup, waiting, and cleanup, with resource shutdown clearly placed in finally. Nesting: Mostly shallow; the anonymous ChannelInitializer adds moderate indentation but remains manageable. Clarity of intent: The class name and Netty API calls clearly convey an SCTP echo server, although abbreviated variables b and f are less descriptive. Code length: Concise overall, but excessive blank lines and the unnecessarily split addLast call add visual clutter. Action granularity: Statements generally perform one action, and bootstrap configuration places each chained operation on its own line. Reading flow: Execution proceeds naturally from initialization through shutdown, but inconsistent whitespace interrupts the flow.

Run 3

Code Structure: Logically separates initialization, server configuration, binding, waiting, and cleanup, with resource shutdown in finally. Nesting: Mostly shallow; the anonymous ChannelInitializer adds modest nesting. Clarity of intent: The class name and Netty API calls clearly indicate an SCTP echo server, although variable names b and f are vague. Code length: Concise overall, but excessive blank lines and the unnecessarily split addLast call add visual clutter. Action granularity: Statements generally perform one action each, and the fluent configuration chain places each setting on its own line. Reading flow: Execution proceeds naturally from setup through shutdown, though inconsistent spacing and indentation interrupt the flow.