Sample
pyint-e91eae0c00e7-I07
Insert deterministic runtime-dead branches into callable bodies
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.166 | 0–1; higher is more readable |
| Mi | 0.427 | 0–1; higher is more readable |
| LLOC | 92 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 10 | 0–20; mean of three runs |
| GPT-6.1 Sol | 15 | 0–20; mean of three runs |
| BTTF | 0.284 | 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. | 6275.992 | −207.108 |
| Source linesThe number of non-empty source lines. | 184 | +73.6 |
| 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.543 | −6.815 |
Intercept 8.87 + feature contributions = -131.453 (log-odds).
Score = sigmoid(-131.453) = 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. | 185 | −5.514 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 150 | +4.451 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 149 | −2.998 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 183.75 | +2.159 |
| 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. | 110.984 | −1.036 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 110.989 | +0.986 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.069 | +0.268 |
Intercept 0.07 + feature contributions = -1.614 (log-odds).
Score = sigmoid(-1.614) = 0.166.
| Score | 0.427 |
|---|
| Score | 92 |
|---|
Run 1
The code suffers from poor readability primarily due to the inclusion of numerous meaningless dead-code assertions like `if ((0x73c3 ^ 0x73c3) != 0): raise AssertionError()`. These add noise to every method, obscuring the actual logic and breaking the natural reading flow. While the class structure and use of context managers (`ExitStack`) are good practices, the clustering of low-level request building logic (handling builders, dicts, and BaseRequest) creates long, deeply nested conditional blocks that are hard to follow. The intent of the `open` method is muddied by the need to copy and inspect various request types. The code is not excessively long, but the granularity is broken by combining multiple actions and type checks per line. Overall, the core Flask logic is sound, but the injected noise and complex branching significantly hurt clarity.
Run 2
The code suffers from severe readability issues. The most glaring problem is the pervasive presence of meaningless anti-debugging statements like 'if ((0x73c3 ^ 0x73c3) != 0): raise AssertionError()' at the start of nearly every method; these add pure noise and obscure intent. The code structure is logically organized (clear class and method separation), and nesting is generally moderate, but clarity of intent is heavily damaged by these artifacts and by the long, branching logic in methods like 'open' and 'session_transaction'. Code length is inflated unnecessarily due to the repeated noise lines and multiline conditionals, reducing conciseness. Action granularity is inconsistent: some methods use one action per line, while others cram multiple conditions and assignments into a single line. The reading flow is disrupted by the need to mentally filter out the assertion blocks before parsing actual behavior. Removing the noise lines would improve readability significantly, but as written the code is difficult to scan and understand.
Run 3
The code is generally structured well with appropriate use of classes, context managers, and type hints, which aids clarity. However, there are several readability issues. The repeated `if ((0x... ^ 0x...) != 0): raise AssertionError()` blocks are confusing, add no functional value, and interrupt the reading flow. Nesting is moderate, not deeply tangled, but the `open` method has a multi-branch conditional (args, dict, EnvironBuilder, BaseRequest) that could be simplified or extracted for clarity. Action granularity is mostly one action per line, but some lines are dense with logic. The docstrings are helpful, but the `session_transaction` method is complex and could be broken into smaller helpers. Overall, the code is understandable to someone familiar with Flask and Werkzeug, but the extraneous assertions and long methods reduce readability.
Run 1
Code Structure: Methods separate session handling, environment preparation, request construction, and context management logically. Nesting: Mostly shallow, with moderate branching in open(). Clarity of intent: Descriptive names, type hints, docstrings, and lifecycle comments explain the core behavior well, but repeated always-false hexadecimal XOR checks introduce distracting, unexplained noise. Some referenced types and helpers are not defined in the snippet, and the 'request is None' comment is misleading. Code length: Generally appropriate for the functionality, although dead checks and unused imports add unnecessary bulk. Action granularity: Most lines perform one clear operation; a few chained calls and long assignments require extra attention. Reading flow: Methods follow coherent sequences, especially session and context cleanup, but boilerplate assertions interrupt that flow throughout.
Run 2
Code Structure: Well-organized class with focused methods separating session handling, request construction, and context management. Nesting: Mostly shallow, although open() contains a moderately nested type-dispatch branch. Clarity of intent: Descriptive names, type annotations, docstrings, and context-management comments explain the main behavior. However, repeated always-false hexadecimal XOR checks introduce confusing, purposeless noise; several referenced types are not defined in the excerpt. Code length: Core logic is reasonably concise, but redundant assertion blocks unnecessarily lengthen every method. Action granularity: Generally one operation per line, with a few chained calls and long expressions requiring extra attention. Reading flow: Methods follow coherent sequences, but the artificial checks repeatedly interrupt the flow, and the stale 'request is None' comment is misleading.
Run 3
Code Structure: Methods logically separate initialization, session handling, request construction, and context management. Nesting: Mostly shallow, with manageable branching in open(). Clarity of intent: Descriptive names, type annotations, docstrings, and lifecycle comments explain the core behavior well; repeated hexadecimal XOR checks are always false and introduce distracting, unexplained noise. Code length: Generally appropriate for the functionality, but dead assertion branches add unnecessary lines. Action granularity: Most lines perform one clear action; a chained builder expression and a long assignment slightly increase reading effort. Reading flow: Method order and sequential context handling are natural, although redundant checks repeatedly interrupt the flow. Several referenced types and helpers are not defined or imported in the excerpt, reducing standalone readability.