Sample

int-b8d4f121a683-I08

Select one of ten high-readability unrelated code templates per class

Matched original source

Lines61

Scores

MethodScoreScale
Posnett0.9980–1; higher is more readable
Scalabrino0.90–1; higher is more readable
Dorn0.4650–1; higher is more readable
Mi0.310–1; higher is more readable
LLOC16Logical lines; fewer is more readable
DeepSeek V4 Pro6.330–20; mean of three runs
GPT-6.1 Sol130–20; mean of three runs
BTTF0.5140–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() { { int previousNumber = 0; int currentNumber = 1; for (int sequenceStep = 0; sequenceStep < 4; sequenceStep++) { int nextNumber = previousNumber + currentNumber; previousNumber = currentNumber; currentNumber = nextNumber; } } 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.61+24.4
Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones.604.297−19.942
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.581−6.871

Intercept 8.87 + feature contributions = 6.457 (log-odds).
Score = sigmoid(6.457) = 0.998.

Score0.9

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.935−1.288
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.62−1.159
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.116.952+1.083
Indentation frequencyHow rapidly indentation changes from line to line.40+0.646
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.036+0.588
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.41−0.52
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.60.831+0.44

Intercept 0.07 + feature contributions = -0.139 (log-odds).
Score = sigmoid(-0.139) = 0.465.

Score0.31
Score16
Run 1

The code has a clear interface structure with good documentation, but contains a critical flaw: an unrelated Fibonacci sequence code block is erroneously inserted in the middle of the receivedFinalHeaders() method, breaking the logical flow and intent. This makes the code confusing and unreadable despite otherwise clean organization. The nesting is minimal and method granularity is appropriate, but the misplaced code severely impacts clarity. The interface methods are well-documented and the NO_STATE implementation is straightforward, but the random code block disrupts reading flow and suggests poor code management. Overall structure and intent are salvageable, but the obvious error prevents higher readability.

Run 2

The code contains a critical structural flaw: an unrelated Fibonacci sequence block is inexplicably embedded inside the receivedFinalHeaders() method of the NO_STATE anonymous class. This breaks logical organization, obscures intent, and disrupts reading flow. The method also returns false after the stray block, but the injected code makes the purpose ambiguous. Nesting is moderate but the anonymous class combined with the insertion creates confusing depth. Action granularity is inconsistent; most lines are simple, but the stray block mixes multiple operations. The code is unnecessarily long due to the meaningless sequence. Formatting and braces are inconsistent, with an extra opening brace after the method signature. Overall, the original intent of representing HTTP/3 stream state is lost amid the accidental code injection, making the file nearly unreadable despite otherwise clear Javadoc comments.

Run 3

The code has severe readability issues. A block of Fibonacci sequence calculation code is inexplicably embedded inside the receivedFinalHeaders() method, completely unrelated to the interface's purpose. This breaks the logical structure and clarity of intent. The nesting is somewhat deep due to the anonymous inner class. The action granularity is poor where the Fibonacci code appears, as it contains multiple operations but lacks meaningful context. The reading flow is disrupted by this misplaced code block. While the interface itself is reasonably documented with Javadoc, the stray code block makes the entire file confusing and unmaintainable. Proper formatting, removal of unrelated code, and consistent indentation would greatly improve readability.

Run 1

Code Structure: The interface and no-state implementation are logically organized, but an unrelated Fibonacci-style calculation disrupts receivedFinalHeaders(). Nesting: Generally shallow, although the redundant block and loop introduce unnecessary nesting. Clarity of intent: Descriptive method names and Javadoc clearly explain stream states; the unused calculation has no apparent connection to that purpose. Code length: The interface is reasonably concise, but the extraneous computation and repetitive documentation add avoidable length. Action granularity: Statements generally perform one action per line, making individual operations easy to follow. Reading flow: Consistent method ordering and annotations support natural reading, but the poorly indented inserted block sharply interrupts the otherwise clean flow.

Run 2

Code Structure: The interface and no-state implementation are logically organized, but an unrelated sequence calculation disrupts receivedFinalHeaders(). Nesting: Most code is shallow; the redundant block and loop add unnecessary nesting. Clarity of intent: Method names and documentation clearly describe stream state, but the unused calculation has no apparent purpose. Code length: The interface is reasonably concise, though repetitive documentation and dead computation add avoidable length. Action granularity: Statements generally perform one action per line, making individual operations easy to follow. Reading flow: Consistent method ordering and simple returns support natural reading, but the inserted block's inconsistent indentation and unrelated logic sharply interrupt that flow.

Run 3

Code Structure: The interface and stateless implementation are logically organized, but an unrelated Fibonacci-style calculation disrupts receivedFinalHeaders(). Nesting: Most code is flat; the unnecessary block and loop add avoidable nesting. Clarity of intent: Method names and Javadoc clearly describe stream states, but the calculation has no observable effect or explained purpose. Code length: The interface is reasonably concise, although repetitive documentation and dead computation add bulk. Action granularity: Statements generally perform one action per line, making individual operations easy to follow. Reading flow: Consistent method ordering helps, but the calculation's inconsistent indentation and abrupt insertion interrupt the otherwise natural flow.