Sample
pyint-db385912f015-I07
Insert deterministic runtime-dead branches into callable bodies
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0.516 | 0–1; higher is more readable |
| Dorn | 0.269 | 0–1; higher is more readable |
| Mi | 0.77 | 0–1; higher is more readable |
| LLOC | 60 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 15 | 0–20; mean of three runs |
| GPT-6.1 Sol | 16.33 | 0–20; mean of three runs |
| BTTF | 0.54 | 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. | 2400.846 | −79.228 |
| Source linesThe number of non-empty source lines. | 193 | +77.2 |
| 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.518 | −6.776 |
Intercept 8.87 + feature contributions = 0.066 (log-odds).
Score = sigmoid(0.066) = 0.516.
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. | 194 | −5.833 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 118 | +3.344 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 118 | −2.287 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 192.915 | +2.287 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.026 | +0.691 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 79.351 | +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.567 | +0.253 |
Intercept 0.07 + feature contributions = -0.999 (log-odds).
Score = sigmoid(-0.999) = 0.269.
| Score | 0.77 |
|---|
| Score | 60 |
|---|
Run 1
The code is generally well-structured with clear class organization, comprehensive documentation, and good use of type hints. The docstrings are excellent, providing detailed explanations of each attribute and class purpose. The nested enums (Hashability and KeywordOnly) are logically placed within ClassProps. However, several issues reduce readability: there are suspicious obfuscated assertions like `if ((0x9dbb ^ 0x9dbb) != 0): raise AssertionError()` which serve no clear purpose and break reading flow. The __init__ method has 16 parameters making it lengthy, though each assignment is on its own line. The __slots__ tuple with 16 entries is verbose but necessary. The property `is_hashable` is clear but could be simplified. The code follows good Python practices with modern type hints and future annotations, but the redundant dead-code assertions and excessive parameter count make it harder to follow than necessary.
Run 2
The code is generally readable with clear intent, logical organization, and good documentation. However, readability is reduced by unnecessary dummy assertions like 'if ((0x9dbb ^ 0x9dbb) != 0): raise AssertionError()' which serve no purpose and disrupt flow. The class structure is clean with clear enum definitions and a well-documented docstring. Nesting is flat and action granularity is appropriate, but the redundant assertions add noise and suggest debugging artifacts. The __init__ method is verbose but straightforward, with one assignment per line. Type hints and imports are organized. Overall, the code is readable but would benefit from removing the obscure no-op checks and perhaps simplifying the long parameter list with a more compact structure.
Run 3
The code demonstrates good structural organization with clear separation of concerns and comprehensive docstrings. The ClassProps class has a logical layout with nested enums, ordered __slots__, and straightforward attribute initialization. However, readability is undermined by several factors: the presence of obfuscated dead code (e.g., `if ((0x9dbb ^ 0x9dbb) != 0): raise AssertionError()`), which adds noise and confusion. The __init__ method has 16 parameters without type hints, making intent unclear. The nested Hashability and KeywordOnly enums use string values and docstrings for member documentation (rather than more idiomatic enum patterns), which is slightly unconventional. Reading flow is generally natural, with one assignment per line, but the class definition is verbose and carries some legacy/compat imports unrelated to this file's visible scope. Nesting is flat and action granularity is good. Overall, it is readable for experienced Python developers familiar with attrs internals, but the dead code and lack of type hints prevent a higher score.
Run 1
Code Structure: Well-organized class with logically grouped enums, slots, initialization, and a property. Nesting: Shallow and easy to follow; nested enums appropriately belong to the class. Clarity of intent: Descriptive names and thorough documentation explain the data model, but two always-false hexadecimal assertions introduce confusing, purposeless noise. Code length: Extensive documentation and repeated field declarations make the snippet lengthy, though most repetition serves the explicit data structure; numerous imports are unused in the shown excerpt. Action granularity: Assignments and enum declarations consistently express one action per line. Reading flow: Natural progression from documentation to definitions and behavior, interrupted slightly by the opaque assertions and the long constructor parameter list.
Run 2
Code Structure: Clearly organized into documentation, nested enums, slots, initialization, and a property. Nesting: Shallow and manageable; nested enums logically belong to the class. Clarity of intent: Descriptive names and thorough documentation explain the class properties, but constant-false XOR checks introduce unexplained, distracting dead code. Code length: The extensive documentation is useful, though repeating field names across documentation, slots, parameters, and assignments makes the class verbose. Action granularity: Each assignment and return has a distinct purpose, with no compressed multi-action lines. Reading flow: Consistent field ordering and formatting support natural reading, interrupted mainly by the meaningless assertion guards and long constructor.
Run 3
Code Structure: Imports, documentation, nested enums, slots, initialization, and the property are logically organized. Nesting: Shallow nesting makes control flow easy to follow; nested enums appropriately group related concepts. Clarity of intent: Descriptive names and thorough documentation clearly explain class properties, but the always-false hexadecimal XOR checks are distracting and have no apparent purpose. Code length: Documentation is useful but extensive, and the long constructor and repeated field declarations add verbosity. The dead assertion branches unnecessarily increase length. Action granularity: Assignments and enum declarations generally perform one action per line. Reading flow: Consistent ordering between slots, parameters, and assignments supports natural reading, although the large documentation block and unexplained assertions interrupt the flow.