Sample
pyint-91965a98f193-I03
Replace names with length-matched meaningful but unrelated identifiers
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.815 | 0–1; higher is more readable |
| Mi | 0.383 | 0–1; higher is more readable |
| LLOC | 18 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 7.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 13 | 0–20; mean of three runs |
| BTTF | 0.556 | 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.423 | −6.634 |
Intercept 8.87 + feature contributions = -10.388 (log-odds).
Score = sigmoid(-10.388) = 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.037 | +0.579 |
| 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.882 | +0.05 |
Intercept 0.07 + feature contributions = 1.486 (log-odds).
Score = sigmoid(1.486) = 0.815.
| Score | 0.383 |
|---|
| Score | 18 |
|---|
Run 1
The code has poor readability due to several issues. Variable names are semantically misleading: 'version' is actually a Request object, 'map' is a form field name, 'sharedResult' holds form values, 'age' holds message parts, and 'price' holds file names. The constructor parameters also use type hints that don't match actual types ('version: Request' but parameter named 'version', 'map: str' but used as form key). The class inherits from both KeyError and AssertionError, which is unusual and confusing. The error message construction is broken into multiple list appends with conditional logic that obscures the final output. The method lacks clear structure for building the error message, and the intent is buried under misleading naming. Some positive aspects include single-purpose methods and no deep nesting, but the confusing naming and unclear variable purposes significantly reduce readability.
Run 2
The code has poor readability due to unclear variable names (e.g., 'age', 'price', 'sharedResult', 'map') that obscure intent. The class inherits from both KeyError and AssertionError, which is conceptually confusing. The __init__ method mixes error message construction with unrelated variable naming, making the logic hard to follow. Nesting is low, but the message construction is fragmented across multiple string concatenations and conditionals, reducing clarity. The reading flow is unnatural: variable names like 'version' for a Request object and 'map' for a dict key add cognitive overhead. While line granularity is acceptable, the overall structure lacks cohesion and clarity. The code would benefit from descriptive naming, clearer separation of message-building logic, and simpler inheritance semantics.
Run 3
The code has several readability issues. Function and parameter names are misleading: `version` is actually a request object, `map` is a form field name, and variables like `age`, `price`, and `sharedResult` obscure their purpose. The multi-line string concatenation in the list makes the error message logic hard to follow. The class inherits from both KeyError and AssertionError, creating ambiguity about intent. The message-building code mixes logic and presentation, and action granularity is poor—multiple operations are packed into single expressions. Nesting is shallow, which is good, but the overall structure lacks clarity. The code would benefit from descriptive naming, clearer separation of concerns, and more straightforward string construction.
Run 1
Code Structure: The exception class logically groups message construction and string conversion, although several imports are unused and Request is not visibly imported. Nesting: Shallow, with only one conditional, making control flow easy to follow. Clarity of intent: The class name, docstring, and error message explain its purpose, but misleading variable names such as version, map, sharedResult, age, and price obscure the roles of the request, field key, filenames, and message fragments. Code length: Reasonably concise; the lengthy diagnostic message is justified and split into readable lines. Action granularity: Statements generally perform one action each, with no compressed multi-statement lines. Reading flow: Construction proceeds naturally from retrieving form values to assembling the message, optionally adding filenames, and storing the result. Poor naming and distracting imports reduce otherwise strong readability.
Run 2
Code Structure: The exception class is logically organized, with initialization and string representation separated, but several unused imports add clutter. Nesting: The code is shallow, containing only one conditional. Clarity of intent: The docstring and detailed error message clearly explain the purpose, but misleading names such as version, map, sharedResult, age, and price obscure the request, field key, submitted filenames, and message fragments. The Request annotation has no visible import, and map shadows a built-in. Code length: The implementation is reasonably concise; splitting the long message across lines improves readability. Action granularity: Each statement performs a distinct operation, with no compressed multi-action lines. Reading flow: The progression from retrieving form values to constructing the error message and optionally adding filenames is natural, although poor naming and import clutter interrupt comprehension.
Run 3
Code Structure: The exception class is logically organized into initialization and string representation, although unrelated imports add clutter. Nesting: Shallow nesting, with only one conditional, keeps the code easy to follow. Clarity of intent: The class name, docstring, and detailed error message explain the purpose, but misleading names such as version, map, sharedResult, age, and price obscure their roles. The Request annotation has no visible import, creating additional ambiguity. Code length: The implementation is reasonably concise; the long message is justified by its diagnostic purpose. Action granularity: Statements generally perform one action each, and multiline string construction is clearly separated from conditional message extension. Reading flow: Execution follows a natural sequence from collecting submitted values to constructing and returning the message, but poor naming and unused imports interrupt comprehension.