Sample
pyint-2e2be149a78a-I02
Shorten method, parameter, and local names without collisions
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.544 | 0–1; higher is more readable |
| Mi | 0.743 | 0–1; higher is more readable |
| LLOC | 36 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 16.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 16 | 0–20; mean of three runs |
| BTTF | 0.361 | 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. | 1864.969 | −61.544 |
| 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.481 | −6.722 |
Intercept 8.87 + feature contributions = -25.796 (log-odds).
Score = sigmoid(-25.796) = 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. | 85 | −1.973 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 57 | +1.234 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 57 | −0.887 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 83.798 | +0.761 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 82.976 | +0.534 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.068 | +0.285 |
| 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. | 82.953 | +0.152 |
Intercept 0.07 + feature contributions = 0.176 (log-odds).
Score = sigmoid(0.176) = 0.544.
| Score | 0.743 |
|---|
| Score | 36 |
|---|
Run 1
The code is generally clear and well-structured. It uses a flat hierarchy, each method has a single clear purpose, and lines are reasonably granular. The use of the `ensure` helper centralizes validation and normalization, avoiding repetitive logic. The class definition is concise thanks to the `attrs` decorators, and the docstrings with examples improve intent. Slight deductions: variable names like `oth`, `oth2`, `oth3` and `us2`, `us3` are short and obscure, reducing clarity compared to more descriptive alternatives. The `ensure` method has multiple validation checks that could be slightly more explicit, but they are linear rather than nested. Overall, the code is highly readable with minor naming and documentation improvements possible.
Run 2
The code is generally readable with clear class structure, logical method organization, and helpful docstrings. It uses decorators appropriately and keeps methods focused on single responsibilities. Nesting is minimal, though the ensure() method has sequential if-statements that could be simplified. Variable naming is inconsistent (oth, oth2, oth3, us2, us3, the, the2) which slightly obscures intent. Action granularity is mostly good, with one operation per line in parsing and comparisons. Some minor issues: the from2 parameter 's2' could be more descriptive, and the return statement in from2 spans multiple lines awkwardly. The reading flow is natural thanks to clear method ordering and explanatory comments. Overall, it's clean, maintainable code that would benefit from more consistent variable naming and slightly cleaner handling of edge cases.
Run 3
The code is well-structured and readable. It uses clear class-level attributes and decorators that convey intent. Methods are short, focused, and perform one logical action, with shallow nesting. Naming is generally clear, though abbreviated variables like 's2', 'v2', 'oth', 'us2', and 'the' slightly reduce clarity. The docstrings and examples improve understanding. The main readability weaknesses are inconsistent variable suffixes (oth, oth2, oth3; us2, us3) and a few slightly dense lines like the return of 'cls(...)' spanning multiple arguments. Overall, the code is concise, maintainable, and easy to follow.
Run 1
Code Structure: Well-organized class with separate parsing, comparison preparation, comparison, and hashing methods; shared logic avoids duplication. Nesting: Shallow conditionals and simple try/except blocks keep complexity low. Clarity of intent: Descriptive fields, examples, and the release-level comment explain behavior, but names such as from2, s2, oth3, us3, and the2 are cryptic. The parsing docstring also references names inconsistent with the implementation. Code length: Concise implementation; the longer class docstring provides useful examples rather than unnecessary verbosity. Action granularity: Most lines perform one action, although the constructor arguments are densely packed. Reading flow: Methods follow a natural progression, and early exits simplify reading. Unconventional use of NotImplementedError for unsupported comparisons adds a small comprehension burden.
Run 2
Code Structure: Well-organized class with distinct parsing, comparison normalization, comparison, and hashing methods. Nesting: Shallow conditionals and simple try/except blocks keep complexity low. Clarity of intent: The class docstring, examples, typed attributes, and release-level comment explain behavior well. However, names such as from2, s2, v2, oth2, us3, and the2 are cryptic and inconsistent; the parsing docstring also references names that differ from the implementation. Code length: Compact overall, with modest duplication between comparison methods. Action granularity: Most lines perform one clear action; the constructor groups several keyword arguments on one line but remains manageable. Reading flow: Methods follow a natural progression from construction to normalization and comparison. Decorator-generated behavior and using NotImplementedError as an internal control-flow signal require some additional interpretation.
Run 3
Code Structure: The class is logically organized into fields, parsing, comparison normalization, comparison operators, and hashing. Nesting: Shallow conditionals and short try/except blocks keep complexity low. Clarity of intent: The class docstring, examples, and release-level comment explain behavior well, but names such as from2, s2, oth3, us3, and the2 are unclear and inconsistent; the parsing docstring also references different names. Code length: Methods are concise, with only minor duplication between comparison operators. Action granularity: Most lines perform one action; the compact constructor call remains understandable. Reading flow: Methods follow a natural progression, although arbitrary numeric suffixes and using NotImplementedError for unsupported comparison operands introduce small comprehension hurdles.