Sample
pyint-ca85fb6f7b93-I07
Insert deterministic runtime-dead branches into callable bodies
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0.023 | 0–1; higher is more readable |
| Dorn | 0.462 | 0–1; higher is more readable |
| Mi | 0.512 | 0–1; higher is more readable |
| LLOC | 6 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 18 | 0–20; mean of three runs |
| GPT-6.1 Sol | 16.33 | 0–20; mean of three runs |
| BTTF | 0.678 | 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. | 330.619 | −10.91 |
| 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.88 | −7.319 |
| Source linesThe number of non-empty source lines. | 14 | +5.6 |
Intercept 8.87 + feature contributions = -3.76 (log-odds).
Score = sigmoid(-3.76) = 0.023.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 15 | +0.505 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 14 | −0.253 |
| 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. | 81 | +0.234 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 13.805 | −0.217 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.106 | −0.086 |
Intercept 0.07 + feature contributions = -0.152 (log-odds).
Score = sigmoid(-0.152) = 0.462.
| Score | 0.512 |
|---|
| Score | 6 |
|---|
Run 1
The code is highly readable. It has a clear, logical structure with imports organized by standard library modules and typing utilities. Nesting is essentially flat — the only indented block is a minimal Protocol method definition. Intent is explicit: it defines a runtime-checkable structural protocol for objects with a `read` method. The code is concise, avoiding any unnecessary verbosity. Action granularity is appropriate, with each import grouping and the Protocol definition on separate logical lines. Reading flow is natural, from future imports down to the protocol definition. The only minor deduction is that the lengthy import block could be slightly streamlined, but it is well-organized and conventional.
Run 2
The code demonstrates excellent readability. Structure is logical, with clear import grouping from the standard library and typing modules. Nesting is minimal — there is only one level within the class method definition, which is unavoidable and the method is short. Intent is explicit: the Protocol declares a `SupportsRead` interface with a `read` method. Naming is self-documenting, and the `runtime_checkable` decorator is applied clearly. Code length is concise for a Protocol definition. Action granularity is one concept per line, aided by the multi-line import block. Reading flow is natural, from future import to standard imports, then typing imports, then the Protocol definition. Minor points: `TypeAlias` and `TypeVar` imports are unused here, which slightly reduces clarity, and the ellipsis default for `length` is idiomatic but requires familiarity with typing overloads. Overall, a clean, readable snippet.
Run 3
The code is highly readable. It has clear structure with organized imports and a well-defined protocol. Nesting is minimal, intent is explicit through the runtime_checkable decorator and SupportsRead protocol, and the length is concise. Each action is on its own line, and the reading flow is natural. Minor deductions because the ellipsis default and forward reference might be slightly unclear to beginners, but overall it is very clean.
Run 1
Code Structure: Imports and the protocol definition are logically organized. Nesting: Minimal nesting makes the snippet easy to scan. Clarity of intent: SupportsRead and read clearly communicate a readable-object interface, though the undefined _T_co obscures the return type, and protocol-specific syntax requires familiarity. Code length: The implementation is concise, but many imports are unused in the shown snippet. Action granularity: Each declaration occupies its own logical line; the one-line method stub is appropriate here. Reading flow: The progression from imports to decorator, class, and method is natural, although an additional blank line before the top-level class would improve separation.
Run 2
Code Structure: Imports precede a focused protocol definition, providing a logical organization, though several imports appear unused. Nesting: Minimal nesting makes the snippet easy to scan. Clarity of intent: SupportsRead and its read method clearly describe a readable-object interface, but _T_co is not defined in the provided code, obscuring the generic type contract. Code length: The implementation is concise, although the import list is excessive for this snippet. Action granularity: Each line serves a single clear purpose; the one-line method stub is conventional for protocols. Reading flow: The progression from imports to decorator, class, and method is natural. Missing conventional spacing before the class and advanced typing syntax slightly reduce accessibility.
Run 3
Code Structure: Imports and the protocol declaration are logically organized, although several imports are unused in this snippet. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: SupportsRead and read clearly describe a readable-object interface, but the undeclared _T_co obscures its generic return type. Code length: The declaration is concise, though the unused imports add clutter. Action granularity: Each line has a distinct purpose; the inline method stub is compact and idiomatic for a protocol. Reading flow: The progression from imports to decorator to interface is natural, but an additional blank line before the top-level class and a visible type-variable definition would improve readability.