Sample
pyint-78cb238334e4-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.558 | 0–1; higher is more readable |
| Mi | 0.769 | 0–1; higher is more readable |
| LLOC | 39 | 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.399 | 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. | 1982.637 | −65.427 |
| Source linesThe number of non-empty source lines. | 87 | +34.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.452 | −6.677 |
Intercept 8.87 + feature contributions = -28.434 (log-odds).
Score = sigmoid(-28.434) = 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. | 88 | −2.079 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 60 | +1.338 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 60 | −0.956 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 86.825 | +0.804 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 77.205 | +0.441 |
| 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. | 79 | +0.319 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.066 | +0.298 |
Intercept 0.07 + feature contributions = 0.235 (log-odds).
Score = sigmoid(0.235) = 0.558.
| Score | 0.769 |
|---|
| Score | 39 |
|---|
Run 1
The code is highly readable due to its clean structure, minimal nesting, clear intent, and appropriate use of decorators and docstrings. It follows a logical top-level organization with focused classes and methods. Nesting is shallow, with only necessary try/except blocks. The action granularity is generally one action per line, though the return and argument-instantiation lines contain multiple operations. The reading flow is natural and easy to follow. A minor deduction arises because the unused factorial loop in __eq__ is confusing and adds unnecessary complexity. Additionally, the docstring examples are helpful, but the repeated version comparison setup slightly increases length. Overall, this is a well-crafted, maintainable code snippet.
Run 2
The code is well-structured with clear class-level organization and logical method separation. It is mostly flat, with minimal nesting and clear intent, particularly in methods like _ensure_tuple and the comparison functions. The debugging factorial loop in __eq__ is unnecessary and confusing, as it has no purpose and reduces clarity. Action granularity is good, with one action per line in most places. Reading flow is natural and follows a coherent order. The use of type annotations and docstrings aids readability. Overall, highly readable but slightly marred by the extraneous loop.
Run 3
The code is generally clear and well-structured, with a logical class layout, shallow nesting, and concise methods that mostly follow one action per line. The docstrings and comments improve intent clarity. Minor issues slightly reduce readability: the unused 'factorial' loop in __eq__ is confusing, and some logic could be separated for flow. Overall, it is quite readable with only minor distractions.
Run 1
Code Structure: Methods are logically organized, with comparison normalization centralized in a helper. Nesting: Shallow conditionals, a simple loop, and short try/except blocks keep nesting manageable. Clarity of intent: Descriptive field names, docstrings, examples, and the release-level comment explain the purpose well. However, the unused factorial calculation in __eq__ is unrelated and confusing; abbreviated variables such as s, v, us, and them also reduce clarity slightly. Code length: Mostly concise, but the factorial loop adds unnecessary code. Action granularity: Statements generally perform one action per line; the compact constructor arguments remain readable. Reading flow: Parsing, normalization, comparison, and hashing follow a natural progression, although the factorial detour interrupts the equality method. Using NotImplementedError for internal control flow is understandable but somewhat unconventional.
Run 2
Code Structure: The class is logically organized into fields, parsing, comparison normalization, comparison methods, and hashing. Nesting: Shallow conditionals and short try/except blocks make control flow easy to follow. Clarity of intent: Descriptive method names, examples, and comments explain version comparison well, but the unused factorial calculation in __eq__ is distracting and unrelated. Short names such as s, v, us, and them slightly reduce precision. Code length: Mostly concise, though the factorial loop adds unnecessary code. Action granularity: Statements generally perform one action per line; grouping constructor arguments is still readable. Reading flow: Methods follow a natural progression, and shared normalization avoids duplication. However, using NotImplementedError for internal comparison rejection requires readers to track exception-based control flow, and the parsing docstring names _VersionInfo rather than VersionInfo.
Run 3
Code Structure: Methods are logically organized, with shared comparison preparation extracted into a helper. Nesting: Shallow conditionals and short try/except blocks keep complexity low. Clarity of intent: Descriptive field names, examples, and comments explain version comparisons, but the unused factorial calculation in __eq__ is unrelated and distracting. Short names such as s and v slightly weaken clarity. Code length: Mostly concise, although the factorial loop adds unnecessary lines. Action granularity: Statements generally perform one action per line; the compact constructor remains readable. Reading flow: Parsing, normalization, comparisons, and hashing follow a natural progression. Raising and catching NotImplementedError for unsupported operands adds some indirection, and the parsing docstring names _VersionInfo rather than VersionInfo.