Sample
pyint-d7ffacf9f35b-I10
Deterministically remove some optional blank lines and bracketed line breaks
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.161 | 0–1; higher is more readable |
| Mi | 0.432 | 0–1; higher is more readable |
| LLOC | 58 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 7.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 12.33 | 0–20; mean of three runs |
| BTTF | 0.393 | 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. | 149 | +59.6 |
| 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.01 | −6.015 |
Intercept 8.87 + feature contributions = -63.322 (log-odds).
Score = sigmoid(-63.322) = 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. | 150 | −4.275 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 127 | +3.656 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 127 | −2.493 |
| 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. | 135.973 | −2.094 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 148.956 | +1.672 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 135.993 | +1.39 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.053 | +0.427 |
Intercept 0.07 + feature contributions = -1.647 (log-odds).
Score = sigmoid(-1.647) = 0.161.
| Score | 0.432 |
|---|
| Score | 58 |
|---|
Run 1
The code suffers from severe formatting and structural issues that make it difficult to read. While the class has a clear purpose, the implementation is obscured by inconsistent and excessive indentation, particularly in the `__attrs_attrs__` definition and various function/method signatures. This creates a tangled, disorganized reading flow. The nesting is moderate but worsened by the formatting. Action granularity is violated in several places, with multiple assignments or arguments crammed onto single lines, while other lines are broken unnecessarily. Code length is verbose due to the poor formatting. The intent of the class is clear from its docstring, but the clarity of individual components is lost. The import section and use of `__slots__` and `__attrs_attrs__` suggest an internal library construct, but the presentation undermines comprehension.
Run 2
The code is difficult to read due to inconsistent formatting, cramped line groupings, and heavy vertical sprawl. The imports and tuples use erratic spacing and line breaks, making visual scanning confusing. The `__attrs_attrs__` construction is deeply nested and mixes many arguments on single lines, violating action granularity. Method definitions are followed immediately by others without blank lines, reducing separation. Although docstrings exist and intent is somewhat clear, the physical layout obscures logical structure. Long parameter lists and odd indentation patterns further hurt readability. Overall, the code functions but requires significant effort to parse.
Run 3
The code has inconsistent and poor formatting that severely harms readability. While it follows some logical structure (e.g., separating the class definition and using slots), many lines cram multiple attributes into a single line (e.g., __slots__, __attrs_attrs__), and others have excessive whitespace or odd indentation. The __attrs_attrs__ tuple is particularly tangled, mixing generator expressions and multiple function arguments on single lines. Some elements like the imports have unnecessary alignment and line breaks, while method definitions are inconsistently spaced. Intent is often clear in comments and docstrings, but the code length is inflated by scattered formatting. Action granularity is violated: multiple fields and parameters are placed per line, making the control flow difficult to scan. Reading flow is disorganized—readers are forced to jump between dense lines and sparse blocks. Overall, this code would benefit greatly from a consistent formatter (e.g., Black) and more careful line-by-line organization.
Run 1
Code Structure: The class logically groups attribute initialization and decorator methods, but inconsistent spacing and crowded declarations obscure organization. Nesting: Control flow is shallow; the nested tuple comprehension and Attribute construction require more effort to parse. Clarity of intent: Descriptive method names and docstrings explain the purpose well, although external helpers and numerous configuration fields add cognitive load. Code length: Methods are concise, but lengthy metadata declarations and repetitive initialization make the class cumbersome to scan. Action granularity: Most executable statements perform one action per line, while multiple arguments and field names crowded onto single lines reduce visual clarity. Reading flow: Initialization followed by related decorators provides a natural progression, but irregular indentation, excessive inline whitespace, and missing separation between some methods interrupt it.
Run 2
Code Structure: The class logically groups attribute metadata, initialization, and decorator methods, but inconsistent formatting weakens organization. Nesting: Control flow is shallow; only metadata construction introduces moderately nested expressions. Clarity of intent: Descriptive method names and docstrings explain ordering, validators, defaults, and converters, although external symbols and numerous configuration fields increase cognitive load. Code length: Mostly justified by explicit metadata and initialization, but repeated configuration arguments are verbose. Action granularity: Executable statements generally perform one action per line; several imports, arguments, and tuple entries are crowded onto single lines. Reading flow: Methods follow a sensible sequence, but irregular spacing, compressed parameter lists, and inconsistent blank lines interrupt scanning. Overall, the logic is understandable, while presentation noticeably reduces readability.
Run 3
Code Structure: The class logically groups attribute initialization and decorator methods, but inconsistent spacing and crowded declarations obscure that organization. Nesting: Control flow is shallow; the tuple comprehension adds only modest complexity. Clarity of intent: Descriptive method names and useful docstrings explain the purpose, although external helpers and numerous configuration fields require context. Code length: Mostly justified by explicit initialization and metadata definitions, with some repetitive boilerplate. Action granularity: Executable statements generally perform one action per line, but multiple arguments and entries are awkwardly packed together. Reading flow: Methods follow a sensible progression, yet irregular indentation, excessive inline whitespace, and inconsistent blank lines interrupt scanning.