Sample

pyint-bb5e84bbf563-I04

Replace names with deterministic minifier-style shortest identifiers

Matched original source

Lines195

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.3380–1; higher is more readable
Mi0.7380–1; higher is more readable
LLOC58Logical lines; fewer is more readable
DeepSeek V4 Pro40–20; mean of three runs
GPT-6.1 Sol120–20; mean of three runs
BTTF0.3790–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, ) class _CountingAttr: """ Intermediate representation of attributes that uses a counter to preserve the order in which the attributes have been defined. *Internal* data structure of the attrs library. Running into is most likely the result of a bug like a forgotten `@attr.s` decorator. """ __slots__ = ( "_converter", "_default", "_validator", "alias", "counter", "eq", "eq_key", "hash", "init", "kw_only", "metadata", "on_setattr", "order", "order_key", "repr", "type", ) __attrs_attrs__ = ( *tuple( Attribute( name=name, alias=_default_init_alias_for(name), default=NOTHING, validator=None, repr=True, cmp=None, hash=True, init=True, kw_only=False, eq=True, eq_key=None, order=False, order_key=None, inherited=False, on_setattr=None, ) for name in ( "counter", "_default", "repr", "eq", "order", "hash", "init", "on_setattr", "alias", ) ), Attribute( name="metadata", alias="metadata", default=None, validator=None, repr=True, cmp=None, hash=False, init=True, kw_only=False, eq=True, eq_key=None, order=False, order_key=None, inherited=False, on_setattr=None, ), ) cls_counter = 0 def __init__( self, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, ): _CountingAttr.cls_counter += 1 self.counter = _CountingAttr.cls_counter self._default = d self._validator = e self._converter = j self.repr = f self.eq = n self.eq_key = o self.order = p self.order_key = q self.hash = h self.init = i self.metadata = k self.type = l self.kw_only = m self.on_setattr = r self.alias = s def a(self, t): """ Decorator that adds *meth* to the list of validators. Returns *meth* unchanged. .. versionadded:: 17.1.0 """ if self._validator is None: self._validator = t else: self._validator = and_(self._validator, t) return t def b(self, u): """ Decorator that allows to set the default for an attribute. Returns *meth* unchanged. Raises: DefaultAlreadySetError: If default has been set before. .. versionadded:: 17.1.0 """ if self._default is not NOTHING: raise DefaultAlreadySetError self._default = Factory(u, takes_self=True) return u def c(self, v): """ Decorator that appends *meth* to the list of converters. Returns *meth* unchanged. .. versionadded:: 26.2.0 """ w = Converter( lambda value, _self, field: v(_self, field, value), takes_self=True, takes_field=True, ) if self._converter is None: self._converter = w else: self._converter = pipe(self._converter, w) return v

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.3930.769−129.715
Source linesThe number of non-empty source lines.195+78
Byte entropyHow varied the bytes in the source text are. Repeated bytes give a lower value; a more even mixture gives a higher value.3.979−5.969

Intercept 8.87 + feature contributions = -48.814 (log-odds).
Score = sigmoid(-48.814) = 0.

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.196−5.903
Indentation frequencyHow rapidly indentation changes from line to line.168+5.074
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.168−3.434
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.194.936+2.315
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.75.342+0.411
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.76.98+0.405
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.057+0.392

Intercept 0.07 + feature contributions = -0.671 (log-odds).
Score = sigmoid(-0.671) = 0.338.

Score0.738
Score58
Run 1

The code is extremely difficult to read due to obfuscated naming and poor structure. Function parameters like 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's' convey no meaning, making the __init__ method incomprehensible. Method names 'a', 'b', 'c' are equally cryptic. The docstrings describe intentions clearly, but the actual code fails to communicate those intentions. The module-level imports appear organized, but the class body breaks down immediately. Nesting is moderate but irrelevant because naming destroys clarity. Code length is unnecessarily verbose in some areas (the massive __attrs_attrs__ tuple) while abbreviating critical identifiers. Action granularity suffers as multiple assignments are packed tightly. Reading flow is nonexistent; readers cannot follow the logic without external documentation. Overall, this fails nearly all readability criteria.

