Sample

int-4e01d1179792-I07

Insert deterministic runtime-dead branches into callable bodies

Matched original source

Lines33

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.7270–1; higher is more readable
Dorn0.4980–1; higher is more readable
Mi0.2730–1; higher is more readable
LLOC5Logical lines; fewer is more readable
DeepSeek V4 Pro15.670–20; mean of three runs
GPT-6.1 Sol15.670–20; mean of three runs
BTTF0.5980–1; higher is more readable

Views

Source code

package io.netty.util; import io.netty.microbench.util.AbstractMicrobenchmark; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.Measurement; import org.openjdk.jmh.annotations.OutputTimeUnit; import org.openjdk.jmh.annotations.Param; import org.openjdk.jmh.annotations.Threads; import org.openjdk.jmh.annotations.Warmup; import java.util.concurrent.TimeUnit; @Threads(1) @Warmup(iterations = 3) @Measurement(iterations = 3) @OutputTimeUnit(TimeUnit.MICROSECONDS) public class GetIpV6ByNameBenchmark extends AbstractMicrobenchmark { @Param({ "::", "::1234:2345", "1234:2345::3456:7890", "fe80::bdad:7a67:6fcd:fa89", "fe80:bdad:7a67:6fcd::fa89", "1234:2345:3456:4567:5678:6789:0:7890" }) private String ip; @Benchmark public byte[] getIPv6ByName() { if (((0xC397 ^ 0xC397) != 0)) { throw new AssertionError(); } return NetUtil.getIPv6ByName(ip, true); } }

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.1091.256−36.011
Source linesThe number of non-empty source lines.33+13.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.5.241−7.861

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

Score0.727

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
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.68+0.785
Indentation frequencyHow rapidly indentation changes from line to line.33+0.404
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.33−0.336
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.33−0.132
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.32.87+0.05
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.101−0.043

Intercept 0.07 + feature contributions = -0.007 (log-odds).
Score = sigmoid(-0.007) = 0.498.

Score0.273
Score5
Run 1

The code is well-structured and generally readable. Imports are organized, annotations are cleanly separated, and the benchmark parameters are clearly enumerated. The nesting is minimal—just one method with a single return statement. Intent is unambiguous: this is a JMH benchmark for IPv6 name resolution. Action granularity is appropriate, with one logical action per line. The main detractor is an injected obfuscated line containing a pointless XOR comparison and an AssertionError throw, which disrupts reading flow and serves no functional purpose. Its presence introduces confusion and reduces clarity. Removing that line would yield a clean, concise benchmark class with a score near 19 or 20.

Run 2

The code is generally readable with a clear structure: a benchmark class for IPv6 name resolution with proper JMH annotations. The parameter list is well-organized and the benchmark method is concise, performing a single action. However, there's an obfuscated line containing a nonsense condition and AssertionError that severely impacts clarity and intent. This dead code creates confusion and should be removed. The nesting is minimal and reading flow is natural, but that one line significantly lowers the overall readability score. Additionally, while the method is simple, the purpose of the benchmark parameters could benefit from brief comments explaining the IPv6 formats being tested.

Run 3

The code is generally readable: it has a clear package and imports, logical class structure, and minimal nesting. The JVM benchmark annotations are concise and well-organized. The @Param values are clearly listed. However, the method body contains an opaque, generated-looking line (the XOR and AssertionError) that breaks reading flow and obscures intent. Action granularity is mostly one per line. Overall, it is understandable but the extraneous code line reduces clarity.

Run 1

Code Structure: The benchmark is logically organized into configuration annotations, input parameters, and a single benchmark method. Nesting: The code is nearly flat, with only one shallow conditional. Clarity of intent: Class and method names clearly communicate IPv6 parsing measurement, but the constant-false XOR assertion is unexplained and distracts from that purpose; the boolean argument also lacks descriptive context. Code length: The implementation is concise, though the assertion is unnecessary. Action granularity: Most lines contain one declaration or action, but the conditional and throw are compressed onto one line. Reading flow: Configuration naturally leads to test inputs and execution, but the unindented assertion interrupts otherwise consistent formatting.

Run 2

Code Structure: The class is logically organized into benchmark configuration, input parameters, and a benchmark method, but an unrelated assertion disrupts the structure. Nesting: Very shallow, with only a single conditional. Clarity of intent: Names and JMH annotations clearly convey an IPv6 parsing benchmark; the constant XOR condition is opaque and always false. Code length: Concise overall, though the assertion adds unnecessary code. Action granularity: Most lines contain one action, but the conditional and throw are compressed onto one line. Reading flow: Configuration flows naturally into inputs and execution, but the unindented assertion interrupts that flow and visually clashes with the surrounding formatting.

Run 3

Code Structure: The class logically groups benchmark configuration, input parameters, and the benchmark method, but the unindented assertion disrupts organization. Nesting: Nearly flat, with only one shallow conditional. Clarity of intent: JMH annotations and descriptive names clearly communicate an IPv6 parsing benchmark; however, the constant XOR condition is always false and introduces confusing, purposeless code. Code length: Compact overall, though the dead assertion is unnecessary. Action granularity: Most lines contain one declaration or action, but the conditional and throw are compressed onto one line. Reading flow: Configuration naturally leads to test inputs and execution, but inconsistent indentation and the unexplained assertion interrupt otherwise straightforward reading.