Sample

int-fbe098c4f5f2-I05

Rewrite eligible decimal integer literals in hexadecimal notation

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 Pro16.330–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 is generally well-structured and readable. It has a clear class purpose, minimal nesting, and concise methods. The constructor uses a flat parameter list, though it is somewhat long, which slightly impacts readability. Intent is clear from method names and the single comment explaining TCP retry absence. Action granularity is good with one logical action per line. However, the long constructor and lengthy parameter list reduce readability slightly, and the import block is not shown, potentially affecting overall organization. Overall, the code is straightforward and maintainable.

Run 3

The code is well-structured and readable. It clearly extends DnsQueryContext with a focused TCP-specific implementation. The constructor cleanly delegates to the superclass with minimal parameters, and the comment explaining the null retry configuration adds clarity. Methods are concise with single responsibilities: newQuery creates a query, protocol returns the protocol name. Nesting is absent, and each action is on its own line, following natural reading flow. The only minor deduction is the slightly long constructor parameter list inherited from the parent class, but this is handled cleanly through delegation. Overall, the code is highly maintainable and self-documenting.

Run 1

Code Structure: Logically organized as a small protocol-specific subclass with a constructor and two focused overrides. Nesting: Flat, with no nested control flow. Clarity of intent: Descriptive class and method names clearly indicate TCP DNS behavior; the comment explains the lack of TCP retry. However, the long constructor signature and positional null/false arguments make superclass configuration less immediately clear. Code length: Concise, with minimal implementation, though unused ChannelFuture and Future imports add clutter. Action granularity: Each method performs a single action, without multiple statements per line. Reading flow: Natural progression from initialization to query creation and protocol identification; wrapped constructor arguments slightly slow scanning.

Run 2

Code Structure: A compact class with a constructor and two clearly separated overrides provides logical organization. Nesting: No nested control flow makes the code easy to scan. Clarity of intent: Descriptive class and method names communicate TCP DNS query behavior, and the comment explains the lack of retries. However, the long constructor and positional null/false arguments require superclass knowledge. Code length: Concise, though unused ChannelFuture and Future imports add minor clutter. Action granularity: Each statement performs one action; grouping some constructor parameters on single lines slightly reduces scanability. Reading flow: The constructor followed by query creation and protocol identification is natural, with consistent indentation and spacing.

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; however, the long constructor and positional null/false arguments require superclass knowledge. Code length: Concise, with minimal implementation, though unused ChannelFuture and Future imports add clutter. Action granularity: Each statement performs one action; grouped constructor parameters slightly reduce scanability. Reading flow: Natural progression from initialization to behavior, with consistent indentation and spacing, although the lengthy superclass call interrupts otherwise straightforward reading.