Sample

int-47f51b432d78-I10

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

Matched original source

Lines24

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.6190–1; higher is more readable
Dorn0.1170–1; higher is more readable
Mi0.0020–1; higher is more readable
LLOC5Logical lines; fewer is more readable
DeepSeek V4 Pro8.670–20; mean of three runs
GPT-6.1 Sol12.670–20; mean of three runs
BTTF0.4610–1; higher is more readable

Views

Source code

package io.netty.resolver.dns; import io.netty.channel.AddressedEnvelope; import io.netty.channel.Channel; import io.netty.channel.ChannelFuture; import io.netty.handler.codec.dns.DefaultDnsQuery; import io.netty.handler.codec.dns.DnsQuery; import io.netty.handler.codec.dns.DnsQuestion; import io.netty.handler.codec.dns.DnsRecord; import io.netty.handler.codec.dns.DnsResponse; import io.netty.util.concurrent.Future; import io.netty.util.concurrent.Promise; import java.net.InetSocketAddress; final class TcpDnsQueryContext extends DnsQueryContext { TcpDnsQueryContext(Channel channel, InetSocketAddress nameServerAddr, DnsQueryContextManager queryContextManager, DnsQueryLifecycleObserver lifecycleObserver, int maxPayLoadSize, boolean recursionDesired, long queryTimeoutMillis, DnsQuestion question, DnsRecord[] additionals, Promise<AddressedEnvelope<DnsResponse, InetSocketAddress>> promise) { super(channel, nameServerAddr, queryContextManager, lifecycleObserver, maxPayLoadSize, recursionDesired, // No retry via TCP. queryTimeoutMillis, question, additionals, promise, null, false); } @Override protected DnsQuery newQuery(int id, InetSocketAddress nameServerAddr) { return new DefaultDnsQuery(id); } @Override protected String protocol() { return "TCP"; } }

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.1438.566−47.473
Source linesThe number of non-empty source lines.24+9.6
Byte entropyHow varied the bytes in the source text are. Repeated bytes give a lower value; a more even mixture gives a higher value.4.638−6.958

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

Score0.619

Feature contributions

FeatureValueContribution
(log-odds)
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.219−5.611
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.219+2.729
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.23+0.222
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.078+0.189
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.23.855−0.076
Indentation frequencyHow rapidly indentation changes from line to line.23+0.058

Intercept 0.07 + feature contributions = -2.021 (log-odds).
Score = sigmoid(-2.021) = 0.117.

Score0.002
Score5
Run 1

The code is functionally concise and mostly flat, with clear class and method names, but its readability is undermined by several factors. The package and imports are crammed onto a single line, violating one-action-per-line and making the header difficult to scan. The super constructor call breaks unnaturally across lines, with a dangling comment on its own line. Parameter alignment is inconsistent, and the long parameter list hurts clarity of intent. While the class structure is logical and simple, the formatting inconsistencies and dense packaging lower overall readability for typical Java conventions.

Run 2

The code is partially readable but suffers from several structural issues. The imports are crammed onto a few lines, making them hard to scan. The constructor has a long parameter list with inconsistent formatting and a trailing comment that is awkwardly placed. The method definitions are simple but the overall flow is disrupted by poor indentation and spacing. Nesting is minimal, but clarity of intent is hampered by the formatting. Action granularity is okay, but code length and structure could be improved. The class appears to be a simple extension of a base class, but the presentation obscures this.

Run 3

The code suffers from severe readability issues. The package declaration and imports are crammed on single lines, making them difficult to scan. The constructor has an extremely long parameter list with inconsistent line breaks, including a comment placed awkwardly mid-call. The super() call is similarly tangled. While the class has a simple logical structure and relatively flat nesting, the formatting damages clarity. The two overridden methods are concise and clear, but they cannot compensate for the constructor's poor layout. Overall, the intent is understandable but the physical presentation significantly hurts readability.

Run 1

Code Structure: The class is logically organized into a constructor and two small overrides, but compressed imports and adjacent declarations obscure boundaries. Nesting: Minimal nesting makes the implementation easy to follow. Clarity of intent: Descriptive class and method names clearly convey a TCP DNS query context; the no-retry comment helps explain constructor behavior, though positional arguments and boolean literals require superclass knowledge. Code length: Concise, with no unnecessary logic, although the long constructor signature is visually dense. Action granularity: Method bodies use one action per line, but several imports, the package declaration, and class or annotation boundaries share lines. Reading flow: The simple constructor-to-overrides progression is natural, but inconsistent line breaks and the constructor closing brace sharing a line with @Override interrupt scanning.

Run 2

Code Structure: The class is logically organized into a constructor and two small overrides, but compressed imports and adjacent declarations obscure boundaries. Nesting: Minimal nesting makes the implementation easy to follow. Clarity of intent: Descriptive class and method names clearly identify a TCP DNS query context; the no-retry comment clarifies constructor behavior, although the long superclass argument list requires extra attention. Code length: The implementation is concise without unnecessary logic. Action granularity: Method bodies generally contain one action per line, but multiple imports share lines, and the constructor closing brace is combined with an annotation. Reading flow: The methods follow a natural order, but inconsistent line wrapping and cramped formatting interrupt scanning.

Run 3

Code Structure: The class is logically organized into a constructor and two focused overrides, but compressed imports and declaration boundaries obscure that structure. Nesting: Minimal nesting makes the implementation easy to follow. Clarity of intent: Descriptive class and method names, straightforward return values, and the TCP retry comment communicate purpose; the long superclass argument list and positional null/false arguments are less clear. Code length: The implementation is concise without unnecessary logic, although the constructor signature is lengthy. Action granularity: Method bodies contain single actions, but multiple imports, the package declaration, and closing braces/annotations share lines. Reading flow: The functional sequence is natural, but inconsistent wrapping and crowded formatting repeatedly interrupt scanning.