Sample

int-3944020f1849-I01

Remove line comments, block comments, and Javadoc

Matched original source

Lines178

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.6080–1; higher is more readable
Dorn0.0430–1; higher is more readable
Mi0.3750–1; higher is more readable
LLOC29Logical lines; fewer is more readable
DeepSeek V4 Pro150–20; mean of three runs
GPT-6.1 Sol15.330–20; mean of three runs
BTTF0.5450–1; higher is more readable

Views

Source code

package io.netty.channel.nio; import io.netty.channel.Channel; import io.netty.channel.DefaultSelectStrategyFactory; import io.netty.channel.EventLoopTaskQueueFactory; import io.netty.channel.IoEventLoop; import io.netty.channel.IoEventLoopGroup; import io.netty.channel.IoHandlerFactory; import io.netty.channel.MultiThreadIoEventLoopGroup; import io.netty.channel.SelectStrategyFactory; import io.netty.channel.SingleThreadEventLoop; import io.netty.util.concurrent.EventExecutor; import io.netty.util.concurrent.EventExecutorChooserFactory; import io.netty.util.concurrent.RejectedExecutionHandler; import io.netty.util.concurrent.RejectedExecutionHandlers; import io.netty.util.internal.logging.InternalLogger; import io.netty.util.internal.logging.InternalLoggerFactory; import java.nio.channels.Selector; import java.nio.channels.spi.SelectorProvider; import java.util.concurrent.Executor; import java.util.concurrent.ThreadFactory; @Deprecated public class NioEventLoopGroup extends MultiThreadIoEventLoopGroup implements IoEventLoopGroup { private static final InternalLogger LOGGER = InternalLoggerFactory.getInstance(NioEventLoopGroup.class); public NioEventLoopGroup() { this(0); } public NioEventLoopGroup(int nThreads) { this(nThreads, (Executor) null); } public NioEventLoopGroup(ThreadFactory threadFactory) { this(0, threadFactory, SelectorProvider.provider()); } public NioEventLoopGroup(int nThreads, ThreadFactory threadFactory) { this(nThreads, threadFactory, SelectorProvider.provider()); } public NioEventLoopGroup(int nThreads, Executor executor) { this(nThreads, executor, SelectorProvider.provider()); } public NioEventLoopGroup( int nThreads, ThreadFactory threadFactory, final SelectorProvider selectorProvider) { this(nThreads, threadFactory, selectorProvider, DefaultSelectStrategyFactory.INSTANCE); } public NioEventLoopGroup(int nThreads, ThreadFactory threadFactory, final SelectorProvider selectorProvider, final SelectStrategyFactory selectStrategyFactory) { super(nThreads, threadFactory, NioIoHandler.newFactory(selectorProvider, selectStrategyFactory), RejectedExecutionHandlers.reject()); } public NioEventLoopGroup( int nThreads, Executor executor, final SelectorProvider selectorProvider) { this(nThreads, executor, selectorProvider, DefaultSelectStrategyFactory.INSTANCE); } public NioEventLoopGroup(int nThreads, Executor executor, final SelectorProvider selectorProvider, final SelectStrategyFactory selectStrategyFactory) { super(nThreads, executor, NioIoHandler.newFactory(selectorProvider, selectStrategyFactory), RejectedExecutionHandlers.reject()); } public NioEventLoopGroup(int nThreads, Executor executor, EventExecutorChooserFactory chooserFactory, final SelectorProvider selectorProvider, final SelectStrategyFactory selectStrategyFactory) { super(nThreads, executor, NioIoHandler.newFactory(selectorProvider, selectStrategyFactory), chooserFactory, RejectedExecutionHandlers.reject()); } public NioEventLoopGroup(int nThreads, Executor executor, EventExecutorChooserFactory chooserFactory, final SelectorProvider selectorProvider, final SelectStrategyFactory selectStrategyFactory, final RejectedExecutionHandler rejectedExecutionHandler) { super(nThreads, executor, NioIoHandler.newFactory(selectorProvider, selectStrategyFactory), chooserFactory, rejectedExecutionHandler); } public NioEventLoopGroup(int nThreads, Executor executor, EventExecutorChooserFactory chooserFactory, final SelectorProvider selectorProvider, final SelectStrategyFactory selectStrategyFactory, final RejectedExecutionHandler rejectedExecutionHandler, final EventLoopTaskQueueFactory taskQueueFactory) { super(nThreads, executor, NioIoHandler.newFactory(selectorProvider, selectStrategyFactory), chooserFactory, rejectedExecutionHandler, taskQueueFactory); } public NioEventLoopGroup(int nThreads, Executor executor, EventExecutorChooserFactory chooserFactory, SelectorProvider selectorProvider, SelectStrategyFactory selectStrategyFactory, RejectedExecutionHandler rejectedExecutionHandler, EventLoopTaskQueueFactory taskQueueFactory, EventLoopTaskQueueFactory tailTaskQueueFactory) { super(nThreads, executor, NioIoHandler.newFactory(selectorProvider, selectStrategyFactory), chooserFactory, rejectedExecutionHandler, taskQueueFactory, tailTaskQueueFactory); } @Deprecated public void setIoRatio(int ioRatio) { LOGGER.debug("NioEventLoopGroup.setIoRatio(int) logic was removed, this is a no-op"); } public void rebuildSelectors() { for (EventExecutor e: this) { ((NioEventLoop) e).rebuildSelector(); } } @Override protected IoEventLoop newChild(Executor executor, IoHandlerFactory ioHandlerFactory, Object... args) { RejectedExecutionHandler rejectedExecutionHandler = (RejectedExecutionHandler) args[0]; EventLoopTaskQueueFactory taskQueueFactory = null; EventLoopTaskQueueFactory tailTaskQueueFactory = null; int argsLength = args.length; if (argsLength > 1) { taskQueueFactory = (EventLoopTaskQueueFactory) args[1]; } if (argsLength > 2) { tailTaskQueueFactory = (EventLoopTaskQueueFactory) args[2]; } return new NioEventLoop( this, executor, ioHandlerFactory, taskQueueFactory, tailTaskQueueFactory, rejectedExecutionHandler); } }

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.5279.93−174.238
Source linesThe number of non-empty source lines.178+71.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.585−6.878

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

