Sample

int-b359886d98b4-I06

Invert eligible conditions and exchange their branches

Matched original source

Lines31

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.8180–1; higher is more readable
Dorn0.5410–1; higher is more readable
Mi0.260–1; higher is more readable
LLOC3Logical lines; fewer is more readable
DeepSeek V4 Pro17.330–20; mean of three runs
GPT-6.1 Sol190–20; mean of three runs
BTTF0.6950–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() { 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.923.471−30.475
Source linesThe number of non-empty source lines.31+12.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.5.188−7.782

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

Score0.818

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.67.875+0.79
Indentation frequencyHow rapidly indentation changes from line to line.31+0.335
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.31−0.291
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.094+0.032
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.30.928+0.022
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.29+0.01

Intercept 0.07 + feature contributions = 0.165 (log-odds).
Score = sigmoid(0.165) = 0.541.

Score0.26
Score3
Run 1

This code is highly readable. It follows a clear, logical structure: package and imports first, then class-level annotations, then the benchmark parameter and method. Nesting is minimal and the code is flat. The intent is immediately clear — benchmarking NetUtil.getIPv6ByName with various IPv6 addresses. The code is concise, with no unnecessary boilerplate. Each annotation is on its own line, and the benchmark method is a single, straightforward action. The reading flow is natural, moving from setup (threads, warmup, measurement) to parameterized inputs to the benchmark logic. The only minor drawback is the long list of @Param values, but it is well-formatted and easy to scan.

Run 2

The code is well-structured with clear separation of annotations, class declaration, field, and benchmark method. Annotations are logically organized and the parameter list is readable. Nesting is flat, and intent is clear: benchmarking NetUtil.getIPv6ByName for various IPv6 addresses. The code is concise with no unnecessary lengh. However, the param list could be slightly more readable if moved to a separate constant or formatted differently, but overall action granularity and reading flow are natural. The single import of AbstractMicrobenchmark and clean method body contribute to strong readability.

Run 3

The code is highly readable with a clear, logical structure. It follows standard microbenchmark conventions with annotations and class inheritance that are easy to understand. The nesting is flat—no conditionals or loops. The intent of the class and method is obvious: it benchmarks IPv6 name resolution. Code length is appropriate and concise, with no redundancy. Each annotation, field, and method call is on its own line, maintaining one-action-per-line granularity. The reading flow is natural, moving from class declaration to annotations, then parameter field, then benchmark method. Minor deductions: the import statement is not separated from the package declaration by a blank line, and some might find the multiple annotations slightly verbose, but these are negligible style issues.

Run 1

1. Code Structure: Imports, benchmark configuration, input parameters, and the benchmark method are logically organized. 2. Nesting: Minimal nesting and no conditional branches make the code easy to scan. 3. Clarity of intent: The class name, method name, and JMH annotations clearly identify an IPv6 parsing benchmark; however, the literal true argument does not explain its meaning. 4. Code length: Concise, with no unnecessary implementation or repetition. 5. Action granularity: Each annotation, declaration, and operation occupies a distinct line, and the method performs a single action. 6. Reading flow: Configuration naturally precedes test inputs and execution. A blank line after the package declaration and clearer import grouping would slightly improve presentation.

Run 2

Code Structure: Imports, benchmark configuration, input parameters, and the benchmark method are logically organized. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: Descriptive class and method names, JMH annotations, and representative IPv6 inputs clearly communicate the benchmark's purpose; the boolean argument 'true' is not self-explanatory. Code length: Concise, with no unnecessary logic. Action granularity: Each declaration and the single return operation are clearly separated. Reading flow: Configuration naturally leads into inputs and execution, although blank lines separating the package and import groups would improve visual organization.

Run 3

Code Structure: Clean organization separates imports, benchmark configuration, parameter values, and the benchmark method. Nesting: Minimal nesting, with no conditional or loop complexity. Clarity of intent: Class and method names clearly identify an IPv6 parsing benchmark; annotations make its configuration explicit. The unnamed boolean argument 'true' is the only notable ambiguity. Code length: Concise, with no unnecessary logic or boilerplate. Action granularity: Each declaration and operation occupies its own line, and the benchmark performs a single action. Reading flow: Natural progression from configuration to inputs to execution; a blank line after the package declaration and clearer import grouping would slightly improve presentation.