Sample

int-ce8250a64dd3-I03

Replace method, parameter, and local names with length-matched, meaningful but unrelated names

Matched original source

Lines51

Scores

MethodScoreScale
Posnett10–1; higher is more readable
Scalabrino0.9750–1; higher is more readable
Dorn0.6840–1; higher is more readable
Mi0.3750–1; higher is more readable
LLOC9Logical lines; fewer is more readable
DeepSeek V4 Pro16.670–20; mean of three runs
GPT-6.1 Sol15.670–20; mean of three runs
BTTF0.7240–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 mapData() { return false; } @Override public boolean validateSession() { return false; } @Override public boolean checkState() { 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 mapData(); /** * 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 validateSession(); /** * If no more frames are expected on this stream. * * @return {@code true} if no more frames are expected on this stream. */ boolean checkState(); }

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.535−6.803

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

Score0.975

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.68
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.898+0.302

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

Score0.375
Score9
Run 1

The code is well-structured with a clear interface definition and descriptive method names. Javadoc comments explain each method's purpose and the NO_STATE anonymous implementation is straightforward. The code is flat with minimal nesting and each method contains a single action. The only minor issue is that the method names (mapData, validateSession, checkState) are somewhat generic and could better convey their specific HTTP/3 stream state semantics. Additionally, the Javadoc for the NO_STATE field contains a minor grammatical error ('managed' instead of 'manages'), but this does not impact readability. Overall, the code demonstrates excellent readability with clear intent, logical organization, and appropriate length.

Run 2

The code is well-structured as a small interface with a clear purpose, documented extensively with Javadoc. It demonstrates flat nesting with an anonymous inner class for the NO_STATE constant. The method names (mapData, validateSession, checkState) are somewhat ambiguous and could better reflect their actual semantics (e.g., hasReceivedData, isSessionValid, isComplete). The Javadoc is thorough but verbose, making the interface longer than necessary. Each method is isolated on its own line with clear action granularity. Reading flow is logical, though the constant defined at the top interrupts the interface's method declarations. Overall, it is highly readable but slightly hindered by verbose documentation and less-than-intuitive naming.

Run 3

The code is generally readable with a clear interface structure and well-documented methods. The purpose of each method is explained through Javadoc comments, and the anonymous class implementation is simple and flat. However, the method names are somewhat vague ('mapData', 'validateSession', 'checkState'), which reduces clarity of intent without context. The code is concise and avoids unnecessary complexity, but the naming could be improved to better convey the specific state transitions being managed. Overall, the logical organization is sound, with one action per method and no deep nesting, but the abstract naming prevents a higher score.

Run 1

Code Structure: The interface is logically organized, with a default stateless implementation followed by documented method declarations. Nesting: Minimal nesting; the anonymous implementation is straightforward. Clarity of intent: Documentation explains the state queries, but mapData, validateSession, and checkState sound like operations rather than boolean queries and do not clearly match their documented meanings. Code length: Short overall, although the Javadoc descriptions and return explanations repeat each other. Action granularity: Each return statement and declaration occupies its own line, making individual behaviors easy to identify. Reading flow: Consistent formatting and method ordering support smooth reading, but the mismatch between method names and documentation requires extra interpretation.

Run 2

Code Structure: Logically organized interface with a no-state implementation followed by documented method declarations. Nesting: Shallow; the anonymous implementation adds little complexity. Clarity of intent: Documentation explains the state queries, but mapData, validateSession, and checkState sound like actions rather than boolean queries and do not clearly reflect their documented meanings. Code length: Compact implementation, though descriptions and return documentation are repetitive. Action granularity: Each method performs a single, clearly separated return operation. Reading flow: Consistent formatting and method ordering make the code easy to scan, but readers must consult the comments to understand the ambiguous method names.

Run 3

Code Structure: The interface is logically organized, with a default stateless implementation followed by documented method declarations. Nesting: Shallow; the anonymous implementation adds minimal complexity. Clarity of intent: Documentation explains the state queries, but names such as mapData, validateSession, and checkState poorly match their documented boolean meanings and suggest actions rather than predicates. Code length: Compact overall, although repeated descriptions in Javadoc and return tags add verbosity. Action granularity: Each declaration and return statement occupies its own line, making behavior easy to scan. Reading flow: Consistent formatting and method ordering support natural reading, but understanding the queries requires consulting comments rather than relying on names. Minor grammatical issues in documentation also reduce polish.