Sample
pyint-645b5dfdcf94-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.847 | 0–1; higher is more readable |
| Mi | 0.621 | 0–1; higher is more readable |
| LLOC | 33 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 12.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 14 | 0–20; mean of three runs |
| BTTF | 0.722 | 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. | 1816.539 | −59.946 |
| Source linesThe number of non-empty source lines. | 69 | +27.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.626 | −6.939 |
Intercept 8.87 + feature contributions = -30.415 (log-odds).
Score = sigmoid(-30.415) = 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. | 70 | −1.442 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 55 | +1.165 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 94.943 | +0.727 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.036 | +0.592 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 68.948 | +0.554 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| 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. | 94.9 | −0.354 |
Intercept 0.07 + feature contributions = 1.71 (log-odds).
Score = sigmoid(1.71) = 0.847.
| Score | 0.621 |
|---|
| Score | 33 |
|---|
Run 1
The code has clear organization and intent in its imports and class structure, but it suffers from inconsistent formatting that harms readability. The import statements are logically grouped with reasonable aliasing, and the class methods are well-documented with clear docstrings and type hints. However, there are several formatting issues: multiple imports appear on single lines with awkward spacing (e.g., 'InvalidHeader, InvalidProxyURL'), which creates visual clutter. The send() method signature has irregular spacing with some parameters on one line and others spread across multiple lines inconsistently. The action granularity is generally good, but the inconsistent alignment and spacing make the code harder to scan. The nesting is minimal and the methods are appropriately short, but the overall flow is disrupted by formatting irregularities. The code appears to be a partial implementation or interface definition, which limits assessment of deeper structural quality. With consistent formatting and adherence to PEP 8 conventions, this would be significantly more readable.
Run 2
The code has a logical structure with clear imports and a simple class definition, but suffers from inconsistent formatting that hurts readability. The import section is well-organized by source but has unusual spacing and alignment (e.g., 'socket # noqa: F401', uneven column alignment in parenthesized imports). The `send` method signature has excessive whitespace between parameter names and type hints, disrupting natural reading flow. While the method's docstring is thorough and clearly explains parameters, the signature formatting contradicts the docstring's professionalism. Nesting is minimal and action granularity is fine. The class structure is clear, but single-line method definitions with `raise NotImplementedError` feel cramped. Overall, the code is readable but inconsistent formatting choices reduce clarity, making it appear unpolished. With normal formatting, this would score significantly higher.
Run 3
The code shows inconsistent formatting, particularly in imports and function signatures. Multiple imports are packed on single lines with unusual spacing, reducing scanability. The `send` method signature is broken across lines awkwardly, making parameter identification difficult. While the class structure is logical and docstrings are helpful, the alignment issues and inconsistent spacing between imports and parameters disrupt reading flow. The code is functional but not cleanly formatted, lowering readability.
Run 1
Code Structure: Imports followed by a small adapter class provide logical organization, although import grouping and spacing are inconsistent. Nesting: Minimal nesting makes the class easy to scan. Clarity of intent: Descriptive method names, type annotations, and docstrings clearly communicate the transport interface; however, PreparedRequest and _t are not defined or imported in the snippet, making annotations harder to interpret. Code length: The class is concise, but the large import section is disproportionate to the functionality shown, with many imports unused here. Action granularity: Executable statements perform one action per line, though multiple imported names and parameters are awkwardly packed onto some lines. Reading flow: The progression from imports to initialization, sending, and cleanup is natural, but irregular whitespace, uneven line wrapping, and limited separation between sections interrupt readability.
Run 2
Code Structure: Imports precede a clearly defined adapter interface, but numerous unused imports and missing definitions for PreparedRequest and _t obscure context. Nesting: Methods are flat, with no nested control flow. Clarity of intent: Descriptive method names, type annotations, and docstrings clearly communicate the adapter contract, although unresolved annotation names reduce clarity. Code length: The implementation is concise, but the import block is disproportionately large for the functionality shown. Action granularity: Executable statements perform one action per line; however, several imports and parameters are crowded onto single lines. Reading flow: The progression from imports to initialization, sending, and cleanup is logical, but inconsistent spacing, awkward line breaks, and limited separation between sections interrupt scanning.
Run 3
Code Structure: Imports followed by a small adapter class provide logical organization, but numerous unused imports and unresolved annotation names add clutter. Nesting: Methods are flat, with no complex branching. Clarity of intent: Descriptive method names, type annotations, and docstrings clearly convey the adapter interface, although PreparedRequest and _t are not defined or imported in the snippet. Code length: The class is concise, but the extensive imports and lengthy send docstring outweigh its minimal implementation. Action granularity: Executable statements each perform one action per line; crowded import lists and signature parameters reduce visual clarity. Reading flow: The class reads naturally from initialization to sending and cleanup, but inconsistent spacing, awkward line breaks, and dense parameter formatting interrupt scanning.