Sample
int-a0a74f362e3b-I10
Remove about 40% of line-break groups while retaining structure
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.822 | 0–1; higher is more readable |
| Dorn | 0.056 | 0–1; higher is more readable |
| Mi | 0.163 | 0–1; higher is more readable |
| LLOC | 11 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 4.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 12.33 | 0–20; mean of three runs |
| BTTF | 0.505 | 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. | 990.93 | −32.701 |
| Source linesThe number of non-empty source lines. | 19 | +7.6 |
| 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.713 | −7.069 |
Intercept 8.87 + feature contributions = -23.3 (log-odds).
Score = sigmoid(-23.3) = 0.
| Score | 0.822 |
|---|
Feature contributions
| Feature | Value | Contribution (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. | 147 | −2.561 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 20 | +0.328 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 18.75 | −0.148 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 18 | −0.115 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.095 | +0.016 |
Intercept 0.07 + feature contributions = -2.816 (log-odds).
Score = sigmoid(-2.816) = 0.056.
| Score | 0.163 |
|---|
| Score | 11 |
|---|
Run 1
The code has serious readability issues. The package and multiple imports are crammed onto one line, breaking convention. The method bodies are not properly formatted—opening braces appear on the same line as conditions and closing braces are collapsed together, making the structure hard to follow. Nesting is shallow, which is good, but action granularity and reading flow suffer due to multiple statements sharing lines. Intent is somewhat clear (validate endpoint strings), but the messy formatting obscures logic. The toString method is overly compact with poor line breaks. Overall, the code requires significant reformatting to be considered maintainable or readable.
Run 2
The code is heavily obfuscated by poor formatting: multiple statements on single lines, inconsistent line breaks, and braces positioned abruptly. While the underlying logic is simple (validate string, optionally parse endpoint, provide description), the presentation severely hampers readability. Nesting is mild (one if, one try-catch), but the compressed layout obscures it. Intent is inferable but not clearly expressed due to formatting. Code length is short, but brevity is achieved through unreadable cramming rather than concise design. Action granularity is violated with multiple actions per line. Reading flow is unnatural and disorganized. Overall, the code would require significant reformatting before a maintainer could readily scan and understand it.
Run 3
The code is functionally simple but structurally confusing due to collapsed import statements, multiple statements on single lines, and inconsistent formatting. The ensureValid method combines an if block on the same line as the method signature, and the try-catch block is compressed into two lines, making it hard to distinguish logical blocks. Action granularity is violated with multiple actions per line. Nesting is shallow, which is positive, but reading flow is disorganized and unnatural. Clarity of intent is partially present, but the formatting undermines readability. Code length is concise, but at the expense of clarity. Overall, basic logic is understandable, yet the presentation is poor and would slow down a reader significantly.
Run 1
Code Structure: The validator has logically separated validation and description methods, but compressed declarations and braces obscure their boundaries. Nesting: Shallow conditionals and a simple try/catch keep complexity low. Clarity of intent: Descriptive names and explicit exceptions make the validation purpose clear. Code length: The implementation is concise without unnecessary logic, although excessive compression reduces readability. Action granularity: Several lines combine imports, declarations, conditionals, returns, or method boundaries, making individual actions harder to scan. Reading flow: Validation follows a natural sequence—check type, allow blank input, parse the endpoint, and wrap errors—but inconsistent formatting and misplaced closing braces interrupt that flow.
Run 2
Code Structure: Validation steps are logically organized within a small class, but compressed declarations and misplaced closing braces obscure method boundaries. Nesting: Shallow conditionals and a simple try/catch keep complexity low. Clarity of intent: Descriptive class and method names make endpoint validation clear, though the parsing method's validation role is implicit. Code length: Concise and free of unnecessary logic. Action granularity: Package/import declarations, variable assignment, conditionals, and annotations share lines, reducing scanability. Reading flow: The validation sequence is natural, but inconsistent formatting and crowded braces interrupt reading.
Run 3
Code Structure: The validator has a logical sequence of type checking, blank-value handling, and endpoint validation, but cramped formatting obscures method boundaries. Nesting: Shallow conditionals and a simple try-catch keep complexity low. Clarity of intent: Descriptive class and method names, explicit exceptions, and the explanatory toString make the purpose clear. Code length: Concise, with no unnecessary logic. Action granularity: Several lines combine distinct statements, including package/import declarations, assignment/conditional handling, and closing braces/annotations. Reading flow: The validation sequence is natural, but inconsistent line breaks and brace placement interrupt scanning. Conventional formatting would substantially improve readability.