Score0.608

Feature contributions

FeatureValueContribution
(log-odds)
Indentation frequencyHow rapidly indentation changes from line to line.178+5.42
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.178−5.266
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.178−3.664
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.177.974+2.078
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.115.961−1.246
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.064+0.318

Intercept 0.07 + feature contributions = -3.095 (log-odds).
Score = sigmoid(-3.095) = 0.043.

Score0.375
Score29
Run 1

The code is generally well-structured with clear naming and logical organization. It uses many constructors, which is typical for Netty but creates repetitive overloads. There are suspicious blank comments and inconsistent indentation (some constructors use 4-space alignment, others 12 or 8 spaces) that hurt readability. The newChild method has moderate nesting with sequential argument parsing, not too deep. Intent is clear: deprecated group implementing IoEventLoopGroup, delegating to super constructors. Action granularity is mostly one action per line. The main issues are constructor overload length (inherent to the API), some overly long lines, and stray empty comment blocks that add noise. The code would benefit from removing dead comments, applying consistent formatting, and documenting which constructor is the primary one.

Run 2

The code is structurally organized as a factory-style group class with multiple constructors, which is intentional but repetitive. Nesting is minimal, and clarity of intent is generally good, though the many constructor overloads can be overwhelming. Code length is long due to required constructor permutations, but each method is concise. Action granularity is fine; most lines perform one action. Reading flow is natural from simple to complex constructors. However, the numerous blank lines between constructors are inconsistent, and the `newChild` method casts arguments using index-based logic, which is brittle and less readable. Overall, it is maintainable but could benefit from a builder pattern or clearer parameter handling.

Run 3

The code is generally readable, with a logical structure and clear intent. It uses constructor overloading effectively to provide multiple configuration options, each delegating to more specific constructors. The code length is reasonable for a class with many configuration permutations. However, the use of Object... args in newChild introduces ambiguity and requires unchecked casts, which reduces clarity. The many empty comment blocks are distracting, and the deeply chained constructor delegation can be hard to follow. The rebuildSelectors method is clear and concise, and the deprecated setIoRatio method is properly marked. Overall, the code is maintainable but could be improved by avoiding the varargs cast pattern and cleaning up empty comments.

Run 1

Code Structure: Constructors are logically grouped and delegate consistently, followed by operational methods, but numerous similar overloads create repetition. Nesting: Very shallow; only a simple loop and independent conditionals. Clarity of intent: Descriptive class, method, and parameter names communicate purpose well, although positional Object... arguments and casts in newChild obscure the configuration contract. Code length: Individual methods are concise, but constructor repetition and excessive blank lines unnecessarily expand the class. Action granularity: Statements generally perform one action each; nested factory calls remain understandable. Reading flow: Constructor delegation and straightforward method bodies provide a natural progression, but inconsistent indentation, parameter wrapping, and large whitespace gaps interrupt scanning.

Run 2

Code Structure: Constructors are logically grouped, followed by operational methods and child creation; extensive overloads make the class repetitive. Nesting: Shallow loops and independent conditionals keep control flow easy to follow. Clarity of intent: Descriptive class, method, and parameter names explain most behavior, but positional Object... arguments and casts obscure the child-creation contract. The deprecated no-op method clearly logs its behavior. Code length: Constructor delegation keeps implementations concise, although numerous overloads and excessive blank lines inflate the listing. Action granularity: Statements generally perform one action each; factory creation within superclass calls remains understandable. Reading flow: Consistent delegation and straightforward methods support natural reading, but irregular spacing, inconsistent signature alignment, unused imports, and long parameter lists interrupt it.

Run 3

Code Structure: Constructors are logically grouped, followed by operational methods and child creation; delegation keeps implementation organized. Nesting: Very shallow, with only a simple loop and independent conditionals. Clarity of intent: Descriptive class, method, and parameter names convey purpose, but positional Object... arguments and casts in newChild obscure the configuration contract. Code length: Individual methods are concise, though numerous similar constructor overloads and excessive blank lines inflate the class. Action granularity: Statements generally perform one action per line; constructor calls combine factory creation and delegation but remain understandable. Reading flow: The progression from simpler constructors to more configurable variants is natural, but inconsistent indentation, sparse documentation, and large whitespace gaps interrupt scanning. Overall, the code is readable and straightforward, with formatting noise and repetitive API boilerplate limiting its readability.