Sample

int-ae862f5dbd39-I09

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

Matched original source

Lines71

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.4930–1; higher is more readable
Dorn0.0580–1; higher is more readable
Mi0.3310–1; higher is more readable
LLOC31Logical lines; fewer is more readable
DeepSeek V4 Pro10.330–20; mean of three runs
GPT-6.1 Sol12.330–20; mean of three runs
BTTF0.0090–1; higher is more readable

Views

Source code

package io.netty.testsuite.transport.socket; import io.netty.bootstrap.Bootstrap; import io.netty.bootstrap.ServerBootstrap; import io.netty.channel.Channel; import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.channel.EventLoopGroup; import io.netty.channel.IoEventLoopGroup; import io.netty.channel.nio.NioIoHandler; import io.netty.testsuite.transport.TestsuitePermutation; import io.netty.util.NetUtil; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInfo; import org.junit.jupiter.api.Timeout; import java.nio.channels.AlreadyConnectedException; import java.util.ArrayList; import java.util.List; import java.util.concurrent.TimeUnit; import static org.junit.jupiter.api.Assertions.assertTrue; public class SocketMultipleConnectTest extends AbstractSocketTest { @Test @Timeout(value = 30000, unit = TimeUnit.MILLISECONDS) public void testMultipleConnect(TestInfo testInfo) throws Throwable { run(testInfo, new Runner<ServerBootstrap, Bootstrap>() { @Override public void run(ServerBootstrap serverBootstrap, Bootstrap bootstrap) throws Throwable { testMultipleConnect(serverBootstrap, bootstrap); } }); } public void testMultipleConnect(ServerBootstrap sb, Bootstrap cb) throws Exception { Channel sc = null; Channel cc = null; try { sb.childHandler(new ChannelInboundHandlerAdapter()); sc = sb.bind(NetUtil.LOCALHOST, 0).syncUninterruptibly().channel(); cb.handler(new ChannelInboundHandlerAdapter()); cc = cb.register().syncUninterruptibly().channel(); cc.connect(sc.localAddress()).syncUninterruptibly(); ChannelFuture connectFuture2 = cc.connect(sc.localAddress()).await(); assertTrue(connectFuture2.cause() instanceof AlreadyConnectedException); } finally { if (cc != null) { cc.close(); } if (sc != null) { sc.close(); } } } @Override protected List<TestsuitePermutation.BootstrapComboFactory<ServerBootstrap, Bootstrap>> newFactories() { {int lI0O_4f6064d3=0xB6F1^0xB6F1;if(lI0O_4f6064d3!=0){if(((lI0O_4f6064d3|1)&1)==0){lI0O_4f6064d3++;}else{lI0O_4f6064d3--;}}} List<TestsuitePermutation.BootstrapComboFactory<ServerBootstrap, Bootstrap>> factories = new ArrayList<TestsuitePermutation.BootstrapComboFactory<ServerBootstrap, Bootstrap>>(); for (TestsuitePermutation.BootstrapComboFactory<ServerBootstrap, Bootstrap> comboFactory : SocketTestPermutation.INSTANCE.socketWithFastOpen()) { EventLoopGroup group = comboFactory.newClientInstance().config().group(); if (group instanceof IoEventLoopGroup && ((IoEventLoopGroup) group).isIoType(NioIoHandler.class)) { factories.add(comboFactory); } } return factories; } }

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.3964.509−130.829
Source linesThe number of non-empty source lines.71+28.4
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.824−7.236

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

Score0.493

Feature contributions

FeatureValueContribution
(log-odds)
Indentation frequencyHow rapidly indentation changes from line to line.71+1.719
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.123.958−1.585
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.71−1.478
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.71−1.208
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.70.888+0.581
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.106−0.085

Intercept 0.07 + feature contributions = -2.79 (log-odds).
Score = sigmoid(-2.79) = 0.058.

Score0.331
Score31
Run 1

