Sample
pyint-49ebf29432f2-I07
Insert deterministic runtime-dead branches into callable bodies
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.41 | 0–1; higher is more readable |
| Mi | 0.3 | 0–1; higher is more readable |
| LLOC | 51 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 16.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 15 | 0–20; mean of three runs |
| BTTF | 0.368 | 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. | 2733.368 | −90.201 |
| Source linesThe number of non-empty source lines. | 111 | +44.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.625 | −6.937 |
Intercept 8.87 + feature contributions = -43.868 (log-odds).
Score = sigmoid(-43.868) = 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. | 112 | −2.929 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 64 | +1.477 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 110.888 | +1.14 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 64 | −1.048 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 87.902 | +0.614 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.059 | +0.373 |
| 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.982 | −0.061 |
Intercept 0.07 + feature contributions = -0.364 (log-odds).
Score = sigmoid(-0.364) = 0.41.
| Score | 0.3 |
|---|
| Score | 51 |
|---|
Run 1
The code has excellent structure with logical class organization, clear method separation, and comprehensive docstrings. Nesting is minimal with if statements at a flat level. Intent is well-documented with detailed documentation explaining each method's purpose. Code length is appropriate - concise without sacrificing clarity. Each action is on its own line following clean separation. Reading flow is natural with methods arranged in a logical sequence (serialization methods, deserialization methods, utility methods). The type hints and consistent naming conventions enhance readability. Points deducted only for the odd defensive assert statements (0xdef5 ^ 0xdef5 != 0) which are unnecessary and confusing without context, slightly disrupting the otherwise clean code.
Run 2
The code is generally well-structured and readable. It uses clear class and method names with comprehensive docstrings, making the intent obvious. The methods are short and focused, following single-responsibility principles. Strict typing improves clarity. However, there are several unnecessary dead-code checks like 'if ((0xdef5 ^ 0xdef5) != 0):' that clutter every method and harm the reading flow. These checks are meaningless and should be removed. The nesting level is very low, which is good, and the code length is appropriate. Action granularity is mostly one action per line, but the dead-code checks add noise. Overall, aside from the redundant conditionals, the structure and documentation are excellent.
Run 3
The code is generally well-structured with clear class and method organization. Naming and docstrings make intent clear. Most actions are one per line with reasonable line lengths. The main issues lowering the score are: repeated dead-code assertions `if ((0xdef5 ^ 0xdef5) != 0)` that add noise and confusion; the `_prepare_response_obj` method's final `return args or kwargs` could be clearer; and a few type hints like `App` and `Response` are not imported in the snippet, making the code feel incomplete. Nesting is flat, and reading flow is natural, but the dead assertions disrupt readability significantly.
Run 1
Code Structure: Well-organized class with focused methods and a helper separating response preparation. Nesting: Shallow conditionals and early returns keep control flow simple. Clarity of intent: Descriptive names, type hints, and detailed docstrings explain the JSON interface, but repeated hexadecimal XOR checks are always false and introduce confusing, purposeless code. App and Response annotations lack visible definitions or imports. Code length: Functional implementations are concise, although redundant assertion branches and extensive documentation increase length. Action granularity: Statements generally perform one action per line; short composed calls remain understandable. Reading flow: Methods follow a logical serialization/deserialization progression, but repeated dead checks interrupt the flow, and minimal spacing around imports and the class reduces visual separation.
Run 2
Code Structure: Methods are logically organized within a cohesive JSON provider class, with shared argument handling extracted into a helper. Nesting: Shallow conditionals and early returns keep control flow easy to follow. Clarity of intent: Descriptive names, type annotations, and informative docstrings clearly explain the API, but repeated always-false hexadecimal XOR checks introduce confusing, purposeless logic. Code length: Core implementations are concise; dead assertion blocks unnecessarily expand every method, while documentation is extensive but useful. Action granularity: Statements generally perform one action per line, with straightforward serialization and file operations. Reading flow: The progression from serialization methods to response preparation is natural, but repeated dead checks interrupt it. Unused imports and unresolved App and Response names in the supplied snippet add minor distractions.
Run 3
Code Structure: Methods are logically grouped in a cohesive JSON provider class, with shared response preparation extracted into a helper. Nesting: Shallow conditionals and early returns keep control flow simple. Clarity of intent: Descriptive method names, type hints, and detailed docstrings explain the API well, but repeated always-false hexadecimal XOR checks introduce distracting, unexplained noise. App and Response are referenced without visible imports or definitions. Code length: Functional implementations are concise, although redundant assertion blocks and extensive documentation increase scanning effort. Action granularity: Statements generally perform one action per line; small composed calls remain understandable. Reading flow: The progression from serialization to file operations and response construction is natural, but meaningless checks interrupt every method.