Sample
int-29738b504777-SRC
Unmodified source class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.653 | 0–1; higher is more readable |
| Dorn | 0.324 | 0–1; higher is more readable |
| Mi | 0.034 | 0–1; higher is more readable |
| LLOC | 51 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 16.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs |
| BTTF | 0.428 | 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.668 | −7.002 |
Intercept 8.87 + feature contributions = -68.077 (log-odds).
Score = sigmoid(-68.077) = 0.
| Score | 0.653 |
|---|
Feature contributions
| Feature | Value | Contribution (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. | 115.98 | −1.247 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 116 | +1.067 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 97.897 | +0.959 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.088 | +0.084 |
Intercept 0.07 + feature contributions = -0.735 (log-odds).
Score = sigmoid(-0.735) = 0.324.
| Score | 0.034 |
|---|
| Score | 51 |
|---|
Run 1
The code is well-structured and readable. It logically groups fields, constructor, accessors, and toString. Nesting in the constructor reaches 4 levels but remains understandable. Intent is clear through method names and validation messages. Code length is reasonable; each line performs a single action. Minor drawbacks: the constructor's nested if-else blocks for address validation could be extracted for improved readability, and the toString method's conditional formatting adds slight complexity. Overall, this is clean, maintainable code.
Run 2
The code is well-structured and readable. It follows clear class organization with fields, constructors, and accessor methods logically arranged. Validation logic in the constructor is explicit, though the address validation has three levels of nesting, which slightly reduces readability. Each validation action is on its own line, and method names clearly indicate intent. The constructor is somewhat long but handles necessary validation. The toString() method flows naturally with a clear if-else structure. Overall, this is clean, maintainable code that would be easily understood by most Java developers, with only minor nesting in the validation block preventing a higher score.
Run 3
The code demonstrates good structure with a clear class hierarchy, well-named fields, and a logical constructor validation flow. Nesting is moderate (3 levels in address validation) but reasonable for the domain logic. Intent is clear throughout - socket address validation and response object creation. The code is appropriately concise with no unnecessary duplication. Action granularity is largely one action per line, especially in the toString method. Reading flow is natural, with validation logic grouped by address type and accessor methods following a standard pattern. The constructor is well-organized with validation before field assignment. Minor improvements could flatten the nested address validation using helper methods, but overall the code is highly maintainable and readable.
Run 1
Code Structure: Fields, constructors, accessors, and string formatting are logically organized, with validation localized in the main constructor. Nesting: Address validation reaches three conditional levels, but the branches remain easy to follow. Clarity of intent: Types, method names, and descriptive exception messages clearly communicate purpose; abbreviated names such as bndAddr require some SOCKS familiarity. Code length: Mostly concise, though repetitive StringBuilder calls make toString somewhat verbose. Action granularity: Statements generally perform one action per line, simplifying scanning. Reading flow: Validation proceeds naturally from null checks through address and port checks to field assignment, followed by straightforward accessors and diagnostic formatting.
Run 2
Code Structure: Fields, constructors, accessors, and string formatting are logically organized with clear separation of responsibilities. Nesting: Address validation reaches three conditional levels, but remains manageable; helper methods could flatten it. Clarity of intent: Descriptive types, straightforward validation, and informative exception messages make the purpose clear, although abbreviated 'bnd' names require some protocol familiarity. Code length: Mostly concise; accessors are appropriate boilerplate, while repetitive StringBuilder calls slightly lengthen toString(). Action granularity: Statements generally perform one action per line, making validation and assignments easy to inspect. Reading flow: The constructor naturally progresses from null checks through address and port validation to field assignment, followed by accessors and formatting. Consistent indentation and spacing support readability.
Run 3
Code Structure: Well organized into immutable fields, constructors, accessors, and string formatting, with validation grouped before initialization. Nesting: Address validation reaches three conditional levels, but the branches remain easy to follow; other methods are flat. Clarity of intent: Types, method names, and descriptive exception messages clearly convey purpose, although abbreviated names such as bndAddr require SOCKS familiarity. Code length: Reasonably concise for the functionality; repetitive accessors and StringBuilder calls add some verbosity. Action granularity: Statements generally perform one action per line, making validation and output construction easy to inspect. Reading flow: The progression from validation to assignment, accessors, and representation is natural, with consistent formatting. Minor drawbacks include dense import spacing, long exception lines, and repetitive address-validation branches.