Sample
pyint-6479a4f95982-SRC
Unmodified source class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.668 | 0–1; higher is more readable |
| Mi | 0.569 | 0–1; higher is more readable |
| LLOC | 18 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 15.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 17 | 0–20; mean of three runs |
| BTTF | 0.453 | 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. | 660.331 | −21.791 |
| Source linesThe number of non-empty source lines. | 22 | +8.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.71 | −7.065 |
Intercept 8.87 + feature contributions = -11.186 (log-odds).
Score = sigmoid(-11.186) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| 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. | 59.957 | +1.126 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.071 | +0.253 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 23 | +0.222 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 21.754 | −0.106 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 22 | −0.084 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 22 | +0.024 |
Intercept 0.07 + feature contributions = 0.7 (log-odds).
Score = sigmoid(0.7) = 0.668.
| Score | 0.569 |
|---|
| Score | 18 |
|---|
Run 1
The code is generally readable with a clear, logical structure. Imports are organized and type hints improve clarity. The class is focused with a single responsibility. However, some points reduce readability: the `__slots__ = ()` is non-obvious without context, the `tag = to_json` alias is somewhat unusual and could confuse readers about intent, and the import section includes several unused imports (b64decode, b64encode, datetime, UUID, Markup, http_date, parse_date, dumps, loads), adding noise. The method definitions are concise, but the lack of docstrings or comments makes the purpose of `check` and `to_json` dependent on familiarity with the codebase's pattern. Nesting is flat and each line represents one action, which improves readability, but the overall flow could be clearer with a brief class-level comment or docstring explaining the PassList tag's role.
Run 2
The code is generally readable with clear intent and logical organization. It uses modern Python features like __future__ annotations and typing, which improves clarity. The class structure is simple and focused, with a single responsibility. Nesting is minimal and the reading flow is natural. However, a few improvements could be made: the 'tag = to_json' alias at the end is slightly ambiguous without context, and the unused imports (Markup, datetime, UUID, etc.) suggest either incomplete code or leftover dependencies. The check method is straightforward, but the to_json method uses a list comprehension that could benefit from a small explanatory comment. Overall, the code is concise and easy to follow, though the presence of unused imports slightly detracts from its clarity.
Run 3
The code is well-structured and readable, with clear imports and a simple class definition. It follows a logical organization with the 'PassList' class inheriting from 'JSONTag' and implementing 'check' and 'to_json' methods concisely. The use of 'typing' and '__slots__' shows intent for clarity and performance. Nesting is flat, and each method performs a single, clear action. However, the 'tag = to_json' assignment is slightly ambiguous without context, and the lack of docstrings or comments reduces clarity for those unfamiliar with the codebase. Overall, it is concise and follows good practices, but minor improvements in documentation could enhance readability.
Run 1
Code Structure: The class is logically organized, with separate methods for type checking and serialization, though the many unused imports and undefined JSONTag base class distract in this snippet. Nesting: The code is flat, with no deeply nested control flow. Clarity of intent: Method names and the list comprehension clearly convey list detection and item tagging; however, PassList, __slots__, and the tag alias require some framework context. Code length: The implementation is concise, but the import block is disproportionately long for the functionality shown. Action granularity: Each statement performs a distinct action, and the comprehension is compact without being overloaded. Reading flow: The class reads naturally from checking to conversion to aliasing, although missing spacing between imports and the class slightly reduces visual separation.
Run 2
Code Structure: The class is logically organized into a type check, serialization method, and alias, though many imports are unused in this snippet and JSONTag is not defined or imported. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: Method names, type annotations, and the list comprehension clearly convey list detection and item serialization; the class name and tag alias require some surrounding context. Code length: The implementation is concise, but the extensive import block adds clutter relative to the small class. Action granularity: Each statement performs one clear action. Reading flow: The class reads naturally, although import grouping and an additional blank line before the class would improve visual organization.
Run 3
Code Structure: The class is logically organized into type checking and serialization methods, though many unused imports add clutter. Nesting: There is no deep nesting; the list comprehension is straightforward. Clarity of intent: Method names and type hints communicate the purpose, but JSONTag is not defined or imported in the snippet, and the tag alias is unexplained. Code length: The implementation is concise, although the import section is disproportionate to the class. Action granularity: Each statement performs a focused action, with the comprehension expressing a single transformation clearly. Reading flow: The methods follow a natural progression, but the missing blank line between imports and the class and the unexplained trailing alias slightly interrupt readability.