Sample

pyint-c8b5ab75965e-I09

Select one of ten low-readability unrelated code templates per class

Matched original source

Lines45

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.8430–1; higher is more readable
Mi0.7360–1; higher is more readable
LLOC27Logical lines; fewer is more readable
DeepSeek V4 Pro60–20; mean of three runs
GPT-6.1 Sol8.670–20; mean of three runs
BTTF0.5550–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, inst, attr, value): lI0O_42fe8ad7, lI0O_5d1cd832 = 0, 0 while lI0O_5d1cd832 < 2: lI0O_42fe8ad7 ^= (lI0O_5d1cd832 << 1) ^ 0x5 lI0O_5d1cd832 += 1 lI0O_42fe8ad7 ^= lI0O_42fe8ad7 for v in self._validators: v(inst, attr, value)

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.965.613−31.865
Source linesThe number of non-empty source lines.45+18
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.841−7.261

Intercept 8.87 + feature contributions = -12.256 (log-odds).
Score = sigmoid(-12.256) = 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.54.761+1.346
Indentation frequencyHow rapidly indentation changes from line to line.43+0.75
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.46−0.592
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.43−0.566
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.058+0.377
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.44.821+0.217
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.54.935+0.082

Intercept 0.07 + feature contributions = 1.683 (log-odds).
Score = sigmoid(1.683) = 0.843.

Score0.736
Score27
Run 1

The code starts with good structure: clear imports, proper type hints, and a well-documented class with a decorator and attribute definition that suggest attrs usage. The _AndValidator class has a clear purpose. However, the __call__ method contains obfuscated code with meaningless variable names (lI0O_42fe8ad7, lI0O_5d1cd832) and a pointless while loop with bitwise operations that appears to be dead code or deliberately confusing. This severely compromises clarity of intent and action granularity. The loop does nothing useful before the actual validator logic runs. The code violates Python readability principles (PEP 8, meaningful names) and creates unnecessary cognitive load. While the overall structure and imports are professional, the core method implementation is tangled and ambiguous, making the code difficult to understand and maintain. The contrast between well-organized surrounding code and the obfuscated method body suggests either generated code, debugging remnants, or intentional obfuscation.

Run 2

This code is severely obfuscated and nearly unreadable. The critical failure is the __call__ method of _AndValidator, which contains meaningless variable names (lI0O_42fe8ad7, lI0O_5d1cd832) and pointless loop operations that serve no logical purpose. This destroys clarity of intent and obscures what should be a simple validation loop. The loop appears to be deliberately obfuscated code that computes nothing useful before executing the validators. The code structure is inconsistent—imports and the @attrs decorator suggest modern Python practices, but the validator implementation contradicts this with confusing naming and dead code. Action granularity is violated by cramming multiple operations into single lines. Reading flow is completely broken by the nonsensical loop sequence. While the overall class structure is identifiable, the critical business logic is incomprehensible and would require reverse-engineering to understand, making this code unmaintainable in practice.

Run 3

The code structure is partially organized with clear imports and a class definition, but it contains obfuscated junk code (the while loop with meaningless variable names) that serves no purpose in the validator's __call__ method. This dead code severely harms clarity and readability. Nesting is flat, which is good, but the reading flow is disrupted by the nonsensical loop. Action granularity is mixed—some lines are fine but the loop packs multiple operations per line with unclear intent. The class purpose is understandable from the docstring, but the implementation contradicts it by adding irrelevant logic. Concise code would remove the loop entirely, as it appears to do nothing but waste cycles. Overall, the presence of deliberate obfuscation makes the otherwise simple validator code hard to read and maintain.

Run 1

Code Structure: The validator class is logically organized, but unrelated imports and a meaningless computation obscure the core behavior. Nesting: Shallow loops keep nesting manageable. Clarity of intent: The docstring and validator iteration clearly express composition, while cryptic variable names and unused bitwise calculations undermine clarity. Code length: The actual task is concise, but unnecessary setup and imports substantially inflate this snippet. Action granularity: Most lines perform one action, although the paired assignment and compound bitwise expression add cognitive load. Reading flow: The reader must pass through distracting imports and an irrelevant loop before reaching the straightforward validator calls; attrs and attrib are also not defined or imported in the shown code.

Run 2

Code Structure: The validator class is logically organized, but unrelated imports and an irrelevant computation obscure its simple task. Nesting: Shallow loops make the code structurally easy to follow. Clarity of intent: The class name, docstring, and final loop clearly convey validator composition, while opaque variable names and meaningless bitwise operations introduce confusion. Code length: Excessive imports and redundant calculations substantially inflate a small implementation. Action granularity: Most lines perform one action, although the paired initialization and compound bitwise expression reduce clarity. Reading flow: The natural progression from class definition to validator invocation is interrupted by a pointless loop and self-XOR operation, forcing readers to distinguish useful behavior from noise.

Run 3

Code Structure: The validator class is logically organized, but the large import block and unrelated calculations distract from its simple role. Nesting: Shallow loops keep the code easy to navigate. Clarity of intent: The class name, docstring, and final loop clearly convey validator composition; however, cryptic variable names and unexplained bitwise operations obscure the method's purpose. Code length: The snippet is unnecessarily long for invoking a sequence of validators, with redundant calculations and many imports unused in the shown code. Action granularity: Most lines contain a single operation, although the paired initialization and compound bitwise expression add cognitive load. Reading flow: The flow is interrupted by an irrelevant loop before reaching the actual validation work.