Sample
pyint-bac66b12db64-I10
Deterministically remove some optional blank lines and bracketed line breaks
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.429 | 0–1; higher is more readable |
| Mi | 0.264 | 0–1; higher is more readable |
| LLOC | 50 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 12.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 16 | 0–20; mean of three runs |
| BTTF | 0.533 | 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. | 82 | +32.8 |
| 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.495 | −6.743 |
Intercept 8.87 + feature contributions = -61.7 (log-odds).
Score = sigmoid(-61.7) = 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. | 83 | −1.902 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 69 | +1.65 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 69 | −1.163 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 107.976 | +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.988 | −0.909 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 81.844 | +0.734 |
| 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.284 (log-odds).
Score = sigmoid(-0.284) = 0.429.
| Score | 0.264 |
|---|
| Score | 50 |
|---|
Run 1
The code has a clear purpose and is logically organized into a single class. However, readability is harmed by several issues. The class has inconsistent spacing between methods, with some methods packed together without blank lines, disrupting the reading flow. Some lines are unnecessarily long, and the `urlunparse` call is oddly formatted, with `parsed.scheme` and `host` cramped together on the same line while other arguments are on separate lines. The type hints are incomplete and inconsistent, and the `type` attribute is defined at the class level without clear necessity. Nesting is shallow, which is good, and most methods are concise. But the importer order and code structure could be improved, and the overall formatting feels uneven. The intent of the code is clear, and the method actions are mostly granular, but the visual inconsistency reduces readability.
Run 2
The code is moderately readable but inconsistent. Structure is logical for a wrapper class, but it suffers from irregular blank lines and cramped method grouping. Nesting is low, which is good. However, the `get_full_url` method contains an oddly formatted list with extraneous spaces that hurts readability. Action granularity is mostly one action per line, but some method definitions and docstrings are packed closely, making it harder to scan. Reading flow is mixed: comments are helpful, but missing blank lines after properties and some methods interrupt flow. The long `get_header` line and type ignore comment add clutter. Clarity of intent is decent due to docstrings and naming, but overall visual inconsistency reduces the score.
Run 3
The code is generally readable but has several structural and formatting issues. It follows a class-based design with clear methods, but the placement of `type: str` before `__init__` and inconsistent blank lines between methods disrupt flow. Some methods are missing blank lines, making the class feel cramped. Nesting is minimal, mostly flat, which is good. Clarity of intent is moderate: docstring helps, but methods like `get_full_url` contain inline comments and oddly spaced list formatting that reduce readability. Code length is appropriate, but action granularity in `urlunparse` is poor—multiple items are placed on one line in a scattered way. Reading flow suffers from inconsistent spacing and formatting. Overall, the logic is understandable, but formatting and organization could be improved for higher readability.
Run 1
Code Structure: A cohesive adapter class groups related request and header operations, though imports are poorly ordered and several appear unused in this excerpt. Nesting: Methods are flat, with only one simple conditional and an early return. Clarity of intent: Descriptive method names, type annotations, and the class docstring clearly explain the interface; the abbreviated _r attribute and misleading reference to a response's URL slightly reduce clarity. Code length: Implementation is concise, although some comments repeat obvious operations. Action granularity: Most lines perform a single action, but the irregularly formatted URL component list puts multiple items on one line. Reading flow: Methods follow a sensible progression from URL access to header handling and properties, but inconsistent blank lines between methods, misplaced threading import, and awkward list spacing interrupt scanning.
Run 2
Code Structure: The class logically groups request-adapter responsibilities, but imports are poorly organized and several appear unused in this snippet. Nesting: Methods are mostly flat, with a simple conditional and early return. Clarity of intent: Descriptive method names, type annotations, and the class docstring clearly explain the adapter's purpose; abbreviated attributes and the unexplained PreparedRequest reference slightly reduce clarity. Code length: Most methods are concise, though some comments restate operations and property wrappers add repetition required by the interface. Action granularity: Statements generally perform one action per line, but two URL components share an awkwardly spaced line. Reading flow: Methods follow a reasonable sequence, but inconsistent blank lines, irregular list formatting, and a long inline type-ignore comment disrupt visual scanning.
Run 3
Code Structure: The class logically groups request-adapter methods, although imports are poorly ordered and include several unused names. Nesting: Methods are shallow, with a straightforward conditional and early return. Clarity of intent: Descriptive method names, type annotations, and the class docstring clearly explain the adapter's purpose; the abbreviated attribute `_r` and a comment referring to a response rather than a request slightly weaken clarity. Code length: Most methods are concise, though some comments repeat obvious operations. Action granularity: Statements generally perform one action per line, but the malformed-looking URL argument formatting places multiple elements on one line. Reading flow: Method ordering is coherent, but inconsistent blank lines between methods and irregular whitespace in `urlunparse` interrupt scanning. Overall, the code is easy to understand despite noticeable formatting issues.