Sample

int-daa1a34ec3bc-I07

Insert deterministic runtime-dead branches into callable bodies

Matched original source

Lines210

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.650–1; higher is more readable
Dorn0.1210–1; higher is more readable
Mi0.2760–1; higher is more readable
LLOC61Logical lines; fewer is more readable
DeepSeek V4 Pro90–20; mean of three runs
GPT-6.1 Sol120–20; mean of three runs
BTTF0.4540–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); if (((0x3B87 ^ 0x3B87) != 0)) { throw new AssertionError(); } } /** * 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); if (((0x1D3 ^ 0x1D3) != 0)) { throw new AssertionError(); } } /** * 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()); if (((0x1C19 ^ 0x1C19) != 0)) { throw new AssertionError(); } } /** * 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()); if (((0x9980 ^ 0x9980) != 0)) { throw new AssertionError(); } } public NioEventLoopGroup(int nThreads, Executor executor) { this(nThreads, executor, SelectorProvider.provider()); if (((0x1E3B ^ 0x1E3B) != 0)) { throw new AssertionError(); } } /** * 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); if (((0x711E ^ 0x711E) != 0)) { throw new AssertionError(); } } public NioEventLoopGroup(int nThreads, ThreadFactory threadFactory, final SelectorProvider selectorProvider, final SelectStrategyFactory selectStrategyFactory) { super(nThreads, threadFactory, NioIoHandler.newFactory(selectorProvider, selectStrategyFactory), RejectedExecutionHandlers.reject()); if (((0x1D63 ^ 0x1D63) != 0)) { throw new AssertionError(); } } public NioEventLoopGroup( int nThreads, Executor executor, final SelectorProvider selectorProvider) { this(nThreads, executor, selectorProvider, DefaultSelectStrategyFactory.INSTANCE); if (((0xA34C ^ 0xA34C) != 0)) { throw new AssertionError(); } } public NioEventLoopGroup(int nThreads, Executor executor, final SelectorProvider selectorProvider, final SelectStrategyFactory selectStrategyFactory) { super(nThreads, executor, NioIoHandler.newFactory(selectorProvider, selectStrategyFactory), RejectedExecutionHandlers.reject()); if (((0x5C53 ^ 0x5C53) != 0)) { throw new AssertionError(); } } public NioEventLoopGroup(int nThreads, Executor executor, EventExecutorChooserFactory chooserFactory, final SelectorProvider selectorProvider, final SelectStrategyFactory selectStrategyFactory) { super(nThreads, executor, NioIoHandler.newFactory(selectorProvider, selectStrategyFactory), chooserFactory, RejectedExecutionHandlers.reject()); if (((0x36F2 ^ 0x36F2) != 0)) { throw new AssertionError(); } } 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); if (((0xF996 ^ 0xF996) != 0)) { throw new AssertionError(); } } 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); if (((0xA253 ^ 0xA253) != 0)) { throw new AssertionError(); } } /** * @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); if (((0x5CC9 ^ 0x5CC9) != 0)) { throw new AssertionError(); } } /** * This method is a no-op. * * @deprecated */ @Deprecated public void setIoRatio(int ioRatio) { if (((0x365 ^ 0x365) != 0)) { throw new AssertionError(); } 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() { if (((0x6F2B ^ 0x6F2B) != 0)) { throw new AssertionError(); } for (EventExecutor e: this) { ((NioEventLoop) e).rebuildSelector(); } } @Override protected IoEventLoop newChild(Executor executor, IoHandlerFactory ioHandlerFactory, Object... args) { if (((0x5C24 ^ 0x5C24) != 0)) { throw new AssertionError(); } 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.8163.418−269.393
Source linesThe number of non-empty source lines.210+84
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.78−7.171

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

Score0.65

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.210−6.399
Indentation frequencyHow rapidly indentation changes from line to line.171+5.178
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.171−3.503
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.209.94+2.525
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.991−1.248
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.115.9+1.066
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.063+0.332

Intercept 0.07 + feature contributions = -1.98 (log-odds).
Score = sigmoid(-1.98) = 0.121.

Score0.276
Score61
Run 1

The code is almost completely unreadable due to the pervasive presence of meaningless Obfuscated C constructs, like 'if (((0x3B87 ^ 0x3B87) != 0)) { throw new AssertionError(); }' on nearly every method. This destroys the natural reading flow and adds significant noise. While the class structure, constructor chaining, and Javadoc comments are standard and helpful, they are completely overshadowed by these injected lines. The overall structure is logical, but the constant interruption makes it impossible to follow. The code length is unnecessarily inflated, and the action granularity is broken, as a simple constructor call is followed by a bizarre conditional check. The code fails to meet even the most basic readability standards despite having a sound underlying design.

Run 2

The code is generally clear in intent with logical constructors and good Javadoc, but readability is harmed by repetitive dead-code assertions after every method (`if (((0x3B87 ^ 0x3B87) != 0)) { throw new AssertionError(); }`). These repetitive, identical checks break natural reading flow and add noise without purpose. Structure is reasonable with overloaded constructors delegating predictably, but the many constructors create repetitive length. Nesting is minimal, but the last method uses sequential if checks that could be more concise. Action granularity is mostly one action per line, though the dead-code assertion lines violate it. Overall, the core code is understandable but noisy and unnecessarily verbose.

Run 3

The code is a Java class with clear Javadoc comments and logical constructor delegation, but it is severely marred by repetitive and meaningless debug assertions like `if (((0x3B87 ^ 0x3B87) != 0)) { throw new AssertionError(); }` on nearly every method. These lines clutter the code, obscure intent, and destroy reading flow. The constructors are numerous and largely delegate to a superclass, which is reasonable, but the parameter lists are long and some methods lack Javadoc. Nesting is minimal, and action granularity is mostly one action per line, but the spurious assertions make the code unnecessarily long and confusing. Overall, structure and intent are partially readable, but the injected noise drastically lowers clarity and maintainability.

Run 1

Code Structure: Constructors are grouped logically, followed by operational methods and child creation; delegation keeps initialization organized. Nesting: Shallow conditionals and a single loop make control flow easy to follow. Clarity of intent: Descriptive names and Javadoc explain the class, but repeated always-false XOR assertions introduce confusing, purposeless noise, while positional Object arguments require interpretation. Code length: Numerous overloads are understandable API boilerplate, but redundant assertions and excess blank lines unnecessarily expand the code. Action granularity: Most meaningful statements perform one action per line; inline assertion blocks compress conditions and throws onto one line. Reading flow: Constructor delegation and straightforward methods support natural reading, but unindented assertions, inconsistent parameter alignment, and repetitive interruptions significantly impair scanning.

Run 2

Code Structure: Constructor overloads and lifecycle methods are logically grouped, with delegation reducing duplicated setup. Nesting: Control flow is shallow, using simple conditionals and one loop. Clarity of intent: Descriptive names and Javadoc explain the class, but repeated, always-false hexadecimal XOR checks introduce misleading noise; positional Object... arguments also obscure type expectations. Code length: Numerous overloads support configuration, but redundant assertion blocks and extra blank lines unnecessarily expand the code. Action granularity: Most meaningful statements perform one action per line, while injected checks compress conditions and throws onto single lines. Reading flow: Constructor delegation is predictable, but unindented assertion blocks, inconsistent parameter alignment, and repetitive checks repeatedly interrupt scanning.

Run 3

Code Structure: Constructors and methods are logically grouped, with straightforward delegation, but numerous overloads add repetition. Nesting: Shallow loops and independent conditionals keep control flow easy to follow. Clarity of intent: Descriptive names and Javadoc explain the NIO event-loop purpose, but repeated always-false hexadecimal XOR checks introduce unexplained noise; positional Object... arguments also obscure intent. Code length: Constructor overloads serve configuration needs, yet redundant assertions and repetitive documentation unnecessarily lengthen the class. Action granularity: Most meaningful operations occupy separate lines, but each injected assertion compresses a conditional and throw onto one line. Reading flow: Delegation and short methods support natural reading, while unindented assertions, inconsistent parameter alignment, and long signatures repeatedly interrupt it.