Sample

int-7703703debcd-I10

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

Matched original source

Lines62

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Scalabrino0.5370–1; higher is more readable
Dorn0.0620–1; higher is more readable
Mi0.0030–1; higher is more readable
LLOC51Logical lines; fewer is more readable
DeepSeek V4 Pro60–20; mean of three runs
GPT-6.1 Sol100–20; mean of three runs
BTTF0.2420–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 status, Socks5AddressType bndAddrType) { this(status, bndAddrType, null, 0); } public DefaultSocks5CommandResponse( Socks5CommandStatus status, Socks5AddressType bndAddrType, String bndAddr, int bndPort) { ObjectUtil.checkNotNull(status, "status"); ObjectUtil.checkNotNull(bndAddrType, "bndAddrType"); if (bndAddr != null) { if (bndAddrType == Socks5AddressType.IPv4) { if (!NetUtil.isValidIpV4Address(bndAddr)) { throw new IllegalArgumentException("bndAddr: " + bndAddr + " (expected: a valid IPv4 address)"); } } else if (bndAddrType == Socks5AddressType.DOMAIN) { bndAddr = IDN.toASCII(bndAddr); if (bndAddr.length() > 255) { throw new IllegalArgumentException("bndAddr: " + bndAddr + " (expected: less than 256 chars)"); } } else if (bndAddrType == Socks5AddressType.IPv6) { if (!NetUtil.isValidIpV6Address(bndAddr)) { throw new IllegalArgumentException("bndAddr: " + bndAddr + " (expected: a valid IPv6 address)"); } } } if (bndPort < 0 || bndPort > 65535) { throw new IllegalArgumentException("bndPort: " + bndPort + " (expected: 0~65535)"); } this.status = status; this.bndAddrType = bndAddrType; this.bndAddr = bndAddr; this.bndPort = bndPort; } @Override public Socks5CommandStatus status() { return status; } @Override public Socks5AddressType bndAddrType() { return bndAddrType; } @Override public String bndAddr() { return bndAddr; } @Override public int bndPort() { return bndPort; } @Override public String toString() { StringBuilder buf = new StringBuilder(128); buf.append(StringUtil.simpleClassName(this)); DecoderResult decoderResult = decoderResult(); if (!decoderResult.isSuccess()) { buf.append("(decoderResult: "); buf.append(decoderResult); buf.append(", status: "); } else { buf.append("(status: "); } buf.append(status()); buf.append(", bndAddrType: "); buf.append(bndAddrType()); buf.append(", bndAddr: "); buf.append(bndAddr()); buf.append(", bndPort: "); buf.append(bndPort()); 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.3307.446−109.146
Source linesThe number of non-empty source lines.62+24.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.872−7.308

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

Score0.537

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.201.968−4.889
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.202+2.455
Indentation frequencyHow rapidly indentation changes from line to line.60+1.338
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.63−1.194
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.60−0.956
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.61.847+0.455
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.096+0.01

Intercept 0.07 + feature contributions = -2.712 (log-odds).
Score = sigmoid(-2.712) = 0.062.

Score0.003
Score51
Run 1

The code is difficult to read due to severe formatting issues. Multiple statements are placed on the same line, violating the one-action-per-line principle and disrupting natural reading flow. The constructor contains deeply nested conditional logic for address validation, making it hard to follow. The toString() method has convoluted branching that obscures its intent. While the class structure and field declarations are logically organized, the lack of consistent spacing, line breaks, and indentation makes the code appear tangled. The validation logic is unnecessarily compact, reducing clarity. Overall, the code functions but requires significant effort to parse and understand.

Run 2

The code suffers from severe formatting issues that dramatically reduce readability: multiple statements are crammed onto single lines, methods are collapsed together, and indentation is inconsistent. The constructor contains deep nesting (up to 4 levels) for validation logic. While the class structure itself is logical (fields, constructor, getters, toString), the physical layout obscures this organization. The intent is partially clear from method names, but the compressed formatting forces the reader to mentally parse statements. Code length is reasonable but the layout makes it feel bloated. Action granularity is violated repeatedly - several lines contain 2-3 statements. Reading flow is disjointed and unnatural. The validation logic in the constructor could be extracted into helper methods to reduce nesting. The toString method, while functionally reasonable, is difficult to follow due to poor line breaks.

Run 3

The code has poor readability due to compressed formatting: multiple statements and field declarations on single lines, inconsistent indentation, and cramped braces. While class structure is logical and methods are short, the dense constructor validation block creates multiple nested conditionals that are hard to follow. Intent is clear in method names and comments, but the visual clutter undermines clarity. Many lines contain multiple actions, violating the one-action-per-line guideline. Reading flow is disrupted by varying spacing and poorly aligned braces. The logic itself is not complex, but presentation makes it unnecessarily difficult to parse.

Run 1

Code Structure: Fields, constructors, accessors, and toString follow a logical class organization, but compressed formatting obscures boundaries. Nesting: Address validation reaches three conditional levels; manageable, though inline braces make it harder to follow. Clarity of intent: Descriptive types, validation helpers, and explicit error messages communicate purpose clearly; abbreviated field names require some domain knowledge. Code length: Reasonably concise for its responsibilities, but packing statements together reduces visual length without improving readability. Action granularity: Multiple imports, declarations, assignments, and method calls frequently share lines, making individual operations harder to identify. Reading flow: Inconsistent line breaks, indentation, and brace placement interrupt an otherwise natural progression from validation to initialization and accessors. The toString method is particularly difficult to scan.

Run 2

Code Structure: Fields, constructors, accessors, and string formatting follow a logical class organization, but compressed declarations obscure boundaries. Nesting: Address validation reaches three conditional levels; manageable, though inconsistent brace placement makes it harder to follow. Clarity of intent: Descriptive types, validation messages, and straightforward accessors communicate purpose well, despite abbreviated field names. Code length: The implementation is reasonably concise without substantial unnecessary logic, but excessive line compression sacrifices readability. Action granularity: Multiple imports, declarations, assignments, conditionals, and append calls share lines, making individual operations difficult to scan. Reading flow: Conventional method ordering helps, but inconsistent indentation, inline constructors, and crowded toString formatting repeatedly interrupt natural reading.

Run 3

Code Structure: Conventional class organization separates fields, constructor validation, accessors, and string formatting, but compressed declarations obscure boundaries. Nesting: Address validation reaches three conditional levels; manageable logically, but inconsistent brace placement makes it harder to follow. Clarity of intent: Descriptive types, method names, and explicit validation messages communicate the purpose well. Code length: Mostly concise and necessary, although extremely long lines sacrifice readability rather than meaningfully simplify the code. Action granularity: Multiple imports, declarations, assignments, conditionals, and append operations share lines, making individual actions difficult to scan. Reading flow: The overall sequence is natural, but inconsistent whitespace, inline constructors, and crowded control flow repeatedly interrupt reading.