Sample

int-044df955f943-I06

Invert eligible conditions and exchange their branches

Matched original source

Lines36

Scores

MethodScoreScale
Posnett0.9870–1; higher is more readable
Scalabrino0.9170–1; higher is more readable
Dorn0.8090–1; higher is more readable
Mi0.7930–1; higher is more readable
LLOC5Logical lines; fewer is more readable
DeepSeek V4 Pro180–20; mean of three runs
GPT-6.1 Sol190–20; mean of three runs
BTTF0.4560–1; higher is more readable

Views

Source code

package io.netty.handler.codec; /** * An {@link CodecException} which is thrown by an encoder. */ public class EncoderException extends CodecException { private static final long serialVersionUID = -5086121160476476774L; /** * Creates a new instance. */ public EncoderException() { } /** * Creates a new instance. */ public EncoderException(String message, Throwable cause) { super(message, cause); } /** * Creates a new instance. */ public EncoderException(String message) { super(message); } /** * Creates a new instance. */ public EncoderException(Throwable cause) { super(cause); } }

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(log-odds)
Source linesThe number of non-empty source lines.36+14.4
Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones.368.017−12.145
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 = 4.322 (log-odds).
Score = sigmoid(4.322) = 0.987.

Score0.917

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.70.973+0.659
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.052+0.432
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.70.946+0.34
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.26−0.176
Indentation frequencyHow rapidly indentation changes from line to line.26+0.162
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.33−0.132
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.35.708+0.089

Intercept 0.07 + feature contributions = 1.445 (log-odds).
Score = sigmoid(1.445) = 0.809.

Score0.793
Score5
Run 1

The code is highly readable. It has a clear, single-purpose structure as a custom exception class. Nesting is non-existent, with a flat class hierarchy and straightforward constructors. Each constructor's intent is unambiguous, following standard Java exception patterns. The code is concise, avoiding unnecessary boilerplate while providing all standard constructor variants. Each action (constructor call) is on its own line, maintaining clean separation. The reading flow is natural: class declaration, serialVersionUID, then constructors in a logical order. The Javadoc comments, while repetitive, are clear and consistent with the codebase style. The only minor drawback is the repetitive 'Creates a new instance' documentation, which adds little value and could be more descriptive, but this does not significantly impact readability.

Run 2

The code is exceptionally readable. It follows a clear, logical structure with a simple class hierarchy (EncoderException extends CodecException). Nesting is non-existent, with all constructors at the top level. Intent is clear from the class name, package location, and Javadoc comments. The code is concise and achieves its purpose without unnecessary verbosity. Each constructor performs one action—delegating to the parent class—and is placed on a single line, preserving action granularity. The reading flow is natural: class declaration, serialVersionUID, then constructors in a logical order (empty, message+cause, message-only, cause-only). The only minor deduction is the repetitive Javadoc comments, which add little value, but this is a common pattern in widely-used libraries like Netty and does not significantly impact readability.

Run 3

The code is highly readable due to its simple, flat structure and clear intent. It follows standard exception class conventions, extending CodecException with four straightforward constructors. There is no deep nesting, and each constructor performs a single action. The Javadoc comments, while repetitive, clearly document each constructor's purpose. The reading flow is natural and logical. Minor deductions: the repeated identical Javadoc could be more descriptive, and the serialVersionUID adds minor noise, but these are negligible. Overall, this is concise, well-organized code that is easy to understand at a glance.

Run 1

Code Structure: A logically organized exception class with a serialization field followed by constructors. Nesting: Flat, with no conditional or loop nesting. Clarity of intent: The class name, inheritance, and class documentation clearly identify an encoder-specific exception; constructor signatures are self-explanatory. Code length: Concise and appropriate, though repeated generic constructor comments add little value. Action granularity: Each constructor performs at most one action, forwarding arguments to the superclass. Reading flow: Consistent formatting and predictable constructor implementations make the code easy to scan and understand.

Run 2

Code Structure: The class is logically organized, with the serialization identifier followed by conventional constructor overloads. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: The class name, inheritance, and class-level documentation clearly identify an encoder-specific exception. Code length: The implementation is concise, although repeated constructor comments add little information. Action granularity: Each nonempty constructor performs a single superclass call on its own line. Reading flow: Consistent formatting and familiar Java exception conventions provide a natural, predictable flow.

Run 3

Code Structure: A logically organized exception class with a serialization identifier followed by constructor overloads. Nesting: Minimal, with no nested control flow. Clarity of intent: The class name, inheritance, and class documentation clearly identify an encoder-specific exception; constructor comments are generic rather than informative. Code length: Short and appropriate, though repeated constructor documentation adds minor verbosity. Action granularity: Each constructor performs at most one action per line by delegating to the superclass. Reading flow: Consistent formatting and predictable constructor definitions make the code easy to scan and understand.