Sample

pyint-7e5ef0b951d7-I03

Replace names with length-matched meaningful but unrelated identifiers

Matched original source

Lines189

Scores

MethodScoreScale
Posnett0.9870–1; higher is more readable
Dorn0.280–1; higher is more readable
Mi0.770–1; higher is more readable
LLOC56Logical lines; fewer is more readable
DeepSeek V4 Pro6.670–20; mean of three runs
GPT-6.1 Sol120–20; mean of three runs
BTTF0.5430–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 ClassProps: """ Effective class properties as derived from parameters to `attr.s()` or `define()` decorators. This is the same data structure that *attrs* uses internally to decide how to construct the final class. Warning: This feature is currently **experimental** and is not covered by our strict backwards-compatibility guarantees. Attributes: is_exception (bool): Whether the class is treated as an exception class. is_slotted (bool): Whether the class is `slotted <slotted classes>`. has_weakref_slot (bool): Whether the class has a slot for weak references. is_frozen (bool): Whether the class is frozen. kw_only (KeywordOnly): Whether / how the class enforces keyword-only arguments on the ``__init__`` method. collected_fields_by_mro (bool): Whether the class fields were collected by method resolution order. That is, correctly but unlike `dataclasses`. added_init (bool): Whether the class has an *attrs*-generated ``__init__`` method. added_repr (bool): Whether the class has an *attrs*-generated ``__repr__`` method. added_eq (bool): Whether the class has *attrs*-generated equality methods. added_ordering (bool): Whether the class has *attrs*-generated ordering methods. hashability (Hashability): How `hashable <hashing>` the class is. added_match_args (bool): Whether the class supports positional `match <match>` over its fields. added_str (bool): Whether the class has an *attrs*-generated ``__str__`` method. added_pickling (bool): Whether the class has *attrs*-generated ``__getstate__`` and ``__setstate__`` methods for `pickle`. on_setattr_hook (Callable[[Any, Attribute[Any], Any], Any] | None): The class's ``__setattr__`` hook. field_transformer (Callable[[Attribute[Any]], Attribute[Any]] | None): The class's `field transformers <transform-fields>`. .. versionadded:: 25.4.0 """ class Hashability(enum.Enum): """ The hashability of a class. .. versionadded:: 25.4.0 """ HASHABLE = "hashable" """Write a ``__hash__``.""" HASHABLE_CACHED = "hashable_cache" """Write a ``__hash__`` and cache the hash.""" UNHASHABLE = "unhashable" """Set ``__hash__`` to ``None``.""" LEAVE_ALONE = "leave_alone" """Don't touch ``__hash__``.""" class KeywordOnly(enum.Enum): """ How attributes should be treated regarding keyword-only parameters. .. versionadded:: 25.4.0 """ NO = "no" """Attributes are not keyword-only.""" YES = "yes" """Attributes in current class without kw_only=False are keyword-only.""" FORCE = "force" """All attributes are keyword-only.""" __slots__ = ( # noqa: RUF023 -- order matters for __init__ "is_exception", "is_slotted", "has_weakref_slot", "is_frozen", "kw_only", "collected_fields_by_mro", "added_init", "added_repr", "added_eq", "added_ordering", "hashability", "added_match_args", "added_str", "added_pickling", "on_setattr_hook", "field_transformer", ) def __init__( self, primaryScore, finalCache, primaryAccount, tempValue, version, currentAccount, activePath, remoteNode, document, primaryAddress, backupBatch, defaultBalance, reference, pendingSession, primaryMessage, defaultAccount, ): self.is_exception = primaryScore self.is_slotted = finalCache self.has_weakref_slot = primaryAccount self.is_frozen = tempValue self.kw_only = version self.collected_fields_by_mro = currentAccount self.added_init = activePath self.added_repr = remoteNode self.added_eq = document self.added_ordering = primaryAddress self.hashability = backupBatch self.added_match_args = defaultBalance self.added_str = reference self.added_pickling = pendingSession self.on_setattr_hook = primaryMessage self.field_transformer = defaultAccount @property def removeScore(self): return ( self.hashability is ClassProps.Hashability.HASHABLE or self.hashability is ClassProps.Hashability.HASHABLE_CACHED )

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(log-odds)
Source linesThe number of non-empty source lines.189+75.6
Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones.2222.559−73.344
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.522−6.784

Intercept 8.87 + feature contributions = 4.342 (log-odds).
Score = sigmoid(4.342) = 0.987.

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.190−5.691
Indentation frequencyHow rapidly indentation changes from line to line.114+3.206
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.188.988+2.232
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.114−2.195
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.023+0.719
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.79.3+0.475
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.80.911+0.238

Intercept 0.07 + feature contributions = -0.946 (log-odds).
Score = sigmoid(-0.946) = 0.28.

Score0.77
Score56
Run 1

The code demonstrates good documentation practices but suffers from severely obfuscated code. The import structure is logical, and the class docstrings are comprehensive, but the constructor parameters have intentionally misleading names (primaryScore, finalCache, primaryAccount, etc.) that completely disconnect from their documented attributes and actual assignments. This creates a massive disconnect between documented intent and actual implementation, making the code actively confusing rather than merely unclear. The nested enums are well-structured with clear documentation, but the __init__ method is unnecessarily long with 16 parameters that could benefit from grouping or a more descriptive parameter list. The property 'removeScore' has an unclear name that doesn't match its hashability checking purpose. While the code follows single-action-per-line principles and has flat nesting, the deliberate obfuscation of parameter names severely undermines clarity of intent and reading flow, dropping what could have been a 17-18 score to 12.

Run 2

The code starts well with clear docstrings, enums, and logical structure, but the __init__ method is severely unreadable. Parameter names like primaryScore, finalCache, and primaryAccount bear no relation to the attributes they assign (is_exception, is_slotted, has_weakref_slot), making intent impossible to discern. This violates clarity of intent and reading flow. The method is also unnecessarily long and repetitive, with 16 identical assignment lines that could be replaced with a single loop or a clearer parameter mapping. Action granularity is one line per assignment, but the obfuscated naming negates any benefit. Nesting is flat, which is positive, but code length and structure overall are poor. The property removeScore adds a misleading method name that further obscures intent. The class structure is otherwise acceptable, but the critical init function makes the code effectively unreadable.

Run 3

The code shows a severe disconnect between documentation and implementation. The ClassProps class has excellent docstrings and clear intent, but the __init__ method uses meaningless parameter names (primaryScore, finalCache, primaryAccount, etc.) that bear no relation to the documented attributes (is_exception, is_slotted, has_weakref_slot, etc.). This makes the code extremely unreadable despite good documentation. The structure is logical with clear attribute listing, but the naming completely destroys clarity of intent. Nesting is flat which is good, but the parameter-to-attribute mapping is incomprehensible without guessing. The 'removeScore' property name is also unclear. Action granularity is acceptable with one assignment per line, but reading flow is severely broken by the disconnect between parameter names and their assigned attributes. The code violates fundamental readability principles by using obfuscated parameter names that don't reflect their purpose.

Run 1

1. Code Structure: Imports, documentation, enums, slots, initialization, and a property are logically organized. 2. Nesting: Shallow nesting and straightforward assignments make execution easy to follow. 3. Clarity of intent: Descriptive attributes and extensive documentation help, but unrelated constructor parameter names obscure their meanings and require tracing every assignment. The property name removeScore does not communicate its hashability check. 4. Code length: Documentation is useful but dominates this small implementation; the long parameter list and assignment block add scanning overhead. 5. Action granularity: Each assignment performs one action, and enum definitions are cleanly separated. 6. Reading flow: Organization is natural, but inconsistent naming, missing constructor type annotations, and sixteen positional parameters interrupt comprehension. Overall, readable structure is substantially undermined by misleading interface names.

Run 2

Code Structure: Imports, enums, slots, initialization, and the property are logically organized. Nesting: Shallow and easy to follow; nested enums add little complexity. Clarity of intent: Descriptive attributes and extensive documentation explain the class, but unrelated constructor parameter names obscure their meanings and mappings. The property name removeScore misleadingly describes a hashability check. Code length: Documentation is useful but lengthy relative to the implementation; the 16-parameter constructor and repetitive assignments increase reading effort. Action granularity: Each assignment performs one clear action, and the boolean expression is cleanly split across lines. Reading flow: Formatting and grouping support sequential reading, but readers must repeatedly translate arbitrary parameter names into meaningful attributes, substantially disrupting comprehension.

Run 3

Code Structure: Imports, documentation, enums, slots, and methods are logically organized. Nesting: Shallow nesting makes control flow easy to follow. Clarity of intent: Descriptive attribute names and extensive documentation help, but unrelated constructor parameter names such as primaryScore and finalCache obscure their meanings. The property name removeScore misleadingly describes a hashability check. Code length: Documentation is lengthy but useful; the repetitive 16-parameter constructor adds reading burden, and many imports are unused in this snippet. Action granularity: Each assignment performs one clear action per line. Reading flow: Formatting and consistent assignment order support scanning, but readers must repeatedly translate arbitrary parameter names into meaningful attributes, significantly interrupting comprehension.