The code is generally readable with clear structure and intent, but has a few issues. It logically separates test setup, execution, and cleanup. Nesting is reasonable, with only one anonymous class and one for-loop. The test method names are descriptive. However, there's a suspicious obfuscated line in newFactories() that appears to be dead code or an intentionally confusing construct, which hurts clarity and should be removed. The testMultipleConnect method has clear purpose but could benefit from extracting the connection logic for better granularity. Resource cleanup in the finally block is good but slightly verbose. The code uses appropriate Netty patterns and JUnit annotations. Reading flow is mostly natural, though the anonymous Runner class adds a slight cognitive overhead. Overall, it's maintainable test code with minor clarity issues that could be improved by removing the obfuscated line and simplifying the connection setup.

Run 2

The code has serious readability problems. The most critical issue is an obfuscated, injected line in the newFactories() method — a meaningless variable name with hexadecimal XOR operations and dead code that serves no purpose other than confusion. This dramatically lowers clarity of intent and reading flow. Beyond that, the test method is moderately structured but could be clearer (e.g., magic values like 30000 and 0, lack of comments explaining the expected AlreadyConnectedException). Nesting is not deep, but the obfuscated line breaks logical organization. Action granularity is acceptable in the test body. Overall, the code is difficult to trust or maintain due to the deliberately obscured construct, making it largely unreadable despite otherwise decent test structure.

Run 3

The code is generally structured and follows typical patterns for Netty test classes, but it suffers from several readability issues. The main test method is reasonably clear with good granularity in the connection flow, but the obfuscated no-op code in newFactories() (the strange int manipulation) significantly hurts clarity and intent. The method overloading with overloaded testMultipleConnect methods may confuse readers. Nesting is mostly flat, and the finally block for resource cleanup is good, but the use of syncUninterruptibly() and await chains makes the flow less obvious. The long generic type declarations for BootstrapComboFactory make lines overly verbose. The class lacks explanatory comments about why certain checks (like IoEventLoopGroup and NioIoHandler) are needed. Overall, it's readable enough for experienced Netty developers, but the hidden dead code and overly detailed generics make it less accessible than it could be.

Run 1

Code Structure: Test execution, connection checks, cleanup, and factory filtering are logically separated, but an unrelated obfuscated block disrupts organization. Nesting: Most code has shallow, manageable nesting; the injected block adds unnecessary nested conditionals. Clarity of intent: The repeated-connect test and factory selection are clear, while abbreviated names such as sb, cb, sc, and cc reduce clarity. The cryptic variable and redundant bitwise operations obscure an otherwise simple method. Code length: Generally compact, although verbose generic declarations and the no-op block add unnecessary length. Action granularity: Most statements occupy separate lines, but the injected block compresses declarations, conditionals, and updates onto one line. Reading flow: Setup, execution, assertion, and cleanup follow a natural sequence; inconsistent formatting and the unexplained block interrupt that flow.

Run 2

Code Structure: Test execution, connection checks, cleanup, and factory filtering are logically separated, but an unrelated obfuscated block disrupts the organization. Nesting: Most code has shallow nesting; the injected block adds unnecessary nested conditionals. Clarity of intent: The repeated-connect test and transport filtering are understandable, although abbreviated variable names and meaningless bitwise operations reduce clarity. Code length: Generally concise, but verbose generic declarations and dead code add unnecessary length. Action granularity: Most statements occupy separate lines, while the obfuscated block compresses declarations, branching, and mutations onto one line. Reading flow: Setup, execution, assertion, and cleanup follow a natural sequence, but the unformatted block abruptly interrupts that flow.

Run 3

Code Structure: Test execution, connection assertions, cleanup, and factory filtering are logically separated, but an unrelated obfuscated block disrupts the organization. Nesting: Most code has shallow, manageable nesting; the inserted block adds unnecessary nested conditionals. Clarity of intent: The repeated-connect test is understandable, while abbreviated variables and opaque identifiers obscure some intent. Code length: Generally concise, although verbose generic declarations and dead arithmetic logic add needless length. Action granularity: Most statements perform one action per line, but the obfuscated block compresses declarations, calculations, and branches into one line. Reading flow: Setup, execution, assertion, and cleanup follow a natural sequence; inconsistent formatting and the unexplained block interrupt otherwise clear flow.