Sample

pyint-368dde67b1e7-SRC

Unmodified source class

Scores

MethodScoreScale
Posnett0.4050–1; higher is more readable
Dorn0.9180–1; higher is more readable
Mi0.4960–1; higher is more readable
LLOC6Logical lines; fewer is more readable
DeepSeek V4 Pro17.670–20; mean of three runs
GPT-6.1 Sol16.670–20; mean of three runs
BTTF0.8370–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 HTTPError(RequestException): """An HTTP error occurred."""

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.853−7.279
Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones.144.754−4.777
Source linesThe number of non-empty source lines.7+2.8

Intercept 8.87 + feature contributions = -0.386 (log-odds).
Score = sigmoid(-0.386) = 0.405.

Feature contributions

FeatureValueContribution
(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 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.024+0.713
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.705−0.316
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.60+0.164

Intercept 0.07 + feature contributions = 2.416 (log-odds).
Score = sigmoid(2.416) = 0.918.

Score0.496
Score6
Run 1

The code is concise and well-structured. It imports only what is needed, uses a clear class name, and includes a docstring that states intent. The inheritance from RequestException is obvious. However, the unused imports (TYPE_CHECKING, Any, BaseHTTPError, CompatJSONDecodeError) reduce clarity slightly, as they suggest missing context or future use. Nesting is non-existent, flow is natural, and each part has a clear purpose.

Run 2

The code is clear and well-structured with concise imports grouped logically, a simple class definition with a clear docstring, and no unnecessary nesting or verbosity. It follows conventional Python style and intent is immediately evident. Minor deductions are only because the example is minimal, so there is little opportunity to demonstrate deeper structural or readability challenges.

Run 3

The code is highly readable. It has clear imports with explicit rationale (e.g., future annotations, type checking, compatibility layer). The class hierarchy is logical—HTTPError extends RequestException with a concise docstring. The structure is flat with no nesting. The naming is explicit, and each import serves a distinct purpose. Minor deductions for unused imports (TYPE_CHECKING, Any, BaseHTTPError, CompatJSONDecodeError) which add slight length without visible usage in this snippet, but they may be used elsewhere. Overall, the intent is clear and the organization is clean.

Run 1

Code Structure: Imports followed by a single exception class provide logical organization. Nesting: No nested control flow, making the snippet easy to scan. Clarity of intent: The class name and docstring clearly identify an HTTP exception, although RequestException is not defined or imported in the snippet, and several imports appear unused. Code length: Very concise, with no unnecessary implementation. Action granularity: Each import and declaration occupies its own line. Reading flow: Straightforward top-to-bottom flow, though clearer import grouping and an additional blank line before the class would improve formatting.

Run 2

Code Structure: Imports followed by a single exception class form a logical organization, though RequestException is not defined or imported in the snippet and several imports appear unused. Nesting: Only the class body is indented, keeping nesting minimal. Clarity of intent: The HTTPError name and brief docstring clearly communicate its purpose; the unexplained base class slightly reduces clarity. Code length: Very concise, with no unnecessary implementation. Action granularity: Each import and declaration occupies its own line. Reading flow: Straightforward top-to-bottom flow, although import grouping and an additional blank line before the class would improve visual separation.

Run 3

Code Structure: Imports followed by a single exception class are logically organized, although RequestException is not defined or imported in the snippet. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: The HTTPError name, inheritance, and docstring clearly identify an HTTP-specific exception, but unused imports obscure dependencies. Code length: The class is concise, though several imports appear unnecessary in this excerpt. Action granularity: Each import and declaration occupies its own line. Reading flow: The top-to-bottom flow is natural, but additional spacing between import groups and before the top-level class would improve readability.