Sample
pyint-e54029042b94-I12
Inline all eligible single-use intermediate local variables
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.815 | 0–1; higher is more readable |
| Mi | 0.382 | 0–1; higher is more readable |
| LLOC | 18 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 17 | 0–20; mean of three runs |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs |
| BTTF | 0.569 | 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. | 782.526 | −25.823 |
| Source linesThe number of non-empty source lines. | 33 | +13.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. | 4.439 | −6.659 |
Intercept 8.87 + feature contributions = -10.412 (log-odds).
Score = sigmoid(-10.412) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.038 | +0.577 |
| 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. | 74.912 | +0.492 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 31 | +0.335 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 33.088 | −0.271 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 34 | −0.167 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 32.934 | +0.051 |
Intercept 0.07 + feature contributions = 1.485 (log-odds).
Score = sigmoid(1.485) = 0.815.
| Score | 0.382 |
|---|
| Score | 18 |
|---|
Run 1
The code is well-structured and readable. It uses clear imports, logical class definition, and a focused exception class with a single responsibility. The constructor builds an error message via a list of strings, which is a clean approach. Nesting is minimal (one conditional), and each line generally performs one logical action. The f-strings and multi-line string concatenation are readable, though the mixing of f-strings and plain string concatenation slightly interrupts flow. The class docstring explains intent clearly. Minor deductions: 'AssertionError' in the base classes is unusual and could confuse readers; 'form_matches' could be more descriptively named. Overall, the code is concise, well-organized, and easy to follow.
Run 2
The code is well-structured with a single class definition focusing on one responsibility. Imports are minimal and purposeful. The class has clear intent: providing a better error message for a specific debugging scenario. The constructor builds a message in a flat, linear fashion using a list and conditional append, avoiding deep nesting. Line lengths are reasonable, and string concatenation is used consistently. Action granularity is appropriate with one logical step per line, especially in the conditional block. Reading flow is natural—the error message is assembled from general to specific details. Minor deductions: the triple-quoted error string with mixed f-strings and implicit concatenation slightly reduces clarity, and the class inherits from both KeyError and AssertionError without explanation, leaving intent slightly ambiguous to an unfamiliar reader. Overall, it is highly readable with only superficial style concerns.
Run 3
The code is well-structured with a clear purpose: a custom exception for debugging file upload issues. The class hierarchy is logical, and the docstring explains intent. Nesting is minimal, with only one conditional inside __init__. Clarity of intent is strong, especially in the error message composition. Code length is appropriate for the functionality. Action granularity is mostly good, though the buf list initialization spans multiple f-strings concatenated across lines, which slightly impacts readability. The reading flow is natural overall, with a logical progression from initialization to string representation. Minor improvements could include simplifying the message building or extracting it into a helper, but the current implementation is quite readable.
Run 1
Code Structure: The exception class is logically organized, with initialization and string representation cleanly separated, though several imports are unused in this snippet. Nesting: Only one shallow conditional keeps complexity low. Clarity of intent: The descriptive class name, docstring, and helpful error message make the purpose clear; however, Request is referenced without a visible import, and buf is somewhat generic. Code length: The implementation is concise; most of its length supports a detailed diagnostic message rather than unnecessary logic. Action granularity: Statements generally perform one action per line, and multiline strings are formatted cleanly. Reading flow: Execution proceeds naturally from collecting form values to constructing the message, optionally adding filenames, and storing the result.
Run 2
Code Structure: The exception class is logically organized, with message construction in __init__ and rendering in __str__. Nesting: Only one shallow conditional keeps control flow simple. Clarity of intent: The class name, docstring, and descriptive error message clearly explain its purpose, although Request is not imported in the snippet and buf is a generic variable name. Code length: The implementation is concise; most length comes from useful diagnostic text, though several imports appear unused. Action granularity: Statements generally perform one action each, with readable multiline formatting. Reading flow: The code progresses naturally from collecting form values to building the message and returning it. Adjacent string literals slightly interrupt reading, and additional spacing around imports and the class would improve presentation.
Run 3
Code Structure: The exception class cleanly groups message construction and string representation, though several imports are unused and Request is not defined or imported in the snippet. Nesting: A single conditional keeps nesting shallow. Clarity of intent: The descriptive class name, docstring, and actionable error message clearly communicate its purpose. Code length: The implementation is compact; most length comes from useful diagnostic text. Action granularity: Statements generally perform one action each, with readable multiline string construction. Reading flow: Execution proceeds naturally from collecting form values to building the message and exposing it through __str__. Minor drawbacks include the generic name buf and limited spacing between imports and the class.