Sample

int-2dd0377da942-I06

Invert eligible conditions and exchange their branches

Matched original source

Lines51

Scores

MethodScoreScale
Posnett10–1; higher is more readable
Scalabrino0.9720–1; higher is more readable
Dorn0.6840–1; higher is more readable
Mi0.370–1; higher is more readable
LLOC9Logical lines; fewer is more readable
DeepSeek V4 Pro18.330–20; mean of three runs
GPT-6.1 Sol18.670–20; mean of three runs
BTTF0.7610–1; higher is more readable

Views

Source code

package io.netty.handler.codec.http3; /** * State of encoding or decoding for a stream following the <a * href="https://quicwg.org/base-drafts/draft-ietf-quic-http.html#name-http-message-exchanges"> * HTTP message exchange semantics</a> */ interface Http3RequestStreamCodecState { /** * An implementation of {@link Http3RequestStreamCodecState} that managed no state. */ Http3RequestStreamCodecState NO_STATE = new Http3RequestStreamCodecState() { @Override public boolean started() { return false; } @Override public boolean receivedFinalHeaders() { return false; } @Override public boolean terminated() { return false; } }; /** * If any {@link Http3HeadersFrame} or {@link Http3DataFrame} has been received/sent on this stream. * * @return {@code true} if any {@link Http3HeadersFrame} or {@link Http3DataFrame} has been received/sent on this * stream. */ boolean started(); /** * If a final {@link Http3HeadersFrame} has been received/sent before {@link Http3DataFrame} starts. * * @return {@code true} if a final {@link Http3HeadersFrame} has been received/sent before {@link Http3DataFrame} * starts */ boolean receivedFinalHeaders(); /** * If no more frames are expected on this stream. * * @return {@code true} if no more frames are expected on this stream. */ boolean terminated(); }

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(log-odds)
Source linesThe number of non-empty source lines.51+20.4
Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones.339.002−11.187
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.52−6.78

Intercept 8.87 + feature contributions = 11.303 (log-odds).
Score = sigmoid(11.303) = 1.

Score0.972

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.116.981−1.29
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.116.962+1.083
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.52−0.805
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.027+0.682
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
Indentation frequencyHow rapidly indentation changes from line to line.31+0.335
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.50.864+0.301

Intercept 0.07 + feature contributions = 0.774 (log-odds).
Score = sigmoid(0.774) = 0.684.

Score0.37
Score9
Run 1

The code is highly readable. It uses a clean interface with clear, well-documented methods that describe HTTP/3 stream state. The structure is logical: a constant NO_STATE provides an immutable no-op implementation, and the three state-checking methods are purpose-driven and concise. Nesting is minimal—only one anonymous inner class with flat method overrides. Each method has a single clear action and Javadoc explains intent and edge cases. Reading flow is natural, moving from interface purpose to a default implementation to query methods. Minor deductions: the anonymous class adds slight verbosity, and the Javadoc references could be simplified, but overall the code is nearly ideal in clarity and structure.

Run 2

The code is highly readable due to its clear structure, minimal nesting, and well-documented intent. It defines a single interface with three methods, each with a clear purpose and Javadoc explaining the semantics. The anonymous implementation for NO_STATE is concise and follows a straightforward pattern. The code avoids unnecessary complexity, with no deep nesting or multiple actions per line. Reading flow is natural: interface declaration, constant definition, then method declarations. The only minor issue is that the interface name could be slightly more concise, but overall this is exemplary code for clarity and maintainability.

Run 3

The code is highly readable due to its clear structure, minimal nesting, and well-documented intent. It defines a single interface with three boolean methods and a no-op implementation, keeping each action on its own line. The reading flow is natural: package declaration, imports, Javadoc, interface, constant, and method declarations. The Javadoc comments are informative and explain the purpose of each method and constant well. The NO_STATE anonymous class is concise and avoids unnecessary complexity. The only minor downside is that the interface might benefit from a slightly more descriptive name, but this does not significantly impact readability.

Run 1

Code Structure: The interface cleanly groups a stateless implementation and three related state queries. Nesting: Minimal; the anonymous implementation adds only a shallow level. Clarity of intent: Descriptive method names and Javadoc explain the stream lifecycle, although receivedFinalHeaders() suggests receiving only while its documentation also covers sending. Code length: Compact implementation, with slightly repetitive Javadoc and unavoidable override boilerplate. Action granularity: Each method performs a single action, and declarations and annotations occupy separate lines. Reading flow: Consistent formatting and method ordering make the code easy to scan. Minor grammatical issues in comments and repeated descriptions slightly reduce polish.

Run 2

Code Structure: The interface logically groups three state queries and a clearly named NO_STATE implementation. Nesting: Only shallow nesting is used for the anonymous implementation and its methods. Clarity of intent: Descriptive method names and Javadoc explain the stream lifecycle states, though receivedFinalHeaders() sounds receive-specific despite covering both sending and receiving. Code length: The code is compact, with some repetition between Javadoc descriptions and return documentation. Action granularity: Each method performs a single, simple action, and declarations are clearly separated. Reading flow: Consistent formatting and method ordering make the code easy to follow; placing the NO_STATE implementation before the documented interface methods slightly delays discovery of the contract.

Run 3

Code Structure: The interface logically groups three state queries and a clearly named stateless implementation. Nesting: Minimal nesting, limited to the anonymous implementation and its short methods. Clarity of intent: Descriptive method names and Javadoc explain the stream lifecycle; receivedFinalHeaders() is slightly less consistent with documentation covering both sending and receiving. Code length: Concise implementation, though the Javadoc repeats descriptions in return clauses. Action granularity: Each method performs one simple action, with no combined statements. Reading flow: Consistent formatting and lifecycle-oriented method ordering make the code easy to scan. Minor documentation verbosity and grammatical issues prevent a perfect score.