Sample
pyint-299d6f54d0f4-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.321 | 0–1; higher is more readable |
| Mi | 0.427 | 0–1; higher is more readable |
| LLOC | 35 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 14.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 16.67 | 0–20; mean of three runs |
| BTTF | 0.499 | 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. | 2440.842 | −80.548 |
| Source linesThe number of non-empty source lines. | 72 | +28.8 |
| 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.716 | −7.074 |
Intercept 8.87 + feature contributions = -49.952 (log-odds).
Score = sigmoid(-49.952) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 73 | −1.548 |
| 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. | 119.986 | −1.417 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 119.973 | +1.131 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 45 | +0.819 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 46 | −0.635 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 71.793 | +0.594 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.072 | +0.238 |
Intercept 0.07 + feature contributions = -0.748 (log-odds).
Score = sigmoid(-0.748) = 0.321.
| Score | 0.427 |
|---|
| Score | 35 |
|---|
Run 1
The class has a clear purpose and mostly logical organization, with a docstring that explains case-insensitive behavior and key storage. However, readability is undermined by inconsistent formatting: missing blank lines between methods, inconsistent indentation/alignment (e.g., in __init__ and __eq__), and trailing whitespace in function signatures. The code is not deeply nested and methods are mostly short, which helps, but occasional confusing constructs like 'type: ignore[reportUnknownArgumentType]' add noise without context. Action granularity is mostly fine, though generator expressions in lower_items are slightly dense. Overall, the code is understandable but the formatting inconsistencies disrupt reading flow and make it feel less polished than it should be.
Run 2
The code is generally well-structured with clear intent, especially in the docstring and method comments. However, several issues reduce readability: inconsistent spacing, a misplaced closing parenthesis in __init__, and multiple methods crammed together without blank lines (e.g., lower_items, __eq__, copy, __repr__). Some lines are too long and combine multiple actions. Nesting is low, which is good, but formatting inconsistencies and minor layout problems disrupt reading flow. Overall, the logic is understandable but the presentation could be cleaner.
Run 3
The code is generally well-structured with clear class and method separation. It uses type hints, docstrings, and comments effectively. However, readability is reduced by minor issues: the `__init__` signature has awkward spacing before `)`, multiple methods are packed together without blank lines (e.g., `lower_items`, `__eq__`, `copy`, `__repr__`), and the generator expressions in `__iter__` and `lower_items` are compact but dense. The `__eq__` method includes a type-ignore comment that adds noise. Overall, intent is clear and the logic is flat, but formatting inconsistencies and slight verbosity in some operations lower the score.
Run 1
Code Structure: The class is logically organized into small mapping methods, though missing blank lines between some methods and imports reduce visual separation. Nesting: Control flow is shallow and easy to follow. Clarity of intent: The detailed docstring, conventional method names, and comments explain case-insensitive lookup and preservation of original keys. However, _VT is never defined despite importing TypeVar, and names such as keyval are less descriptive. Code length: Implementation methods are concise; documentation is lengthy but useful. Action granularity: Statements generally perform one action per line, with straightforward generator expressions. Reading flow: Methods follow a natural progression from initialization through mapping operations to equality and representation. Awkward constructor formatting and a long type-ignore line interrupt otherwise smooth reading.
Run 2
Code Structure: Logically organized into small mapping methods, though missing blank lines between some methods and before the class weaken visual separation. Nesting: Very shallow, with only simple conditionals. Clarity of intent: The class docstring, type annotations, and storage comment clearly explain case-insensitive behavior; however, _VT is not defined in the snippet, and unused imports introduce distraction. Code length: Implementation is concise, although the docstring is relatively long and references legacy iteration methods. Action granularity: Statements generally perform one action per line; generator expressions are compact and understandable. Reading flow: Methods follow a natural progression from initialization through mapping operations, equality, copying, and representation. Awkward constructor formatting and the long annotated assignment in __eq__ slightly interrupt readability.
Run 3
Code Structure: Well organized into a focused mapping class with small, logically grouped methods, though missing blank lines weaken separation. Nesting: Very shallow, with only simple conditionals. Clarity of intent: The class docstring, descriptive method names, annotations, and storage comment clearly explain case-insensitive behavior. However, _VT is referenced without a visible definition, some imports are unused, and tuple indexing slightly obscures the internal representation. Code length: Implementation is concise; the lengthy docstring provides useful context but references legacy methods. Action granularity: Statements generally perform one action per line, with compact generator expressions remaining readable. Reading flow: Follows conventional mapping operations naturally, but the malformed-looking constructor spacing, long equality annotation line, and inconsistent method spacing interrupt the flow.