Sample

pyint-cb9d100fca44-I03

Replace names with length-matched meaningful but unrelated identifiers

Matched original source

Lines14

Scores

MethodScoreScale
Posnett0.0230–1; higher is more readable
Dorn0.4620–1; higher is more readable
Mi0.5120–1; higher is more readable
LLOC6Logical lines; fewer is more readable
DeepSeek V4 Pro16.670–20; mean of three runs
GPT-6.1 Sol150–20; mean of three runs
BTTF0.6330–1; higher is more readable

Views

Source code

from __future__ import annotations from collections.abc import Callable, Iterable, Mapping, MutableMapping, Sequence from typing import ( TYPE_CHECKING, Any, Protocol, TypeAlias, TypeVar, runtime_checkable, ) @runtime_checkable class SupportsRead(Protocol[_T_co]): def join(self, option: int = ..., /) -> _T_co: ...

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(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.875−7.313
Source linesThe number of non-empty source lines.14+5.6

Intercept 8.87 + feature contributions = -3.753 (log-odds).
Score = sigmoid(-3.753) = 0.023.

Feature contributions

FeatureValueContribution
(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.

Score0.512
Score6
Run 1

The code is clear and logically organized. It uses modern Python features (future annotations, typing) effectively, making intent clear: defining a runtime-checkable protocol for objects that support a 'join' method. Structure is flat, with a single class definition containing a single method. Minor verbosity comes from the lengthy imports, which, while justified for type hinting, add lines. The method signature is concise, though the ellipsis default is slightly unusual and could require extra thought. Overall, readability is high due to explicit typing, minimal nesting, and clear nomenclature.

Run 2

The code is well-structured and highly readable. It uses clear, modern Python typing features (Protocol, TypeVar, TypeAlias) with explicit imports, showing intent. The Protocol definition is concise with a single method and minimal nesting. Naming is clear (SupportsRead, join). One action per line is respected, and the flow from imports to class definition is natural. The only minor deduction is slight verbosity in the typing imports, but this is typical for robust type-checking code.

Run 3

The code is highly readable due to its logical structure and clear intent. It begins with a future import, follows with organized imports from collections.abc and typing, and then defines a single runtime-checkable protocol. The nesting is flat, and the protocol method `join` has a clear signature with an optional integer parameter and a type variable return. The use of `_T_co` and `TypeVar` correctly indicates covariance. The code is concise, with each import and definition on separate lines, contributing to a natural reading flow. Minor deductions are for the slight ambiguity of the `join` method's purpose within the `SupportsRead` protocol, which isn't explicitly documented, and the possible redundancy of importing several unused typing names (e.g., `Callable`, `Iterable`, `Mapping`, `MutableMapping`, `Sequence`, `TYPE_CHECKING`, `Any`, `TypeAlias`). Overall, it's well-structured, clear, and maintainable.

Run 1

Code Structure: Imports and the protocol declaration are logically organized, but several imports are unused and _T_co is not defined in the snippet. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: Protocol typing communicates an interface, but SupportsRead conflicts with the method name join, and option is vague. Code length: The declaration is concise, though unused imports add clutter. Action granularity: Each statement has a distinct purpose; the inline ellipsis is conventional for protocol methods. Reading flow: The progression from imports to decorator to class is natural, but the naming mismatch and missing type-variable definition interrupt understanding.

Run 2

Code Structure: Imports and the protocol declaration are logically organized, although many imports are unused. Nesting: Minimal nesting makes the snippet easy to scan. Clarity of intent: Protocol typing communicates an interface, but SupportsRead declaring join is confusing, and _T_co is not defined in the provided code. Code length: The implementation is concise, though the import list adds unnecessary bulk. Action granularity: Each statement has a distinct purpose; the inline method stub is compact and conventional for a protocol. Reading flow: The top-to-bottom flow is natural, but the undefined type variable and naming mismatch interrupt understanding.

Run 3

Code Structure: Imports and the protocol declaration are logically organized, although several imports are unused and _T_co is not defined in the snippet. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: Protocol and typing annotations communicate an interface, but SupportsRead conflicts with the method name join, and option is vague. Code length: The implementation is concise, though the imports are disproportionately extensive. Action granularity: Each import or declaration is distinct; the one-line method stub is conventional for protocols. Reading flow: The top-to-bottom flow is natural, but the unexplained type variable and naming mismatch interrupt understanding.