Sample

int-ae3147395a40-I03

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

Matched original source

Lines31

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.8450–1; higher is more readable
Dorn0.5410–1; higher is more readable
Mi0.2610–1; higher is more readable
LLOC3Logical lines; fewer is more readable
DeepSeek V4 Pro17.330–20; mean of three runs
GPT-6.1 Sol17.670–20; mean of three runs
BTTF0.6630–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[] createAccount() { 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.927.923−30.621
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.17−7.756

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

Score0.845

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.261
Score3
Run 1

The code is generally well-structured and readable. It uses clear annotations for benchmarking, keeps the class cohesive, and has a straightforward benchmark method. The parameter list is concise though could benefit from spacing or comments for readability. The method name 'createAccount' is misleading — it actually performs an IPv6 lookup, which reduces clarity of intent. Overall, the code is flat, concise, and follows consistent formatting, but the naming inconsistency and dense parameter list slightly reduce readability.

Run 2

The code is well-structured and highly readable. Imports are organized, and annotations clearly define JMH benchmark parameters. The class has a single responsibility with a clean, flat structure. The @Param list provides real-world IPv6 examples, improving clarity. The benchmark method is concise, with one clear action per line. Minor deductions: the method name 'createAccount' is misleading—it doesn't create an account but resolves an IPv6 address. Additionally, the benchmark method could use a more descriptive name like 'resolveIpv6Address'. Overall, the code demonstrates excellent clarity, minimal nesting, and logical flow.

Run 3

The code is highly readable due to its clean, flat structure and clear intent. The class is logically organized: imports are standard, annotations are concise, and the benchmark method is singular and focused. Nesting is minimal—no conditional or loop structures—contributing to a natural top-to-bottom reading flow. Action granularity is appropriate, with one meaningful operation per line. The method name `createAccount` is slightly misleading given its actual operation (`getIPv6ByName`), which slightly obscures intent. Code length is minimal and avoids unnecessary boilerplate. Overall, the code is concise, well-structured, and easy to understand with only a minor naming ambiguity.

Run 1

Code Structure: Imports, benchmark configuration, input parameters, and benchmark method are logically organized. Nesting: The code is flat, with no nested control flow. Clarity of intent: The class name, annotations, and IPv6 inputs clearly indicate an IPv6 parsing benchmark, but createAccount() misleadingly suggests account creation, and the boolean argument true lacks an explanation. Code length: The implementation is concise without unnecessary logic. Action granularity: Each annotation, declaration, and operation is clearly separated, with only one operation in the method. Reading flow: Configuration naturally leads to test inputs and execution, although a blank line after the package declaration and clearer import grouping would improve presentation.

Run 2

Code Structure: A logically organized benchmark class with configuration annotations, input parameters, and a single benchmark method. Nesting: Flat and easy to scan, with no nested control flow. Clarity of intent: The class name, annotations, and IPv6 inputs clearly establish the purpose, but createAccount is misleading for an IPv6 parsing benchmark, and the boolean argument true does not explain its meaning. Code length: Concise, with no unnecessary implementation. Action granularity: The method performs one clear operation in a single return statement. Reading flow: Configuration naturally precedes inputs and execution; import grouping and a blank line after the package declaration would slightly improve presentation.

Run 3

Code Structure: Logically organized into imports, benchmark configuration, input parameters, and a single benchmark method. Nesting: Flat and easy to follow, with no nested control flow. Clarity of intent: The class name, JMH annotations, and IPv6 inputs clearly indicate a parsing benchmark, but the method name createAccount is misleading, and the boolean argument true does not explain its purpose. Code length: Concise, with no unnecessary implementation detail. Action granularity: Each annotation, declaration, and operation is cleanly separated; the method performs one action. Reading flow: Natural top-to-bottom progression, though blank lines separating the package and import groups would improve formatting.