Sample
pyint-18f000153ee8-I01
Remove comments and docstrings
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0.338 | 0–1; higher is more readable |
| Dorn | 0.802 | 0–1; higher is more readable |
| Mi | 0.494 | 0–1; higher is more readable |
| LLOC | 6 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 18 | 0–20; mean of three runs |
| GPT-6.1 Sol | 17 | 0–20; mean of three runs |
| BTTF | 0.788 | 0–1; higher is more readable |
Views
Loading feature diagnosis…
Source regions
Feature contributions
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| 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.755 | −7.133 |
| Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones. | 157.891 | −5.21 |
| Source linesThe number of non-empty source lines. | 7 | +2.8 |
Intercept 8.87 + feature contributions = -0.673 (log-odds).
Score = sigmoid(-0.673) = 0.338.
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. | 59.875 | +1.129 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 8 | +0.753 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.029 | +0.662 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 7 | −0.495 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 6.869 | −0.314 |
Intercept 0.07 + feature contributions = 1.399 (log-odds).
Score = sigmoid(1.399) = 0.802.
| Score | 0.494 |
|---|
| Score | 6 |
|---|
Run 1
The code is clean, flat, and well-structured. It clearly imports only what's needed, preserves compatibility, and defines a single custom exception with a minimal, one-action-per-line style. The intent is obvious, the length is appropriate, and the reading flow is natural. Minor deductions: the unused 'TYPE_CHECKING' and 'Any' imports, and the lack of an explanatory comment for the exception's purpose, but overall readability is high.
Run 2
The code is highly readable: it has a clear logical structure, minimal nesting, explicit intent through class naming and imports, concise length, one action per line, and a natural top-down reading flow. It follows common Python patterns for importing compatibility layers and defining custom exception types.
Run 3
The code is highly readable due to its clear structure and minimal complexity. It uses straightforward imports with sensible aliasing, avoiding clutter. The single class definition is flat with no nesting, making the hierarchy immediately obvious. Naming is precise and conventional, clearly indicating the purpose of each element. The code is concise and contains no unnecessary lines. Reading flow is natural, from future imports to standard library imports to local imports, and finally the class definition. Minor points deducted only because the alias 'BaseHTTPError' could be slightly shorter, but this does not affect clarity.
Run 1
Code Structure: Imports precede a clearly separated class definition, providing logical organization. Nesting: Only the class body is indented, so nesting is minimal. Clarity of intent: ConnectTimeout clearly suggests a connection-timeout exception, but ConnectionError and Timeout are not defined or explicitly imported in this snippet, leaving their origins unclear. Code length: Very concise, although several imports appear unused. Action granularity: Each import and declaration occupies its own line, with no compressed operations. Reading flow: The progression from imports to the exception class is natural; an additional blank line before the top-level class would improve conventional formatting.
Run 2
Code Structure: Imports precede a simple class definition, providing logical organization, though several imports appear unused. Nesting: No nested control flow, making the snippet easy to scan. Clarity of intent: ConnectTimeout clearly suggests a connection timeout exception, but ConnectionError and Timeout are not explicitly imported or defined, leaving their origins unclear. Code length: Very concise, although unused imports add unnecessary clutter. Action granularity: Each import and the class body occupy separate lines, with no compressed actions. Reading flow: Straightforward top-to-bottom flow, though an additional blank line before the class would improve conventional Python formatting.
Run 3
Code Structure: Imports followed by a single exception class provide a simple, logical organization. Nesting: There is no deep nesting; the class contains only a pass statement. Clarity of intent: ConnectTimeout clearly suggests a connection timeout exception, but Timeout is not defined or imported in the snippet, and ConnectionError's intended source is unclear. Several imports are unused, adding distracting context. Code length: Very concise, though removing unused imports would improve focus. Action granularity: Each statement occupies its own line. Reading flow: The top-to-bottom flow is natural, but additional separation between import groups and before the class would improve formatting.