Sample

int-fcd113470966-I05

Rewrite eligible decimal integer literals in hexadecimal notation

Matched original source

Lines31

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.8180–1; higher is more readable
Dorn0.5430–1; higher is more readable
Mi0.2630–1; higher is more readable
LLOC3Logical lines; fewer is more readable
DeepSeek V4 Pro17.330–20; mean of three runs
GPT-6.1 Sol180–20; mean of three runs
BTTF0.6080–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(0x1) @Warmup(iterations = 0x3) @Measurement(iterations = 0x3) @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.945.107−31.189
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.206−7.809

Intercept 8.87 + feature contributions = -17.727 (log-odds).
Score = sigmoid(-17.727) = 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.093+0.039
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.30.913+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.171 (log-odds).
Score = sigmoid(0.171) = 0.543.

Score0.263
Score3
Run 1

The code is well-structured and readable. Package declaration and imports are organized, though import ordering could be slightly improved. Annotations are placed logically at the class level, keeping the class body clean. Nesting is minimal—only one method with a single return statement. The benchmark method name and parameter names clearly convey intent. The parameter list for IP addresses is formatted clearly, one per line, enhancing readability. Code length is concise without unnecessary boilerplate. Each action is on its own line, respecting granularity. Reading flow is natural, moving from annotations to fields to methods. Minor drawbacks: use of hex literals (0x1, 0x3) is slightly unusual for JMH annotations, and missing spaces in some IPv6 addresses reduce readability slightly. Overall, the code is highly readable and maintainable.

Run 2

The code is clean and well-structured. It clearly separates annotations, class declaration, parameter declaration, and benchmark method. Nesting is minimal, with only one method and no conditional blocks. The intent is unambiguous: benchmark NetUtil.getIPv6ByName for various IPv6 inputs. The code is concise, avoiding unnecessary boilerplate. Each action (annotation, field declaration, method return) is on its own line, aiding readability. The reading flow is natural: package, imports, annotations, class, field, method. Minor deductions: use of hexadecimal literals like 0x1 and 0x3 for thread and iteration counts is slightly less intuitive than decimal values, and the long @Param list slightly reduces scannability, but overall readability is high.

Run 3

The code is highly readable: imports are organized, annotations clearly configure the benchmark, and the class structure is straightforward. The @Param array cleanly lists test cases, and the benchmark method is concise with a single clear action. Minor deductions for use of hex literals in annotations (0x1, 0x3), which slightly obscure intent, and lack of javadoc, but overall clarity and structure are excellent.

Run 1

Code Structure: Logically organized into imports, benchmark configuration, input parameters, and a single benchmark method. Nesting: Minimal, with no nested control flow. Clarity of intent: Class and method names clearly identify an IPv6 parsing benchmark; however, the boolean argument 'true' does not explain its purpose, and hexadecimal annotation values are unnecessarily unconventional. Code length: Short and focused, with no redundant logic. Action granularity: Each import, declaration, and operation occupies its own line; the method performs one clear action. Reading flow: Natural top-to-bottom progression, though blank lines separating the package declaration and import groups would improve presentation.

Run 2

Code Structure: A well-organized benchmark class cleanly separates configuration, input parameters, and the benchmark method. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: The class name, method name, and JMH annotations clearly convey IPv6 parsing performance measurement; however, the boolean argument true is unexplained, and hexadecimal annotation values obscure ordinary counts slightly. Code length: Concise, with no unnecessary logic or repetition. Action granularity: Each declaration and statement serves a single purpose, and input values appear on separate lines. Reading flow: Configuration naturally leads to test inputs and then execution. A blank line after the package declaration and clearer import grouping would improve presentation.

Run 3

Code Structure: Imports, benchmark configuration, input parameters, and the benchmark method are logically organized. Nesting: The code is flat, with no nested control flow. Clarity of intent: Class and method names clearly identify an IPv6 parsing benchmark, and the parameter list exposes representative inputs. However, the boolean argument true is unexplained, and hexadecimal annotation values obscure simple counts. Code length: The implementation is concise without unnecessary logic. Action granularity: Each import, annotation, input value, and return statement occupies its own line. Reading flow: Configuration naturally leads to test data and execution; a blank line after the package declaration and clearer import grouping would improve visual separation.