Sample

pyint-fd8f9aed543a-I03

Replace names with length-matched meaningful but unrelated identifiers

Matched original source

Lines21

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.7990–1; higher is more readable
Mi0.2050–1; higher is more readable
LLOC16Logical lines; fewer is more readable
DeepSeek V4 Pro90–20; mean of three runs
GPT-6.1 Sol150–20; mean of three runs
BTTF0.5610–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, *flag: Any, **region: Any) -> None: """Initialize RequestException with `request` and `response` objects.""" nextItem: Response | None = region.pop("response", None) self.response = nextItem self.request = region.pop("request", None) if nextItem is not None and not self.request and hasattr(nextItem, "request"): self.request = nextItem.request super().__init__(*flag, **region)

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.739−7.108

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

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.82.227+0.522
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.065+0.307
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.805−0.119
Indentation frequencyHow rapidly indentation changes from line to line.19−0.08
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.86+0.023

Intercept 0.07 + feature contributions = 1.378 (log-odds).
Score = sigmoid(1.378) = 0.799.

Score0.205
Score16
Run 1

The code is generally readable with clear structure and intent. It uses modern type hints and follows a logical initialization flow. However, readability is somewhat reduced by poor naming choices: '*flag' and '**region' are ambiguous and don't convey their purpose (likely meant to mirror 'args' and 'kwargs' from the parent class). 'nextItem' breaks Python naming conventions (should be snake_case). The conditional line is slightly long but manageable. The exception class purpose is clear, and nesting is minimal. Overall, it's understandable but could be improved with better parameter naming and adherence to Python naming conventions.

Run 2

The code has several readability issues. The parameter names 'flag' and 'region' are misleading and don't reflect their actual purpose (they serve as *args and **kwargs). The variable 'nextItem' uses camelCase, inconsistent with Python's snake_case convention. The logic flow in __init__ is convoluted: it mutates 'region', assigns attributes, and conditionally backfills 'request' from 'response' in a way that's hard to follow. The type annotations are good and the docstrings help, but the misleading names and multi-step conditional logic reduce clarity. The exception class itself is reasonably structured and imports are clean, but the initialization logic lacks transparency about what arguments are expected and how they map to attributes. A clearer approach would use explicit keyword parameters with meaningful names rather than **kwargs manipulation.

Run 3

This code is nearly unreadable due to severely misleading naming choices and confusing structure. The parameter names `*flag` and `**region` are completely meaningless and have no relation to their actual purpose, violating 'clarity of intent'. The local variable `nextItem` is used to represent a `response`, obscuring its role. The logic for extracting and assigning `request` and `response` is tangled into a single method with multiple responsibilities, hurting 'action granularity' and 'code structure'. The conditional dependency chain (`if nextItem is not None and not self.request and hasattr(...)`) creates unnecessary nesting and impairs 'reading flow'. While the type hints and docstrings exist, they cannot compensate for the cryptic variable names and misleading constructor signature. The code is concise but not readable.

Run 1

Code Structure: Imports, class documentation, attributes, and initialization are logically organized, although TYPE_CHECKING and exception imports are unused in this snippet. Nesting: A single conditional keeps nesting shallow. Clarity of intent: The docstring and request/response attributes explain the purpose, but names such as flag, region, and nextItem obscure the roles of positional arguments, keyword arguments, and the response object. Response, Request, and PreparedRequest are not defined or imported in the snippet. Code length: The implementation is compact without excessive boilerplate. Action granularity: Each line generally performs one action; the conditional combines several related checks reasonably. Reading flow: Initialization proceeds naturally from extracting the response to assigning the request, inferring it when absent, and invoking the parent initializer. More descriptive variable names and cleaner imports would improve readability.

Run 2

1. Code Structure: Imports, class documentation, attribute annotations, and initialization are logically organized, though several imports appear unused. 2. Nesting: Only one conditional level keeps the code easy to scan. 3. Clarity of intent: The initializer clearly attaches request and response objects, but names such as flag, region, and nextItem obscure their roles; Response, Request, and PreparedRequest are not defined or imported in the snippet. 4. Code length: Compact and mostly necessary, with little repetition. 5. Action granularity: Each statement performs a distinct action, although the conditional combines several checks. 6. Reading flow: Initialization proceeds naturally from extracting arguments to deriving the request and initializing the superclass, but unconventional naming and the vague class docstring interrupt comprehension.

Run 3

Code Structure: Imports, class attributes, and initialization are logically organized, though several imports appear unused. Nesting: Only one shallow conditional keeps the code easy to follow. Clarity of intent: The class name, type annotations, and initializer docstring explain its purpose, but names such as flag, region, and nextItem obscure otherwise straightforward argument and response handling. Response, Request, and PreparedRequest are not defined or imported in the snippet, reducing standalone clarity. Code length: Compact and appropriately scoped, without unnecessary implementation detail. Action granularity: Each statement performs a distinct action, although the conditional combines three checks. Reading flow: Initialization proceeds naturally from extracting the response to setting the request, inferring it when needed, and invoking the parent initializer. More descriptive variable names and cleaner imports would improve readability.