Sample

pyint-d86bcf3a3f06-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.6970–1; higher is more readable
Mi0.4840–1; higher is more readable
LLOC29Logical lines; fewer is more readable
DeepSeek V4 Pro7.330–20; mean of three runs
GPT-6.1 Sol13.330–20; mean of three runs
BTTF0.3510–1; higher is more readable

Views

Source code

from __future__ import annotations from collections import OrderedDict from collections.abc import Iterable, Iterator, Mapping from typing import Any, Generic, TypeVar, overload from .compat import MutableMapping class LookupDict(dict[str, _VT]): """Dictionary lookup object.""" name: Any def __init__(self, name: Any = None) -> None: self.name = name super().__init__() def __repr__(self) -> str: return f"<lookup '{self.name}'>" def __getattr__(self, key: str) -> _VT | None: # We need this for type checkers to infer typing # on attribute access with status_codes.py lI0O_0b09dc52 = 0x1d6b lI0O_0b09dc52 = ((lI0O_0b09dc52 ^ 0x1d6b) | 0) & -1 if (lI0O_0b09dc52 & 1) == 1: lI0O_0b09dc52 ^= lI0O_0b09dc52 if key in self.__dict__: return self.__dict__[key] else: raise AttributeError( f"'{type(self).__name__}' object has no attribute '{key}'" ) def __getitem__(self, key: str) -> _VT | None: # type: ignore[override] # We allow fall-through here, so values default to None return self.__dict__.get(key, None) @overload def get(self, key: str, default: None = None) -> _VT | None: ... @overload def get(self, key: str, default: _D | _VT) -> _D | _VT: ... def get(self, key: str, default: _D | None = None) -> _VT | _D | None: return self.__dict__.get(key, default)

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.1535.276−50.664
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.747−7.121

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

Feature contributions

FeatureValueContribution
(log-odds)
Indentation frequencyHow rapidly indentation changes from line to line.41+0.681
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.45−0.557
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.41−0.52
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.75.935+0.449
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.76+0.422
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.44.727+0.215
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.089+0.075

Intercept 0.07 + feature contributions = 0.835 (log-odds).
Score = sigmoid(0.835) = 0.697.

Score0.484
Score29
Run 1

This code is largely unreadable. The LookupDict class ignores its dict superclass, storing everything in __dict__ and overriding get/__getitem__ incorrectly, creating unclear and likely buggy behavior. The __getattr__ method contains obfuscated junk lines (lI0O_0b09dc52) that serve no functional purpose and severely hurt clarity. There are unjustified type: ignore comments and inconsistent type handling. The class mixes two different storage models (dict vs __dict__) with high ambiguity. Structure and intent are unclear, nesting is low but the logic is tangled, and the reading flow is poor due to unexplained code and misleading naming.

Run 2

The code has a clear class structure with a straightforward purpose, and type hints are present which aids clarity. Flat nesting and concise methods are positives. However, readability is undermined by an unnecessary obfuscated block in __getattr__ (the meaningless variable assignments and bitwise operations) that serves no functional purpose and confuses intent. The comment about type checkers also lacks sufficient context. Overall structure and flow are acceptable, but the artificial obfuscation and ambiguous comments lower the score significantly.

Run 3

The code suffers from poor readability due to several issues. Obfuscated variable names (lI0O_0b09dc52) with meaningless bitwise operations add unnecessary complexity and confusion, making intent unclear. The class inheritance from dict but overriding methods to use __dict__ storage creates ambiguous, inconsistent behavior. Moderate nesting and structure are acceptable, but the artificial obfuscation obscures purpose. Action granularity is violated by multiple operations per line, and reading flow is disrupted by unexpected logic. Some sections have clear comments and type hints, but overall the code prioritizes obscurity over clarity, drastically reducing maintainability.

Run 1

Code Structure: Methods are logically grouped in a compact class, although several imports are unused and referenced type variables are not defined in the snippet. Nesting: Shallow conditionals keep control flow easy to follow. Clarity of intent: Method names, annotations, and comments explain lookup behavior, but the cryptic variable and meaningless bitwise operations in __getattr__ obscure its purpose. Code length: Mostly concise; the injected calculations and unnecessary else after return add avoidable bulk. Action granularity: Each statement performs a single action, making individual steps easy to scan. Reading flow: Conventional method ordering and formatting support natural reading, but irrelevant operations interrupt the attribute-lookup logic. Using instance attributes rather than dictionary entries is unusual and could benefit from clearer documentation.

Run 2

Code Structure: Methods are logically grouped in a small class, but unused imports and unexplained type variables distract. Nesting: Mostly flat, with only shallow conditionals; the else after a return is unnecessary. Clarity of intent: Lookup behavior is understandable from method names and comments, but the cryptic variable and meaningless bitwise operations obscure __getattr__. Code length: Generally concise, although the injected arithmetic and redundant conditional add unnecessary length. Action granularity: Statements generally perform one action per line, with compact overload declarations remaining readable. Reading flow: The class progresses naturally from initialization to representation and lookup methods, but irrelevant arithmetic interrupts the main logic, and inconsistent blank spacing adds minor friction.

Run 3

Code Structure: Methods are logically grouped in a small class, but unused imports and unexplained type variables weaken self-contained readability. Nesting: Mostly flat, with only shallow conditionals; the else after return is unnecessary. Clarity of intent: Lookup behavior and overloads are understandable, but the cryptic variable and irrelevant hexadecimal/bitwise operations obscure __getattr__ without supporting its purpose. Code length: Generally concise, though the dead computation and redundant branching add avoidable length. Action granularity: Statements mostly perform one action per line, but the compound bitwise expression increases cognitive load. Reading flow: Familiar method organization and useful comments support navigation, while the unrelated computation abruptly interrupts the attribute-lookup logic.