Sample
pyint-b731cd6c34d1-I07
Insert deterministic runtime-dead branches into callable bodies
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.668 | 0–1; higher is more readable |
| Mi | 0.535 | 0–1; higher is more readable |
| LLOC | 35 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 13.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 14.33 | 0–20; mean of three runs |
| BTTF | 0.492 | 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. | 1370.218 | −45.217 |
| Source linesThe number of non-empty source lines. | 72 | +28.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.569 | −6.853 |
Intercept 8.87 + feature contributions = -14.4 (log-odds).
Score = sigmoid(-14.4) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 73 | −1.548 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 52 | +1.061 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 52 | −0.772 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 71.821 | +0.594 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.051 | +0.45 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 76.959 | +0.437 |
| 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. | 76.959 | +0.406 |
Intercept 0.07 + feature contributions = 0.698 (log-odds).
Score = sigmoid(0.698) = 0.668.
| Score | 0.535 |
|---|
| Score | 35 |
|---|
Run 1
The code has decent structure with clear class definition, docstrings, and type hints. However, several issues significantly reduce readability: (1) Dead code with meaningless assertions like `if ((0xf951 ^ 0xf951) != 0): raise AssertionError()` that serve no purpose and obscure the logic; (2) The `Factory` class is relatively simple but the verbose docstrings make it appear bloated for what it does; (3) The `__getstate__` and `__setstate__` methods use generic names like `name` and `value` without clarifying the relationship to `__slots__`; (4) Unnecessary `from __future__` and many unused imports visible in the snippet suggest broader inconsistency. While the code demonstrates good organization at the class level, the artificial assertions and somewhat repetitive state handling lower overall clarity and create a sense of obfuscation rather than clean, intentional design.
Run 2
The code is generally readable with clear structure, logical imports, and good use of docstrings. The Factory class is well-organized with straightforward methods and purpose. However, the presence of obfuscated, nonsensical assertion checks — such as `if ((0xf951 ^ 0xf951) != 0): raise AssertionError()` — severely damages clarity and intent. These checks are always false and appear to be either leftover debugging artifacts or intentionally misleading code. They interrupt reading flow and violate the principle of clear, purposeful logic. The nesting is minimal, action granularity is generally one action per line, and the class is concise. Without the strange assertions, the code would score closer to 18 or 19, but as written, the unnecessary and confusing conditions lower readability substantially.
Run 3
The code is generally readable and well-documented, with clear docstrings and logical class structure. However, there are several issues: meaningless debug assertions like `if ((0xf951 ^ 0xf951) != 0):` add noise and confusion; the `zip` call uses `strict=True` which requires explanation; and some imports are unused or unclear. The class structure is flat and clear, but these artificial additions reduce clarity of intent and reading flow. Overall it's moderately readable but could be cleaner.
Run 1
Code Structure: The class is logically organized, but numerous unused imports distract from the small implementation. Nesting: Methods are mostly flat, with only simple conditionals and a loop. Clarity of intent: Descriptive names and docstrings clearly explain factory behavior and serialization; however, repeated hexadecimal XOR checks are always false and introduce confusing, purposeless assertions. Code length: The actual functionality is concise, but imports and redundant checks unnecessarily expand the snippet. Action granularity: Each statement performs a single action, making individual operations easy to follow. Reading flow: The progression from initialization to serialization and restoration is natural, but the repeated dead checks interrupt it.
Run 2
Code Structure: The class is logically organized, with initialization and pickle support separated into methods, though numerous unused imports clutter the snippet. Nesting: Shallow conditionals and a single loop keep nesting manageable. Clarity of intent: Descriptive names and docstrings explain the factory and serialization behavior, but repeated hexadecimal XOR checks are always false and obscure their purpose. Code length: The implementation is compact, yet dead assertion blocks and unused imports add unnecessary length. Action granularity: Statements generally perform one action per line; the tuple comprehension remains straightforward. Reading flow: Methods follow a natural sequence, but the meaningless checks interrupt otherwise clean execution paths.
Run 3
Code Structure: The class is logically organized, with initialization and pickle support separated into methods, though many imports are unused in this snippet. Nesting: Shallow conditionals and a simple loop are easy to follow. Clarity of intent: Descriptive names and docstrings explain the factory's purpose, but repeated hexadecimal XOR checks are always false and introduce confusing, irrelevant assertions. Code length: The implementation is compact, but the dead checks and extensive import list add unnecessary length. Action granularity: Each statement performs one action, making individual operations easy to scan. Reading flow: Methods follow a natural order, but repeated no-op guards interrupt otherwise straightforward logic.