Sample
pyint-781ee414f8ee-I01
Remove comments and docstrings
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.235 | 0–1; higher is more readable |
| Mi | 0.712 | 0–1; higher is more readable |
| LLOC | 54 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 13 | 0–20; mean of three runs |
| GPT-6.1 Sol | 15 | 0–20; mean of three runs |
| BTTF | 0.469 | 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. | 3757.676 | −124.003 |
| Source linesThe number of non-empty source lines. | 168 | +67.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. | 3.935 | −5.903 |
Intercept 8.87 + feature contributions = -53.837 (log-odds).
Score = sigmoid(-53.837) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 168 | +5.074 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 169 | −4.947 |
| 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. | 167.986 | +1.938 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| 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. | 71.941 | +0.618 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.066 | +0.304 |
Intercept 0.07 + feature contributions = -1.181 (log-odds).
Score = sigmoid(-1.181) = 0.235.
| Score | 0.712 |
|---|
| Score | 54 |
|---|
Run 1
The code shows moderate readability. Structure is logically organized with class and method separation, but the __attrs_attrs__ tuple construction is complex and hard to follow. Nesting is reasonable overall. Intent is clear for individual methods, but the Attribute tuple with many parameters obscures the overall purpose. The code is lengthy due to many constructor parameters, though this may be domain-necessary. Action granularity is good—one operation per line. Reading flow is mixed: simple methods like validator() are clear, but the Attribute instantiation loop requires careful study to understand. The use of descriptive names helps, but the deep parameter lists reduce scanability. Type hints would improve clarity.
Run 2
The code demonstrates moderate readability. The class structure is logical with clear __slots__ and organized attributes, and imports are comprehensive. However, several issues reduce readability: the __attrs_attrs__ tuple construction is deeply nested and complex with a generator expression inside a tuple unpacking. The __init__ method has 17 parameters making it difficult to understand without documentation. Many methods contain only a docstring placeholder with no actual documentation, leaving intent ambiguous. Lines are occasionally too long. The code mixes configuration, attribute counting, and decorator logic within one class, creating cognitive overhead. Overall, the code is maintainable but requires significant mental effort to understand the intricate attribute handling and the complex __attrs_attrs__ generation logic.
Run 3
The code has a clear structure with logical organization, using type hints and avoiding deep nesting. However, it has several readability issues: the large __attrs_attrs__ tuple with generator expression inside __slots__ creates complex nested logic that's hard to follow. The class has excessive constructor parameters (16) making it difficult to understand intent without documentation. The empty docstrings don't provide meaningful guidance. While the method implementations are simple and readable, the class-level attribute definitions are tangled and verbose, making the code longer than necessary. Action granularity is good at the method level with one operation per line, but the class setup is dense and disorganized. Reading flow is disrupted by the large tuple construction spanning many lines before reaching any executable logic.
Run 1
Code Structure: The class is logically organized into attribute declarations, initialization, and decorator methods. Nesting: Control flow is shallow, although the nested tuple expansion and comprehension add visual complexity. Clarity of intent: Most assignments and method names are clear, but missing docstrings, external definitions, and terse names such as meth obscure some framework-specific behavior. Code length: The implementation is reasonably concise, but repeated Attribute arguments and the large constructor introduce boilerplate. Action granularity: Statements generally perform one action per line, making state changes easy to follow. Reading flow: Consistent formatting and straightforward methods support natural reading, while the lengthy metadata declaration before the constructor, unused imports in this excerpt, and unnecessary blank whitespace interrupt it.
Run 2
Code Structure: The class is logically organized into attribute declarations, initialization, and decorator methods, though numerous imports appear unrelated to this excerpt. Nesting: Shallow conditionals keep methods easy to follow; the nested tuple expansion and Attribute construction are denser. Clarity of intent: Descriptive field names and straightforward assignments communicate most behavior, but missing docstrings, external helpers, and names that shadow built-ins reduce clarity. Code length: Methods are concise, while repetitive Attribute configuration and the long constructor add visual bulk. Action granularity: Most lines perform a single assignment or operation, supporting readability. Reading flow: The progression from class configuration to initialization and behavior is natural, but the large metadata declaration delays the main logic, and empty whitespace-only lines feel unfinished.
Run 3
Code Structure: The class is logically organized into metadata, initialization, and decorator methods, though numerous imports and external dependencies add noise. Nesting: Mostly flat, with shallow conditionals and a manageable comprehension. Clarity of intent: Descriptive field and method names convey attribute configuration, but absent documentation, unexplained helpers, and built-in-shadowing parameter names such as repr, hash, and type reduce clarity. Code length: The long constructor and repetitive Attribute configuration make the code verbose, although much of that repetition is explicit and easy to scan. Action granularity: Statements generally perform one action per line; the converter lambda is compact but requires attention to argument reordering. Reading flow: Consistent formatting and straightforward method bodies support natural reading, while the large metadata block delays reaching behavior and unexplained blank lines slightly disrupt presentation.