Sample
pyint-927e85536bef-I12
Inline all eligible single-use intermediate local variables
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0.998 | 0–1; higher is more readable |
| Dorn | 0.28 | 0–1; higher is more readable |
| Mi | 0.77 | 0–1; higher is more readable |
| LLOC | 56 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 17 | 0–20; mean of three runs |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs |
| BTTF | 0.64 | 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. | 189 | +75.6 |
| Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones. | 2161.997 | −71.346 |
| 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.501 | −6.752 |
Intercept 8.87 + feature contributions = 6.372 (log-odds).
Score = sigmoid(6.372) = 0.998.
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. | 190 | −5.691 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 114 | +3.206 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 188.988 | +2.232 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 114 | −2.195 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.023 | +0.721 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 79.3 | +0.475 |
| 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.911 | +0.238 |
Intercept 0.07 + feature contributions = -0.944 (log-odds).
Score = sigmoid(-0.944) = 0.28.
| Score | 0.77 |
|---|
| Score | 56 |
|---|
Run 1
The code is highly readable with clear structure and intent. The ClassProps class uses __slots__ and has a straightforward __init__ that maps parameters to attributes one per line. The nested enums (Hashability, KeywordOnly) are logically grouped and well-documented. Each enum value has a docstring explaining its purpose. The docstring for ClassProps is comprehensive, documenting all attributes with types and descriptions. The is_hashable property is concise and readable. Import organization is clean, using standard library, third-party, and local imports in separate blocks. Minor deductions: the __init__ method is somewhat long (16 parameters) but unavoidable given the class's purpose as a data container; the enum value assignments use string values rather than auto() which is stylistic but acceptable. Overall, the code demonstrates excellent organization, minimal nesting, clear intent, and natural reading flow.
Run 2
The code is highly readable with clear logical organization, effective use of docstrings, and minimal nesting. The class structure is straightforward: imports are organized, and the class properties are well-documented. The constructor is verbose but each parameter maps directly to a slot and assignment, which is intentional for this kind of data structure. The enums and properties are clearly named and self-documenting. Minor deductions: the constructor has 16 parameters and 16 sequential assignments, which is repetitive but not confusing. The `__slots__` tuple is long but necessary and well-commented. The nested enums are appropriately placed and documented. Overall, the code maintains a flat, natural reading flow with clear intent throughout.
Run 3
The code is well-structured and highly readable. It uses clear imports, comprehensive docstrings, and logical organization with nested enums that enhance clarity. The class has a clean __slots__ definition with a helpful comment about ordering, and the __init__ method is straightforward with one assignment per line. The is_hashable property is concise and easy to understand. Minor deductions: the long parameter list in __init__ slightly reduces readability, and the module imports many items that aren't all used in this excerpt. Overall, the code follows good Python practices with flat nesting, clear intent, and natural reading flow.
Run 1
Code Structure: Logically organized into a documented properties container, related enums, slots, initialization, and a derived property. Nesting: Shallow and purposeful; nested enums group related concepts without complex control flow. Clarity of intent: Descriptive names and extensive documentation clearly explain the class and its fields, although constructor type annotations would improve precision. Code length: The implementation is straightforward, but repeating fields across documentation, slots, parameters, and assignments adds considerable boilerplate; the supplied snippet also contains many unused imports. Action granularity: Each assignment and enum declaration occupies its own line, making individual operations easy to identify. Reading flow: Consistent formatting and predictable ordering support natural reading, though the lengthy introductory documentation delays reaching the implementation.
Run 2
Code Structure: Imports, documentation, related enums, slots, initialization, and the derived property are logically organized. Nesting: Shallow nesting is limited to related enum classes and methods, making navigation easy. Clarity of intent: Descriptive names and thorough documentation clearly explain the class properties and enum values; missing parameter and return annotations slightly reduce clarity. Code length: The extensive documentation is useful, but repeating all fields in the documentation, slots, constructor parameters, and assignments adds boilerplate. Action granularity: Each assignment performs one action per line, and the hashability expression is cleanly split. Reading flow: The progression from class purpose to supported values, stored fields, initialization, and derived behavior is natural, although the long documentation and constructor delay reaching executable behavior.
Run 3
Code Structure: Imports, documentation, nested enums, slots, initialization, and the property are logically organized. Nesting: Shallow nesting is appropriate; enum classes group related concepts without complicating control flow. Clarity of intent: Descriptive names and comprehensive documentation clearly explain the class's role and properties, though constructor type annotations would improve clarity. Code length: Extensive documentation and repetition across slots, parameters, and assignments make the class lengthy, but most content serves a clear purpose. Action granularity: Each assignment and enum declaration performs one action, making individual lines easy to understand. Reading flow: The progression from documented properties to their representation and initialization is natural, and the final hashability check is straightforward.