Sample
pyint-52a272e84757-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.808 | 0–1; higher is more readable |
| Mi | 0.515 | 0–1; higher is more readable |
| LLOC | 38 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 10.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 13.33 | 0–20; mean of three runs |
| BTTF | 0.539 | 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. | 2524.999 | −83.325 |
| Source linesThe number of non-empty source lines. | 76 | +30.4 |
| 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.639 | −6.958 |
Intercept 8.87 + feature contributions = -51.013 (log-odds).
Score = sigmoid(-51.013) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 72 | +1.753 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 77 | −1.69 |
| 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. | 113.974 | −1.162 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 113.987 | +1.035 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 75.87 | +0.651 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.057 | +0.383 |
Intercept 0.07 + feature contributions = 1.438 (log-odds).
Score = sigmoid(1.438) = 0.808.
| Score | 0.515 |
|---|
| Score | 38 |
|---|
Run 1
The code has clear structure with logical imports and well-defined methods, but readability is hampered by inconsistent formatting and alignment. The import section has erratic spacing and alignment, making it visually noisy. The class methods are flat and have clear intent with concise docstrings, but the register_hook method contains a moderately nested conditional and a defensive runtime filter that adds complexity. Action granularity varies, with some lines containing multiple operations. The type annotations are thorough and helpful, improving clarity. Overall, the code is functional but would benefit from consistent formatting and minor decomposition to enhance readability.
Run 2
The code exhibits readability issues primarily due to inconsistent formatting, especially in imports where alignment is erratic and some imports are excessively long or fragmented across lines. The class methods are logically structured but lack separation—no blank lines between methods, making the class feel dense. Nesting is minimal, which is positive, and action granularity is generally reasonable, though some conditionals could be clearer. The intent of each method is reasonably clear via docstrings, but the overall reading flow is disrupted by inconsistent spacing, unusual indentation in function signatures, and a few very long lines. Variable naming is acceptable. The code is understandable but requires effort due to stylistic inconsistency and visual noise, placing it in the mid-to-low readability range.
Run 3
The code suffers from severe import statement misalignment and inconsistent spacing, making it visually chaotic and difficult to scan. Multiple imports are bundled on single lines (e.g., 'Any, Final'), while others are awkwardly split, hurting readability. The class logic itself is relatively clear, but the method signatures have odd spacing before closing parentheses, and type hints are verbose without clear separation. Nesting is minimal, which is good, but the overall structure is undermined by formatting inconsistencies. Action granularity is mostly one-per-line inside methods, and intent is somewhat clear, but the import section dominates the file and obscures purpose. The code appears to be auto-formatted poorly or hand-edited inconsistently. Overall, it is readable with effort but far from clean or natural to follow.
Run 1
Code Structure: Imports are broadly grouped and hook operations are logically contained in a mixin, but inconsistent formatting and limited spacing between methods weaken organization. Nesting: Shallow conditionals and a simple try/except keep control flow easy to follow. Clarity of intent: Descriptive method names, type annotations, and docstrings clearly explain registration and deregistration; the callable filter is understandable. Code length: Methods are concise, although the extensive import section dominates this excerpt and introduces visual overhead. Action granularity: Executable statements generally perform one action per line, but several crowded import lines hinder scanning. Reading flow: Method logic progresses naturally from validation to mutation or success reporting, while irregular whitespace, awkward line wrapping, and missing blank lines interrupt readability.
Run 2
Code Structure: Imports precede a cohesive mixin, and hook registration and removal are cleanly separated, but inconsistent import grouping and missing blank lines reduce organization. Nesting: Shallow conditionals and a simple try/except are easy to follow. Clarity of intent: Descriptive method names, type annotations, and docstrings clearly communicate behavior; the defensive callable filter is explained. Code length: Methods are concise, although the large import block overwhelms this small excerpt. Action granularity: Executable statements generally perform one action per line, but multiple imported names crowded onto irregularly spaced lines hinder scanning. Reading flow: Control flow is natural and straightforward, while inconsistent spacing, awkward line wrapping, and minimal separation between methods interrupt readability.
Run 3
Code Structure: Imports precede a logically organized mixin, but the extensive import section overwhelms the small implementation and lacks consistent formatting. Nesting: Methods remain shallow, with simple conditionals, a generator expression, and straightforward exception handling. Clarity of intent: Descriptive method names, type annotations, and docstrings clearly explain hook registration and removal. Code length: The methods are concise, although the import-heavy excerpt adds substantial reading overhead. Action granularity: Statements generally perform one action per line; crowded import lines reduce visual clarity without combining executable actions. Reading flow: Method logic reads naturally, but irregular spacing, inconsistent import wrapping, and missing blank lines between methods disrupt scanning.