Sample
pyint-a8a36aba2355-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.759 | 0–1; higher is more readable |
| Mi | 0.076 | 0–1; higher is more readable |
| LLOC | 60 | 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.361 | 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. | 3336.79 | −110.114 |
| 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.363 | −6.545 |
Intercept 8.87 + feature contributions = -77.389 (log-odds).
Score = sigmoid(-77.389) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 74 | +1.822 |
| 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. | 118.961 | −1.374 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 119 | +1.116 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 75.692 | +0.648 |
| 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.081 | +0.156 |
Intercept 0.07 + feature contributions = 1.147 (log-odds).
Score = sigmoid(1.147) = 0.759.
| Score | 0.076 |
|---|
| Score | 60 |
|---|
Run 1
The code demonstrates basic organization with a clear class and method separation, but readability suffers from several issues. Method signatures are awkwardly broken across lines with inconsistent indentation and spacing, disrupting natural reading flow. The `_get_source_explained` method uses confusing variable names like `rv` and `trv` that obscure their purpose, while the redundant assignment of `rv = None` after catching `TemplateNotFound` adds unnecessary complexity. Type hints are verbose and repeated throughout, inflating code length without proportionally improving clarity. The `Scaffold` type annotation appears in the return type but is never imported, creating ambiguity. Action granularity is mixed: some methods are clean while others pack multiple conceptual steps into single lines. The decorator-free streaming context and signal imports suggest the code is incomplete, further hampering coherent understanding. Nesting is acceptable but could be flatter.
Run 2
The code has clear intent with helpful docstrings and logical organization into methods, but suffers from formatting issues. Type hints are used well, but line wrapping is inconsistent and breaks readability (e.g., 'get_source' signature). While nesting is generally flat, the explained method has unnecessary complexity with both 'rv' and 'trv' variables tracking state. Action granularity is mostly one action per line, but method definitions and type signatures exceed reasonable line lengths. Reading flow is interrupted by awkward line breaks and inconsistent spacing. The code is functional but would benefit from consistent formatting to improve readability.
Run 3
The code is generally readable with clear class and method names, logical structure, and moderate nesting. It avoids excessive depth and uses concise methods for different paths (explained vs fast). However, there are minor formatting inconsistencies in function signatures (odd line breaks and spacing), which slightly disrupt the reading flow. The action granularity is mostly one action per line, though some lines combine multiple operations. The intent is clear overall, but the `_get_source_explained` method has a slightly tangled variable naming (`rv`, `trv`) that could be more descriptive. The `_iter_loaders` method is clean, but `list_templates` duplicates loader retrieval logic, reducing conciseness. Overall, it's readable but could benefit from formatting cleanup and minor refactoring to reduce repetition and improve variable clarity.
Run 1
Code Structure: Methods logically separate loader selection, diagnostic loading, fast loading, and template listing. Nesting: Generally moderate, though diagnostic loading and blueprint template listing have several nested levels. Clarity of intent: Descriptive method names and the class docstring clarify the purpose, but abbreviations such as rv, trv, and srcobj obscure local meaning. Code length: Fairly concise, although repeated complex type annotations and the explicit template-adding loop add verbosity. Action granularity: Each line generally performs one action, making operations easy to follow. Reading flow: Control flow is natural, with straightforward fallback behavior, but inconsistent signature spacing, missing blank lines between some methods, and a mid-method import interrupt scanning. Unused imports and types not defined in the snippet add minor distractions.
Run 2
Code Structure: Responsibilities are logically separated into loader iteration, fast lookup, diagnostic lookup, and template listing. Nesting: Mostly shallow, although template listing uses three nested levels. Clarity of intent: Method names and the class docstring communicate purpose, but abbreviations such as rv, trv, and srcobj obscure meaning; App and Scaffold also lack visible imports. Code length: Reasonably concise, though repeated complex type annotations and the template-listing loop add avoidable verbosity. Action granularity: Statements generally perform one action per line. Reading flow: Control flow is natural and exceptions clearly handle missing templates, but inconsistent signature formatting, excessive internal whitespace, missing blank lines between some methods, and unused imports interrupt readability.
Run 3
Code Structure: Methods logically separate loader selection, diagnostic loading, fast loading, and template listing. Nesting: Generally moderate, though template listing reaches three nested levels. Clarity of intent: Descriptive method names and the class docstring explain the purpose, but abbreviations such as rv, trv, and srcobj obscure local meaning. Code length: Mostly concise; repeated complex type annotations and the explicit template-addition loop add avoidable verbosity. Action granularity: Each line generally performs one action, making operations easy to follow. Reading flow: Control flow is natural, but inconsistent signature spacing, long lines, and missing blank lines between some methods disrupt scanning. Unused imports and type names whose definitions are not shown also add distractions.