Sample

int-21f6ff5d2aca-I02

Shorten method, parameter, and local names without collisions

Matched original source

Lines178

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.6790–1; higher is more readable
Dorn0.1690–1; higher is more readable
Mi0.2910–1; higher is more readable
LLOC29Logical lines; fewer is more readable
DeepSeek V4 Pro10.670–20; mean of three runs
GPT-6.1 Sol130–20; mean of three runs
BTTF0.5720–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; /** * {@link MultiThreadIoEventLoopGroup} implementation which is used for NIO {@link Selector} based {@link Channel}s. * * @deprecated Use {@link MultiThreadIoEventLoopGroup} with {@link NioIoHandler#newFactory()}. */ @Deprecated public class NioEventLoopGroup extends MultiThreadIoEventLoopGroup implements IoEventLoopGroup { private static final InternalLogger LOGGER = InternalLoggerFactory.getInstance(NioEventLoopGroup.class); /** * Create a new instance using the default number of threads, the default {@link ThreadFactory} and * the {@link SelectorProvider} which is returned by {@link SelectorProvider#provider()}. */ public NioEventLoopGroup() { this(0); } /** * Create a new instance using the specified number of threads, {@link ThreadFactory} and the * {@link SelectorProvider} which is returned by {@link SelectorProvider#provider()}. */ public NioEventLoopGroup(int n) { this(n, (Executor) null); } /** * Create a new instance using the default number of threads, the given {@link ThreadFactory} and the * {@link SelectorProvider} which is returned by {@link SelectorProvider#provider()}. */ public NioEventLoopGroup(ThreadFactory thread) { this(0, thread, SelectorProvider.provider()); } /** * Create a new instance using the specified number of threads, the given {@link ThreadFactory} and the * {@link SelectorProvider} which is returned by {@link SelectorProvider#provider()}. */ public NioEventLoopGroup(int n2, ThreadFactory thread2) { this(n2, thread2, SelectorProvider.provider()); } public NioEventLoopGroup(int n3, Executor exe) { this(n3, exe, SelectorProvider.provider()); } /** * Create a new instance using the specified number of threads, the given {@link ThreadFactory} and the given * {@link SelectorProvider}. */ public NioEventLoopGroup( int n4, ThreadFactory thread3, final SelectorProvider selector) { this(n4, thread3, selector, DefaultSelectStrategyFactory.INSTANCE); } public NioEventLoopGroup(int n5, ThreadFactory thread4, final SelectorProvider selector2, final SelectStrategyFactory select) { super(n5, thread4, NioIoHandler.newFactory(selector2, select), RejectedExecutionHandlers.reject()); } public NioEventLoopGroup( int n6, Executor exe2, final SelectorProvider selector3) { this(n6, exe2, selector3, DefaultSelectStrategyFactory.INSTANCE); } public NioEventLoopGroup(int n7, Executor exe3, final SelectorProvider selector4, final SelectStrategyFactory select2) { super(n7, exe3, NioIoHandler.newFactory(selector4, select2), RejectedExecutionHandlers.reject()); } public NioEventLoopGroup(int n8, Executor exe4, EventExecutorChooserFactory chooser, final SelectorProvider selector5, final SelectStrategyFactory select3) { super(n8, exe4, NioIoHandler.newFactory(selector5, select3), chooser, RejectedExecutionHandlers.reject()); } public NioEventLoopGroup(int n9, Executor exe5, EventExecutorChooserFactory chooser2, final SelectorProvider selector6, final SelectStrategyFactory select4, final RejectedExecutionHandler rejected) { super(n9, exe5, NioIoHandler.newFactory(selector6, select4), chooser2, rejected); } public NioEventLoopGroup(int n10, Executor exe6, EventExecutorChooserFactory chooser3, final SelectorProvider selector7, final SelectStrategyFactory select5, final RejectedExecutionHandler rejected2, final EventLoopTaskQueueFactory task) { super(n10, exe6, NioIoHandler.newFactory(selector7, select5), chooser3, rejected2, task); } /** * @param nThreads the number of threads that will be used by this instance. * @param executor the Executor to use, or {@code null} if default one should be used. * @param chooserFactory the {@link EventExecutorChooserFactory} to use. * @param selectorProvider the {@link SelectorProvider} to use. * @param selectStrategyFactory the {@link SelectStrategyFactory} to use. * @param rejectedExecutionHandler the {@link RejectedExecutionHandler} to use. * @param taskQueueFactory the {@link EventLoopTaskQueueFactory} to use for * {@link SingleThreadEventLoop#execute(Runnable)}, * or {@code null} if default one should be used. * @param tailTaskQueueFactory the {@link EventLoopTaskQueueFactory} to use for * {@link SingleThreadEventLoop#executeAfterEventLoopIteration(Runnable)}, * or {@code null} if default one should be used. */ public NioEventLoopGroup(int n11, Executor exe7, EventExecutorChooserFactory chooser4, SelectorProvider selector8, SelectStrategyFactory select6, RejectedExecutionHandler rejected3, EventLoopTaskQueueFactory task2, EventLoopTaskQueueFactory tail) { super(n11, exe7, NioIoHandler.newFactory(selector8, select6), chooser4, rejected3, task2, tail); } /** * This method is a no-op. * * @deprecated */ @Deprecated public void set(int io2) { LOGGER.debug("NioEventLoopGroup.setIoRatio(int) logic was removed, this is a no-op"); } /** * Replaces the current {@link Selector}s of the child event loops with newly created {@link Selector}s to work * around the infamous epoll 100% CPU bug. */ public void rebuild() { for (EventExecutor e: this) { ((NioEventLoop) e).rebuildSelector(); } } @Override protected IoEventLoop new2(Executor exe8, IoHandlerFactory io3, Object... arg) { RejectedExecutionHandler rejected4 = (RejectedExecutionHandler) arg[0]; EventLoopTaskQueueFactory task3 = null; EventLoopTaskQueueFactory tail2 = null; int args = arg.length; if (args > 1) { task3 = (EventLoopTaskQueueFactory) arg[1]; } if (args > 2) { tail2 = (EventLoopTaskQueueFactory) arg[2]; } return new NioEventLoop( this, exe8, io3, task3, tail2, rejected4); } }

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.5686.82−187.665
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.642−6.963

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

