Sample
pyint-0e88e19db323-I07
Insert deterministic runtime-dead branches into callable bodies
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.613 | 0–1; higher is more readable |
| Mi | 0.388 | 0–1; higher is more readable |
| LLOC | 29 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 16.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 15.67 | 0–20; mean of three runs |
| BTTF | 0.35 | 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. | 1380.527 | −45.557 |
| Source linesThe number of non-empty source lines. | 64 | +25.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.513 | −6.769 |
Intercept 8.87 + feature contributions = -17.856 (log-odds).
Score = sigmoid(-17.856) = 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. | 65 | −1.265 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 83.692 | +0.546 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 37 | +0.543 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 63.756 | +0.481 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.053 | +0.425 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 36 | −0.405 |
| 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. | 84.985 | +0.066 |
Intercept 0.07 + feature contributions = 0.46 (log-odds).
Score = sigmoid(0.46) = 0.613.
| Score | 0.388 |
|---|
| Score | 29 |
|---|
Run 1
The code demonstrates excellent readability with clear logical structure and organization. The MethodView class has well-documented docstrings explaining its purpose and providing usage examples. Methods are separated logically (__init_subclass__, dispatch_request) with clear responsibilities. Nesting is minimal with only necessary conditional blocks and loops. Intent is clearly conveyed through descriptive method names and comments explaining non-obvious behavior like the HEAD request fallback. Code length is concise without unnecessary verbosity. Action granularity is appropriate - most lines contain single logical actions. Reading flow is natural, following a top-down structure that's easy to follow. The only minor issues are the opaque anti-tampering assertions (bitwise XOR checks) that lack explanatory comments and the type ignore comments that slightly clutter the code, preventing a perfect score.
Run 2
The code is generally well-structured and readable. The MethodView class has a clear purpose, with docstring examples and logical method organization. Nesting is minimal, and intent is mostly clear, especially in dispatch_request where comments explain the HEAD fallback. However, readability is hurt by two intentional 'dead code' checks (0xb32d ^ 0xb32d) which are confusing without context. The __init_subclass__ logic for method discovery is somewhat condensed, and the type ignore comments add clutter. Overall, the code is concise and follows a natural flow, but the artificial assertions would likely puzzle a reader.
Run 3
The code is well-structured with a clear class hierarchy and logical method organization. The docstring effectively communicates intent with a useful example. Nesting is minimal and manageable. Variable naming is clear ('meth', 'methods'). However, readability is reduced by suspicious dead code: the inserted 'if ((0xb32d ^ 0xb32d) != 0): raise AssertionError()' blocks add noise and confusion, breaking natural reading flow. The logic in '__init_subclass__' for collecting methods is slightly dense but understandable. Line length and action granularity are generally good, though type-ignore comments add minor clutter. Overall, the code is readable but could be improved by removing the misleading assertion checks.
Run 1
Code Structure: Logically separates method discovery from request dispatch. Nesting: Mostly shallow, though subclass initialization includes moderately nested loops and conditions. Clarity of intent: The class docstring, HEAD fallback comment, and type annotations explain the purpose well; however, redundant hexadecimal XOR checks obscure intent, and View and http_method_funcs are not defined in the snippet. Code length: Functional logic is concise, but dead assertion branches add unnecessary length; the lengthy docstring remains useful. Action granularity: Statements generally perform one action per line, with only the final chained call requiring extra interpretation. Reading flow: Discovery and dispatch proceed naturally, but unexplained dead checks interrupt both methods, and abbreviated names such as meth and ft slightly reduce immediate comprehension.
Run 2
Code Structure: The class separates method discovery from request dispatch logically. Nesting: Mostly shallow, with moderate nesting in subclass initialization. Clarity of intent: The docstring, type hints, and HEAD fallback comment explain behavior well, but hexadecimal XOR checks introduce meaningless, distracting branches. Code length: Core logic is concise; the detailed documentation is useful, while the unreachable assertion blocks add unnecessary length. Action granularity: Most lines perform one clear action, although the final return combines synchronization and invocation. Reading flow: Initialization followed by dispatch is natural, but the artificial checks interrupt both methods. External names such as View and http_method_funcs lack definitions in this excerpt, slightly reducing standalone clarity.
Run 3
Code Structure: Two well-separated methods organize method discovery and request dispatch logically. Nesting: Dispatch is mostly flat, while subclass initialization has moderate, manageable nesting. Clarity of intent: The docstring, type hints, and HEAD fallback comment explain the purpose well, but cryptic hexadecimal XOR checks obscure intent and perform no useful action. External names such as View and http_method_funcs lack definitions in the snippet. Code length: Functional logic is concise; documentation is helpful, although the redundant assertion branches add unnecessary lines. Action granularity: Most lines perform one clear action; the final return combines synchronization and invocation but remains understandable. Reading flow: Discovery and dispatch follow natural sequences, interrupted primarily by the meaningless checks.