Run 2

This code is severely unreadable due to multiple factors. The constructor uses meaningless single-letter parameter names (d through s) that are then assigned to meaningful attributes, making the code extremely difficult to follow. Method names are cryptic single letters (a, b, c) with no connection to their functionality. The __attrs_attrs__ structure contains deeply nested tuple comprehensions and long Attribute constructors that obscure the intent. The code violates the single responsibility principle by mixing concerns and the action granularity is inconsistent - some lines contain multiple logical operations while others are unnecessarily verbose. Parameter signatures have 17 positional arguments with no type hints, making it impossible to understand what data is expected. The reading flow is completely broken by the disconnect between parameter names and their eventual assignment to meaningful attribute names. While the docstrings provide some context, the implementation details are so obfuscated that even the documentation cannot compensate for the poor naming and structure.

Run 3

The code suffers from severe readability issues. Function/variable names like d, e, f, g, h, i, j, a, b, c, t, u, v, w are meaningless and make intent completely unclear. The class __init__ has 18 positional parameters, requiring readers to decode their order with no semantic hints. __attrs_attrs__ is a long, repetitive tuple comprehension with nearly identical Attribute(...) calls, creating dense, difficult-to-scan structure. While the module imports and class-level organization are somewhat standard, the core logic is convoluted. Action granularity is largely one-per-line, but reading flow is broken by opaque naming. Nesting is moderate, but code length and verbosity in the attribute definitions are unnecessarily high. The docstrings exist but describe behavior, not the cryptic parameter bindings, so they do little to rescue clarity. Overall, this reads like obfuscated or auto-generated code rather than maintainable source.

Run 1

Code Structure: The class is logically organized into metadata, initialization, and decorator helpers, although the large metadata declaration dominates. Nesting: Control flow is shallow, with simple conditionals and a moderately nested comprehension. Clarity of intent: Descriptive attribute names and docstrings help, but single-letter methods, parameters, and local variables severely obscure meaning; docstrings reference 'meth' rather than actual parameter names. Code length: Repeated Attribute configuration and the lengthy constructor make the code verbose, though much is declarative. Action granularity: Statements generally perform one action per line, making individual operations easy to follow. Reading flow: Layout is consistent, but mapping opaque constructor parameters to attributes requires frequent backtracking, and numerous imports and externally defined symbols distract from the class's purpose.

Run 2

Code Structure: Logically organized into a class, attribute declarations, initialization, and decorator helpers, though the large import block adds clutter. Nesting: Mostly flat, with only simple conditionals and one comprehension. Clarity of intent: The class docstring and descriptive field names help, but single-letter methods, parameters, and temporary variables obscure behavior; docstrings reference 'meth' rather than actual parameter names. Code length: Verbose attribute metadata and a long constructor reduce concision, although much of this is declarative. Action granularity: Assignments and operations generally occupy separate lines, making individual steps easy to follow. Reading flow: Method bodies flow naturally, but understanding the constructor requires repeatedly mapping opaque parameters to fields, and the converter lambda adds some cognitive overhead.

Run 3

Code Structure: The class logically groups attribute metadata, initialization, and decorators, but the extensive imports distract from the excerpt. Nesting: Methods remain shallow, with straightforward conditionals; the metadata comprehension adds moderate complexity. Clarity of intent: Descriptive fields and docstrings explain the overall purpose, but single-letter method names, parameters, and temporary variables obscure individual operations. Docstrings refer to 'meth' rather than the actual parameter names. Code length: The long constructor and repetitive Attribute configuration make the class verbose, although the comprehension reduces some duplication. Action granularity: Assignments and updates generally perform one action per line, making execution easy to follow. Reading flow: Formatting and method separation are consistent, but mapping numerous opaque constructor arguments to fields forces repeated cross-referencing, especially where assignment order differs from parameter order.