Sample
pyint-c78b32659a04-I07
Insert deterministic runtime-dead branches into callable bodies
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.348 | 0–1; higher is more readable |
| Mi | 0.602 | 0–1; higher is more readable |
| LLOC | 61 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 11.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 14.67 | 0–20; mean of three runs |
| BTTF | 0.472 | 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. | 3124.72 | −103.116 |
| Source linesThe number of non-empty source lines. | 135 | +54 |
| 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.443 | −6.665 |
Intercept 8.87 + feature contributions = -46.911 (log-odds).
Score = sigmoid(-46.911) = 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. | 135 | −3.744 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 105 | +2.895 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 105 | −1.989 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 134.912 | +1.476 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 100.985 | +0.825 |
| 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. | 100.963 | −0.611 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.051 | +0.451 |
Intercept 0.07 + feature contributions = -0.627 (log-odds).
Score = sigmoid(-0.627) = 0.348.
| Score | 0.602 |
|---|
| Score | 61 |
|---|
Run 1
This code exhibits severe readability problems. The most glaring issue is the presence of dead code checks like `if ((0xf42e ^ 0xf42e) != 0): raise AssertionError()` which are nonsensical and clutter every method, disrupting reading flow and intent. The `__init__` method has multiple nested conditional branches assigning lambdas with cryptic underscores, making action granularity poor and clarity of intent ambiguous. While the structure has logical class organization and method length is moderate, the annoying assertions and complex conditional logic undermine understandability. The docstrings are helpful but cannot overcome the confusing implementation details.
Run 2
The code has clear structure with logical class organization, type hints, and docstrings. However, it is needlessly polluted with dead code (multiple `if ((0xf42e ^ 0xf42e) != 0): raise AssertionError()` blocks that never execute). These blocks disrupt reading flow and add visual noise. Nesting is mostly flat and the intent is generally clear, but the lambda assignments for `__call__` are somewhat cryptic and require effort to parse. The `_fmt_converter_call` method has long return lines that could be broken up. Action granularity is mostly good, with one operation per line in most places. The use of `__slots__`, static methods, and dunder methods is idiomatic but adds density. Overall the code is maintainable, but the dead code and some long lines reduce its readability score.
Run 3
The code is generally well-structured with clear class and method organization, and docstrings explain intent. However, there are several issues affecting readability: the use of dead code like `if ((0xf42e ^ 0xf42e) != 0): raise AssertionError()` in multiple places is confusing and detracts from clarity. The `Converter` class mixes several responsibilities (validation, callable assignment, formatting) without clear separation. The use of `lambda` functions assigned to `self.__call__` obscures the callable's behavior and makes the logic harder to follow. The `_fmt_converter_call` method contains long f-strings that reduce readability due to line length. The `__slots__` includes `__call__`, which is unconventional and may confuse readers. Overall, the code is functional but could be simplified by removing dead code, replacing lambdas with explicit methods, and breaking down the formatting logic for better clarity.
Run 1
1. Code Structure: A cohesive class with logically separated initialization, call formatting, and serialization methods, though numerous unrelated imports add clutter. 2. Nesting: Mostly shallow conditionals and early returns make control paths easy to follow. 3. Clarity of intent: Descriptive method names and detailed docstrings explain the converter behavior, but repeated always-false hexadecimal XOR checks obscure intent; abbreviated names and placeholder lambda parameters also require interpretation. 4. Code length: Core functionality is reasonably concise, but redundant assertion blocks and unused imports unnecessarily expand the snippet. 5. Action granularity: Statements generally perform one action per line; lambdas and formatted call strings remain manageable. 6. Reading flow: Methods follow a natural progression, but meaningless checks repeatedly interrupt reading, and some long string expressions reduce scanability. The serialization docstring also omits takes_field despite its inclusion in the returned state.
Run 2
Code Structure: Methods are logically separated into initialization, call formatting, and serialization, though numerous imports distract from the small class. Nesting: Branches are shallow, with early returns keeping formatting logic flat. Clarity of intent: Descriptive names and docstrings explain converter behavior, but repeated hexadecimal XOR checks are meaningless distractions, and the serialization docstring omits takes_field. Code length: Mostly concise, but redundant assertions, verbose documentation, and repeated condition checks add unnecessary bulk. Action granularity: Statements generally perform one action each; lambda wrappers remain simple despite combining callable adaptation and assignment. Reading flow: Method order is natural and consistent, but dead checks interrupt every method, while dynamic __call__ assignment and annotation mutation require extra attention.
Run 3
Code Structure: Methods are logically separated by initialization, call formatting, and serialization, although numerous unused imports distract from the class. Nesting: Mostly flat, with straightforward conditional branches and early returns. Clarity of intent: Descriptive names and docstrings explain converter behavior, but repeated always-false hexadecimal XOR checks introduce confusing, purposeless noise. The __getstate__ docstring also omits takes_field despite its inclusion in the returned dictionary. Code length: Reasonably concise overall, but redundant assertions, imports, and repeated argument-condition logic add unnecessary length. Action granularity: Statements generally perform one action per line; multiline lambdas remain understandable. Reading flow: Method ordering is natural, but dummy checks repeatedly interrupt the flow, and dynamically assigning __call__ and modifying its annotations require extra attention.