Sample

pyint-a2e58266742c-I04

Replace names with deterministic minifier-style shortest identifiers

Matched original source

Lines14

Scores

MethodScoreScale
Posnett0.0230–1; higher is more readable
Dorn0.4560–1; higher is more readable
Mi0.5150–1; higher is more readable
LLOC6Logical lines; fewer is more readable
DeepSeek V4 Pro15.330–20; mean of three runs
GPT-6.1 Sol11.330–20; mean of three runs
BTTF0.6710–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 a(self, b: 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.873−7.309
Source linesThe number of non-empty source lines.14+5.6

Intercept 8.87 + feature contributions = -3.749 (log-odds).
Score = sigmoid(-3.749) = 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.756−0.218
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.108−0.111

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

Score0.515
Score6
Run 1

This code is highly readable due to its clean structure, logical import grouping, and clear intent. It defines a single runtime-checkable protocol with minimal nesting and one action per line. The use of type hints and explicit imports demonstrates clarity and modern Python conventions, making the code concise and unambiguous. Minor deductions for the abbreviated method name 'a' and parameter 'b', which slightly obscure intent, and the missing docstring.

Run 2

The code is structured cleanly: imports are grouped logically (future, abc, typing), aliases like TypeAlias and Protocol are imported for clarity, and the runtime_checkable decorator makes intent explicit. The protocol class is short, flat, and has a single clearly named method. Action granularity and reading flow are good. However, the method name 'a' and parameter names 'b' and `_T_co` are ambiguous, which reduces clarity of intent; more descriptive names would improve readability. Slight verbosity in imports (e.g., `Any`, `Iterable`, `Mapping`, `MutableMapping`, `Sequence` unused here) slightly lengthens the code without adding value in this snippet. Overall, the structure is professional but naming choices and unused imports prevent a higher score.

Run 3

The code is structurally organized with clear import grouping and type-checking separation, but its intent is ambiguous. The Protocol class named 'SupportsRead' defines an undocumented method 'a', which is unclear and likely intentionally obfuscated for an example. Nesting is flat, and code length is concise, but action granularity is trivial. Reading flow is interrupted by the disconnect between the class name and its contents, making it hard to understand the intended purpose.

Run 1

Code Structure: Imports and the protocol are logically organized, but _T_co is not defined in the snippet, leaving the structure incomplete. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: SupportsRead suggests a reading interface, but method a and parameter b obscure its behavior; the undeclared type variable adds confusion. Code length: The implementation is concise, although many imports are unused in the shown code. Action granularity: Statements are generally separated clearly; the one-line method declaration is reasonable for a protocol stub. Reading flow: The progression from imports to decorator to class is natural, but unexplained generic typing and vague names interrupt understanding.

Run 2

Code Structure: Imports and the protocol declaration are logically organized, but numerous 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 suggests a readable interface, but method a and parameter b obscure its actual contract. Code length: The snippet is short, although the import list is unnecessarily extensive for the shown functionality. Action granularity: Statements are generally separated clearly; the one-line abstract method is conventional for a protocol. Reading flow: The progression from imports to decorator to class is natural, but the undefined type variable and cryptic identifiers interrupt comprehension.

Run 3

Code Structure: Imports and the protocol declaration are logically organized, but _T_co is not defined in the snippet and most imports are unused. Nesting: Very shallow, making the code easy to scan. Clarity of intent: SupportsRead and the typing constructs suggest a read-capability interface, but method name a and parameter b obscure its behavior. Code length: The declaration is concise, although unused imports add clutter. Action granularity: Each line generally has one purpose; the inline ellipsis body is conventional for a protocol method. Reading flow: Imports lead naturally into the class, but the missing type-variable definition and cryptic names interrupt understanding.