Sample
pyint-96ca4f0252d8-I12
Inline all eligible single-use intermediate local variables
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.893 | 0–1; higher is more readable |
| Mi | 0.335 | 0–1; higher is more readable |
| LLOC | 60 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 16 | 0–20; mean of three runs |
| GPT-6.1 Sol | 16.67 | 0–20; mean of three runs |
| BTTF | 0.399 | 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. | 84 | +33.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.368 | −6.552 |
Intercept 8.87 + feature contributions = -74.196 (log-odds).
Score = sigmoid(-74.196) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 82 | +2.099 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 85 | −1.973 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 83.655 | +0.76 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 85.859 | +0.581 |
| 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.155 |
| 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. | 85.894 | +0.027 |
Intercept 0.07 + feature contributions = 2.117 (log-odds).
Score = sigmoid(2.117) = 0.893.
| Score | 0.335 |
|---|
| Score | 60 |
|---|
Run 1
The code is generally well-structured and readable. It follows a clean class-based approach with clear separation of concerns (explained vs fast loading paths). Functions are small and focused with descriptive names. The nesting level is shallow (maximum 2-3 levels), and the flow from public method to private helpers is logical. Type hints improve clarity significantly. The main weaknesses are: (1) the complex tuple type annotations create noise and potential maintenance burden - extracting a type alias would improve readability; (2) the `_get_source_explained` method has slightly convoluted logic with `rv` and `trv` variables that could use clearer naming; (3) some lines with type unions are quite long. Overall, the code demonstrates good practices like single responsibility, consistent error handling, and readable iteration patterns.
Run 2
The code is well-structured with clear separation into fast and explained loading paths, and the class docstring explains its purpose. Type hints improve clarity, and the methods are logically ordered. Nesting is shallow, with only one or two levels in loops and conditionals. However, readability is slightly reduced by redundant type annotations (e.g., `rv` and `trv` declarations), a mixed use of `_srcobj` and `srcobj`, and the long union type repeated several times. The `list_templates` method contains some repetition that could be extracted. Overall the flow is natural and intent is mostly clear, but a few minor inconsistencies and verbosity from type hints keep it from being highly readable.
Run 3
The code is generally well-structured and readable. It uses clear class and method names, follows a logical flow, and keeps actions mostly granular. The separation of 'explained' and 'fast' paths is clear, and the helper iterator reduces duplication. However, there are minor issues: the variable names 'rv' and 'trv' are opaque, especially around None handling; the type annotation for 'trv' is awkwardly written and slightly hurts clarity near the top of '_get_source_explained'. The nested try/except and conditional logic is acceptable but adds a small amount of complexity. Overall, it is understandable with moderate effort, but not perfectly self-documenting.
Run 1
Code Structure: Methods logically separate loader dispatch, diagnostic loading, fast loading, and template listing. Nesting: Generally shallow, although diagnostic loading and blueprint template listing introduce moderate nesting. Clarity of intent: Descriptive method names and the class docstring explain the purpose, but abbreviations such as rv, trv, and srcobj obscure meaning; App and Scaffold are not defined or imported in this snippet. Code length: Reasonably concise, though repeated complex type annotations and loader traversal add verbosity, and several imports are unused. Action granularity: Statements generally perform one action per line, making operations easy to follow. Reading flow: The progression from public dispatch to implementation helpers is natural, with clear early returns and exception handling. The local debug import and dense annotations slightly interrupt that flow.
Run 2
Code Structure: Well organized into focused methods for loader iteration, fast lookup, diagnostic lookup, and template listing. Nesting: Mostly shallow; the diagnostic try/if and template-listing loops add modest depth. Clarity of intent: Descriptive method names, a useful class docstring, and type annotations clarify behavior, but rv/trv are opaque, App and Scaffold lack visible imports, and _iter_loaders accepts an unused parameter. Code length: Generally concise, though repeated complex tuple annotations and the explicit template-addition loop introduce avoidable verbosity. Action granularity: Each statement performs a distinct action, with no compressed multi-action lines. Reading flow: Dispatch followed by lookup implementations and supporting methods creates a natural progression; the mid-method import and dense annotations cause minor interruptions.
Run 3
Code Structure: Methods cleanly separate dispatch, diagnostic loading, fast loading, loader iteration, and template listing. Nesting: Generally shallow, although diagnostic loading and blueprint template listing introduce several nested levels. Clarity of intent: Descriptive method names, a class docstring, and type annotations clarify behavior; abbreviated variables such as rv and trv obscure their roles, and App and Scaffold lack visible imports. Code length: Mostly concise, but repeated complex tuple annotations add visual noise, and template listing could use result.update consistently. Action granularity: Each line generally performs one action, with no compressed statements. Reading flow: Public dispatch followed by implementation helpers creates a natural progression; the inline debug import slightly interrupts flow. Overall, the code is well organized and readable, with minor naming, repetition, and nesting issues.