Sample
pyint-359bd07542b2-I07
Insert deterministic runtime-dead branches into callable bodies
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0.035 | 0–1; higher is more readable |
| Dorn | 0.797 | 0–1; higher is more readable |
| Mi | 0.751 | 0–1; higher is more readable |
| LLOC | 11 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 5.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 14 | 0–20; mean of three runs |
| BTTF | 0.444 | 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. | 336.045 | −11.089 |
| 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.466 | −6.699 |
| Source linesThe number of non-empty source lines. | 14 | +5.6 |
Intercept 8.87 + feature contributions = -3.318 (log-odds).
Score = sigmoid(-3.318) = 0.035.
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. | 40.933 | +1.931 |
| 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. | 14 | +0.541 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 14 | −0.253 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 13.81 | −0.217 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 14 | +0.1 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.097 | −0.002 |
Intercept 0.07 + feature contributions = 1.366 (log-odds).
Score = sigmoid(1.366) = 0.797.
| Score | 0.751 |
|---|
| Score | 11 |
|---|
Run 1
The code is short but difficult to follow. The class name 'AutoDetect' is vague and the @attr.s decorator does not clarify what it configures. The __init__ method contains a dead branch: the condition `(0x928e ^ 0x928e) != 0` is always False, so the `raise AssertionError()` is unreachable. This obscures intent and wastes lines. The assignment `self.x = x` is clear, but the surrounding noise hurts readability. Importing both `attr` and `attrs` is confusing and redundant; only one is needed, and neither is used meaningfully. Overall, the structure is poor because the class serves no evident purpose and includes misleading logic.
Run 2
The code is short but confusing. The class AutoDetect uses an unusual __init__ with a meaningless assertion check (0x928e ^ 0x928e) that will never trigger. This obscures intent. The import of attrs alongside attr is redundant, and the typing imports (Any, Dict, List, Tuple) are unused. There is no clear purpose for the class. Nesting is flat, but structure is weakened by dead code and unnecessary imports. Action granularity is fine, but overall readability suffers from ambiguity and clutter.
Run 3
This code is difficult to read and understand. The class structure is simple but contains confusing and unnecessary elements. The `__init__` method includes a meaningless bitwise XOR operation that always evaluates to zero, followed by a conditional that would never raise the `AssertionError`. This obscures the code's intent and adds dead logic. The use of both `attr.s` and `attrs` imports is redundant and confusing. The type hints and forward annotations are good practice, but they are overshadowed by the unclear conditional and unused imports. Nesting is minimal, which is positive, but clarity of intent and code length suffer due to the dead code and redundant imports. Action granularity is adequate, with one statement per line, but the reading flow is disrupted by the nonsensical condition. Overall, the code is hard to follow and appears to contain artifacts or test code, making it very low in readability.
Run 1
Code Structure: The class and constructor are logically organized, but unused imports add clutter. Nesting: Shallow nesting makes the code easy to follow. Clarity of intent: The typed field and assignment are clear, while the always-false hexadecimal XOR condition obscures the constructor's simple purpose. Code length: Short overall, but unnecessary imports and unreachable assertion code inflate it. Action granularity: Each line contains a single action. Reading flow: Mostly natural, though the redundant condition interrupts the straightforward initialization flow, and spacing between imports and the class could be improved.
Run 2
Code Structure: The small class is logically organized, but several unused imports add clutter. Nesting: Only one shallow conditional, so nesting is easy to follow. Clarity of intent: The annotated field and assignment are clear, but the hexadecimal XOR condition is obscure and always false, making the assertion unreachable. Code length: Short overall, though the redundant guard and unused imports unnecessarily lengthen it. Action granularity: Each statement occupies its own line. Reading flow: Mostly natural, but the pointless assertion interrupts the straightforward initialization, and spacing between imports and the class could be improved.
Run 3
Code Structure: Imports and a small class are logically organized, though several imports are unused and importing both attr and attrs adds clutter. Nesting: Only one conditional level keeps nesting shallow. Clarity of intent: The class stores an integer, but the hexadecimal XOR condition always evaluates to false, making the assertion branch confusing and purposeless. Code length: Brief overall, yet unnecessarily expanded by unused imports and dead code. Action granularity: Each line performs one action, supporting readability. Reading flow: The conventional import-to-class-to-constructor sequence is natural, but the opaque conditional interrupts the straightforward initialization.