Sample

int-d12a616c696f-I02

Shorten method, parameter, and local names without collisions

Matched original source

Lines98

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.6910–1; higher is more readable
Dorn0.330–1; higher is more readable
Mi0.0470–1; higher is more readable
LLOC51Logical lines; fewer is more readable
DeepSeek V4 Pro10.670–20; mean of three runs
GPT-6.1 Sol130–20; mean of three runs
BTTF0.3620–1; higher is more readable

Views

Source code

package io.netty.handler.codec.socksx.v5; import io.netty.handler.codec.DecoderResult; import io.netty.util.NetUtil; import io.netty.util.internal.ObjectUtil; import io.netty.util.internal.StringUtil; import java.net.IDN; /** * The default {@link Socks5CommandResponse}. */ public final class DefaultSocks5CommandResponse extends AbstractSocks5Message implements Socks5CommandResponse { private final Socks5CommandStatus status; private final Socks5AddressType bndAddrType; private final String bndAddr; private final int bndPort; public DefaultSocks5CommandResponse(Socks5CommandStatus sta, Socks5AddressType bnd) { this(sta, bnd, null, 0); } public DefaultSocks5CommandResponse( Socks5CommandStatus sta2, Socks5AddressType bnd2, String bnd3, int bnd4) { ObjectUtil.checkNotNull(sta2, "status"); ObjectUtil.checkNotNull(bnd2, "bndAddrType"); if (bnd3 != null) { if (bnd2 == Socks5AddressType.IPv4) { if (!NetUtil.isValidIpV4Address(bnd3)) { throw new IllegalArgumentException("bndAddr: " + bnd3 + " (expected: a valid IPv4 address)"); } } else if (bnd2 == Socks5AddressType.DOMAIN) { bnd3 = IDN.toASCII(bnd3); if (bnd3.length() > 255) { throw new IllegalArgumentException("bndAddr: " + bnd3 + " (expected: less than 256 chars)"); } } else if (bnd2 == Socks5AddressType.IPv6) { if (!NetUtil.isValidIpV6Address(bnd3)) { throw new IllegalArgumentException("bndAddr: " + bnd3 + " (expected: a valid IPv6 address)"); } } } if (bnd4 < 0 || bnd4 > 65535) { throw new IllegalArgumentException("bndPort: " + bnd4 + " (expected: 0~65535)"); } this.status = sta2; this.bndAddrType = bnd2; this.bndAddr = bnd3; this.bndPort = bnd4; } @Override public Socks5CommandStatus sta() { return status; } @Override public Socks5AddressType bnd() { return bndAddrType; } @Override public String bnd2() { return bndAddr; } @Override public int bnd3() { return bndPort; } @Override public String to() { StringBuilder buf = new StringBuilder(128); buf.append(StringUtil.simpleClassName(this)); DecoderResult decoder = decoderResult(); if (!decoder.isSuccess()) { buf.append("(decoderResult: "); buf.append(decoder); buf.append(", status: "); } else { buf.append("(status: "); } buf.append(sta()); buf.append(", bndAddrType: "); buf.append(bnd()); buf.append(", bndAddr: "); buf.append(bnd2()); buf.append(", bndPort: "); buf.append(bnd3()); buf.append(')'); return buf.toString(); } }

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.3368.435−111.158
Source linesThe number of non-empty source lines.98+39.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.664−6.996

Intercept 8.87 + feature contributions = -70.085 (log-odds).
Score = sigmoid(-70.085) = 0.

Score0.691

Feature contributions

FeatureValueContribution
(log-odds)
Indentation frequencyHow rapidly indentation changes from line to line.96+2.583
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.99−2.469
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.96−1.782
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.112.98−1.12
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.113+1.019
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.97.93+0.959
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.094+0.032

Intercept 0.07 + feature contributions = -0.708 (log-odds).
Score = sigmoid(-0.708) = 0.33.

Score0.047
Score51
Run 1

The code has a clear class structure and logical flow, but readability is hampered by poor naming (sta, bnd, sta2, bnd2, etc.), ambiguous method names (to(), sta(), bnd()), and verbose constructor validation. The nested if-else chain for address validation creates moderate nesting and mixes multiple concerns. Action granularity is inconsistent—the constructor performs validation, assignment, and string conversion in one block. The toString method is relatively flat but uses many append calls, making it long. Overall, the code works but requires domain knowledge to understand the abbreviated names, reducing clarity of intent.

Run 2

The code has a clear purpose and logical structure, with reasonable field encapsulation and constructor validation. However, readability is hurt by poor naming choices: constructor parameters and methods are named 'sta', 'bnd', 'bnd2', 'bnd3', 'sta2', 'bnd2', 'bnd3', 'bnd4', which obscures intent. The `to()` method is relatively flat and readable, but the constructor has moderate nesting with an inner if-else chain. Action granularity is acceptable, though some validation logic is clustered. Overall, the code is maintainable but not particularly expressive; meaningful names would improve clarity significantly.

Run 3

The code has clear, professional Java style and simple constructor/getter structure, but variable names like sta, bnd, bnd2, bnd3, bnd4 and sta2 obscure intent. The validation logic is nested multiple levels inside the constructor, making flow harder to follow. Method names such as bnd(), bnd2(), bnd3(), and to() are unclear and break natural reading flow. Multiple validation actions are embedded in a single block, and the toString logic has an awkward conditional append pattern. The class is concise, but naming and nesting hurt readability significantly despite clean formatting.

Run 1

Code Structure: Fields, constructors, accessors, and string formatting are logically organized. Nesting: Address validation reaches three conditional levels, adding moderate complexity, while other methods remain flat. Clarity of intent: Descriptive fields and validation messages help, but abbreviated and numbered names such as sta2, bnd3, and bnd4 obscure parameter roles. Accessors named bnd2 and bnd3 and the formatting method named to further weaken intent. Code length: Reasonably compact overall, although repetitive validation branches and append statements add verbosity. Action granularity: Statements generally perform one action per line, making individual operations easy to follow. Reading flow: Validation followed by field assignment and accessors provides a natural progression, but inconsistent naming forces readers to repeatedly map variables and methods to their meanings.

Run 2

Code Structure: Fields, constructors, accessors, and formatting are logically grouped. Nesting: Address validation reaches three conditional levels, adding moderate complexity. Clarity of intent: Descriptive fields and validation messages help, but cryptic parameters (sta2, bnd2–bnd4) and methods (sta, bnd2, to) obscure meaning and require cross-referencing. Code length: Reasonably concise overall, although repetitive validation and append statements add verbosity. Action granularity: Statements generally perform one action per line, making execution easy to follow. Reading flow: Validation followed by assignment and accessors provides a natural progression, but inconsistent naming interrupts comprehension.

Run 3

Code Structure: Fields, constructors, accessors, and formatting are logically grouped, with validation localized in the main constructor. Nesting: Address validation reaches three conditional levels, adding moderate complexity. Clarity of intent: Descriptive fields and error messages help, but cryptic parameters and methods such as sta2, bnd3, and to obscure meaning; numbered names represent different concepts across contexts. Code length: Reasonably compact overall, although repetitive validation and append calls add verbosity. Action granularity: Statements generally perform one action per line, making operations easy to follow. Reading flow: Construction proceeds naturally from validation to assignment, followed by accessors and formatting, but inconsistent naming forces readers to repeatedly consult field assignments.