Sample

int-21f50743fef1-I03

Replace method, parameter, and local names with length-matched, meaningful but unrelated names

Matched original source

Lines69

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.4150–1; higher is more readable
Dorn0.10–1; higher is more readable
Mi0.2810–1; higher is more readable
LLOC26Logical lines; fewer is more readable
DeepSeek V4 Pro7.670–20; mean of three runs
GPT-6.1 Sol120–20; mean of three runs
BTTF0.3780–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 validateAddress(TestInfo nextNode) throws Throwable { add(nextNode, new Runner<ServerBootstrap, Bootstrap>() { @Override public void add(ServerBootstrap currentSession, Bootstrap backupKey) throws Throwable { validateAddress(currentSession, backupKey); } }); } public void validateAddress(ServerBootstrap age, Bootstrap key) throws Exception { Channel map = null; Channel size = null; try { age.childHandler(new ChannelInboundHandlerAdapter()); map = age.bind(NetUtil.LOCALHOST, 0).syncUninterruptibly().channel(); key.handler(new ChannelInboundHandlerAdapter()); size = key.register().syncUninterruptibly().channel(); size.connect(map.localAddress()).syncUninterruptibly(); ChannelFuture pendingBalance = size.connect(map.localAddress()).await(); assertTrue(pendingBalance.cause() instanceof AlreadyConnectedException); } finally { if (size != null) { size.close(); } if (map != null) { map.close(); } } } @Override protected List<TestsuitePermutation.BootstrapComboFactory<ServerBootstrap, Bootstrap>> fetchBalance() { List<TestsuitePermutation.BootstrapComboFactory<ServerBootstrap, Bootstrap>> localMode = new ArrayList<TestsuitePermutation.BootstrapComboFactory<ServerBootstrap, Bootstrap>>(); for (TestsuitePermutation.BootstrapComboFactory<ServerBootstrap, Bootstrap> backupWindow : SocketTestPermutation.INSTANCE.socketWithFastOpen()) { EventLoopGroup cache = backupWindow.newClientInstance().config().group(); if (cache instanceof IoEventLoopGroup && ((IoEventLoopGroup) cache).isIoType(NioIoHandler.class)) { localMode.add(backupWindow); } } return localMode; } }

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.3573.777−117.935
Source linesThe number of non-empty source lines.69+27.6
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.732−7.098

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

Score0.415

Feature contributions

FeatureValueContribution
(log-odds)
Indentation frequencyHow rapidly indentation changes from line to line.69+1.65
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.70−1.442
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.69−1.163
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.110.957−1.035
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.68.866+0.553
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.099−0.023

Intercept 0.07 + feature contributions = -2.194 (log-odds).
Score = sigmoid(-2.194) = 0.1.

Score0.281
Score26
Run 1

The code has severe readability issues. Variable names are misleading and unrelated to their purpose (e.g., 'map' and 'size' for channels, 'age' and 'key' for server/client bootstraps, 'pendingBalance' for a ChannelFuture, 'backupWindow' and 'cache' for bootstrap factories and event loops). Method names like 'validateAddress' don't match their actual function of testing connection behavior. The 'add' method name is overloaded ambiguously. There's no clear separation between test setup, execution, and verification. The nested anonymous inner class adds complexity. While the code is relatively flat with limited nesting depth and concise line length, the deceptive naming and unclear intent make it difficult to understand what the code actually does without careful analysis of each line.

Run 2

The code has poor readability due to confusing variable names that obscure intent: 'age' for ServerBootstrap, 'key' for Bootstrap, 'map' and 'size' for channels, 'pendingBalance' for a ChannelFuture, and 'fetchBalance' for a test permutation method. These names make the logic hard to follow. The structure is somewhat disorganized—multiple operations are chained on single lines, and the try/finally block mixes setup and execution. While nesting is shallow and imports are organized, the reading flow is disrupted by the semantic mismatch between names and their actual roles. Action granularity is moderate but inconsistent. The method 'add' in the inner Runner is poorly named and adds confusion. Overall, the code requires significant mental effort to understand what it actually does.

Run 3

The code has reasonable structure (test class with setup methods) but suffers from poor naming that obscures intent. Variable names like 'map', 'size', 'age', 'key', 'currentSession', 'backupKey', 'pendingBalance', 'backupWindow', 'cache', and 'fetchBalance' appear to be obfuscated or machine-renamed, making the logic extremely difficult to follow. Method names like 'validateAddress' and 'fetchBalance' do not match their actual behavior. Nesting is moderate (two levels in the test method, one in the loop). Action granularity is acceptable, with mostly one operation per line. Reading flow is severely compromised by the misleading identifiers, forcing the reader to reverse-engineer the meaning of each variable from context. The code is concise but at the cost of clarity. Without the confusing names, this would be a straightforward socket test; as written, it is unnecessarily opaque.

Run 1

Code Structure: Methods separate test setup, connection verification, and bootstrap filtering logically. Nesting: Mostly shallow, with manageable try/finally blocks, null checks, and a loop containing one condition. Clarity of intent: The AlreadyConnectedException assertion makes the test purpose discoverable, but misleading names such as validateAddress, age, key, map, size, and fetchBalance obscure roles and behavior. Code length: Reasonably compact, though the anonymous runner and repeated generic types add verbosity. Action granularity: Statements generally occupy separate lines, but chained calls combine configuration, synchronization, and channel retrieval. Reading flow: Setup, execution, assertion, and cleanup follow a natural order; however, unrelated naming and dense generic declarations interrupt comprehension.

Run 2

Code Structure: Methods logically separate test dispatch, connection validation, and bootstrap filtering, with reliable cleanup in finally. Nesting: Mostly shallow; the anonymous runner and loop conditional add modest complexity. Clarity of intent: The assertion clearly tests rejection of a second connection, but misleading names such as validateAddress, age, key, map, size, fetchBalance, and pendingBalance obscure roles and purpose. Code length: Reasonably concise, although verbose generic declarations and anonymous-class boilerplate increase visual weight. Action granularity: Most lines perform one operation, but chained asynchronous calls combine several steps. Reading flow: Setup, execution, assertion, and cleanup follow a natural sequence; ambiguous identifiers, dense imports, and long generic signatures interrupt comprehension.

Run 3

Code Structure: Methods logically separate test execution, connection validation, cleanup, and bootstrap filtering. Nesting: Mostly shallow, with manageable try/finally blocks, null checks, and a loop condition; the anonymous runner adds some complexity. Clarity of intent: The class name and AlreadyConnectedException assertion convey the test purpose, but misleading names such as age, key, map, size, pendingBalance, and fetchBalance significantly obscure roles. Code length: Reasonably compact, although repeated generic types and anonymous-class boilerplate add visual weight. Action granularity: Most statements perform one logical action; chained asynchronous calls are conventional but require careful reading. Reading flow: Setup, first connection, repeated connection, assertion, and cleanup follow naturally. However, inconsistent naming and a dense type-check condition interrupt comprehension.