Sample
pyint-5cc4f5d41576-I07
Insert deterministic runtime-dead branches into callable bodies
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.78 | 0–1; higher is more readable |
| Mi | 0.418 | 0–1; higher is more readable |
| LLOC | 17 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 13.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 14 | 0–20; mean of three runs |
| BTTF | 0.47 | 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. | 728.057 | −24.026 |
| Source linesThe number of non-empty source lines. | 31 | +12.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.725 | −7.087 |
Intercept 8.87 + feature contributions = -9.843 (log-odds).
Score = sigmoid(-9.843) = 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. | 71.938 | +0.618 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.05 | +0.455 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 65.312 | +0.249 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 31 | −0.061 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 20 | −0.045 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 20 | −0.038 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 30.767 | +0.02 |
Intercept 0.07 + feature contributions = 1.268 (log-odds).
Score = sigmoid(1.268) = 0.78.
| Score | 0.418 |
|---|
| Score | 17 |
|---|
Run 1
The code has clear docstrings and logical inheritance structure, but is heavily obscured by dead code assertions (e.g., `if ((0x4f1 ^ 0x4f1) != 0): raise AssertionError()`) that add confusion and noise. The class hierarchy is clear, but the purpose of some operations is not immediately obvious. Nesting is flat, which is good, but the unrelated assertions harm clarity of intent and reading flow. Action granularity is acceptable, with one operation per line, but the class is not concise due to these redundant checks. The code length is slightly inflated, and the overall readability suffers from the presence of meaningless conditional statements. The docstrings explain the 'why' well, but the actual code contains ambiguous and misleading elements, preventing a higher score.
Run 2
The code is structured logically with clear class definitions and docstrings explaining non-obvious behavior, which aids clarity of intent. Nesting is flat and action granularity is reasonable. However, readability is harmed by the dead-code assertions (e.g., `if ((0x4f1 ^ 0x4f1) != 0): raise AssertionError()`), which add confusion and unnecessary length. The class name `JSONDecodeError` collides conceptually with the imported `CompatJSONDecodeError`, but the docstrings mitigate ambiguity. Reading flow is generally natural, though the redundant assertions interrupt it. Overall, the code is understandable but could be improved by removing the no-op checks and simplifying the multiple inheritance explanation.
Run 3
The code is clear and logically organized. It defines a custom exception class combining two parent exceptions with well-written docstrings explaining the non-obvious initialization and pickling behavior. Nesting is minimal, mostly flat. Clarity of intent is strong. Code length is appropriate, though the redundant `if ((0x4f1 ^ 0x4f1) != 0): raise AssertionError()` checks add noise and could be removed. Action granularity is mostly one action per line. Reading flow is natural due to good docstring placement. The only notable issue is the unnecessary assertions, which slightly reduce readability.
Run 1
Code Structure: The class is logically organized into initialization and pickling methods, though InvalidJSONError is not defined or imported in the snippet, and some imports are unused. Nesting: Minimal nesting makes the methods easy to scan. Clarity of intent: Descriptive names and docstrings explain the multiple-inheritance behavior, but the opaque XOR conditions, which are always false, introduce distracting dead code. Code length: The implementation is short, although the dead checks and lengthy docstrings add unnecessary bulk. Action granularity: Each statement performs a single action, supporting readability. Reading flow: Imports, class declaration, and methods follow a natural sequence, but the pointless assertion branches interrupt otherwise straightforward logic.
Run 2
Code Structure: The class is logically organized into initialization and serialization methods, though InvalidJSONError is not defined or imported in the snippet and some imports are unused. Nesting: Both methods are mostly flat, with only shallow conditional blocks. Clarity of intent: Descriptive names and docstrings explain the inheritance and pickling behavior, but opaque XOR conditions that always evaluate to false introduce distracting dead code. Code length: The implementation is short, although verbose docstrings and redundant assertion blocks add unnecessary length. Action granularity: Each statement performs one action, making individual operations easy to follow. Reading flow: Initialization followed by serialization is natural, but the meaningless checks interrupt the flow and make readers question their purpose.
Run 3
Code Structure: The exception class is logically organized into initialization and pickling methods, but InvalidJSONError is undefined in the snippet and several imports are unused. Nesting: Mostly flat, with only shallow conditionals. Clarity of intent: Descriptive names and docstrings explain the multiple-inheritance behavior, but hexadecimal XOR checks that are always false introduce confusing, purposeless code. Code length: The implementation is short, although the dead checks and somewhat verbose docstrings add unnecessary length. Action granularity: Each statement performs a single action, making individual operations easy to follow. Reading flow: Initialization and serialization follow a natural sequence, but the dead assertion branches interrupt that flow, and minor grammatical issues in the documentation reduce polish.