Sample
pyint-5a558e70f330-SRC
Unmodified source class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.678 | 0–1; higher is more readable |
| Mi | 0.565 | 0–1; higher is more readable |
| LLOC | 31 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 17.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 17 | 0–20; mean of three runs |
| BTTF | 0.58 | 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. | 1423.286 | −46.968 |
| Source linesThe number of non-empty source lines. | 43 | +17.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.628 | −6.942 |
Intercept 8.87 + feature contributions = -27.841 (log-odds).
Score = sigmoid(-27.841) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 43 | +0.75 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 43 | −0.566 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 44 | −0.522 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 82 | +0.519 |
| 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. | 81.955 | +0.194 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 42.831 | +0.189 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.086 | +0.108 |
Intercept 0.07 + feature contributions = 0.742 (log-odds).
Score = sigmoid(0.742) = 0.678.
| Score | 0.565 |
|---|
| Score | 31 |
|---|
Run 1
The code is highly readable with clear structure, logical organization, and flat nesting. Each method has a single responsibility, and action granularity is well-maintained with one action per line. The class hierarchy and type hints make intent explicit. The overload decorators properly document the type flexibility. Minor deductions: the __eq__ method uses a list inside all() when a generator would be marginally cleaner, and the __ne__ method could use `is not` for slightly better clarity. Overall, the code follows Python best practices, uses appropriate spacing, imports, and docstrings, making it easy to understand and maintain.
Run 2
The code is highly readable with clear structure and intent. The class is logically organized with a simple method sequence, minimal nesting, and one action per line. Type hints and overloads improve clarity, though they add some length. The __eq__ method uses a list with getattr, which is slightly less concise than a tuple comparison, but still clear. Overall, the code is concise, well-structured, and easy to follow, with only minor verbosity from typing overhead.
Run 3
The code is well-structured and highly readable. It has a clear class definition with a focused purpose, minimal nesting, and a natural reading flow. The use of type hints, overloads for type safety, and docstrings clarifies intent. Each action is separated logically, and the methods are concise. The `__eq__` method uses `all()` with a list for readability, though a generator could be slightly more efficient. The `__ne__` method is straightforward. Overall, the code adheres to best practices, with good separation of concerns and clean formatting. Minor deductions for slightly verbose list construction in `__eq__` and reliance on `getattr` without a default type check.
Run 1
Code Structure: The class logically groups initialization, equality checks, and request authentication, though numerous unused imports clutter the excerpt. Nesting: Methods remain flat, with no deeply nested control flow. Clarity of intent: The descriptive class name, docstring, and type annotations clearly communicate HTTP Basic Authentication; however, AuthBase, PreparedRequest, and _basic_auth_str are not defined or imported in the snippet, reducing standalone clarity. Code length: The implementation is concise, although using all() with a list for two comparisons is more verbose than a direct conjunction. Action granularity: Each statement generally performs one clear action. Reading flow: Methods follow a natural progression, but the dense import block and limited spacing around overload declarations slightly weaken visual readability.
Run 2
Code Structure: The class is logically organized into type declarations, initialization, comparison, and request modification, although many imports are unused in this snippet. Nesting: Methods are flat, with no deeply nested control flow. Clarity of intent: The class name, docstring, type annotations, and Authorization assignment clearly communicate its purpose; the abbreviated parameter r and externally defined AuthBase, PreparedRequest, and _basic_auth_str require some context. Code length: The implementation is concise overall, but the overloads and all([...]) equality expression add verbosity for simple operations. Action granularity: Each statement generally performs one action, making changes easy to follow. Reading flow: Method ordering is natural and consistent, though tighter spacing around imports and overload declarations slightly reduces visual separation.
Run 3
Code Structure: The class logically groups initialization, equality checks, and request authentication, though numerous unused imports clutter the snippet. Nesting: Methods remain flat, with no deeply nested control flow. Clarity of intent: The class name, docstring, type annotations, and Authorization assignment clearly convey its purpose; the abbreviated parameter r and externally defined dependencies slightly reduce self-contained clarity. Code length: The implementation is concise, although the all() call with a two-element list is more verbose than a direct conjunction. Action granularity: Each statement performs one clear action; compact overload declarations are conventional and understandable. Reading flow: Methods follow a natural progression from construction to comparison to application, with consistent indentation and spacing within the class.