Sample

int-650e216df035-I06

Invert eligible conditions and exchange their branches

Matched original source

Lines28

Scores

MethodScoreScale
Posnett0.0020–1; higher is more readable
Scalabrino0.7810–1; higher is more readable
Dorn0.5510–1; higher is more readable
Mi0.2590–1; higher is more readable
LLOC6Logical lines; fewer is more readable
DeepSeek V4 Pro180–20; mean of three runs
GPT-6.1 Sol190–20; mean of three runs
BTTF0.3220–1; higher is more readable

Views

Source code

package io.netty.channel; import io.netty.util.internal.ThrowableUtil; import io.netty.util.internal.UnstableApi; import java.nio.channels.ClosedChannelException; /** * Cheap {@link ClosedChannelException} that does not fill in the stacktrace. */ @UnstableApi public final class StacklessClosedChannelException extends ClosedChannelException { private static final long serialVersionUID = -2214806025529435136L; private StacklessClosedChannelException() { } @Override public Throwable fillInStackTrace() { // Suppress a warning since this method doesn't need synchronization return this; } /** * Creates a new {@link StacklessClosedChannelException} which has the origin of the given {@link Class} and method. */ public static StacklessClosedChannelException newInstance(Class<?> clazz, String method) { return ThrowableUtil.unknownStackTrace(new StacklessClosedChannelException(), clazz, method); } }

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.577.677−19.063
Source linesThe number of non-empty source lines.28+11.2
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.826−7.24

Intercept 8.87 + feature contributions = -6.233 (log-odds).
Score = sigmoid(-6.233) = 0.002.

Score0.781

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.119.931−1.415
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.119.931+1.131
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.051+0.442
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.23−0.107
Indentation frequencyHow rapidly indentation changes from line to line.23+0.058
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.28+0.045
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.27.785−0.021

Intercept 0.07 + feature contributions = 0.203 (log-odds).
Score = sigmoid(0.203) = 0.551.

Score0.259
Score6
Run 1

The code is highly readable. Structure is logical: package, imports, class, field, constructor, override, factory method. Nesting is minimal—only one method override and one static factory, both flat. Intent is clear: a performance-optimized exception that skips stacktrace generation, with Javadoc explaining purpose. Length is concise and appropriate for the functionality. Action granularity is one action per line. Reading flow is natural, moving from class definition to constructor to behavior override to factory method. Minor deductions: the suppressed warning comment could be slightly more specific, and the class could be final (already is). Overall, excellent clarity and simplicity.

Run 2

The code demonstrates excellent readability. Structure is logical with a clear class hierarchy and organized imports. Nesting is minimal with flat structure throughout. Intent is immediately clear from the class name, Javadoc comments, and method purposes, explaining the stacktrace optimization technique. Code length is concise with no unnecessary boilerplate. Each method performs one clear action: the constructor prevents instantiation, fillInStackTrace returns self, and the static factory creates a new instance. Reading flow is natural: class declaration, serial version, private constructor, override, then factory method. Javadoc comments effectively explain non-obvious design decisions like the stackless exception optimization and the warning suppression. Overall, this is exemplary readable code.

Run 3

The code is well-structured and readable. It has a clear single-purpose class with a private constructor and a static factory method. Nesting is minimal, with only one method override and no deep indentation. Intent is explicit: the class is documented as a stacktrace-free ClosedChannelException for performance. The code is concise—no unnecessary lines or boilerplate. Each statement is on its own line, and the flow is logical: imports, class declaration, fields, constructor, method override, factory method. Minor deductions for brevity of comments (e.g., why serialVersionUID is set, or the warning suppression) but overall it is highly maintainable and understandable.

Run 1

Code Structure: Logically organized into a constant, private constructor, overridden method, and factory method. Nesting: Flat, with no nested control flow. Clarity of intent: The class name, documentation, and fillInStackTrace override clearly communicate stack-trace suppression; the factory documents its origin metadata. Code length: Compact without unnecessary logic. Action granularity: Each statement performs one clear action, and the factory's nested calls remain easy to follow. Reading flow: Natural progression from class definition to construction and behavior. Minor drawbacks are the lack of spacing between package and import sections and the somewhat vague constructor parameter name clazz.

Run 2

Code Structure: The class is logically organized into a constant, private constructor, override, and factory method. Nesting: There is no nested control flow, making the code easy to scan. Clarity of intent: The class name, Javadoc, and fillInStackTrace override clearly communicate the stackless exception behavior; the factory documents the supplied origin. Code length: The implementation is concise, with no unnecessary logic. Action granularity: Each statement performs a focused action, although the factory combines construction and stack-trace customization in one expression. Reading flow: The ordering is natural and consistent. Minor readability limitations include the abbreviated parameter name clazz and reliance on understanding the external unknownStackTrace helper.

Run 3

Code Structure: The class is logically organized into a constant, constructor, overridden behavior, and factory method. Nesting: Methods are flat, with no nested control flow. Clarity of intent: The class name, documentation, and fillInStackTrace override clearly communicate a lightweight exception that avoids capturing a stack trace; the factory documents its supplied origin. Code length: The implementation is concise without unnecessary logic. Action granularity: Statements generally perform one action per line; the factory combines construction and stack-trace customization in a straightforward expression. Reading flow: The declaration-to-factory progression is natural. Minor readability drawbacks are the missing blank line between the package and imports and the synchronization comment, which could explain its context more explicitly.