Sample
pyint-1ce4e525acd0-SRC
Unmodified source class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.346 | 0–1; higher is more readable |
| Mi | 0.738 | 0–1; higher is more readable |
| LLOC | 58 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 11.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 16.67 | 0–20; mean of three runs |
| BTTF | 0.48 | 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. | 3811.44 | −125.778 |
| Source linesThe number of non-empty source lines. | 195 | +78 |
| 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.037 | −6.056 |
Intercept 8.87 + feature contributions = -44.964 (log-odds).
Score = sigmoid(-44.964) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 196 | −5.903 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 168 | +5.074 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 168 | −3.434 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 194.987 | +2.316 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.053 | +0.424 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 75.342 | +0.411 |
| 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. | 76.964 | +0.405 |
Intercept 0.07 + feature contributions = -0.638 (log-odds).
Score = sigmoid(-0.638) = 0.346.
| Score | 0.738 |
|---|
| Score | 58 |
|---|
Run 1
The code shows good structure with clear imports, a focused class, and natural method grouping. However, readability suffers from a long, hard-to-scan __attrs_attrs__ construction with deeply nested tuple/generator expressions and many keyword arguments. Nesting and sparse comments increase complexity, while clarity of intent is partly reduced by terse one-letter abbreviations (e.g., 'eq', 'cmp', 'hash'). Action granularity varies: some lines pack several operations (e.g., self._validator = and_(...)), while others are appropriately single-action. Overall, knowledgeable readers can follow it, but it would benefit from shorter, better-named grouping for attrs metadata.
Run 2
The code is a mix of clear patterns and poor structure. Imports and docstrings are readable, but the `__attrs_attrs__` tuple is a deeply nested, repetitive construction that obscures intent and violates flat structure and action granularity. The `Attribute` constructor call is repeated many times with slight variations, making the code longer than necessary and hard to scan. While individual methods like `validator`, `default`, and `converter` are concise and clear, the overall class definition suffers from low readability due to tangled metadata construction and multiple parameters without clear grouping. The reading flow is disrupted by the large tuple literal before the `__init__` method. The use of `__slots__` is fine, but the overall file segment is dense and requires careful reading to understand attribute definitions.
Run 3
The code is generally well-structured and readable, with clear class and method definitions. However, several factors reduce readability: the `__init__` method has a very long parameter list (14 parameters), which makes it hard to scan and understand. The `__attrs_attrs__` tuple is complex, mixing a generator-like tuple unpacking with a manual `Attribute` definition, which obscures the overall structure. Some methods like `converter` and `validator` are clear, but the lambda inside `converter` adds unnecessary nesting and indirection. The code uses descriptive names and follows Python idioms, but the dense class-level metadata and long initialization logic make it harder to follow. Overall, it is readable but not highly readable due to parameter bloat and complex class attributes.
Run 1
Code Structure: The class is logically organized into field declarations, initialization, and focused decorator methods, though the extensive imports distract from this excerpt. Nesting: Shallow conditionals and a single comprehension keep nesting manageable. Clarity of intent: Descriptive names and informative docstrings explain attribute ordering and decorator behavior; external helpers and the converter lambda require some context. Code length: Repeated Attribute configuration and the long constructor add verbosity, although most lines directly represent necessary state. Action granularity: Assignments and operations generally occupy separate lines, making changes easy to follow. Reading flow: Consistent formatting and straightforward method bodies support natural reading, but the large metadata declaration delays the core behavior, and names such as repr, hash, and type overlap Python built-ins.
Run 2
Code Structure: The class logically groups attribute metadata, initialization, and decorator methods, though the broad import block and large class-level declaration add overhead. Nesting: Control flow is shallow, with simple conditional branches; the nested tuple expansion and generator expression require more attention. Clarity of intent: Descriptive names and focused docstrings clearly explain attribute ordering and decorator behavior, although external helpers and sentinel values require context. Code length: Methods are concise, but repeated Attribute arguments and the lengthy constructor make the class verbose. Action granularity: Statements generally perform one action per line, and multiline calls are consistently formatted. Reading flow: The progression from metadata to initialization to behavior is natural, with useful whitespace; however, the dense __attrs_attrs__ construction and numerous configuration fields slow scanning.
Run 3
Code Structure: The class is logically organized into slots, attribute metadata, initialization, and focused decorator methods, though numerous imports appear unrelated to this excerpt. Nesting: Methods remain shallow; the nested tuple expansion and Attribute construction are the main complexity. Clarity of intent: Descriptive method names and docstrings clearly explain behavior, but external symbols and many configuration flags require library context. Code length: Methods are concise, while repetitive Attribute arguments and the lengthy initializer add boilerplate. Action granularity: Statements generally perform one action per line, making state changes easy to follow. Reading flow: Consistent formatting and straightforward conditionals support natural reading, but the large metadata declaration delays the behavioral code, and names such as repr, hash, and type shadow built-ins.