Sample
pyint-db93c6560a63-I04
Replace names with deterministic minifier-style shortest identifiers
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0.65 | 0–1; higher is more readable |
| Dorn | 0.86 | 0–1; higher is more readable |
| Mi | 0.307 | 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.67 | 0–20; mean of three runs |
| BTTF | 0.789 | 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.692 | −7.039 |
| 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. | 10 | +4 |
Intercept 8.87 + feature contributions = 0.621 (log-odds).
Score = sigmoid(0.621) = 0.65.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.019 | +0.761 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 11 | +0.647 |
| 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. | 74 | +0.531 |
| 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. | 9.88 | −0.272 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 60.636 | +0.174 |
Intercept 0.07 + feature contributions = 1.813 (log-odds).
Score = sigmoid(1.813) = 0.86.
| Score | 0.307 |
|---|
| Score | 6 |
|---|
Run 1
The code is highly readable and well-structured. It uses clear imports with future annotations for modern type hinting. The exception class `ConnectTimeout` inherits logically from `ConnectionError` and `Timeout`, accurately reflecting its purpose. The docstring concisely explains when the error occurs and explicitly notes that retrying is safe, which is crucial for error handling. Nesting is nonexistent, and each import is on its own line, following clean action granularity. The code length is minimal and avoids unnecessary complexity. Reading flow is natural: imports first, then class definition with documentation. Minor deductions only because the docstring could include a period after the first sentence, and the class body contains only a docstring, which is acceptable for an exception class.
Run 2
The code is highly readable. It has a clear, logical structure: imports are organized with future annotations first, followed by typing, third-party, and local imports. There is no nesting. Intent is evident—defining a custom exception with a docstring explaining its meaning and retry safety. Length is concise and appropriate. Each line performs a single action. Reading flow is natural, as the class definition is preceded by a helpful docstring. Minor deductions: the alias 'BaseHTTPError' and 'CompatJSONDecodeError' are not used in the visible snippet, and the mixin order (ConnectionError, Timeout) could raise MRO questions, though it is standard for requests.
Run 3
The code is well-structured with clear imports and a simple class definition. It uses a docstring to explain when the error occurs and that retries are safe, making intent clear. The class inherits from two built-in exceptions, which is concise and logical. No nesting or complexity is present. Each line serves a distinct purpose, and the reading flow is natural. Minor deductions: the imports are unused in the visible snippet, and a trailing triple-backtick artifact appears after the code block, but neither is part of the actual Python code.
Run 1
Code Structure: Imports followed by a focused exception class provide clear organization. Nesting: There is no unnecessary nesting. Clarity of intent: The descriptive class name and docstring clearly explain the connection timeout and retry safety, although ConnectionError and Timeout are not defined or imported in the snippet. Code length: The implementation is concise, but several imports are unused in the shown code. Action granularity: Each import and declaration occupies its own line. Reading flow: The code reads naturally from dependencies to declaration to documentation; an additional blank line before the class would improve conventional formatting.
Run 2
Code Structure: Imports followed by a focused exception class provide logical organization, though a blank line between imports and the class would improve formatting. Nesting: No nested control flow; the class is easy to scan. Clarity of intent: The descriptive class name and docstring clearly explain the connection timeout and retry safety. However, ConnectionError and Timeout are not defined or imported in the snippet, leaving inheritance context unclear. Code length: Concise, although the displayed imports are unused. Action granularity: Each import and class declaration occupies its own line. Reading flow: Natural top-to-bottom progression, with minor distractions from unused imports and missing base-class context.
Run 3
Code Structure: Imports followed by a focused exception class provide a logical organization. Nesting: Only the class body is indented, making the code easy to scan. Clarity of intent: The class name and docstring clearly describe a connection timeout and retry safety, although ConnectionError and Timeout are not defined or imported in the snippet. Code length: The class is concise, but the unused imports add unnecessary clutter. Action granularity: Each import and declaration occupies its own line. Reading flow: The flow from imports to class definition to documentation is natural, though additional spacing between import groups and before the class would improve readability.