Sample
pyint-9d36d927e815-I07
Insert deterministic runtime-dead branches into callable bodies
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0.118 | 0–1; higher is more readable |
| Dorn | 0.84 | 0–1; higher is more readable |
| Mi | 0.699 | 0–1; higher is more readable |
| LLOC | 12 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 8.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 14.33 | 0–20; mean of three runs |
| BTTF | 0.489 | 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. | 310.335 | −10.241 |
| 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.425 | −6.637 |
| Source linesThe number of non-empty source lines. | 15 | +6 |
Intercept 8.87 + feature contributions = -2.008 (log-odds).
Score = sigmoid(-2.008) = 0.118.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| 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. | 35.938 | +2.143 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 15 | +0.505 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 15 | −0.218 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 14.486 | −0.207 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.087 | +0.094 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 15 | +0.077 |
Intercept 0.07 + feature contributions = 1.659 (log-odds).
Score = sigmoid(1.659) = 0.84.
| Score | 0.699 |
|---|
| Score | 12 |
|---|
Run 1
The code is short and simple but contains confusing elements that undermine readability. The class name 'AutoDetect' does not match its purpose or the attrs 'auto_detect=True' setting, creating ambiguity. The custom __init__ overrides attrs' generated initializer but only assigns a single attribute, which is redundant and obscures intent. The if-statement with a constant XOR expression that always evaluates to zero and raises 'AssertionError' is dead code and adds unnecessary noise. While indentation is flat and each statement is on its own line, the presence of meaningless logic and unclear naming reduce clarity. The code would be more readable if the custom __init__ were removed, the class were given a meaningful name, and dead code eliminated.
Run 2
The code is short and mostly clear, but it has several readability issues. The class structure is simple but contains an unnecessary custom __init__ when attrs.define already handles initialization with auto_detect. The odd conditional check `if ((0x7e6c ^ 0x7e6c) != 0): raise AssertionError()` is confusing and adds no value—it's a dead-code pattern that obscures intent. The imports include unused ones (copy, re, sys, Any), which introduces noise. Nesting is flat, which is good, and action granularity is mostly one action per line. Reading flow is natural enough, but the redundant custom initializer and pointless assertion degrade clarity. The code is concise but not clean; it could be reduced to just the attrs.define class with no __init__ at all. Overall, it's readable but marred by cruft and misleading constructs.
Run 3
The code is short and the structure is simple, but several issues hurt readability. The class name 'AutoDetect' and the use of attrs.define with auto_detect=True conflict with the manual __init__ method, creating ambiguity about intent. The redundant XOR check (0x7e6c ^ 0x7e6c) is meaningless noise — it always evaluates to 0 and will never raise. The __init__ method does nothing beyond assignment, so it could be removed entirely, making the code shorter and clearer. Nesting is minimal, and action granularity is acceptable, but the overall reading flow is interrupted by the pointless assertion. Imports like copy, re, sys, and Any are unused, adding clutter. The code works but is unnecessarily convoluted for what should be a one-line class definition.
Run 1
Code Structure: The imports and small class are logically organized, but several unused imports add clutter. Nesting: Shallow nesting makes the code easy to scan. Clarity of intent: The class clearly stores an integer, but the hexadecimal XOR condition always evaluates to false and obscures intent with unreachable assertion code. The interaction between attrs auto-detection and the explicit initializer also requires some library knowledge. Code length: Short overall, though redundant imports and the dead conditional are unnecessary. Action granularity: Each statement performs a single action. Reading flow: Mostly natural, but the meaningless conditional interrupts the straightforward initialization.
Run 2
Code Structure: The class and initializer are logically organized, but several unused imports introduce clutter. Nesting: Only one shallow conditional appears, so nesting is minimal. Clarity of intent: The typed attribute and assignment are straightforward, but the opaque XOR condition always evaluates to false, making the assertion unreachable and its purpose unclear. Code length: The snippet is short, yet unused imports and dead code unnecessarily expand it. Action granularity: Each statement performs one action, supporting readability. Reading flow: The progression from imports to class to initializer is natural, but redundant parentheses and the meaningless conditional interrupt the otherwise simple initialization.
Run 3
Code Structure: Imports and a single class are logically organized, though several imports are unused. Nesting: Shallow, with only one conditional inside the constructor. Clarity of intent: The class clearly stores an integer, but the hexadecimal XOR condition is always false and obscures intent with unreachable assertion logic. Code length: Short overall, yet unnecessarily extended by unused imports and the redundant check. Action granularity: Each statement performs one action, making individual lines easy to follow. Reading flow: Mostly natural from imports to class to initialization, but the opaque condition interrupts an otherwise straightforward constructor.