Sample

int-93590d48d02d-I08

Select one of ten high-readability unrelated code templates per class

Matched original source

Lines35

Scores

MethodScoreScale
Posnett0.0010–1; higher is more readable
Scalabrino0.7580–1; higher is more readable
Dorn0.4160–1; higher is more readable
Mi0.2720–1; higher is more readable
LLOC9Logical lines; fewer is more readable
DeepSeek V4 Pro120–20; mean of three runs
GPT-6.1 Sol140–20; mean of three runs
BTTF0.1980–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() { { int remainingSteps = 3; while (remainingSteps > 0) { remainingSteps--; } } } @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.698.806−23.061
Source linesThe number of non-empty source lines.35+14
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.833−7.25

Intercept 8.87 + feature contributions = -7.44 (log-odds).
Score = sigmoid(-7.44) = 0.001.

Score0.758

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.889−1.413
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.97.306+0.766
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.059+0.368
Indentation frequencyHow rapidly indentation changes from line to line.30+0.301
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.30−0.268
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.36−0.238
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.34.843+0.077

Intercept 0.07 + feature contributions = -0.337 (log-odds).
Score = sigmoid(-0.337) = 0.416.

Score0.272
Score9
Run 1

The code is mostly readable but contains a bizarre implementation detail that hurts clarity. The empty constructor includes a meaningless `while` loop with `remainingSteps` that serves no purpose, which is confusing and appears to be dead code or an artifact. It has good organization, clear class purpose, one action per line, and a natural reading flow, but the superfluous loop and unnecessary block nesting lower readability. The class is concise and well-documented, but the constructor should simply be empty.

Run 2

The code is generally well-structured with clear intent: it defines a stackless exception, overrides fillInStackTrace to avoid stacktrace overhead, and provides a factory method. Imports and documentation are appropriate. However, there is a confusing leftover empty nested block with a pointless while loop in the private constructor, which adds unnecessary nesting and obscures the constructor's intent. Removing it would improve clarity. The class is concise and follows good practices for readability, but the misplaced block prevents a higher score.

Run 3

The code has severe structural issues that make it hard to read. The most problematic part is the malformed constructor with an unnecessary nested block containing a meaningless while loop with a counter that does nothing - this is confusing and appears to be dead code or a placeholder. The indentation is inconsistent: the constructor has an extra opening brace and poor alignment. While the class purpose is clear from the Javadoc and the fillInStackTrace() method is straightforward, the broken constructor undermines readability. The code is concise overall but contains unexplained leftover code. The reading flow is disrupted by the odd nested block. If the constructor were empty and properly formatted, the code would rate much higher. Action granularity is acceptable - each line performs a single action. However, the presence of meaningless, non-functional code in the constructor makes the intent ambiguous and the structure tangled.

Run 1

Code Structure: The class is logically organized into a constructor, override, and factory method, but the constructor contains an unexplained block. Nesting: Generally shallow, although the redundant block and loop introduce unnecessary nesting. Clarity of intent: Naming and documentation clearly explain the stackless exception and factory method; the constructor's countdown loop has no apparent purpose. Code length: Mostly concise, but the loop adds needless lines. Action granularity: Each statement performs a single action, making individual operations easy to follow. Reading flow: Conventional method ordering supports readability, but inconsistent constructor indentation and awkward braces interrupt the flow.

Run 2

Code Structure: The class is logically organized into a constructor, override, and factory method, but the constructor contains an unrelated block. Nesting: Most code is flat; the extra constructor block and loop add unnecessary nesting. Clarity of intent: Documentation, class naming, and method naming clearly explain the stackless exception behavior, but the countdown loop has no apparent purpose. Code length: The implementation is concise overall, though the constructor loop unnecessarily lengthens it. Action granularity: Statements generally perform one action per line. Reading flow: The main methods read naturally, but inconsistent constructor indentation, redundant braces, and missing spacing after the package declaration disrupt the flow.

Run 3

Code Structure: The class is logically organized into a field, constructor, override, and factory method, but the constructor contains an unrelated loop. Nesting: Most code is flat; the constructor adds an unnecessary block and loop. Clarity of intent: Documentation, naming, and the stack-trace override clearly communicate the class's purpose, while remainingSteps has no meaningful role. Code length: The implementation is concise overall, but the constructor's countdown adds unnecessary lines. Action granularity: Statements generally perform one action per line. Reading flow: The methods follow naturally, but inconsistent constructor indentation and extra braces interrupt the flow; missing spacing after the package declaration also reduces polish.