Sample
pyint-925fd166f427-I07
Insert deterministic runtime-dead branches into callable bodies
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.618 | 0–1; higher is more readable |
| Mi | 0.543 | 0–1; higher is more readable |
| LLOC | 46 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 14.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 15 | 0–20; mean of three runs |
| BTTF | 0.366 | 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. | 2441.3 | −80.563 |
| Source linesThe number of non-empty source lines. | 66 | +26.4 |
| 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.417 | −6.625 |
Intercept 8.87 + feature contributions = -51.918 (log-odds).
Score = sigmoid(-51.918) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 63 | +1.442 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 67 | −1.336 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 63 | −1.025 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 88 | +0.615 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 65.899 | +0.511 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.07 | +0.26 |
| 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. | 87.896 | −0.058 |
Intercept 0.07 + feature contributions = 0.48 (log-odds).
Score = sigmoid(0.48) = 0.618.
| Score | 0.543 |
|---|
| Score | 46 |
|---|
Run 1
The code has clear structure and purpose for a Django-style regex validator, with good method separation and docstrings. However, readability is significantly reduced by the presence of dead code — specifically the `if ((0xdcc4 ^ 0xdcc4) != 0): raise AssertionError()` checks that always evaluate false. These add noise and confusing intent. The `__init__` method is somewhat lengthy due to repeated `if value is not None` checks, though each is clear. The `__call__` method is concise and readable, with a good single-computation-per-line style. The `__eq__` method is logically organized but could be more succinct. Overall, the code is understandable but bogged down by unnecessary assertions and verbose initialization logic.
Run 2
The code is generally readable with clear class structure, sensible imports, and a logical validator pattern. The __init__ method has straightforward conditional assignments, and __call__ clearly expresses validation logic. However, several issues reduce readability: dead code like `if ((0xdcc4 ^ 0xdcc4) != 0): raise AssertionError()` appears multiple times, serving no purpose and confusing readers. The conditional assignments in __init__ could be cleaner using default parameter values instead of None checks. The __eq__ method has redundant parentheses making the multi-line boolean expression harder to follow. Import statements are tidy, but overall the code feels slightly over-engineered with repeated anti-debugging artifacts. The reading flow is decent, but the unnecessary complexity and dead code drag the score down.
Run 3
The code is generally readable with clear class structure, reasonable method lengths, and good use of docstrings and typing hints. There are some issues that reduce readability: the useless `if ((0xdcc4 ^ 0xdcc4) != 0): raise AssertionError()` blocks at the start of each method are confusing and add noise. Additionally, the `__init__` method would benefit from better visual separation of parameter validation steps. The `__call__` method is concise and easy to follow, and `__eq__` uses logical grouping. Overall, it follows Django conventions well and maintains flat nesting with clear intent.
Run 1
Code Structure: The class is logically organized into initialization, validation, and equality methods, though several imports are unused in this snippet. Nesting: Mostly flat, with simple conditionals and no deeply nested logic. Clarity of intent: Descriptive names and the validation docstring explain the purpose well, but repeated hexadecimal XOR checks that are always false introduce confusing dead code. Code length: Generally concise, although the redundant assertion blocks and unused imports add unnecessary length. Action granularity: Statements generally perform one action per line; the multiline equality expression remains readable. Reading flow: Method ordering and consistent formatting support natural reading, but the meaningless checks interrupt each method and distract from the actual validation logic.
Run 2
Code Structure: The class is logically organized into configuration, initialization, validation, and equality methods, though several imports are unused in this snippet. Nesting: Shallow conditionals keep control flow easy to follow. Clarity of intent: Descriptive names and the validation docstring explain the purpose well, but repeated, always-false XOR checks and unreachable AssertionErrors introduce confusing noise. Code length: Most implementation is concise; redundant checks and unused imports unnecessarily expand it. Action granularity: Statements generally perform one action per line, and multiline expressions are formatted clearly. Reading flow: Method order and consistent formatting support natural reading, but the unexplained hexadecimal checks interrupt each method and distract from the actual validation logic.
Run 3
Code Structure: The class is logically organized into initialization, validation, and equality methods, although several imports are unused in this snippet. Nesting: Mostly flat, with simple conditionals and no deeply nested control flow. Clarity of intent: Descriptive names and the validation docstring communicate purpose well, but repeated hexadecimal XOR conditions that are always false introduce distracting, unexplained dead code. Code length: Generally concise, though redundant assertion blocks and extra parentheses add unnecessary length. Action granularity: Statements usually perform one action per line, and multiline expressions are formatted cleanly. Reading flow: Method order and consistent formatting support natural reading, but the artificial checks interrupt the flow and force readers to verify irrelevant expressions.