Sample

pyint-af7e2b1da101-I04

Replace names with deterministic minifier-style shortest identifiers

Matched original source

Lines13

Scores

MethodScoreScale
Posnett0.5530–1; higher is more readable
Dorn0.9010–1; higher is more readable
Mi0.6990–1; higher is more readable
LLOC10Logical lines; fewer is more readable
DeepSeek V4 Pro110–20; mean of three runs
GPT-6.1 Sol17.670–20; mean of three runs
BTTF0.8090–1; higher is more readable

Views

Source code

from __future__ import annotations import copy import re import sys from typing import Any import attrs @attrs.define(auto_detect=True) class AutoDetect: x: int def __init__(self, a: int): self.x = a

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.221.138−7.298
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.372−6.558
Source linesThe number of non-empty source lines.13+5.2

Intercept 8.87 + feature contributions = 0.214 (log-odds).
Score = sigmoid(0.214) = 0.553.

Feature contributions

FeatureValueContribution
(log-odds)
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.33.429+2.249
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.14+0.541
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.13−0.287
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.068+0.278
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.12.686−0.233

Intercept 0.07 + feature contributions = 2.212 (log-odds).
Score = sigmoid(2.212) = 0.901.

Score0.699
Score10
Run 1

The code is very short and superficially clean, but its intent is deeply ambiguous. The class name 'AutoDetect' is vague, and the combination of attrs' auto_detect, a custom __init__, and the x attribute is highly confusing. The custom __init__ overrides attrs-generated behavior, making the auto_detect usage pointless. The code structure is minimal but not transparent; it raises more questions than it answers. Action granularity and reading flow are fine due to the small size, but clarity of intent is severely lacking. Overall, it reads like an incomplete or mistaken snippet rather than a coherent, maintainable piece of code.

Run 2

The code is highly readable. It has a clear, logical structure with all imports grouped at the top and a single, well-defined class. Nesting is minimal — there are no nested blocks beyond the class and its method. The intent is clear: define an attrs-based class with auto-detection and a custom constructor. Code length is concise; there is no unnecessary code. Action granularity is appropriate, with one action per line where applicable. Reading flow is natural, progressing from imports to class definition to constructor. The only minor point is that the constructor override slightly complicates the attrs pattern, but it remains clean and understandable.

Run 3

The code is short and syntactically clear, but it suffers from several readability issues. The class name 'AutoDetect' is misleading because it does not reflect the class's actual behavior; it simply stores an integer. The `auto_detect=True` parameter in the attrs decorator is ambiguous without context and creates confusion when combined with a manually defined __init__ method. This redundancy undermines clarity of intent, as the class appears to rely on attrs while simultaneously overriding its initialization. Imports such as `re`, `sys`, and `copy` are unused, adding unnecessary noise. The code is flat and concise, with one action per line, which aids readability, but the overall structure feels disjointed due to the mismatch between decorator usage and manual method definition. Naming and unused imports are the primary detractors, making the code harder to understand at a glance despite its brevity.

Run 1

Code Structure: Imports and the class are logically organized, though several imports are unused and spacing between top-level elements could improve. Nesting: Minimal, with only a class and its constructor. Clarity of intent: The constructor clearly assigns its argument to an integer attribute, but generic names such as AutoDetect, x, and a provide little domain context; the decorator's auto-detection behavior requires familiarity with attrs. Code length: Short and focused, aside from unnecessary imports. Action granularity: Each statement performs a single action. Reading flow: Straightforward from imports to class declaration to initialization, with no tangled control flow.

Run 2

Code Structure: Imports, decorator, class, and constructor are logically organized, though several imports are unused. Nesting: Minimal, with only standard class and method indentation. Clarity of intent: The constructor clearly assigns an integer to x, but generic names and the interaction between attrs auto-detection and the custom constructor could benefit from context. Code length: Very concise, although unused imports add clutter. Action granularity: Each statement performs one action. Reading flow: Natural top-to-bottom flow; an additional blank line before the decorated class would improve conventional formatting.

Run 3

Code Structure: Imports and the class are logically organized, though several imports are unused and spacing between top-level elements could improve. Nesting: Minimal nesting makes the code easy to follow. Clarity of intent: The typed field and constructor clearly show initialization, but generic names such as AutoDetect, x, and a provide little context; the purpose of auto_detect=True requires familiarity with attrs. Code length: The implementation is concise, although unused imports add clutter. Action granularity: Each statement performs a single action. Reading flow: The progression from imports to class declaration to initialization is natural and straightforward.