Sample

int-914b7d7b6678-I03

Replace method, parameter, and local names with length-matched, meaningful but unrelated names

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.2680–1; higher is more readable
LLOC6Logical lines; fewer is more readable
DeepSeek V4 Pro16.670–20; mean of three runs
GPT-6.1 Sol13.670–20; mean of three runs
BTTF0.250–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 validateSession() { // 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 readSession(Class<?> count, String buffer) { return ThrowableUtil.unknownStackTrace(new StacklessClosedChannelException(), count, buffer); } }

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.813−7.22

Intercept 8.87 + feature contributions = -6.213 (log-odds).
Score = sigmoid(-6.213) = 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.897−1.413
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.052+0.441
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.826−0.021

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

Score0.268
Score6
Run 1

The code is well-structured and highly readable. It uses clear naming conventions, minimal nesting, and concise methods. Each action is on its own line, and the flow is natural. The only minor issue is the unconventional parameter names in readSession (e.g., 'count' and 'buffer' instead of 'clazz' and 'method'), which slightly obscures intent.

Run 2

The code is generally readable with clear structure: package declaration, imports, class Javadoc, class definition, field, constructor, method override, and factory method. Nesting is minimal and flat. Intent is reasonably clear: a stackless variant of ClosedChannelException. However, readability is reduced by misleading method and parameter names: 'validateSession' does not convey its actual purpose, and 'readSession' with parameters named 'count' and 'buffer' appear copied from another context, obscuring the intention of supplying class and method origin. The code is concise and has one action per line. Reading flow is natural due to consistent ordering and Javadoc. Overall, the structure and formatting are good, but naming issues prevent a higher score.

Run 3

The code is highly readable with clear structure: package/imports, Javadoc, class declaration, single private constructor, overridden method, and one static factory method. Nesting is minimal, and intent is evident—a stackless exception variant for closed channels. Each logical action is separated cleanly. Minor deductions: parameter names 'count' and 'buffer' are misleading for a Class and String representing originating class and method; they should be 'clazz' and 'method'. The @UnstableApi annotation is clear, but the validateSession() override is empty except returning this, slightly reducing clarity of intent. Overall, concise and well-organized.

Run 1

Code Structure: The class is logically organized, with imports, documentation, a constant, constructor, override, and factory method. Nesting: There is no nested control flow, making it easy to scan. Clarity of intent: The class documentation clearly describes a stackless exception, but validateSession and readSession do not reflect stack-trace suppression or exception creation. Parameter names count and buffer obscure their roles as an origin class and method name. Additionally, validateSession does not override a ClosedChannelException method, making the annotation and synchronization comment misleading. Code length: The implementation is concise without unnecessary scaffolding. Action granularity: Statements perform one clear action each, although the factory combines construction and stack-trace assignment in a reasonable expression. Reading flow: The top-to-bottom organization is natural, but inconsistent naming and the apparent invalid override interrupt comprehension.

Run 2

Code Structure: A small, logically organized class with imports, a constant, constructor, override, and factory method. Nesting: Flat methods with no nested control flow. Clarity of intent: Documentation explains the stackless exception, but validateSession and readSession do not match their apparent purposes, and count and buffer obscure the class and method parameters. The synchronization comment also appears unrelated to validateSession; its @Override does not correspond to a superclass method, further undermining comprehension. Code length: Concise, with no unnecessary implementation. Action granularity: Each statement performs a focused action, though the factory return combines construction and stack-trace adjustment. Reading flow: Generally natural, but misleading names and the mismatch between documentation and implementation interrupt understanding.

Run 3

Code Structure: The class is logically organized with imports, a constant, constructor, override, and factory method. Nesting: Flat methods make it easy to scan. Clarity of intent: The class documentation states its purpose, but validateSession and readSession are misleading names, and count and buffer obscure the class and method parameters. The synchronization comment does not explain stack-trace suppression. Moreover, validateSession does not override a ClosedChannelException method, so the annotation contradicts the implementation and the stated purpose is not fulfilled. Code length: Compact without unnecessary boilerplate. Action granularity: Each statement performs one clear operation, though the factory return combines construction and utility invocation reasonably. Reading flow: Generally natural, but inconsistent naming and behavior force readers to question how the implementation achieves its documented intent.