Sample

pyint-b28360e02eac-I10

Deterministically remove some optional blank lines and bracketed line breaks

Matched original source

Lines11

Scores

MethodScoreScale
Posnett0.0070–1; higher is more readable
Dorn0.4560–1; higher is more readable
Mi0.480–1; higher is more readable
LLOC6Logical lines; fewer is more readable
DeepSeek V4 Pro17.330–20; mean of three runs
GPT-6.1 Sol14.330–20; mean of three runs
BTTF0.6440–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 read(self, length: 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.862−7.292
Source linesThe number of non-empty source lines.11+4.4

Intercept 8.87 + feature contributions = -4.933 (log-odds).
Score = sigmoid(-4.933) = 0.007.

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.12+0.611
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.11−0.357
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.10.744−0.26
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.80.833+0.241
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.105−0.076

Intercept 0.07 + feature contributions = -0.176 (log-odds).
Score = sigmoid(-0.176) = 0.456.

Score0.48
Score6
Run 1

The code is highly readable with a clear, logical structure. It follows standard import conventions and uses explicit, well-organized typing imports. The Protocol class definition is concise and demonstrates clear intent: defining a read-supporting interface. Nesting is flat, and action granularity is appropriate—each line serves a single, clear purpose. The reading flow is natural, moving from import organization to the type definition. Minor deductions: the import block could be compacted slightly, and the `length` parameter's default (`...`) might confuse readers unfamiliar with the ellipsis convention for 'no default'. Overall, the code is clean, idiomatic, and easy to understand.

Run 2

The code is highly readable with clear structure and minimal nesting. It imports only necessary dependencies, grouped logically from standard library modules and typing utilities. The use of `Protocol` and `runtime_checkable` clearly communicates intent, making the purpose of `SupportsRead` immediately obvious. The type variables and `TypeAlias` imports suggest future extensibility. The code is concise—no unnecessary lines or redundant abstractions. Each action occupies a single logical line, maintaining good granularity. Reading flow is natural: imports first, then class definition, then method signature. Minor deductions: the multi-line import with unusual spacing around `TYPE_CHECKING` and the trailing ellipsis parameter might briefly interrupt flow, but overall this is exceptionally clean, idiomatic Python.

Run 3

The code is highly readable. It has a clear logical structure: future import first, then standard library imports grouped logically, followed by typing imports with a clean multiline layout. Nesting is minimal and appropriate. Intent is unambiguous—defining a runtime-checkable protocol for readable objects. The code is concise, with no unnecessary length. Action granularity is clear, with one logical action per line for imports and the protocol definition cleanly structured. Reading flow is natural, following Python conventions. Minor deduction for the `Any` import being unused and slight inconsistency in import spacing, but overall it is exceptionally clear and well-organized.

Run 1

Code Structure: Imports and the protocol declaration are logically organized, although several imports appear unused in this snippet. Nesting: Minimal, with only a method inside a class. Clarity of intent: SupportsRead and read clearly describe a reading interface, but _T_co is not defined in the shown code, making its generic return type less clear. Code length: Very concise, though the broad imports add clutter. Action granularity: Each declaration occupies its own line; the compact method signature is appropriate for a protocol stub. Reading flow: Generally natural, but inconsistent spacing in the typing imports interrupts scanning.

Run 2

Code Structure: Imports and the protocol declaration are logically organized, but unused imports add clutter and _T_co is not defined in the snippet. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: SupportsRead and its read method clearly describe a readable-object interface, though the undefined type variable and advanced typing syntax reduce immediate clarity. Code length: The implementation is concise, but the extensive imports are unnecessary for the shown functionality. Action granularity: Statements are separated cleanly; the inline method stub is compact and conventional for protocols. Reading flow: The progression from imports to interface is natural, but irregular spacing in the typing import and insufficient separation before the class disrupt the presentation.

Run 3

Code Structure: Imports and the protocol definition are logically separated, but the irregular typing import formatting reduces organization. Nesting: Minimal nesting makes the snippet easy to scan. Clarity of intent: SupportsRead and its read method clearly describe a readable-object interface, though _T_co is not defined in the snippet, leaving the generic type unclear. Code length: The definition is concise, but several imports are unused within the shown code. Action granularity: Statements are separate, although multiple imported names are awkwardly grouped on one line. Reading flow: The progression from imports to decorator to class is natural, but inconsistent spacing and limited separation before the class interrupt readability.