Sample
pyint-319b85ef565e-SRC
Unmodified source class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0.106 | 0–1; higher is more readable |
| Dorn | 0.761 | 0–1; higher is more readable |
| Mi | 0.707 | 0–1; higher is more readable |
| LLOC | 20 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 16.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs |
| BTTF | 0.752 | 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. | 638.793 | −21.08 |
| 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.746 | −7.119 |
Intercept 8.87 + feature contributions = -2.129 (log-odds).
Score = sigmoid(-2.129) = 0.106.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.033 | +0.619 |
| 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. | 75.364 | +0.412 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 33 | +0.404 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 33 | −0.336 |
| 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. | 78.977 | +0.32 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 42.913 | +0.19 |
Intercept 0.07 + feature contributions = 1.157 (log-odds).
Score = sigmoid(1.157) = 0.761.
| Score | 0.707 |
|---|
| Score | 20 |
|---|
Run 1
This code is highly readable due to its clear structure and organization. The module imports are grouped logically: standard library imports first, then third-party/related modules, followed by local imports. The use of `from __future__ import annotations` at the top is a best practice. The `_CacheHashWrapper` class has a clear, descriptive name and includes a comprehensive docstring explaining its unusual behavior (pickling as None). The method `__reduce__` is concise and uses descriptive parameter names with helpful comments. Type hints are used appropriately throughout. The code avoids excessive nesting and maintains a flat structure. Each action is on its own line, and the overall reading flow is natural. Minor deductions for the slightly complex import structure and the `# noqa: B008` comment, which could benefit from additional context, but overall this is exemplary Python code that balances clarity with functionality.
Run 2
The code demonstrates clear structure with organized imports, a single class definition, and a focused docstring explaining the purpose. Nesting is minimal and flat, contributing to readability. The intent of the class is well-documented, and the code length is concise. Action granularity is appropriate — each line performs one logical operation. However, score is reduced because the reading flow is slightly interrupted by the `# noqa: B008` comment and default argument usage in the method signature, which may confuse unfamiliar readers. Additionally, the import block is long but acceptable for library code. Overall, the code is clear and maintainable with minor readability trade-offs related to style pragmatics.
Run 3
The code is well-structured with clear separation of imports, proper use of `__future__` annotations, and a documented class. Imports are grouped logically (stdlib, third-party, local), and the class has a clear purpose explained in a concise docstring. Nesting is minimal, with no deeply nested blocks. The class method `__reduce__` is implemented in one line but remains readable. Action granularity is appropriate, and reading flow is natural. Minor deductions: the use of `# noqa: B008` suggests a potential linting workaround, and the class name `_CacheHashWrapper` is slightly verbose but still clear. Overall, the code is highly readable.
Run 1
Code Structure: Imports are grouped before a small, focused class, providing clear organization. Nesting: Minimal nesting makes the implementation easy to follow. Clarity of intent: The descriptive class name and detailed docstring explain why cached hashes reset during copying or pickling; the specialized __reduce__ mechanism requires some Python knowledge. Code length: The implementation is concise, although the extensive imports appear disproportionate to the displayed functionality. Action granularity: Each statement performs one clear action. Reading flow: The progression from imports to documentation to implementation is natural, with only minor spacing limitations and specialized default arguments slowing comprehension.
Run 2
Code Structure: Imports are grouped logically, followed by a focused class, though many imports are unused in this excerpt. Nesting: Minimal nesting makes the implementation easy to scan. Clarity of intent: The descriptive class name and detailed docstring clearly explain why cached hashes reset during copying or serialization; the specialized __reduce__ signature requires some Python knowledge. Code length: The implementation is concise, and the documentation provides useful context without excessive detail. Action granularity: Each statement performs a single clear action. Reading flow: The progression from imports to explanation to implementation is natural, although additional blank lines between import groups and before the class would improve visual separation.
Run 3
Code Structure: Imports are grouped logically, followed by a small, focused class. Nesting: Minimal nesting makes the implementation easy to scan. Clarity of intent: The class name and detailed docstring clearly explain why cached hashes reset during copying or pickling; the unusual default arguments in __reduce__ require some Python knowledge. Code length: The implementation is concise, though the extensive imports appear disproportionate to this excerpt. Action granularity: Each line performs a single clear action. Reading flow: The progression from imports to explanation to implementation is natural, with minor spacing improvements possible between import groups and the class.