Sample
pyint-2e34081a0f33-SRC
Unmodified source class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.401 | 0–1; higher is more readable |
| Mi | 0.372 | 0–1; higher is more readable |
| LLOC | 50 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 16.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs |
| BTTF | 0.535 | 0–1; higher is more readable |
Views
Loading feature diagnosis…
Source regions
Feature contributions
Feature contributions
| Feature | Value | Contribution (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. | 2928.092 | −96.627 |
| Source linesThe number of non-empty source lines. | 93 | +37.2 |
| 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.499 | −6.749 |
Intercept 8.87 + feature contributions = -57.306 (log-odds).
Score = sigmoid(-57.306) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 94 | −2.292 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 79 | +1.995 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 79 | −1.392 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 107.989 | +0.938 |
| 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. | 107.947 | −0.907 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 92.798 | +0.887 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.066 | +0.298 |
Intercept 0.07 + feature contributions = -0.402 (log-odds).
Score = sigmoid(-0.402) = 0.401.
| Score | 0.372 |
|---|
| Score | 50 |
|---|
Run 1
The code is generally readable, with a clear class structure and descriptive method names. It maintains a flat structure with minimal nesting, only using a few conditional blocks. Each method performs a single logical action, and the docstring provides useful context. However, some issues affect clarity, such as the over-broad type hint on `get_type` (should be `str`), the assert-based validation which might be unclear at runtime, and the non-obvious use of `# type: ignore` in `get_header`. The imports are somewhat verbose and include an unused `threading` import, which slightly detracts from conciseness. Overall, it is well-organized and easy to follow, but minor ambiguities prevent a higher score.
Run 2
The code is well-structured, readable, and adheres to clean coding principles. It has a clear class with a single responsibility (wrapping a requests.PreparedRequest for CookieJar compatibility), good use of type hints, and descriptive method names. Nesting is minimal—only one conditional exists, and it is short. Most methods perform a single action or a clear sequence of steps. The reading flow is natural due to consistent ordering of methods and clear separation of concerns. The docstring explains the class's purpose well. Slight deductions are for the inline comment on a type ignore line, which could be clearer, and the incomplete import (PreparedRequest is not imported, though it may be under TYPE_CHECKING). Overall, the code is concise and maintainable.
Run 3
The code is well-structured and readable. The class has a clear single responsibility: adapting a requests.PreparedRequest to the urllib2.Request interface expected by cookiejar. Methods are short, focused, and have descriptive names. Naming is clear, and type hints are used consistently. Comments explain non-obvious behavior (e.g., Host header reconstruction). Most methods follow a flat structure with minimal nesting. The class-level docstring is helpful. Minor deductions: a few methods are longer than necessary (e.g., get_full_url), and one type ignore annotation reduces clarity. Overall, the code is easy to follow and maintain.
Run 1
Code Structure: A cohesive adapter class organizes related request and header operations into focused methods; import ordering and several unused imports slightly reduce polish. Nesting: Almost entirely flat, with a single conditional and early return. Clarity of intent: The class docstring, descriptive method names, type annotations, and URL-reconstruction comments clearly explain its purpose, although `_r` is terse and PreparedRequest is not defined or imported in the snippet. Code length: Concise implementation overall, with some repetitive interface wrappers justified by compatibility requirements. Action granularity: Statements generally perform one action each; the nested dictionary lookup in get_header is slightly denser. Reading flow: Methods progress naturally from initialization through request metadata and header handling to compatibility properties, with consistent formatting and useful whitespace.
Run 2
Code Structure: The class is logically organized into initialization, request metadata access, header handling, and compatibility properties, although imports are cluttered with unused names. Nesting: Control flow is shallow, with a single conditional and an early return. Clarity of intent: Descriptive method names, type annotations, and the class docstring clearly explain the adapter's purpose; the abbreviated _r attribute and the comment referring to a response rather than a request slightly weaken clarity. Code length: Methods are concise, though some comments and forwarding properties add verbosity justified by interface compatibility. Action granularity: Statements generally perform one action per line; the nested dictionary lookup in get_header is somewhat dense. Reading flow: The progression through related methods is natural, and formatting is consistent, but placing threading after local imports and retaining unused imports introduces minor distractions.
Run 3
Code Structure: The class logically groups request-adapter methods, though imports are cluttered with unused names and threading is out of order. Nesting: Control flow is shallow, with a single conditional and an early return. Clarity of intent: Descriptive method names, type annotations, and the class docstring clearly explain the adapter's purpose; the abbreviated _r attribute and unshown PreparedRequest definition slightly reduce clarity. Code length: Methods are concise and appropriately scoped, although some comments repeat obvious operations. Action granularity: Statements generally perform one action per line; the nested dictionary lookups in get_header are slightly dense. Reading flow: Consistent formatting and straightforward method bodies make the code easy to follow, with minor distractions from redundant wrappers and the inline type-ignore comment.