Sample
pyint-6b48fd984b9f-I01
Remove comments and docstrings
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.276 | 0–1; higher is more readable |
| Mi | 0.677 | 0–1; higher is more readable |
| LLOC | 48 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 15.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 16.67 | 0–20; mean of three runs |
| BTTF | 0.539 | 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. | 2902.505 | −95.783 |
| Source linesThe number of non-empty source lines. | 84 | +33.6 |
| 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.383 | −6.574 |
Intercept 8.87 + feature contributions = -59.887 (log-odds).
Score = sigmoid(-59.887) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 84 | +2.168 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 84 | −1.938 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 84 | −1.507 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 83.707 | +0.76 |
| 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. | 80.988 | +0.235 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.092 | +0.049 |
Intercept 0.07 + feature contributions = -0.966 (log-odds).
Score = sigmoid(-0.966) = 0.276.
| Score | 0.677 |
|---|
| Score | 48 |
|---|
Run 1
The code has a clear class structure with cohesive methods for request handling, but readability is hindered by several issues. There's inconsistent formatting with blank lines (e.g., line 16), trailing whitespace after `get_header`, and no whitespace after the colon in the `type` annotation. Long lines in `get_header` and type hints reduce readability. Some methods have unnecessary multi-line formatting with blank comment-only lines (e.g., in `get_full_url`), while others are one-liners, creating inconsistent granularity. The naming is generally clear, but methods like `is_unverifiable` and `get_origin_req_host` are unclear without context. The `get_full_url` method has complex parsing logic that could benefit from helper functions or comments explaining the fallback strategy. Additionally, the abstract `add_header` raising `NotImplementedError` is a code smell that might confuse readers. Overall organization is logical, but implementation details and formatting inconsistencies suggest moderate readability.
Run 2
The code is well-structured and readable, using clear class and method names. It follows the single responsibility principle, with each method performing one focused task. Nesting is minimal, and the logic flows naturally. Type hints improve clarity of intent. Some minor issues affect readability: a few unused imports (calendar, time, threading, Iterator, MutableMapping, TYPE_CHECKING, Any, TypeVar, overload, CookieJar, CookiePolicy, Morsel, cookielib) add noise. The get_full_url method has multiple steps but remains understandable. The add_header method correctly raises NotImplementedError. Overall, the code is maintainable and easy to follow.
Run 3
The code is well-structured and follows clean patterns. The class has a clear single responsibility (mocking a request for cookie processing), with methods that are small and focused. Nesting is minimal throughout, and each method performs one action, making the code easy to follow. Type hints improve clarity, and the use of properties provides natural access patterns. The reading flow is logical, with methods organized by functionality. Minor deductions: the get_header method could be simplified, and the __init__ method has an assertion that could be replaced with a more explicit validation pattern. Overall, this code is highly readable and maintainable.
Run 1
Code Structure: Methods are logically grouped within a focused request adapter, though import ordering is inconsistent and several imports appear unused. Nesting: Very shallow, with a simple conditional and early return. Clarity of intent: Descriptive method names and type annotations communicate purpose, but the terse _r attribute, undefined PreparedRequest reference in the snippet, and lack of explanation for Host-header handling reduce clarity. Code length: Mostly concise; excessive blank lines and minor wrapper repetition add noise. Action granularity: Each statement generally performs one action, making execution easy to follow. Reading flow: Initialization, accessors, header operations, and properties follow a natural progression, although irregular whitespace and trailing spaces interrupt visual consistency.
Run 2
Code Structure: The class is logically organized into initialization, request accessors, header operations, and properties, though imports are inconsistently grouped and several appear unused. Nesting: Methods are flat, with only one simple conditional. Clarity of intent: Descriptive method names and type annotations make the adapter behavior understandable, but abbreviated attributes, the unexplained Host override, and the undefined PreparedRequest type in this snippet reduce clarity. Code length: Most methods are concise; thin accessor wrappers add some repetition but fit the interface. Action granularity: Each statement generally performs one action, with no compressed multi-statement lines. Reading flow: The progression is natural, but excessive blank lines, whitespace-only lines, and trailing spaces interrupt the otherwise clean presentation.
Run 3
Code Structure: The class logically groups request-adapter methods and properties, although imports are poorly ordered and several appear unused in this snippet. Nesting: Control flow is shallow, with a simple early return and no deeply nested blocks. Clarity of intent: Descriptive method names and type annotations make most behavior clear, but the abbreviated field _r and absence of a class docstring leave the adapter's purpose and interface requirements implicit. Code length: Methods are concise; some wrappers seem repetitive but plausibly support the expected interface. Action granularity: Statements generally perform one action per line, and the URL reconstruction is clearly formatted. Reading flow: Methods progress naturally from request metadata to header handling and properties, but excessive whitespace, trailing spaces, and the late threading import interrupt an otherwise clean presentation.