Sample

int-b9de794ceebc-I10

Remove about 40% of line-break groups while retaining structure

Matched original source

Lines18

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.7050–1; higher is more readable
Dorn0.2970–1; higher is more readable
Mi0.2160–1; higher is more readable
LLOC3Logical lines; fewer is more readable
DeepSeek V4 Pro9.330–20; mean of three runs
GPT-6.1 Sol12.670–20; mean of three runs
BTTF0.5920–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
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.246−7.868
Source linesThe number of non-empty source lines.18+7.2

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

Score0.705

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.19+0.364
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.92−0.232
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.17.914−0.159
Indentation frequencyHow rapidly indentation changes from line to line.18−0.115
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.18+0.008
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.096+0.005

Intercept 0.07 + feature contributions = -0.864 (log-odds).
Score = sigmoid(-0.864) = 0.297.

Score0.216
Score3
Run 1

The code is difficult to read due to extremely poor formatting and organization. Multiple imports and annotations are crammed onto single lines, violating the 'one action per line' principle and making the structure tangled and hard to follow. The class declaration mixes the benchmark setup with the parameter declaration, reducing clarity of intent. While the code could be concise, the current formatting makes it appear chaotic and unnecessarily hard to parse. The reading flow is broken by the inconsistent line breaks and dense grouping. The only positive aspects are the relatively short method body and the use of standard JMH annotations, but these are overshadowed by the formatting issues.

Run 2

The code is a JMH benchmark class with a logical structure (imports, annotations, field, benchmark method), but formatting severely hurts readability. Multiple annotations and imports are placed on the same line, violating one-action-per-line and making scanning difficult. The @Param array mixes single-line and multi-line entries, reducing clarity. Indentation is inconsistent, and the main method's return statement is compressed onto one line. While the purpose is reasonably clear (benchmarking IPv6 name resolution), the tangled formatting obscures intent and harms reading flow. The code is concise but at the cost of readability. Better line breaks and consistent formatting would significantly improve its score.

Run 3

The code demonstrates reasonable logical organization for a benchmark class, but suffers from poor formatting that obscures intent. The package structure and annotations are appropriate, yet multiple annotations and imports are crammed onto single lines, violating the 'one action per line' principle. The class declaration, field declaration, and method implementation share lines with other elements, making the code visually tangled and breaking natural reading flow. While the actual benchmark logic is simple and the parameter definitions are clear, the inconsistent indentation and lack of line breaks between logical sections (imports, annotations, class body) make it difficult to parse. The nesting itself is minimal and acceptable, but the compressed formatting creates artificial complexity. The method name and parameter list effectively communicate the benchmark's purpose, but the overall presentation undermines clarity. With normalized formatting and proper line breaks, this would be quite readable, but as presented it feels unnecessarily dense and disorganized.

Run 1

Code Structure: The imports, benchmark configuration, parameter field, and benchmark method follow a logical order, but cramped formatting obscures their boundaries. Nesting: Minimal nesting makes the code easy to understand. Clarity of intent: The class and method names, JMH annotations, and IPv6 examples clearly identify the benchmark's purpose. Code length: The code is concise without unnecessary logic, though excessive compression reduces readability. Action granularity: Multiple imports, annotations, declarations, and closing braces share lines, making individual elements harder to scan. Reading flow: The overall sequence is natural, but inconsistent line breaks and spacing interrupt it. Separating imports, annotations, fields, methods, and braces onto conventional lines would substantially improve readability.

Run 2

Code Structure: Imports, benchmark configuration, input parameters, and the benchmark method follow a logical order, but compressed formatting weakens separation. Nesting: Minimal nesting makes the code easy to understand. Clarity of intent: The class and method names, JMH annotations, and IPv6 inputs clearly identify a parameterized benchmark; the boolean argument's meaning is not explicit. Code length: The implementation is concise without unnecessary logic. Action granularity: Several imports, annotations, declarations, and braces share lines, reducing visual clarity despite the method performing only one action. Reading flow: The overall sequence is natural, but inconsistent line breaks and crowded declarations interrupt scanning.

Run 3

Code Structure: Imports, benchmark annotations, parameters, and the benchmark method are logically ordered, but compressed formatting obscures their boundaries. Nesting: Minimal nesting makes the code easy to follow. Clarity of intent: Descriptive class and method names, JMH annotations, and IPv6 inputs clearly convey the benchmark's purpose; the boolean argument's meaning is not explicit. Code length: Short and focused, with no unnecessary logic. Action granularity: Multiple imports, annotations, declarations, and braces share lines, reducing scanability. Reading flow: The overall sequence is natural, but inconsistent line breaks and crowded declarations interrupt reading.