Sample

pyint-4f7dce077535-I04

Replace names with deterministic minifier-style shortest identifiers

Matched original source

Lines21

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.8070–1; higher is more readable
Mi0.1930–1; higher is more readable
LLOC16Logical lines; fewer is more readable
DeepSeek V4 Pro16.330–20; mean of three runs
GPT-6.1 Sol160–20; mean of three runs
BTTF0.5660–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 RequestException(IOError): """There was an ambiguous exception that occurred while handling your request. """ response: Response | None request: Request | PreparedRequest | None def __init__(self, *a: Any, **b: Any) -> None: """Initialize RequestException with `request` and `response` objects.""" c: Response | None = b.pop("response", None) self.response = c self.request = b.pop("request", None) if c is not None and not self.request and hasattr(c, "request"): self.request = c.request super().__init__(*a, **b)

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(log-odds)
Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones.743.088−24.522
Source linesThe number of non-empty source lines.21+8.4
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.735−7.102

Intercept 8.87 + feature contributions = -14.354 (log-odds).
Score = sigmoid(-14.354) = 0.

Feature contributions

FeatureValueContribution
(log-odds)
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.72.864+0.371
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.79.955+0.279
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.07+0.258
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.22+0.257
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.20.691−0.121
Indentation frequencyHow rapidly indentation changes from line to line.19−0.08

Intercept 0.07 + feature contributions = 1.432 (log-odds).
Score = sigmoid(1.432) = 0.807.

Score0.193
Score16
Run 1

The code is well-structured with clear imports, type hints, and a logical class hierarchy. The RequestException class has a useful docstring, and the __init__ method handles both direct arguments and response-embedded requests sensibly. The primary readability issue is the use of meaningless variable names: 'a', 'b', and especially 'c' for the response object. This forces the reader to scan the code to understand what data is being manipulated. The single-line conditional assignment, while concise, could be more explicit. The nesting is minimal and the overall flow is mostly natural. With better variable naming and slightly clearer intent, this would be close to excellent readability.

Run 2

The code is generally clear and maintainable. It has a single, well-defined class with a logical structure and minimal nesting (one conditional). The intent is clear: capture request/response context for exceptions. The type hints and docstrings enhance readability. Variable names like 'a' and 'b' for *args and **kwargs are conventional but slightly terse; using 'args' and 'kwargs' would be clearer. The logic for inferring request from response is compact and readable, though the condition could be broken into two lines for better action granularity. Overall, it is concise, flat, and flows naturally.

Run 3

The code is generally readable with a clear purpose and logical structure. It defines a custom exception class with type hints and a concise docstring explaining intent. The __init__ method is flat, performs one logical action per line, and follows a natural reading flow: extract response, set attributes, infer request from response if needed, then call parent initializer. However, readability is slightly reduced by the use of single-letter variable names (a, b, c), which obscure intent despite the explanatory docstring, and the conditional logic on one line is somewhat dense. The import section is clean, and the overall length is minimal and appropriate. Type annotations improve clarity, but the cryptic variable naming and inline conditionals prevent a higher score.

Run 1

Code Structure: Imports, class documentation, attributes, and initialization are logically organized, though several imports are unused in this snippet. Nesting: Only one conditional keeps the code flat and easy to follow. Clarity of intent: The class name, type annotations, and initializer docstring explain its purpose, but parameter names a and b and local variable c obscure their roles; the class docstring is also vague. Code length: Compact without substantial unnecessary code. Action granularity: Each statement occupies its own line, making operations easy to distinguish. Reading flow: Initialization proceeds naturally from extracting response and request to inferring the request and initializing the superclass, although clearer variable names and additional spacing around top-level declarations would improve readability.

Run 2

Code Structure: Imports, class attributes, and initialization are logically organized, though TYPE_CHECKING and exception imports are unused in this snippet. Nesting: A single conditional keeps nesting shallow. Clarity of intent: The class name, annotations, and initializer docstring explain its purpose, but a, b, and c obscure arguments and the response object; the class docstring is vague. Code length: The implementation is concise without unnecessary expansion. Action granularity: Each statement performs a distinct action, making execution easy to follow. Reading flow: Initialization proceeds naturally from extracting response and request to inferring a missing request and initializing the superclass. However, Response, Request, and PreparedRequest are not defined or imported here, leaving their context unclear.

Run 3

Code Structure: Imports, exception class, attributes, and initialization are logically organized; TYPE_CHECKING and the exception aliases are unused in this snippet. Nesting: A single conditional keeps the code flat and easy to follow. Clarity of intent: The class name, annotations, and initializer docstring explain its purpose, but a, b, and c obscure the meanings of arguments, keyword arguments, and response. The class docstring is vague. Code length: Compact without substantial unnecessary code. Action granularity: Each statement performs one main action, though the conditional combines several checks. Reading flow: Initialization proceeds naturally from extracting response and request to inferring a missing request and initializing the superclass. More descriptive local names and clearer spacing would improve readability.