Sample
pyint-718b563fad34-I13
Lower every eligible synchronous for loop to a while loop
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.573 | 0–1; higher is more readable |
| Mi | 0.769 | 0–1; higher is more readable |
| LLOC | 36 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 17.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs |
| BTTF | 0.414 | 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. | 1843.139 | −60.824 |
| 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.465 | −6.698 |
Intercept 8.87 + feature contributions = -25.052 (log-odds).
Score = sigmoid(-25.052) = 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.862 | +0.762 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 78.953 | +0.469 |
| 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. | 78.965 | +0.321 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.066 | +0.299 |
Intercept 0.07 + feature contributions = 0.295 (log-odds).
Score = sigmoid(0.295) = 0.573.
| Score | 0.769 |
|---|
| Score | 36 |
|---|
Run 1
The code is highly readable with a clear logical structure: class definition, attributes, classmethod, helper, then dunder comparisons. Nesting is minimal (try-except with a single if-guard). Intent is explicit through descriptive method and variable names. Code length is concise without unnecessary verbosity. Each line generally performs one action, enhancing clarity. The reading flow is natural due to consistent organization and docstrings explaining non-obvious logic.
Run 2
The code is well-structured and highly readable. It uses clear class-level attributes with type hints, logical method organization, and consistent error handling. Nesting is minimal: each method has at most one level of indentation beyond the method body. Helper methods like `_ensure_tuple` encapsulate validation and normalization, keeping comparison methods concise. Action granularity is good—each line generally performs one meaningful operation. Reading flow is natural: parsing, validation, then comparison logic. The docstrings are informative and the inline comment explains a non-obvious release-level ordering decision. Minor deductions: the `_ensure_tuple` method returns a slice of the internal tuple, which relies on understanding `astuple` behavior; and the class-level `attrib` declarations could be slightly more compact, though they aid clarity. Overall, the code is approachable for someone familiar with Python.
Run 3
The code is highly readable, with a clean logical structure: class-level attributes are defined clearly using the `attrib` helper, and methods are short and focused. It benefits from flat nesting with only one level of exception handling and minimal indentation. Intent is clear throughout, supported by docstrings and comments explaining non-obvious logic, such as releaselevel ordering. Code length is appropriate—no unnecessary repetition or bloat. Each line performs a single logical action, especially in parsing and tuple conversion. Reading flow is natural, moving from class definition to attribute declarations, then helper methods and comparison operators. Minor deductions come from slight complexity in `_ensure_tuple` (multiple validation steps and exception control) and the use of `NotImplementedError` inside a helper method, which can obscure control flow for less experienced readers.
Run 1
Code Structure: Well-organized class with distinct parsing, normalization, comparison, and hashing methods; shared comparison logic avoids duplication. Nesting: Shallow conditionals and simple try/except blocks keep complexity low. Clarity of intent: Descriptive method names, field names, docstrings, examples, and a release-order comment explain behavior well, though abbreviated variables such as s and v are less expressive. Code length: Concise implementation; the longer docstring provides useful examples rather than unnecessary verbosity. Action granularity: Statements generally perform one action per line; the compact constructor call remains readable. Reading flow: Imports, decorators, fields, and methods follow a natural sequence. Minor readability drawbacks include reliance on decorator-generated behavior and using NotImplementedError as internal control flow.
Run 2
Code Structure: Well-organized class with focused parsing, normalization, comparison, and hashing methods; shared comparison logic avoids duplication. Nesting: Shallow conditionals and simple try/except blocks keep complexity low. Clarity of intent: Descriptive method and attribute names, useful docstrings, examples, and a release-ordering comment explain behavior clearly. Short names such as s and v and exception-based signaling in _ensure_tuple slightly reduce clarity. Code length: Concise implementation; the longer class docstring provides valuable usage examples rather than unnecessary detail. Action granularity: Most lines perform one action, with compact constructor arguments remaining easy to follow. Reading flow: Imports, decorators, attributes, and methods appear in a natural sequence. Decorator-generated behavior requires some library familiarity, and the parsing docstring inconsistently names _VersionInfo instead of VersionInfo.
Run 3
Code Structure: Well-organized class with clearly separated parsing, comparison normalization, comparison operators, and hashing. Nesting: Shallow conditionals and straightforward try/except blocks keep complexity low. Clarity of intent: Descriptive fields, docstrings, comparison examples, and the release-level comment explain behavior well. Short names such as 's', 'v', and 'us' slightly reduce clarity, and using NotImplementedError as an internal control-flow signal is less intuitive. Code length: Concise implementation with useful documentation; duplicated comparison handling is minor. Action granularity: Statements generally perform one action per line, and the compact constructor call remains readable. Reading flow: Fields and methods follow a natural progression, with consistent formatting and helpful spacing. Decorator-generated behavior requires some familiarity with attrs and total_ordering.