Sample

int-7fd583c42a85-I12

Inline all eligible single-use intermediate local variables

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 Pro18.670–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

This code is highly readable. It is a simple exception class extending CodecException. The structure is logical and minimal, with no unnecessary complexity. Nesting is flat. Each constructor clearly maps to a common exception pattern (empty, message+cause, message-only, cause-only), making intent obvious. The code is concise, and each action occupies a single line. Reading flow is natural: package declaration, imports, class declaration, serialVersionUID, then constructors in a logical order. Javadoc comments are present, though slightly repetitive, but do not detract from readability.

Run 3

The code is highly readable due to its simple, logical structure. It's a minimal exception class with no nesting, clear purpose, and concise implementation. Each constructor performs a single, clear action by delegating to the parent class. The reading flow is natural, with constructors grouped logically. The only minor redundancy is repeating the same Javadoc comment for multiple constructors, which slightly reduces conciseness but doesn't significantly impact readability.

Run 1

Code Structure: The class is logically organized, with a serialization constant followed by 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, though repeated generic constructor comments add little value. Action granularity: Each nonempty constructor performs one clear action by delegating to the superclass. Reading flow: Consistent formatting and straightforward constructor definitions support natural reading.

Run 2

Code Structure: A logically organized exception class with a serialization identifier followed by constructor overloads. Nesting: Minimal nesting, limited to the class and constructors. Clarity of intent: The class name, inheritance, and class-level documentation clearly identify an encoder-specific exception; constructor comments are generic rather than informative. Code length: Concise implementation, though repeated constructor documentation adds minor verbosity. Action granularity: Each statement performs one action, with constructors simply delegating to the superclass. Reading flow: Consistent formatting and straightforward constructor definitions make the code easy to scan and understand.

Run 3

Code Structure: A logically organized exception class with a serialization field followed by standard constructor overloads. Nesting: Minimal, with no conditional or loop nesting. Clarity of intent: The class name, superclass, and class documentation clearly identify an encoder-specific exception; constructor delegation is straightforward. Code length: Concise implementation, although repeated generic constructor comments add little value. Action granularity: Each nonempty constructor performs a single superclass call on its own line. Reading flow: Consistent formatting and predictable organization make the code easy to scan and understand.