Sample

pyint-734fb4ce2fbd-I04

Replace names with deterministic minifier-style shortest identifiers

Matched original source

Lines36

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.8580–1; higher is more readable
Mi0.5680–1; higher is more readable
LLOC20Logical lines; fewer is more readable
DeepSeek V4 Pro13.670–20; mean of three runs
GPT-6.1 Sol140–20; mean of three runs
BTTF0.5420–1; higher is more readable

Views

Source code

import operator import re from contextlib import contextmanager from re import Pattern from ._config import get_run_validators, set_run_validators from ._make import _AndValidator, and_, attrib, attrs from .converters import default_if_none from .exceptions import NotCallableError @attrs(repr=False, slots=True, unsafe_hash=True) class _DeepIterable: member_validator = attrib(validator=is_callable()) iterable_validator = attrib( default=None, validator=optional(is_callable()) ) def __call__(self, a, b, c): """ We use a callable class to be able to change the ``__repr__``. """ if self.iterable_validator is not None: self.iterable_validator(a, b, c) for d in c: self.member_validator(a, b, d) def __repr__(self): e = ( "" if self.iterable_validator is None else f" {self.iterable_validator!r}" ) return ( f"<deep_iterable validator for{e}" f" iterables of {self.member_validator!r}>" )

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.919.264−30.336
Source linesThe number of non-empty source lines.36+14.4
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.334−6.501

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

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.70+0.7
Indentation frequencyHow rapidly indentation changes from line to line.34+0.439
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.058+0.375
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.37−0.274
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.35.845+0.091
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.49.649−0.003

Intercept 0.07 + feature contributions = 1.796 (log-odds).
Score = sigmoid(1.796) = 0.858.

Score0.568
Score20
Run 1

The code has a clear class structure with appropriate use of the attrs library, making the validators declarative and readable. The __call__ method is logical but uses cryptic one-letter variable names (a, b, c, d) that obscure the intent—these likely represent instance, attribute, and value. The __repr__ method builds strings across multiple lines with conditional f-strings, which is reasonably clear but could be more concise. Nesting is minimal, and each line performs a single action. The docstring explains the purpose of using a callable class, but this context is not fully leveraged throughout the code. Overall, the code is readable to someone familiar with the codebase but would benefit from descriptive variable names instead of alphabetical placeholders.

Run 2

The code has a clear purpose and a straightforward two-attribute class structure, but it suffers from unnecessary single-letter variable names (a, b, c, d, e) that obscure intent. The `__call__` method is concise but would benefit from meaningful parameter names and type hints. The `__repr__` method has clear logic but the conditional expression and string concatenation could be clearer with an intermediate variable or a clearer null-check. Imports appear unused (`operator`, `re`, `Pattern`, `contextmanager`, etc.), which reduces readability by adding clutter and confusion. Nesting is minimal, and action granularity is mostly acceptable. Overall, the code is readable to someone familiar with the domain but falls short of being self-documenting or maintainable without additional context.

Run 3

The code is moderately readable with a clear class structure and logical organization. The single method '__call__' and '__repr__' are straightforward, but parameter names like 'a, b, c' and 'd' obscure intent, reducing clarity. The nested loop adds complexity but remains flat with only two levels. Variable 'e' in '__repr__' is vaguely named and used for string building, which slightly hurts readability. The use of 'attrib' and 'validator' from the referenced module suggests a domain-specific context that may require additional knowledge. Overall, the code is concise, mostly one action per line, and follows a natural reading flow, but cryptic variable names prevent a higher score.

Run 1

Code Structure: The class logically groups configuration, validation, and representation, though numerous unused imports add clutter and callable helpers are not defined or imported in the snippet. Nesting: Shallow conditionals and a single loop keep control flow easy to follow. Clarity of intent: Class and attribute names communicate iterable validation, but parameters a, b, c and variables d, e obscure their roles; the docstring explains the class design rather than the method's behavior. Code length: The implementation is concise, although imports and multiline formatting add some overhead. Action granularity: Statements generally perform one action each, with no compressed sequences. Reading flow: Validation proceeds naturally from the iterable itself to its members, followed by representation logic; terse variable names and the split conditional expression slightly interrupt readability.

Run 2

Code Structure: The class is logically organized into validator attributes, validation behavior, and representation, although several imports appear unused and is_callable and optional are not defined or imported in the snippet. Nesting: Control flow is shallow, with a simple conditional and loop. Clarity of intent: The class and attribute names communicate deep iterable validation, but single-letter parameters a, b, c and variables d and e obscure their roles; the docstring explains the callable-class design rather than validation behavior. Code length: The implementation is compact, though unused imports add clutter. Action granularity: Statements generally perform one action per line, and multiline expressions remain manageable. Reading flow: Attribute declarations followed by __call__ and __repr__ create a natural progression, but opaque variable names and conditional string construction introduce minor friction.

Run 3

Code Structure: The class is logically organized into attributes, validation behavior, and representation, though numerous unused imports add clutter. Nesting: Control flow is shallow, with a simple conditional and loop. Clarity of intent: Descriptive class and validator names convey the purpose, but parameters a, b, c and variables d and e obscure their roles. The docstring explains the callable-class design rather than the validation behavior; is_callable and optional are also not defined or imported in the shown code. Code length: The implementation is concise, although the representation formatting is somewhat fragmented. Action granularity: Each statement performs a single clear action, without compressed multi-action lines. Reading flow: Validation proceeds naturally from checking the iterable to checking its members, but cryptic identifiers and unnecessary imports interrupt comprehension.