Sample
pyint-a41a657d36b3-SRC
Unmodified source class
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 | 16.67 | 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 well-structured with clear class definition, appropriate use of decorators, and focused methods. Nested logic is minimal, mostly using guard clauses and exception handling, which keeps the flow flat. Intent is clear through descriptive method names and docstrings with examples. Code length is reasonable—concise yet complete. Action granularity is appropriate; relevant actions are grouped logically, though a few lines could be slightly more explicit. Reading flow is natural, with helper methods separated from comparisons. Minor deductions for the `_ensure_tuple` return line relying on a tuple slice (less explicit) and the compact `return cls(...)` line, but overall readability is high.
Run 2
The code is well-structured and readable. It uses clear class-level attributes with type hints, has a single responsibility per method, and maintains a flat structure with minimal nesting. The helper method `_ensure_tuple` cleanly encapsulates validation and transformation logic, reducing duplication in comparison methods. Method names and docstrings clearly communicate intent. Action granularity is good — most lines perform one logical step. The reading flow is natural, though a few minor improvements would help: the `__lt__` comment is slightly distracting, and `_ensure_tuple` could be simplified by using a tuple of valid lengths instead of a range check. Overall, the code is concise, maintainable, and easy to follow.
Run 3
The code is highly readable with clear structure and intent. Class definition, attributes, and methods are logically organized with minimal nesting. Each method has a single responsibility and performs one action per line in most cases. Type hints and docstrings provide helpful context. The use of decorators and exception handling is clear. The longest method (_ensure_tuple) is still easy to follow due to flat control flow. Naming conventions are consistent and descriptive. The only minor weakness is the slightly cramped return statement in _from_version_string, but overall the code reads naturally from top to bottom.
Run 1
Code Structure: The class is logically organized into fields, parsing, comparison normalization, comparison methods, and hashing; shared logic avoids duplication. Nesting: Shallow conditionals and simple try/except blocks keep complexity low. Clarity of intent: Descriptive method names, docstrings, comparison examples, and the release-level comment explain behavior well, though short names like s and v and exception-based signaling slightly reduce clarity. Code length: Concise overall; the extensive examples provide useful documentation rather than unnecessary implementation length. Action granularity: Statements generally perform one action each; the compact constructor call remains readable. Reading flow: Methods follow a natural progression, with consistent formatting and straightforward control flow. Decorator behavior and the use of NotImplementedError as an internal signal require some background knowledge.
Run 2
Code Structure: The class is logically organized, with parsing, comparison normalization, comparison operators, and hashing separated into focused methods. Nesting: Shallow conditionals and simple try/except blocks keep complexity low. Clarity of intent: Descriptive fields, docstrings, examples, and the release-level comment explain behavior well; abbreviated names such as s and v slightly reduce clarity. Using NotImplementedError for internal control flow is somewhat unconventional. Code length: Concise overall, with useful documentation and minimal duplication between comparison methods. Action granularity: Most lines perform one action; the constructor groups several keyword arguments without becoming difficult to read. Reading flow: Imports, decorators, fields, and methods follow a natural progression, and the shared tuple-normalization helper makes comparisons easy to follow. Minor issues include the docstring referring to _VersionInfo rather than VersionInfo and the need to understand decorator-generated behavior.
Run 3
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 execution paths easy to follow. Clarity of intent: Descriptive method and field names, docstrings, examples, and the release-level comment explain behavior well. Short names such as s and v, a mismatched _VersionInfo reference, and using NotImplementedError for unsupported operands slightly reduce clarity. Code length: Compact implementation with useful documentation rather than unnecessary verbosity. Action granularity: Statements generally perform one action each; the constructor arguments remain readable despite sharing a line. Reading flow: Imports, decorators, fields, and methods follow a natural sequence, with consistent spacing and straightforward returns. Decorator-generated behavior requires some familiarity with attrs and total_ordering.