Sample
pyint-348ec9ce990f-SRC
Unmodified source class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0.824 | 0–1; higher is more readable |
| Dorn | 0.916 | 0–1; higher is more readable |
| Mi | 0.472 | 0–1; higher is more readable |
| LLOC | 6 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 17 | 0–20; mean of three runs |
| GPT-6.1 Sol | 17.67 | 0–20; mean of three runs |
| BTTF | 0.85 | 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.855 | −7.282 |
| Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones. | 146.719 | −4.842 |
| Source linesThe number of non-empty source lines. | 12 | +4.8 |
Intercept 8.87 + feature contributions = 1.546 (log-odds).
Score = sigmoid(1.546) = 0.824.
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. | 60 | +1.124 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.015 | +0.797 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 13 | +0.576 |
| 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. | 11.639 | −0.247 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 59.923 | +0.162 |
Intercept 0.07 + feature contributions = 2.385 (log-odds).
Score = sigmoid(2.385) = 0.916.
| Score | 0.472 |
|---|
| Score | 6 |
|---|
Run 1
The code is clear and concise. It imports only what is necessary (with proper handling for type checking and compatibility), defines a single exception class with a clear, dual-purpose docstring. There is no nesting, no unnecessary length, and each action is on its own line. The reading flow is natural: imports, then class definition with a useful docstring. Minor deductions: unused imports (BaseHTTPError, CompatJSONDecodeError, Any) may confuse readers about intended use, and the class body is sparse, but overall it is highly readable.
Run 2
The code is well-structured and readable, with clear imports, a concise class definition, and a helpful docstring. It is flat, has no unnecessary nesting, and each import is on its own line. The intent is straightforward: define a Timeout exception for request operations. The docstring clarifies that it encompasses both ConnectTimeout and ReadTimeout. While the code is short and clear, it slightly lacks context—such as the definition of RequestException—and could benefit from a brief comment explaining the relationship between Timeout and the specific timeout exceptions. Overall, it is highly readable and maintainable.
Run 3
The code is highly readable due to its clear structure and intent. It contains only necessary imports and a well-defined exception class with a concise docstring explaining its purpose. Nesting is minimal (class and docstring only), code length is appropriate, and each element appears on its own logical line with natural reading flow. The only minor deductions are for the unused TYPE_CHECKING/Any imports and the alias names, which add slight ambiguity.
Run 1
Code Structure: Imports followed by a single exception class form a logical organization, though RequestException is not defined or imported in the snippet. Nesting: Minimal, with only the class body. Clarity of intent: The Timeout name and descriptive docstring clearly communicate its purpose and catching behavior. Code length: Concise, although several imports appear unused within the provided code. Action granularity: Each import and declaration occupies its own line, with no bundled actions. Reading flow: Straightforward from imports to declaration to documentation; an additional blank line before the class would improve conventional Python formatting.
Run 2
Code Structure: Imports precede a focused exception class, providing logical organization, though RequestException is not defined or imported in the snippet. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: The Timeout name and explanatory docstring clearly communicate its purpose and related exceptions. Code length: The class is concise, but several imports appear unused within this snippet and add noise. Action granularity: Each import and declaration occupies its own line, with no compressed actions. Reading flow: The progression from imports to class to documentation is natural, although an additional blank line before the top-level class would improve conventional Python formatting.
Run 3
Code Structure: Imports precede a focused exception class, providing logical organization. Nesting: The code is flat, with only a class and its docstring. Clarity of intent: The class name and docstring clearly describe timeout behavior and related exceptions, though RequestException is not defined or imported in the snippet. Code length: The implementation is concise, but several imports appear unused within the provided code. Action granularity: Each import occupies its own line, with no combined operations. Reading flow: The progression from imports to class declaration to documentation is natural; an additional blank line before the top-level class would improve formatting.