Sample
int-2015b05c08c4-I01
Remove line comments, block comments, and Javadoc
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.653 | 0–1; higher is more readable |
| Dorn | 0.069 | 0–1; higher is more readable |
| Mi | 0.023 | 0–1; higher is more readable |
| LLOC | 51 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 15.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 17 | 0–20; mean of three runs |
| BTTF | 0.423 | 0–1; higher is more readable |
Views
Loading feature diagnosis…
Source regions
Feature contributions
Feature contributions
| Feature | Value | Contribution (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. | 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.646 | −6.969 |
Intercept 8.87 + feature contributions = -68.045 (log-odds).
Score = sigmoid(-68.045) = 0.
| Score | 0.653 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 98 | +2.653 |
| 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. | 98 | −1.828 |
| 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. | 115.98 | −1.247 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 97.897 | +0.959 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.09 | +0.069 |
Intercept 0.07 + feature contributions = -2.598 (log-odds).
Score = sigmoid(-2.598) = 0.069.
| Score | 0.023 |
|---|
| Score | 51 |
|---|
Run 1
The code is generally readable with clear structure and naming, but suffers from some nested validation logic that reduces clarity. The constructor uses a three-level nested if statement for address validation, which could be flattened using early returns or separate validation methods. Intent is mostly clear through descriptive variable names like bndAddrType and bndPort, and each line generally performs a single action. The toString method is verbose with repeated StringBuilder append calls, which could be more concise using string concatenation or a formatted string. The constructor has multiple overloads and the parameter alignment is good, but the validation logic is mixed with assignment, making it harder to follow the flow. Overall, the code follows Java conventions well but lacks the polish of top-tier readable code due to nesting and verbosity in certain sections.
Run 2
The code is generally readable and well-structured. It follows common Java conventions, has clear naming, and separates concerns logically. The constructor validation has moderate nesting (3 levels deep) but remains understandable. Each line performs a single action, and the flow is natural. String validation logic is slightly verbose but clear. Minor issues include some nested conditionals that could be extracted into helper methods, and the toString() method has slightly awkward branching but remains readable. Overall, it's solid production code with good clarity and organization.
Run 3
The code is well-structured and follows clear conventions. The constructor validates inputs logically with shallow nesting (only one level of 'if' inside a type check), and each validation maps to a single concern. Getters are concise and direct, and toString is flat and readable. Minor issues: the address validation block could be extracted into a private helper to reduce constructor length, and a few comments explaining non-obvious validation rules (e.g., IDN conversion) would improve clarity. Overall, the code is highly readable with clear intent and natural flow.
Run 1
Code Structure: Well organized into immutable fields, constructors, accessors, and string formatting. Nesting: Address validation reaches three conditional levels, adding moderate complexity, while other methods remain flat. Clarity of intent: Class and method names clearly convey a SOCKS5 command response; abbreviated field names such as bndAddr require protocol familiarity. Explicit validation messages clarify constraints. Code length: Reasonably concise, though repetitive validation and StringBuilder calls add some verbosity, and excess blank lines near the imports are distracting. Action granularity: Statements generally perform one action per line, making validation and field assignment easy to inspect. Reading flow: Construction proceeds naturally from null checks through address and port validation to assignment, followed by straightforward accessors and formatting.
Run 2
Code Structure: Fields, constructors, accessors, and string formatting are logically grouped. Nesting: Address validation reaches three conditional levels, adding moderate complexity, while other methods remain flat. Clarity of intent: Types, validation checks, and descriptive exception messages make the purpose clear, although abbreviated names such as bndAddr require domain familiarity. Code length: Generally appropriate, with some repetitive validation and verbose string-building statements. Action granularity: Each statement performs one clear action, making execution easy to follow. Reading flow: Construction proceeds naturally from validation to assignment, followed by accessors and formatting. Excess blank lines near the imports and long exception lines slightly reduce visual consistency.
Run 3
Code Structure: Fields, constructors, accessors, and string formatting are logically organized, with validation grouped before assignment. Nesting: Address validation reaches three conditional levels, adding moderate complexity, but remains manageable. Clarity of intent: Types, method names, and descriptive exception messages communicate purpose clearly; abbreviated bnd names require some protocol familiarity. Code length: Mostly concise, though repetitive validation branches and individual string-builder calls add verbosity, while excess blank lines introduce minor clutter. Action granularity: Each statement performs a single clear action, making execution easy to follow. Reading flow: Constructor delegation, validation, initialization, and straightforward accessors create a natural progression; toString is sequential and predictable.