Sample

int-1ac5e6bb9b7e-I11

Split eligible integer literals into pairs of short-named intermediate variables

Matched original source

Lines38

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.660–1; higher is more readable
Dorn0.7180–1; higher is more readable
Mi0.0760–1; higher is more readable
LLOC5Logical lines; fewer is more readable
DeepSeek V4 Pro170–20; mean of three runs
GPT-6.1 Sol180–20; mean of three runs
BTTF0.6390–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.38+15.2
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.553−6.83

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

Score0.66

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.111.974−1.078
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.112+1.003
Indentation frequencyHow rapidly indentation changes from line to line.37+0.543
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.39−0.345
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.074+0.222
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.37.92+0.12

Intercept 0.07 + feature contributions = 0.933 (log-odds).
Score = sigmoid(0.933) = 0.718.

Score0.076
Score5
Run 1

The code is well-structured and readable. It has a clear class hierarchy with a single inheritance from DnsQueryContext. The constructor is straightforward, with parameters clearly named and a concise super() call that uses a helpful comment to explain the null and false arguments. Methods are short and focused, each performing a single action. There is minimal nesting, with no conditional logic or loops. The code is concise and follows standard Java conventions. Minor deductions: the long constructor parameter list could be wrapped differently, and the 'protocol()' method is trivially simple. Overall, this code is easy to understand and maintain.

Run 2

The code demonstrates excellent readability through a simple, focused class with clear purpose. The constructor is well-structured with logical parameter ordering and a helpful comment explaining why retry is disabled for TCP. Method bodies are minimal and each performs a single clear action. The code is flat with no nesting, uses descriptive naming conventions, and imports only what's necessary. The one slight readability concern is the long constructor parameter list, though this is common in Netty-style APIs and is justified by the parent class design. Overall, the code is concise, well-organized, and immediately understandable.

Run 3

The code is well-structured and readable. It has a clear class hierarchy (TcpDnsQueryContext extends DnsQueryContext), flat nesting with no nested conditionals or loops, and each action is on its own line. The constructor delegates to the parent class with a clear comment explaining that TCP has no retry. Method names (newQuery, protocol) are descriptive and concise. The import list is complete but slightly long. The reading flow is natural: class declaration, constructor, then overridden methods. Minor deduction for the multi-line constructor parameter alignment and the somewhat long constructor signature, which could be slightly harder to scan, but overall it is highly readable.

Run 1

Code Structure: The class is logically organized into a constructor and two small overrides. Nesting: There is no nested control flow, making the code easy to scan. Clarity of intent: Descriptive class and method names clearly convey TCP DNS query behavior, and the comment explains the lack of TCP retry. However, the long positional superclass call, especially its null and false arguments, requires knowledge of the parent class. Code length: The implementation is concise, although unused imports add minor clutter. Action granularity: Each statement performs one clear action; wrapping the constructor call across lines does not obscure its operation. Reading flow: The constructor followed by query creation and protocol identification provides a natural progression. Dense constructor parameters and minimal spacing around the package and imports slightly reduce readability.

Run 2

Code Structure: Well-organized, focused subclass with a constructor and two small overrides; unused ChannelFuture and Future imports add minor clutter. Nesting: Flat, with no nested control flow. Clarity of intent: Class and method names clearly convey TCP DNS behavior, and the comment explains the absence of retries; the long superclass argument list and literal null/false arguments obscure some configuration details. Code length: Concise, with minimal implementation overhead. Action granularity: Each statement performs one action, although the constructor call bundles many configuration values. Reading flow: Natural progression from initialization to query creation and protocol identification; tightly grouped imports and the lengthy constructor signature slightly reduce scanning ease.

Run 3

Code Structure: A small, logically organized subclass separates construction, query creation, and protocol identification. Nesting: No nested control flow, making the code easy to scan. Clarity of intent: Descriptive class and method names, overrides, and the TCP retry comment communicate purpose; the long superclass argument list and literal null/false values slightly obscure configuration. Code length: Concise overall, though unused ChannelFuture and Future imports add clutter. Action granularity: Each method performs one clear action; multiline constructor arguments remain a single understandable operation. Reading flow: Natural progression from initialization to behavior, with consistent indentation. Grouped constructor parameters and the dense superclass call require slightly more attention.