Sample
pyint-a88552bc9b98-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.626 | 0–1; higher is more readable |
| Mi | 0.491 | 0–1; higher is more readable |
| LLOC | 60 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 10 | 0–20; mean of three runs |
| GPT-6.1 Sol | 14 | 0–20; mean of three runs |
| BTTF | 0.444 | 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. | 4437.184 | −146.427 |
| Source linesThe number of non-empty source lines. | 130 | +52 |
| 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.599 | −6.898 |
Intercept 8.87 + feature contributions = -92.456 (log-odds).
Score = sigmoid(-92.456) = 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. | 131 | −3.602 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 105 | +2.895 |
| 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. | 149.969 | −2.687 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 149.985 | +1.615 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 129.861 | +1.405 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.054 | +0.419 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
Intercept 0.07 + feature contributions = 0.514 (log-odds).
Score = sigmoid(0.514) = 0.626.
| Score | 0.491 |
|---|
| Score | 60 |
|---|
Run 1
The code shows mixed readability. While the class structure, type hints, and docstring demonstrate clear intent and good organization, the formatting severely impacts readability. Many import statements and the __init__ signature are unnecessarily broken across lines with awkward spacing, creating visual noise and disrupting natural reading flow. The __init__ method crams multiple parameters onto single lines despite available space, violating the 'one action per line' principle. Nesting is minimal and the logic is straightforward, but the inconsistent formatting patterns (e.g., mixed alignment in imports) make the code appear disorganized. The code length is reasonable, and the docstring is excellent, but the poor formatting choices significantly reduce clarity. With consistent formatting, this would score much higher.
Run 2
The code has logical organization but severely suffers from inconsistent and haphazard formatting, harming readability. Imports are grouped logically, but vertical alignment and spacing are erratic — some lines have excessive indentation or missing spaces around commas. Class structure is clear, but method signatures and function calls are broken into awkward, disorganized line wraps. Nesting is minimal, which is positive, and intent is generally clear thanks to docstrings and type hints. However, action granularity is uneven; some lines contain multiple statements while others are unnecessarily fragmented. Reading flow is disrupted by inconsistent line breaks and alignment, making the code feel messy. Overall, the structure is sound, but formatting inconsistencies drastically reduce readability.
Run 3
The code suffers from severe formatting inconsistencies that significantly impair readability. Import statements have erratic spacing and alignment (e.g., 'from typing import ( TYPE_CHECKING,') making them hard to scan. Function signatures and calls are broken across lines with excessive whitespace and misaligned parameters, disrupting visual flow. While the overall structure is logical and follows common request library patterns, the execution undermines clarity. The docstring is well-written and informative, but the surrounding code's garbled indentation and spacing overshadow this. Action granularity is mostly acceptable, with one main operation per line, but the chaotic alignment makes even simple assignments appear disorganized. Nesting is minimal, but the formatting issues create a perception of tangled code. The code is functional but would require substantial reformatting to meet professional readability standards.
Run 1
Code Structure: The class is logically organized into type declarations, initialization, representation, and preparation, although extensive imports obscure the main code. Nesting: Control flow is shallow, with only one straightforward loop. Clarity of intent: Descriptive names, type annotations, and documentation make the request object's purpose clear; dependencies not defined in the snippet require external context. Code length: The implementation is reasonably concise, but lengthy documentation and imports dominate this small excerpt. Action granularity: Most executable statements perform one action per line, while several imports, parameters, and keyword arguments are crowded onto shared lines. Reading flow: Methods follow a natural sequence, but inconsistent spacing, long signature lines, and limited separation between declarations and methods interrupt scanning.
Run 2
Code Structure: The class logically groups attributes, initialization, representation, and request preparation, although the extensive imports obscure its focus. Nesting: Shallow control flow makes execution easy to follow. Clarity of intent: Descriptive names, type annotations, and a detailed docstring clearly explain the class's purpose. Code length: Methods are concise, but many imports appear unused in this excerpt, adding visual overhead. Action granularity: Assignments generally perform one action per line; however, multiple parameters and keyword arguments crowded onto single lines hinder scanning. Reading flow: Initialization proceeds naturally from defaults to hooks to attribute assignment, followed by preparation. Inconsistent whitespace, poorly formatted signatures and imports, and limited spacing between sections interrupt that flow. Overall, the underlying logic is readable, but presentation significantly weakens readability.
Run 3
Code Structure: The class is logically organized into attributes, initialization, representation, and preparation, although the extensive import block distracts from the small implementation. Nesting: Control flow is shallow, with only a simple loop. Clarity of intent: Descriptive names, type annotations, and a detailed docstring clearly explain the request object's purpose. Code length: Methods are concise, but numerous imports unused in this excerpt and lengthy documentation add reading overhead. Action granularity: Assignments generally perform one action per line, but multiple parameters and keyword arguments crowded onto single lines reduce scanability. Reading flow: Initialization and preparation follow a natural sequence, but inconsistent spacing, awkward line wrapping, and limited separation between class sections interrupt the flow. Referenced types and the base class are not defined or imported in the excerpt, limiting standalone understanding.