Sample
pyint-aea035ef9ee2-I08
Select one of ten high-readability unrelated code templates per class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.293 | 0–1; higher is more readable |
| Mi | 0.472 | 0–1; higher is more readable |
| LLOC | 38 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 17 | 0–20; mean of three runs |
| GPT-6.1 Sol | 16 | 0–20; mean of three runs |
| BTTF | 0.401 | 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. | 2551.406 | −84.196 |
| Source linesThe number of non-empty source lines. | 83 | +33.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.705 | −7.058 |
Intercept 8.87 + feature contributions = -49.184 (log-odds).
Score = sigmoid(-49.184) = 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. | 84 | −1.938 |
| 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.94 | −1.415 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 119.988 | +1.132 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 53 | +1.096 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 54 | −0.818 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 82.81 | +0.748 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.072 | +0.244 |
Intercept 0.07 + feature contributions = -0.882 (log-odds).
Score = sigmoid(-0.882) = 0.293.
| Score | 0.472 |
|---|
| Score | 38 |
|---|
Run 1
The code is generally well-structured and readable. It has clear intent, reasonable nesting, and mostly one action per line. The class docstring is excellent. However, there is a confusing dead code block in `copy()` (the `while remaining_steps` loop does nothing) which harms clarity and should be removed. Overall, the code is clean and maintainable.
Run 2
The code is well-structured with clear separation of methods and logical organization. The class has a clear purpose documented in its docstring, including usage examples. Nesting is minimal and flat, with only basic conditional logic in __eq__. Intent is clear through descriptive method names and type hints. Code length is concise and appropriate. Action granularity is good, with one operation per line. Reading flow is natural, following standard Python dictionary implementation patterns. Minor deductions for the unnecessary while loop in copy() which appears to be leftover debug code, and the __eq__ method has slightly awkward type checking flow.
Run 3
The code is well-structured and highly readable. The class has a clear, single responsibility and follows standard mapping patterns. Methods are concise with low nesting and one action per line. Type hints and docstrings clearly express intent. The main flaw is the `copy` method: it contains a pointless `while` loop that serves no purpose, likely leftover debug or placeholder code. This hurts clarity and should be removed. Otherwise, the code flows naturally and is easy to follow.
Run 1
Code Structure: Methods are logically organized around the mapping interface, though _VT is not defined in the snippet and several imports are unused. Nesting: Control flow is shallow and easy to follow. Clarity of intent: Descriptive method names, type hints, and documentation clearly explain case-insensitive lookup and preserved key casing; tuple indexing is slightly less explicit. Code length: Most methods are concise, but copy() contains a pointless countdown loop that adds noise and suggests missing intent. Action granularity: Statements generally perform one action per line, with compact generator expressions remaining understandable. Reading flow: The progression from initialization through mapping operations, comparison, copying, and representation is natural. The long type-ignore line and unnecessary loop interrupt otherwise clean reading.
Run 2
Code Structure: Methods are logically organized around the mapping interface, although _VT is never defined and some imports are unused. Nesting: Control flow is shallow and easy to follow. Clarity of intent: The class docstring, type annotations, and storage comment clearly explain case-insensitive behavior; however, the pointless countdown in copy() introduces confusion. Code length: Most methods are concise, but the countdown and unused imports add unnecessary material. Action granularity: Statements generally perform one action per line; generator expressions compactly express iteration without excessive complexity. Reading flow: Initialization, core mapping operations, comparison, copying, and representation follow a natural progression. Tuple indexing and the long type-ignore line slightly interrupt readability. Overall, the implementation is readable, but the undefined type variable and unexplained loop undermine an otherwise clean design.
Run 3
Code Structure: Methods are logically organized around the mapping interface, although _VT is never defined and some imports are unused. Nesting: Control flow is shallow and easy to follow. Clarity of intent: The class docstring, type annotations, and descriptive method names explain case-insensitive behavior well; however, the pointless countdown in copy() obscures its otherwise simple purpose. Code length: Most methods are concise, but the countdown and some verbose documentation add unnecessary length. Action granularity: Statements generally perform one action per line; generator expressions remain reasonably readable. Reading flow: Construction, basic operations, comparison, copying, and representation follow a natural sequence. Dense tuple indexing and the long type-ignore line introduce minor friction. Overall, the code is highly approachable but weakened by distracting dead work and incomplete typing setup.