Sample
pyint-a263266385a0-I08
Select one of ten high-readability unrelated code templates per class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0.973 | 0–1; higher is more readable |
| Dorn | 0.273 | 0–1; higher is more readable |
| Mi | 0.77 | 0–1; higher is more readable |
| LLOC | 61 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 14.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 15.67 | 0–20; mean of three runs |
| BTTF | 0.589 | 0–1; higher is more readable |
Views
Loading feature diagnosis…
Source regions
Feature contributions
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Source linesThe number of non-empty source lines. | 194 | +77.6 |
| Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones. | 2306.901 | −76.128 |
| 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.5 | −6.75 |
Intercept 8.87 + feature contributions = 3.592 (log-odds).
Score = sigmoid(3.592) = 0.973.
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. | 195 | −5.868 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 119 | +3.379 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 119 | −2.31 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 193.988 | +2.302 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.023 | +0.719 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 79.359 | +0.476 |
| 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. | 80.579 | +0.252 |
Intercept 0.07 + feature contributions = -0.98 (log-odds).
Score = sigmoid(-0.98) = 0.273.
| Score | 0.77 |
|---|
| Score | 61 |
|---|
Run 1
The code is highly readable with clear structure and organization. The ClassProps class is well-documented with comprehensive docstrings explaining each attribute. The nested enum classes (Hashability, KeywordOnly) are logically grouped and help organize related constants. The __slots__ declaration is concise and includes an explanatory comment about ordering. The constructor is straightforward with one assignment per line, making the initialization clear. The is_hashable property demonstrates good readability despite the slightly unusual weather comparison example. Code length is appropriate - the extensive documentation justifies the length. Action granularity follows one-action-per-line conventions consistently. Nesting is minimal with only two levels of class nesting for enums. The reading flow is natural, moving from imports to class definition, nested enums, then methods. Minor improvements could include grouping related imports more aggressively, but the overall structure is excellent for a library module. The experimental feature warning is prominently placed. The use of type hints and the future annotations import maintain modern Python practices.
Run 2
The code is generally well-structured with clear class organization and comprehensive docstrings. The ClassProps class has good logical grouping with meaningful attribute names. However, several issues reduce readability: the unused imports and ClassProps.Hashability/KeywordOnly enums are documented well but clutter the file. The __init__ method is excessively long with 16 positional parameters, making it error-prone and hard to read. The is_hashable property contains completely unrelated dead code (temperature variable assignments) that serves no purpose and is confusing. Multiple actions occur per line in some places. While nesting is minimal and naming is descriptive, the unrelated dead code and overly long parameter lists significantly hurt clarity and maintainability. The Action granularity is generally good, but the dead code completely breaks reading flow and should be removed.
Run 3
The code is generally well-structured with clear class organization, good documentation, and proper use of enums and slots. However, there are notable readability issues: the `is_hashable` property contains unrelated temperature variables (likely leftover debug code) that confuse intent. The `__init__` method has 16 parameters with repetitive assignments, making it lengthy. While nesting is minimal and action granularity is good (one assignment per line), the large number of near-identical lines creates visual noise. Import section is comprehensive but slightly cluttered. Type hints are present but the init parameters lack annotations. The documentation is excellent for the main class but missing for the `is_hashable` property. Overall, the structure is logical and readable, but the extraneous code and verbose initialization reduce clarity.
Run 1
Code Structure: Imports, enums, slots, initialization, and the property are logically organized. Nesting: Mostly flat, with only shallow class and conditional nesting. Clarity of intent: Descriptive names and extensive documentation explain the class well, but unrelated temperature calculations in is_hashable obscure an otherwise simple purpose. Code length: Documentation is useful, though repeated field declarations and assignments are verbose; the unused temperature logic is unnecessary. Action granularity: Statements generally perform one action per line, making individual operations easy to follow. Reading flow: Consistent formatting and field ordering support natural reading, but the long documentation and constructor delay reaching behavior, and the irrelevant calculations interrupt the property's flow.
Run 2
Code Structure: Imports, the main class, nested enums, slots, and methods are logically organized. Nesting: Shallow nesting keeps control flow easy to follow. Clarity of intent: Descriptive property names and thorough documentation clearly explain the class, but unrelated temperature calculations in is_hashable distract from its purpose. Code length: Extensive documentation is useful, though repeated field declarations across documentation, slots, parameters, and assignments add verbosity; the temperature block is unnecessary. Action granularity: Statements generally perform one action per line, and the return expression is cleanly formatted. Reading flow: Consistent formatting and predictable organization support natural reading, but the long constructor and irrelevant calculations interrupt it.
Run 3
Code Structure: Imports, the main class, nested enums, slots, and methods are logically organized. Nesting: Shallow nesting keeps the code easy to follow. Clarity of intent: Descriptive names and detailed documentation explain the class well, but unrelated temperature calculations in is_hashable distract from its purpose. Code length: Extensive documentation is useful, though repeated field declarations and constructor assignments add boilerplate; the temperature logic is unnecessary. Action granularity: Each line generally performs one clear action, and the return expression is neatly formatted. Reading flow: The progression from documentation to enums, fields, initialization, and the property is natural, but the irrelevant calculations interrupt the final method.