Sample

pyint-286ac8ac564a-I04

Replace names with deterministic minifier-style shortest identifiers

Matched original source

Lines40

Scores

MethodScoreScale
Posnett0.0010–1; higher is more readable
Dorn0.8540–1; higher is more readable
Mi0.7490–1; higher is more readable
LLOC22Logical lines; fewer is more readable
DeepSeek V4 Pro140–20; mean of three runs
GPT-6.1 Sol14.330–20; mean of three runs
BTTF0.7010–1; higher is more readable

Views

Source code

from __future__ import annotations import abc import contextlib import enum import itertools import linecache import sys import types import unicodedata import weakref from collections.abc import Callable, Mapping from functools import cached_property from typing import Any, NamedTuple, TypeVar from . import _compat, _config, setters from ._compat import ( PY_3_11_PLUS, PY_3_13_PLUS, _AnnotationExtractor, _get_annotations, _lazy_is_generator, get_generic_base, ) from .exceptions import ( DefaultAlreadySetError, FrozenInstanceError, NotAnAttrsClassError, UnannotatedAttributeError, ) @attrs(slots=True, unsafe_hash=True) class _AndValidator: """ Compose many validators to a single one. """ _validators = attrib() def __call__(self, a, b, c): for d in self._validators: d(a, b, c)

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.765.065−25.247
Source linesThe number of non-empty source lines.40+16
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.66−6.99

Intercept 8.87 + feature contributions = -7.367 (log-odds).
Score = sigmoid(-7.367) = 0.001.

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.44.927+1.762
Indentation frequencyHow rapidly indentation changes from line to line.38+0.577
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.38−0.451
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.054+0.416
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.41−0.415
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.28.976−0.337
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.39.848+0.147

Intercept 0.07 + feature contributions = 1.769 (log-odds).
Score = sigmoid(1.769) = 0.854.

Score0.749
Score22
Run 1

The code structure is clean with a clear separation of imports and class definition, and the import grouping is logical. Nesting is minimal—the only indentation is a simple for-loop within the `__call__` method. The class purpose is documented with a concise docstring, making intent clear. The code is concise overall, though `__call__` uses non-descriptive names (`a`, `b`, `c`, `d`) that slightly reduce clarity. Action granularity is good—one logical operation per line. Reading flow is mostly natural, but the use of short variable names in the validator method and the lack of type hints on `a`, `b`, `c` interrupt comprehension. The import of many typing and compatibility symbols may exceed the needs of this snippet but does not affect readability significantly.

Run 2

The code demonstrates organized imports and a simple validator class, but suffers from poor naming and unclear intent. The loop variable names 'a', 'b', 'c', and 'd' are meaningless, obscuring the validator's purpose. The class structure is flat and concise, but the methods lack docstrings explaining the call signature. While the code avoids deep nesting, the action granularity is mixed—'__call__' compresses iteration into a loop without clarifying error propagation. The reading flow follows a logical top-down order, yet the abstract nature and non-descriptive arguments reduce clarity. Overall, the structure is clean but the clarity of intent and naming significantly hinder readability.

Run 3

The code imports are organized and the use of `__future__` annotations shows modern Python practices. The decorator and class structure are logically arranged with minimal nesting and single-purpose actions. The class `_AndValidator` is concise, with a clear `__call__` method that delegates to each validator. However, parameter names `a`, `b`, `c`, and loop variable `d` are ambiguous, reducing clarity of intent. The `@attrs(...)` decorator and `attrib()` usage rely on external library knowledge, which may confuse readers unfamiliar with attrs. While the code is short and flat, the lack of descriptive naming and internal documentation hinders readability. A minor improvement would be to rename parameters and loop variable to reflect their roles (e.g., `instance`, `attribute`, `value`, `validator`).

Run 1

Code Structure: Imports are grouped sensibly, and the validator class is logically organized, though most imports are unused in this snippet and attrs/attrib are not visibly defined or imported. Nesting: Very shallow, with only a loop inside a method. Clarity of intent: The class name, docstring, and _validators field clearly indicate validator composition, but parameter names a, b, c and loop variable d obscure their roles. Code length: The implementation is concise, although the extensive import section overwhelms the small class. Action granularity: Each statement performs one clear action. Reading flow: The class reads naturally from declaration to stored validators to invocation, but the disproportionate imports and unexplained decorator dependencies interrupt understanding.

Run 2

Code Structure: The validator class is logically organized, but the large import block is mostly unrelated to the shown implementation. Nesting: A single loop inside a method keeps nesting shallow. Clarity of intent: The class name, docstring, and _validators attribute clearly indicate validator composition, but a, b, c, and d obscure argument and validator roles. The origins of attrs and attrib are not shown, reducing self-contained clarity. Code length: The implementation is concise, although imports dominate this short snippet. Action granularity: Each statement performs one action, with no compressed multi-operation lines. Reading flow: The class reads naturally from description to stored validators to invocation, but excessive imports and vague parameter names interrupt comprehension.

Run 3

Code Structure: Imports are grouped before a small, logically organized validator class, though many imports appear unrelated to this excerpt and attrs/attrib are not defined here. Nesting: Minimal nesting makes the loop easy to follow. Clarity of intent: The class name, docstring, and _validators field communicate validator composition, but parameter names a, b, c and loop variable d obscure their roles. Code length: The implementation is concise, while the extensive import block adds distraction relative to the shown functionality. Action granularity: Each line performs a single clear action. Reading flow: The class reads naturally from documentation to state to behavior, but import clutter and unexplained decorator dependencies interrupt comprehension.