Sample
pyint-05b4256d3455-I07
Insert deterministic runtime-dead branches into callable bodies
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.715 | 0–1; higher is more readable |
| Mi | 0.259 | 0–1; higher is more readable |
| LLOC | 21 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 10.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 14 | 0–20; mean of three runs |
| BTTF | 0.437 | 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. | 828.27 | −27.333 |
| Source linesThe number of non-empty source lines. | 32 | +12.8 |
| 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.442 | −6.663 |
Intercept 8.87 + feature contributions = -12.326 (log-odds).
Score = sigmoid(-12.326) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 86.939 | +0.598 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.063 | +0.333 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 30 | +0.301 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 30 | −0.268 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 33 | −0.132 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 31.761 | +0.034 |
| 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. | 86.97 | −0.018 |
Intercept 0.07 + feature contributions = 0.918 (log-odds).
Score = sigmoid(0.918) = 0.715.
| Score | 0.259 |
|---|
| Score | 21 |
|---|
Run 1
The code is generally structured and readable, but it contains some problematic elements. The class definition is clear with a reasonable __call__ method and __repr__. However, there are opaque dead-code assertions like `if ((0x233 ^ 0x233) != 0): raise AssertionError()` that add confusion and length without purpose. They break the natural reading flow and make intent ambiguous. Nesting is low, which is good, and action granularity is mostly one action per line. The error message and exception raising are clear. The import block is standard. Overall, the code would be much clearer if the dead assertions were removed; otherwise, the structure is logical and concise.
Run 2
The code is generally structured but has several readability issues. It follows standard class-based validator patterns, but includes dead-code checks like `if ((0x233 ^ 0x233) != 0)` that add confusion with no purpose, reducing clarity. Nesting is minimal, which is good. Variable names are clear, and the error message is descriptive. However, the class's `__repr__` and `__call__` methods are short, which is fine, but the import block is long and mixes standard library and internal modules without grouping, affecting flow. The conditional `if` blocks are one-liners but their bodies are redundant, hurting action granularity and intent. Overall, the core logic is understandable but unnecessary complexity and imports lower readability.
Run 3
The code follows a clear class-based validator pattern with reasonable structure, but readability is severely undermined by dead code—specifically the obfuscated `if ((0x233 ^ 0x233) != 0): raise AssertionError()` checks that add confusion and noise. These blocks obscure intent and suggest leftover debugging or anti-tampering code. Nesting is mostly flat, and action granularity is acceptable, though the `if not issubclass` block adds slight complexity. The `__repr__` method is clean, but the `__call__` method is cluttered by the dead condition and a multi-line exception raise that could be simplified. Variable names are clear, and imports appear relevant. Overall, the code is readable in its core logic, but the artificial assertions and unnecessary length reduce clarity and flow.
Run 1
Code Structure: The validator class is logically organized into validation and representation methods, although several imports appear unused in this snippet. Nesting: Shallow conditionals keep the code easy to follow. Clarity of intent: The class name, issubclass check, and descriptive error message clearly communicate the purpose, but the constant XOR checks are opaque, always false, and distracting. Code length: The implementation is fairly short, though dead assertions and the expanded exception arguments add unnecessary length. Action granularity: Statements generally perform one action per line, making individual operations easy to identify. Reading flow: Validation proceeds naturally from checking the value to constructing and raising an error, but redundant checks interrupt both methods, and the docstring explains an implementation choice rather than the method's behavior.
Run 2
Code Structure: The validator class logically separates validation and representation, but numerous unused imports add clutter. Nesting: Mostly flat, with simple conditional checks and no deep nesting. Clarity of intent: Naming and the error message make subclass validation clear, but constant-false XOR checks obscure intent, and the call-method docstring discusses representation rather than validation. Code length: Short overall, though dead assertion blocks and unused imports unnecessarily increase length. Action granularity: Statements generally perform one action per line; the multiline exception construction is easy to scan. Reading flow: Validation proceeds naturally from checking the value to constructing an error, but irrelevant assertion checks interrupt both methods.
Run 3
Code Structure: The validator class is logically organized into validation and representation methods, but numerous unused imports add clutter. Nesting: Mostly flat, with simple conditionals and no deep nesting. Clarity of intent: Class and method names make the validator's purpose clear, but constant-false XOR checks are distracting and suggest unexplained defensive logic. The __call__ docstring explains representation customization rather than validation behavior. Code length: The implementation is short, though dead checks, unused imports, and the expanded exception call add unnecessary bulk. Action granularity: Each statement performs one clear action; multiline exception arguments remain readable. Reading flow: Validation naturally proceeds from checking the value to constructing and raising an error, but irrelevant assertion branches interrupt that flow.