Sample

int-b805bf41c38f-I01

Remove line comments, block comments, and Javadoc

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

The code is highly readable. It uses a clear class name and follows a logical structure: imports, annotations, class declaration, parameter field, and benchmark method. Nesting is minimal and flat, with no complex control flow. The intent of the code is evident—a JMH benchmark for IPv6 name resolution using Netty’s NetUtil. Code length is concise and appropriate for a single benchmark. Action granularity is well-maintained; each line performs one logical step, such as importing, annotating, or returning a result. Reading flow is natural from top to bottom. Minor deductions stem from the repetitive import block and slightly dense annotation cluster, which could be grouped or documented, but overall the code is clear and purposeful.

Run 2

The code is highly readable. It has a clear structure with imports, annotations, and a single benchmark method. Nesting is minimal, consisting of simple annotation and class-level blocks. The purpose—benchmarking IPv6 name resolution—is immediately evident. The parametrized IP addresses are logically grouped and clearly formatted. The action granularity is excellent, with one meaningful operation per line, and the reading flow follows a natural progression from setup to execution. The only minor deductions are for the multiple import statements and annotations, which add slight visual overhead but are standard for JMH benchmarks.

Run 3

The code is highly readable with clear structure and intent. It has a flat, straightforward design with minimal nesting. The benchmark class is concise, with one method performing a single action. Annotations are organized logically at the top, and the parameterized test data is clearly listed. The only minor deductions are for the import order (java import appears after Netty imports) and the slight coupling between the parameter name 'ip' and the method call, which could be slightly more explicit. Overall, the code is clean, easy to follow, and follows good practices for a microbenchmark.

Run 1

1. Code Structure: Imports, benchmark configuration, input parameters, and the benchmark method are logically organized. 2. Nesting: Minimal nesting makes the code easy to scan. 3. Clarity of intent: Descriptive class and method names clearly identify an IPv6 parsing benchmark; the unexplained boolean argument slightly reduces clarity. 4. Code length: Concise, with no unnecessary implementation detail. 5. Action granularity: Each annotation, parameter value, and statement occupies its own line. 6. Reading flow: Configuration flows naturally into 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: The class and method names clearly identify an IPv6 parsing benchmark; annotations explain its configuration, though the boolean argument 'true' is not self-explanatory. Code length: Concise, with no unnecessary logic or repetition. Action granularity: Each annotation, declaration, and operation occupies a separate line. Reading flow: Configuration leads naturally into test inputs and the measured operation. Minor formatting improvements, such as separating the package declaration from imports and grouping imports consistently, would improve readability.

Run 3

Code Structure: Logically organized into imports, benchmark configuration, input parameters, and a single benchmark method. Nesting: Flat, with no nested control flow. Clarity of intent: Class and method names clearly identify the IPv6 parsing benchmark; annotations make its configuration explicit, though the boolean argument 'true' does not explain its purpose. Code length: Concise, with no unnecessary implementation or repetition. Action granularity: Each declaration and operation occupies its own line, and the method performs one clear action. Reading flow: Natural top-to-bottom progression from setup to execution; a blank line after the package declaration and clearer import grouping would slightly improve formatting.