Sample
pyint-da94f07fbd47-I07
Insert deterministic runtime-dead branches into callable bodies
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.726 | 0–1; higher is more readable |
| Mi | 0.574 | 0–1; higher is more readable |
| LLOC | 24 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 10.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 14 | 0–20; mean of three runs |
| BTTF | 0.497 | 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. | 1126.181 | −37.164 |
| Source linesThe number of non-empty source lines. | 40 | +16 |
| 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.376 | −6.564 |
Intercept 8.87 + feature contributions = -18.857 (log-odds).
Score = sigmoid(-18.857) = 0.
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. | 69.976 | +0.701 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 38 | +0.577 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 38 | −0.451 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 41 | −0.415 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.064 | +0.318 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 39.676 | +0.145 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 51.61 | +0.028 |
Intercept 0.07 + feature contributions = 0.973 (log-odds).
Score = sigmoid(0.973) = 0.726.
| Score | 0.574 |
|---|
| Score | 24 |
|---|
Run 1
The code has several readability issues. The class structure is logical but includes dead code blocks like `if ((0x79ec ^ 0x79ec) != 0): raise AssertionError()` that are confusing and serve no purpose. Nesting is excessive in `__call__`, with a conditional check for the iterable validator then a loop, creating multiple levels of indentation. Clarity of intent is obscured by misleading variable names such as `inst`, `attr`, and `value`, and the purpose of the dead code is unclear. Code length is moderate but includes unnecessary imports (`operator`, `re`, `Pattern`, `contextmanager`, `get_run_validators`, etc.) that are never used, adding noise. Action granularity is reasonable, with one logical action per line, but the dead code breaks this by adding extraneous lines. Reading flow is disrupted by the dead code and the awkward f-string construction in `__repr__`, making the code difficult to follow naturally.
Run 2
The code has clear structure at the class level with logical attributes and methods, but readability is hurt by noise: meaningless self-XOR assertions with non-zero checks that always pass, and magic hex values. Nesting is mostly flat, and intent of __call__ and __repr__ is understandable. However, the assertions add confusion. Action granularity is reasonable, mostly one action per line. Length is concise. Reading flow is disrupted by suspicious dead-code-like checks before real logic. Overall, the core class is readable, but the boilerplate guards reduce clarity and trust.
Run 3
The code follows a mostly logical structure with a single class definition and clear method separation. However, readability is severely impacted by several obfuscation artifacts: zero-effect AssertionError checks like `if ((0x79ec ^ 0x79ec) != 0)` appear in both methods, serving no functional purpose and disrupting flow. Nesting is moderate—the `__call__` method has one loop and one conditional, which is acceptable. Clarity of intent is undermined by unclear variable names like `inst` and `attr`, and the obfuscated assertions make purpose ambiguous. Code length is concise, but action granularity is mixed: some methods perform multiple actions per line. The reading flow is interrupted by the redundant assertions and slightly awkward conditional formatting in `__repr__`. Without the obfuscation, the code would be reasonably readable, but as presented it scores below average.
Run 1
Code Structure: The class is logically organized into attributes, validation, and representation methods, but unused imports add clutter. Nesting: Shallow conditionals and a simple loop are easy to follow. Clarity of intent: Descriptive validator names make the purpose clear, although the always-false XOR checks introduce confusing, irrelevant logic, and is_callable and optional are not defined or imported in the snippet. Code length: Mostly concise, but dead checks and unnecessary imports increase length without value. Action granularity: Each statement performs a single action, and multiline expressions are reasonably formatted. Reading flow: Validation proceeds naturally from the iterable to its members, while representation construction is straightforward; however, the distracting assertion checks interrupt both methods.
Run 2
Code Structure: The callable validator class is logically organized into validation and representation methods, though several imports are unused in this snippet. Nesting: Control flow is shallow, with straightforward conditionals and a single loop. Clarity of intent: Descriptive names make iterable and member validation understandable, but unexplained hexadecimal XOR checks obscure intent, and is_callable and optional are not defined or imported in the excerpt. Code length: Mostly concise, but impossible assertion branches add unnecessary lines. Action granularity: Statements generally perform one action per line, and multiline expressions remain readable. Reading flow: Validation proceeds naturally from the iterable to its members, followed by representation formatting; redundant checks interrupt that flow, and the __call__ docstring explains class design rather than the method's behavior.
Run 3
Code Structure: The class logically separates validation behavior from representation, although several imports appear unused. Nesting: Shallow conditionals and a simple loop keep control flow easy to follow. Clarity of intent: Descriptive validator names make the purpose clear, but unexplained hexadecimal XOR checks add misleading noise, and is_callable and optional are not defined or imported in the shown snippet. Code length: Mostly concise, though redundant assertion branches and an uninformative docstring add unnecessary length. Action granularity: Statements generally perform one action per line, with readable formatting for longer expressions. Reading flow: Validation proceeds naturally from the iterable to its members, and representation construction is straightforward; however, dead checks interrupt both methods and distract from their actual behavior.