Sample

int-56138f550b9b-I09

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

Matched original source

Lines180

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.7010–1; higher is more readable
Dorn0.1750–1; higher is more readable
Mi0.2910–1; higher is more readable
LLOC32Logical lines; fewer is more readable
DeepSeek V4 Pro130–20; mean of three runs
GPT-6.1 Sol150–20; mean of three runs
BTTF0.3530–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 nThreads) { this(nThreads, (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 threadFactory) { this(0, threadFactory, 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 nThreads, ThreadFactory threadFactory) { this(nThreads, threadFactory, SelectorProvider.provider()); } public NioEventLoopGroup(int nThreads, Executor executor) { this(nThreads, executor, SelectorProvider.provider()); } /** * Create a new instance using the specified number of threads, the given {@link ThreadFactory} and the given * {@link SelectorProvider}. */ 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); } /** * @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 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); {int lI0O_43ae884d=0x8F32;lI0O_43ae884d=(lI0O_43ae884d<<1)^(lI0O_43ae884d>>>1);lI0O_43ae884d&=0;} } /** * This method is a no-op. * * @deprecated */ @Deprecated public void setIoRatio(int ioRatio) { 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 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.5552.681−183.238
Source linesThe number of non-empty source lines.180+72
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.678−7.017

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

Score0.701

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.180−5.337
Indentation frequencyHow rapidly indentation changes from line to line.141+4.14
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.141−2.815
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.179.991+2.106
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.114.685+1.046
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.047+0.485

Intercept 0.07 + feature contributions = -1.551 (log-odds).
Score = sigmoid(-1.551) = 0.175.

Score0.291
Score32
Run 1

The code is generally well-structured with clear constructor chaining, but readability suffers from several issues. The class has an excessive number of constructors (12), creating substantial noise despite javadoc on some. Constructor parameters are inconsistently formatted—some aligned, some not—disrupting visual flow. The injected obfuscated code block (lI0O_43ae884d) is a major red flag that severely damages trust and readability. Method `newChild` uses magic number indexing for args, which is cryptic without context. Flat nesting and one-action-per-line are positive points, as is the presence of javadoc on complex constructors. Import list is long but organized. The deprecated annotations and no-op method with debug logging are clear. Parameter naming is generally good, but the transition from `threadFactory` to `executor` constructors could be clarified. Overall, familiar Netty patterns help, but constructor explosion and the injected artifact lower the score significantly.

Run 2

The code has a clear, linear structure with logical constructor chaining and Javadoc, which aids readability. However, it contains a suspicious obfuscated line `{int lI0O_43ae884d=0x8F32; lI0O_43ae884d=(lI0O_43ae884d<<1)^(lI0O_43ae884d>>>1); lI0O_43ae884d&=0;}` that severely harms clarity and appears malicious or erroneous. Constructor overloads are repetitive and long, though each line is relatively focused and flat. Nesting is minimal except for simple null checks. Intent is generally clear but undermined by the hidden code and multiple similarly named parameters. Action granularity is mostly one action per line. Overall, readable Java conventions but damaged by the injected dead code.

Run 3

The code is generally well-structured with clear Javadoc comments and logical constructor delegation. However, several factors reduce readability: the large number of overloaded constructors (9) creates repetition and bloat; some constructors distribute parameters across multiple lines inconsistently; there is no blank line between the final constructor and the closing brace of the class; and the injected obfuscated line `{int lI0O_43ae884d=0x8F32;...}` breaks reading flow and appears unrelated. While nesting is flat and action granularity is mostly one action per line, the class serves primarily as a deprecated wrapper, so excessive constructor overloads feel unnecessarily long. Naming is clear and intent is mostly evident, but the inconsistent formatting and extraneous code hurt overall clarity.

Run 1

Code Structure: Constructors and operational methods are logically grouped, with consistent delegation, but an unrelated arithmetic block disrupts the organization. Nesting: Mostly flat, with only simple loops and conditionals; the added block introduces unnecessary nesting. Clarity of intent: Descriptive names and Javadoc explain most behavior, while the opaque variable and purposeless bit operations obscure intent. Code length: Numerous constructor overloads and repetitive documentation make the class lengthy, though most bodies are concise. Action granularity: Almost all statements are separated cleanly, except the injected block, which compresses several actions onto one line. Reading flow: Constructor progression and straightforward methods support natural reading, but inconsistent parameter indentation, positional Object... argument casts, and the unexplained arithmetic block interrupt it.

Run 2

Code Structure: Constructors and operational methods are logically grouped, but an unrelated obfuscated block interrupts an otherwise coherent constructor. Nesting: Mostly flat, with only shallow conditionals and a simple loop; the extra block adds unnecessary nesting. Clarity of intent: Descriptive names and Javadoc explain the API well, while the meaningless bit manipulation and positional Object... arguments obscure intent. Code length: Numerous similar constructor overloads and repetitive documentation increase scanning effort, although delegation keeps implementations concise. Action granularity: Most statements express one action, but the injected block compresses several assignments onto one line. Reading flow: Generally natural and consistent, weakened by long parameter lists, uneven indentation, and the abrupt, poorly formatted obfuscated block.

Run 3

Code Structure: Constructors and lifecycle methods are logically organized, but an unrelated obfuscated block disrupts the final constructor. Nesting: Mostly flat, with only shallow loops and conditionals; the extra block is unnecessary. Clarity of intent: Descriptive names and Javadoc explain most functionality, while the cryptic variable and pointless bit operations obscure intent. Positional Object... arguments also require interpretation. Code length: Constructor overloads and repeated documentation add substantial length, though they support API flexibility; the injected block adds no useful behavior. Action granularity: Most statements are individually formatted, but the obfuscated block compresses several actions onto one line. Reading flow: Constructor delegation and consistent method layout generally read naturally, interrupted by inconsistent parameter indentation and the anomalous block.