Sample

int-22cc31eb6537-I10

Remove about 40% of line-break groups while retaining structure

Matched original source

Lines27

Scores

MethodScoreScale
Posnett0.6430–1; higher is more readable
Scalabrino0.8880–1; higher is more readable
Dorn0.7460–1; higher is more readable
Mi0.8180–1; higher is more readable
LLOC5Logical lines; fewer is more readable
DeepSeek V4 Pro60–20; mean of three runs
GPT-6.1 Sol14.670–20; mean of three runs
BTTF0.4240–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)
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
Source linesThe number of non-empty source lines.27+10.8
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.624−6.936

Intercept 8.87 + feature contributions = 0.589 (log-odds).
Score = sigmoid(0.589) = 0.643.

Score0.888

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.84.964+0.566
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.054+0.413
Indentation frequencyHow rapidly indentation changes from line to line.17−0.149
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.26+0.116
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.85+0.065
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.26.849−0.035
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.17+0.031

Intercept 0.07 + feature contributions = 1.077 (log-odds).
Score = sigmoid(1.077) = 0.746.

Score0.818
Score5
Run 1

The code structure is mostly logical, but formatting significantly hurts readability. There are multiple statements and Javadoc comments collapsed onto single lines (e.g., the class declaration, serialVersionUID, and first constructor). This violates the 'one action per line' and 'natural reading flow' criteria. Nesting is flat, which is good, and intent is clear—it's a simple exception hierarchy. However, the inconsistent line breaks and compressed constructors make the code feel disorganized and harder to scan. Code length is appropriate, but the visual clutter undermines clarity. With standard formatting, this would rate much higher.

Run 2

The code has poor readability due to inconsistent formatting. Javadoc comments are placed on the same line as declarations, and multiple constructors are crammed onto single lines, violating action granularity. The class declaration and serialVersionUID are also on the same line as comments. While the overall class structure is simple and the intent is clear (a custom exception for encoders), the formatting makes it hard to scan and follow. The nesting is flat, but reading flow is disrupted by the lack of line breaks. Code length is appropriate, but the layout feels tangled despite the straightforward purpose. Improved formatting with proper line breaks and comment placement would significantly raise readability.

Run 3

The code is functionally simple but structurally unreadable. Javadoc comments are placed on the same line as class/constructor declarations, and one comment is embedded in the middle of a field declaration. Constructors are wrapped inconsistently with methods collapsed onto single lines, which breaks reading flow and makes the intent less clear. Action granularity is mixed, with some lines containing multiple logical elements, and nesting / structure is disorganized due to absolute formatting disregard. Proper line breaks and consistent spacing would dramatically improve readability.

Run 1

Code Structure: The class is logically organized, with a serialization identifier followed by constructor overloads. Nesting: Minimal nesting makes the code easy to follow. Clarity of intent: The class name, inheritance, and constructor signatures clearly communicate an encoder-specific exception, though constructor comments are generic. Code length: Concise and appropriate for a simple exception class, with some repetitive documentation. Action granularity: Each constructor performs at most one action, but declarations, comments, and statements sometimes share lines. Reading flow: Inconsistent formatting disrupts scanning; Javadoc endings run into declarations, comments follow fields or closing braces on the same line, and constructor bodies alternate between inline and multiline styles.

Run 2

Code Structure: The exception class is logically organized, with a serial version identifier and related constructors, but inconsistent formatting blurs member boundaries. Nesting: Minimal nesting makes the code easy to follow. Clarity of intent: The class name, inheritance, constructor signatures, and documentation clearly communicate its purpose. Code length: The implementation is concise; repeated generic constructor comments add little information. Action granularity: Each constructor performs at most one action, although some declarations, superclass calls, braces, and comments share lines. Reading flow: The overall sequence is natural, but comments attached to preceding declarations and inconsistent brace placement interrupt scanning. Conventional formatting would substantially improve readability.

Run 3

Code Structure: The exception class is logically organized, with a serialization identifier and four constructor overloads. Nesting: Minimal nesting makes the code easy to follow. Clarity of intent: The class name, inheritance, documentation, and constructor parameters clearly communicate its purpose. Code length: The implementation is concise, although repeated generic constructor comments add little information. Action granularity: Each constructor performs at most one action, but some superclass calls share lines with declarations and braces. Reading flow: Inconsistent formatting disrupts scanning, especially comments placed immediately after field declarations or closing braces and declarations placed on the same line as comment endings. Conventional line breaks and consistent constructor formatting would substantially improve readability.