Sample

pyint-bedbeb4d5970-SRC

Unmodified source class

Lines10

Scores

MethodScoreScale
Posnett0.650–1; higher is more readable
Dorn0.860–1; higher is more readable
Mi0.3070–1; higher is more readable
LLOC6Logical lines; fewer is more readable
DeepSeek V4 Pro170–20; mean of three runs
GPT-6.1 Sol17.330–20; mean of three runs
BTTF0.7890–1; higher is more readable

Views

Source code

from __future__ import annotations from typing import TYPE_CHECKING, Any from urllib3.exceptions import HTTPError as BaseHTTPError from .compat import JSONDecodeError as CompatJSONDecodeError class ConnectTimeout(ConnectionError, Timeout): """The request timed out while trying to connect to the remote server. Requests that produced this error are safe to retry. """

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(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

FeatureValueContribution
(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.

Score0.307
Score6
Run 1

The code is clear and well-structured. It uses modern Python features like `from __future__ import annotations` and `TYPE_CHECKING` for type hints, which shows good practice. Imports are logically grouped: standard library/external libraries first, then local modules. The custom exception `ConnectTimeout` is clearly named and inherits from both `ConnectionError` and `Timeout`, which is semantically correct and immediately communicates the error's meaning. The docstring is concise and useful, explaining what the error means and whether retrying is safe. Nesting is non-existent, and each import or class definition is one logical action per line. The reading flow is natural: imports, then class definition, then documentation. There is no ambiguity in intent. The only minor deduction is that the code is incomplete (it ends abruptly after the docstring), but judging only the visible portion, it is highly readable.

Run 2

The code is clean and well-structured. It imports future annotations, typing utilities, and exception classes with clear aliasing. The class definition is flat, with a clear docstring explaining the error condition and retry safety. Naming is explicit and follows Python conventions. The code length is concise, and each import stands alone, improving readability. The only minor deduction is that the action granularity is straightforward but could include more context (e.g., why safe to retry), though this does not significantly harm clarity. Overall, the code is highly readable with a clear intent and logical organization.

Run 3

The code is highly readable. It has a clear, logical structure with standard imports grouped by source. Nesting is non-existent, as it consists only of imports and a single class definition. Intent is explicit: the class name and docstring clearly define it as a connection timeout error, and the docstring notes safe retry behavior. Code length is concise and appropriate. Action granularity and reading flow are excellent, with one logical statement per line and a natural order from imports to class definition. Clarity slightly reduced by the alias names (`BaseHTTPError`, `CompatJSONDecodeError`) whose purpose isn't obvious without context, but this is standard practice for avoiding name collisions.

Run 1

Code Structure: Imports followed by a single exception class provide a simple, logical organization, though several imports are unused in this snippet. Nesting: The code is flat, with no nested control flow. Clarity of intent: The descriptive class name and docstring clearly explain the timeout condition and retry safety; however, ConnectionError and Timeout are not explicitly imported or defined here, leaving their origins unclear. Code length: The snippet is concise without unnecessary implementation. Action granularity: Each import and declaration occupies its own line. Reading flow: The progression from imports to declaration to documentation is natural, though an additional blank line before the top-level class would improve conventional formatting.

Run 2

Code Structure: Imports followed by a focused exception class provide a logical organization. Nesting: There is no unnecessary nesting. Clarity of intent: The class name and docstring clearly explain a connection timeout and its retry safety, though ConnectionError and Timeout are not defined or explicitly imported in the snippet. Code length: The class is concise, but several imports appear unused here. Action granularity: Each import and declaration occupies its own line. Reading flow: The code reads naturally from dependencies to the exception definition, although a second blank line before the top-level class would improve conventional Python formatting.

Run 3

Code Structure: Imports followed by a single exception class are logically organized, though several imports appear unused. Nesting: The code is flat, with only a class and its docstring. Clarity of intent: The class name and docstring clearly describe a connection timeout and retry safety, but ConnectionError and Timeout are not defined or imported in the snippet. Code length: The implementation is concise, with little unnecessary content beyond the apparently unused imports. Action granularity: Each import and declaration occupies its own line. Reading flow: The sequence is natural and easy to scan, although a blank line between standard-library, third-party, and local imports, plus another before the class, would improve visual organization.