Sample
pyint-78333b872497-I04
Replace names with deterministic minifier-style shortest identifiers
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0.019 | 0–1; higher is more readable |
| Dorn | 0.484 | 0–1; higher is more readable |
| Mi | 0.471 | 0–1; higher is more readable |
| LLOC | 6 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 15 | 0–20; mean of three runs |
| GPT-6.1 Sol | 12 | 0–20; mean of three runs |
| BTTF | 0.773 | 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. | 336.045 | −11.089 |
| 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.884 | −7.326 |
| Source linesThe number of non-empty source lines. | 14 | +5.6 |
Intercept 8.87 + feature contributions = -3.946 (log-odds).
Score = sigmoid(-3.946) = 0.019.
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.78 | −0.217 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.096 | +0.004 |
Intercept 0.07 + feature contributions = -0.063 (log-odds).
Score = sigmoid(-0.063) = 0.484.
| Score | 0.471 |
|---|
| Score | 6 |
|---|
Run 1
The code is well-structured and highly readable. It uses modern Python typing features (Protocol, TypeAlias, TypeVar, runtime_checkable, __future__ annotations) in a logical order. The imports are cleanly grouped and formatted. The Protocol class `SupportsItems` is concise, with a single abstract method that clearly communicates intent. There is minimal nesting, no unnecessary length, and each line serves a distinct purpose. The only minor deduction is that the method name `a` is ambiguous compared to what the protocol implies (perhaps `items` would be clearer), which slightly impacts clarity of intent.
Run 2
The code is highly readable. It has a clear, logical structure: imports are grouped and ordered (future, abc, typing), and the protocol class is cleanly defined. Nesting is flat, with only a single decorator and method signature. Intent is explicit—the protocol abstracts item iteration over key-value pairs. Code length is minimal and appropriate for the task, with no redundancy. Each line conveys one action or purpose: separate import lines, separate method definition, distinct type parameters. The reading flow is natural: future import first, then standard library imports, then typing helpers, then the protocol definition. Type variables (_KT_co, _VT_co) are conventionally named and underscore-prefixed, indicating internal use. One minor deduction is the use of a single-letter method name 'a', which is slightly less descriptive than 'items' or 'iter_items', but given the context of a protocol named SupportsItems, the intent is still reasonably clear.
Run 3
The code is a short import block and a single Protocol definition. It is structurally flat and concise, but readability is limited by several factors: cryptic, single-letter method name `a` with no docstring or explanation; heavy use of advanced typing constructs (Protocol, TypeVars, runtime_checkable) without context; and a class name `SupportsItems` that suggests an `items()` method, making the mismatch confusing. The imports are organized but may include unused ones. Overall, the intent is ambiguous and the code lacks self-documenting clarity.
Run 1
Code Structure: Imports and the protocol declaration are logically organized, but several imports are unused and the referenced type variables are not defined in the snippet. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: SupportsItems suggests an items-like interface, but the method name 'a' is vague and inconsistent with that purpose. Code length: The snippet is concise, although unused imports add clutter. Action granularity: Each statement has a distinct role; the single-line protocol method is appropriate for a stub. Reading flow: The top-to-bottom flow is natural, but missing type-variable definitions and insufficient spacing before the class interrupt comprehension.
Run 2
Code Structure: Imports and the protocol declaration are logically organized, but the generic type variables are undefined and many imports are unused. Nesting: Minimal, with only a class and method. Clarity of intent: SupportsItems suggests an items-like interface, but the method name a does not communicate that purpose; undefined _KT_co and _VT_co also impede understanding. Code length: The implementation is concise, though the import list is unnecessarily broad for this snippet. Action granularity: Each statement serves a single purpose, and the inline ellipsis is conventional for protocol methods. Reading flow: The top-to-bottom flow is natural, but missing type-variable declarations and the ambiguous method name interrupt comprehension.
Run 3
Code Structure: Imports and the protocol declaration are logically organized, but the type variables referenced in the class are not defined in the snippet, and several imports are unused. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: SupportsItems suggests an items-like interface, but the method name a does not communicate that purpose. Code length: The implementation is concise, though unused imports add clutter. Action granularity: Each import or declaration is distinct; the one-line method stub is appropriate for a protocol. Reading flow: The progression from imports to class to method is natural, but undefined type variables and the mismatch between class and method names interrupt understanding.