Sample
pyint-4cd49b4d7f02-I06
Invert eligible conditions and exchange their branches
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 | 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 well-structured and highly readable. It has a clear class definition with a single responsibility (HTTP Basic Auth), no unnecessary nesting, and type hints that improve clarity. Each method is concise and focused on one action. The reading flow is natural, with imports, class definition, overloaded constructors, equality methods, and the main __call__ method in logical order. Minor deductions: the __eq__ method uses an unnecessary list inside all(), and the __ne__ method could be omitted in Python 3. The overloaded constructor with ellipsis bodies may add slight complexity for readers unfamiliar with typing overloads. Overall, this is clean, maintainable code that clearly expresses its intent.
Run 2
The code is highly readable due to its clear structure and organization. The class has a single, well-defined responsibility (HTTP Basic Authentication), and methods are short with clear purposes. The use of type hints, overloads, and docstrings enhances clarity of intent, especially for a library-level API. Nesting is minimal, with only one level in the `__eq__` method using `all()` and `getattr()`. Each action is typically one line, and the reading flow is natural — imports, class definition, overloads, constructor, equality checks, and call logic follow a logical sequence. Minor deductions: the overloads add slight verbosity, and `__ne__` could be omitted in Python 3, but these are stylistic, not readability-breaking. Overall, the code is clean, maintainable, and easy to follow.
Run 3
The code is highly readable with clear structure and intent. It follows a logical organization: imports, class definition, type hints, overloads, constructor, comparison methods, and the call method. Nesting is minimal, with only one level inside __eq__ and __call__. The purpose is explicit — attaching HTTP Basic Auth to a request. Each method performs a single action, and lines are concise. Type hints and overloads enhance clarity, though the overload declarations add slight verbosity without affecting readability. The use of 'all([...])' in __eq__ is slightly less natural than a simple 'and' expression but remains clear. Overall, the code is clean, well-typed, and easy to follow.
Run 1
Code Structure: The class logically groups credential storage, equality checks, and request authentication, though many imports are unused in this excerpt. Nesting: Methods are flat, with no complex control flow. Clarity of intent: The docstring, descriptive credential names, and type annotations clearly communicate the purpose; the abbreviated parameter r and externally defined AuthBase, PreparedRequest, and _basic_auth_str slightly reduce standalone clarity. Code length: The implementation is concise, although all([...]) is more verbose than a direct conjunction for two comparisons. Action granularity: Each statement performs a single clear action. Reading flow: Methods follow a natural progression from initialization to comparison to application, but tightly spaced imports and overload declarations slightly impede visual scanning.
Run 2
Code Structure: The class is logically organized into initialization, equality comparisons, and request authentication, although several imports are unused in this excerpt. Nesting: Methods are shallow, with no complex branching or loops. Clarity of intent: The class name, docstring, method signatures, and explicit Authorization assignment clearly communicate its purpose; the short parameter name r is less descriptive. AuthBase, PreparedRequest, and _basic_auth_str are not defined or imported in the excerpt, limiting self-contained understanding. Code length: The implementation is concise overall, though the multiline all([...]) equality check is more verbose than a simple conjunction. Action granularity: Each statement performs a single clear action. Reading flow: Methods follow a natural progression, but crowded imports and tightly spaced overload declarations slightly reduce visual readability.
Run 3
Code Structure: The class logically groups credential storage, equality comparison, and request authentication, although many unused imports clutter the snippet. Nesting: Methods are flat, with only a simple list inside all(). Clarity of intent: The class docstring, descriptive credential names, and type annotations make its purpose clear; the short parameter name r and externally defined symbols require some context. Code length: The implementation is concise, though the equality expression could be simpler and the imports leaner. Action granularity: Statements generally perform one action per line; compact overload declarations remain understandable. Reading flow: Methods follow a natural progression from initialization to comparison to authentication, but tightly spaced imports and overload decorators slightly reduce visual separation.