Sample
pyint-11d20ea1dd23-I08
Select one of ten high-readability unrelated code templates per class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.679 | 0–1; higher is more readable |
| Mi | 0.565 | 0–1; higher is more readable |
| LLOC | 35 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 10.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 15 | 0–20; mean of three runs |
| BTTF | 0.431 | 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. | 1610.322 | −53.141 |
| Source linesThe number of non-empty source lines. | 47 | +18.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.601 | −6.902 |
Intercept 8.87 + feature contributions = -32.372 (log-odds).
Score = sigmoid(-32.372) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 47 | +0.889 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 48 | −0.663 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 46 | −0.635 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 82 | +0.519 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 46.831 | +0.245 |
| 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.979 | +0.193 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.083 | +0.134 |
Intercept 0.07 + feature contributions = 0.751 (log-odds).
Score = sigmoid(0.751) = 0.679.
| Score | 0.565 |
|---|
| Score | 35 |
|---|
Run 1
The code has decent structure with clear class and method organization, type hints, and reasonable naming conventions. However, the __eq__ method contains a completely unrelated and nonsensical loop (counting even numbers from 0-5) that serves no purpose, significantly damaging clarity of intent. This dead code creates confusion about the method's actual purpose. The code is generally flat with minimal nesting, which is positive, but the unnecessary loop adds length without value. Action granularity is mostly one action per line, and reading flow is natural except for the puzzling loop. The imports are clean and the docstring is helpful. Type hints improve readability, and the __call__ method is concise and clear. Overall, removing the irrelevant loop would substantially improve the score, as it currently introduces ambiguity and breaks the logical flow of an otherwise readable implementation.
Run 2
The code structure is generally logical, with clear class definition and method organization. However, there are significant readability issues. The `__eq__` method contains irrelevant, confusing code: the loop counting even numbers serves no purpose and obfuscates the actual comparison logic. This severely damages clarity of intent. The `__init__` method has redundant overload decorators followed by a broad implementation signature, adding noise without clarity. Nesting is minimal, and action granularity is mostly acceptable. Reading flow is interrupted by the nonsensical even-number counting block, forcing the reader to puzzle over its purpose. While basic HTTP auth functionality is clear, the extraneous code violates the principle of concise, purposeful implementation. The `__ne__` method is straightforward. Overall, the code suffers from a critical flaw in its equality method that dramatically reduces readability despite otherwise clean structure.
Run 3
The code is mostly readable but has significant issues. The class structure is clear, with straightforward __init__ and __call__ methods. However, the __eq__ method contains a completely irrelevant loop counting even numbers that serves no purpose and severely damages clarity of intent. This unrelated code block confuses readers and violates the single-responsibility principle. Nesting is minimal, which is good, but the unnecessary loop adds needless complexity. Type annotations improve readability, and the __call__ method is concise with clear purpose. The import statements are organized but some appear unused (hashlib, os, re, threading, time, warnings, b64encode, parse_dict_header, extract_cookies_to_jar), which clutters the module. Action granularity is mostly good, with one operation per line. The reading flow is disrupted by the nonsensical even-number counting loop, which appears to be dead code or a mistake. Removing that loop and unused imports would significantly improve the score.
Run 1
Code Structure: The class is logically organized into initialization, comparison, and request authentication methods, but many imports are unused in this snippet. Nesting: Mostly flat, with only a shallow loop and conditional in __eq__. Clarity of intent: Descriptive names, type annotations, and the class docstring clarify authentication behavior; however, counting even numbers serves no purpose and distracts from equality checking. Code length: Generally concise, but the irrelevant loop and all() applied to a two-item list add unnecessary bulk. Action granularity: Each line performs a clear, discrete action. Reading flow: Method order is natural, but the unrelated computation interrupts __eq__, and limited spacing between imports and overload declarations reduces visual separation. AuthBase, PreparedRequest, and _basic_auth_str are not defined in the excerpt, requiring external context.
Run 2
Code Structure: The class is logically organized into initialization, comparison, and request authentication methods, but numerous unused imports add clutter. Nesting: Most code is flat; the nested loop and condition in __eq__ are shallow but unnecessary. Clarity of intent: Descriptive names, type annotations, and the class docstring clearly communicate authentication behavior, while the unrelated even-number count obscures the equality method's purpose. Code length: Generally concise, but the unused counting logic, imports, and verbose all([...]) comparison unnecessarily increase length. Action granularity: Statements mostly perform one action per line, making individual operations easy to follow. Reading flow: Method ordering is natural, but the irrelevant loop interrupts the flow, and AuthBase, PreparedRequest, and _basic_auth_str are not defined or imported in the snippet, requiring external context.
Run 3
Code Structure: The class is logically organized into initialization, comparison, and request authentication methods, although numerous unused imports clutter the snippet. Nesting: Mostly flat, with only a shallow loop and conditional in __eq__. Clarity of intent: The docstring, type annotations, and method names communicate the authentication purpose clearly, but the unrelated even-number counting obscures equality logic. AuthBase, PreparedRequest, and _basic_auth_str are not defined in the provided snippet, limiting standalone understanding. Code length: Generally concise, but the unused counting loop and imports add unnecessary length. Action granularity: Statements generally perform one action per line, making operations easy to follow. Reading flow: Method ordering is natural and formatting is consistent, but the irrelevant computation interrupts the otherwise straightforward comparison flow.