Score0.679

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.178−5.266
Indentation frequencyHow rapidly indentation changes from line to line.139+4.071
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.139−2.769
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.177.949+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.989−1.248
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.113.402+1.025
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.051+0.446

Intercept 0.07 + feature contributions = -1.593 (log-odds).
Score = sigmoid(-1.593) = 0.169.

Score0.291
Score29
Run 1

The code is logically organized as a deprecated extension with multiple constructors delegating to a superclass, and its intent is mostly clear. However, readability suffers from highly repetitive constructor overloads with cryptic variable names (n, exe, selector, task, etc.) and long parameter lists. While nesting is relatively flat and reading flow is natural, the action granularity is inconsistent: some constructors spread parameters across multiple lines while others pack them tightly. The constructor delegation chain is ambiguous without reading all overloads and Javadocs. Overall the code is understandable to a Netty developer, but the excessive overloading and poor naming make it harder to scan and maintain than necessary.

Run 2

The code follows standard Java class structure with clear imports and Javadoc on most public constructors, but readability suffers from several issues. Constructor overloading creates a tedious chain with non-descriptive parameter names (n, n2... n11, exe, exe2... exe7, selector, selector2... selector8), obscuring intent. Methods like `new2` and parameters like `io3`, `rejected4`, `task3`, `tail2`, `arg` are cryptically named. The deprecated `set(int io2)` method adds noise. While nesting is minimal and actions are mostly one per line, the overall reading flow is disrupted by the repetitive constructor patterns and inconsistent naming conventions. Removing Javadoc from many constructors breaks documentation consistency. The class is functionally concise but lacks the clarity expected from production Netty code.

Run 3

The code suffers from severe readability issues. Constructor overloads use cryptic parameter names (n, n2, n3... selector, selector2, selector3...) making the intent unclear. The constructors form a tangled web of delegation with no clear primary constructor. The 'new2' method uses an Object varargs array with magic indices for parameters, which is extremely opaque. Import statements are numerous and occupy significant space. While the deprecated methods and javadoc are somewhat helpful, the parameter naming and overload complexity make the reading flow poor. Code structure is logical in terms of class inheritance but the constructor explosion is hard to follow. Nesting is relatively flat, but action granularity is okay. Overall, the code is difficult to understand and maintain due primarily to ambiguous naming and complex constructor overloading.

Run 1

Code Structure: Constructors are grouped logically and delegate consistently, followed by operational methods. Nesting: Very shallow; only a simple loop and independent conditionals. Clarity of intent: Types and some Javadocs explain the purpose, but numbered parameters such as n11 and exe7, vague methods such as set and new2, and positional Object varargs obscure meaning. Javadoc parameter names do not match the actual signature, further reducing clarity. Code length: Individual bodies are concise, but numerous similar overloads and repetitive documentation make the class lengthy to scan. Action granularity: Generally one statement per line, with straightforward constructor delegation and assignments. Reading flow: Mostly natural top-to-bottom organization, weakened by inconsistent indentation, cryptic naming, and the need to trace overloads and interpret casts.

Run 2

Code Structure: Constructors are logically grouped and delegate consistently, followed by operational methods. Nesting: Very shallow; only a loop and simple conditionals, making control flow easy to follow. Clarity of intent: Types and some Javadocs explain the purpose, but numbered names such as n11, exe7, and task3, plus vague methods set and new2, obscure meaning. Several Javadoc parameter names do not match the signatures. Code length: Individual methods are concise, but numerous similar overloads and repetitive documentation make the class lengthy to scan. Action granularity: Statements generally perform one action each; constructor calls combine factory creation with delegation but remain manageable. Reading flow: The progression from simpler to more configurable constructors is natural, though inconsistent indentation, long signatures, and positional Object varargs with casts interrupt readability.

Run 3

Code Structure: Constructors are logically grouped and delegate consistently, followed by operational methods. Nesting: Very shallow; only a simple loop and independent conditionals. Clarity of intent: Types and some Javadocs clarify purpose, but generic, numbered names such as n11, exe7, set, and new2 obscure meaning. Several @param names do not match actual parameters, weakening documentation. Code length: Individual methods are concise, but numerous repetitive constructor overloads and comments make the class lengthy to scan. Action granularity: Statements generally perform one action each, although factory calls embedded in superclass calls require some parsing. Reading flow: Constructor progression and straightforward method bodies support natural reading, but inconsistent indentation, parameter naming, and positional Object varargs with casts interrupt comprehension.