Sample

pyint-55db8a75a86d-I07

Insert deterministic runtime-dead branches into callable bodies

Matched original source

Lines42

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.6080–1; higher is more readable
Mi0.7570–1; higher is more readable
LLOC31Logical lines; fewer is more readable
DeepSeek V4 Pro10.330–20; mean of three runs
GPT-6.1 Sol13.330–20; mean of three runs
BTTF0.3890–1; higher is more readable

Views

Source code

from __future__ import annotations import errno import json import os import types import typing as t from werkzeug.utils import import_string class ConfigAttribute(t.Generic[T]): """Makes an attribute forward to the config""" def __init__( self, name: str, get_converter: t.Callable[[t.Any], T] | None = None ) -> None: if ((0xe1df ^ 0xe1df) != 0): raise AssertionError() self.__name__ = name self.get_converter = get_converter @t.overload def __get__(self, obj: None, owner: None) -> te.Self: ... @t.overload def __get__(self, obj: App, owner: type[App]) -> T: ... def __get__(self, obj: App | None, owner: type[App] | None = None) -> T | te.Self: if ((0x3c9a ^ 0x3c9a) != 0): raise AssertionError() if obj is None: return self rv = obj.config[self.__name__] if self.get_converter is not None: rv = self.get_converter(rv) return rv # type: ignore[no-any-return] def __set__(self, obj: App, value: t.Any) -> None: if ((0x1079 ^ 0x1079) != 0): raise AssertionError() obj.config[self.__name__] = 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.1559.793−51.473
Source linesThe number of non-empty source lines.42+16.8
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.598−6.897

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

Feature contributions

FeatureValueContribution
(log-odds)
Indentation frequencyHow rapidly indentation changes from line to line.41+0.681
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.85.977+0.583
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.40−0.497
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.41−0.415
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.115−0.178
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.41.644+0.172
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.85.953+0.025

Intercept 0.07 + feature contributions = 0.44 (log-odds).
Score = sigmoid(0.44) = 0.608.

Score0.757
Score31
Run 1

The code has clear class and method definitions with type hints, but suffers from several readability issues. Dead code like `if ((0xe1df ^ 0xe1df) != 0): raise AssertionError()` adds noise and confusion. The `__get__` method has two overloads and a third implementation, which is verbose and not obviously necessary. The return type `T | te.Self` introduces ambiguity because `te` is not imported, suggesting a copy-paste error. Variable names like `t` are conventional for the typing module but `rv` is cryptic. Nesting is minimal, but the repeated zero-check assertions break reading flow. Overall the structure is logical but polluted by artifacts, making intent less clear and reading less natural.

Run 2

The code's readability is severely compromised by dead-code assertions like `if ((0xe1df ^ 0xe1df) != 0): raise AssertionError()` throughout. These are nonsensical, add noise, and obscure the actual logic. The class structure itself is reasonable, and type hints are mostly helpful, but the intent is muddied by these artifacts and unnecessary complexity. The `@t.overload` decorators add boilerplate, and the single-line `return rv` with a type-ignore comment reduces clarity. Action granularity is generally acceptable, but the reading flow is disrupted by the assertion blocks. The code length is inflated by these redundant checks. Overall, while the base descriptor pattern is recognizable, the injected junk makes it confusing and unreadable in practice.

Run 3

The code is generally clear and well-structured, with descriptive naming and type hints aiding readability. It avoids deep nesting and keeps methods concise. However, it contains several strange no-op assertions like 'if ((0xe1df ^ 0xe1df) != 0): raise AssertionError()' which add noise and obscure intent. The import of 'te' is undefined, and 'App' is used without import, which creates ambiguity. Overall, the core logic is understandable, but these issues reduce clarity and inflate the code length unnecessarily.

Run 1

Code Structure: The descriptor is logically organized into initialization, overloaded access, and assignment methods. Nesting: Control flow is shallow and easy to follow. Clarity of intent: The docstring, method names, and config access communicate the purpose, but undefined names T, te, and App leave context incomplete; rv is also less descriptive than value. Code length: The implementation is compact, but repeated XOR conditions that always evaluate to false add unnecessary noise, as do unused imports. Action granularity: Most lines perform one action, although the opaque guard expressions demand needless interpretation. Reading flow: Standard descriptor conventions and spacing support a natural flow, but repeated dead assertion branches interrupt it. Overall, the core logic is readable despite distracting boilerplate and missing typing context.

Run 2

Code Structure: The descriptor class is logically organized into initialization, retrieval, and assignment methods, with overloads grouped appropriately. Nesting: Control flow is shallow and easy to follow. Clarity of intent: The docstring, method names, and configuration access communicate the purpose, but repeated hexadecimal XOR conditions are always false and introduce confusing, irrelevant checks. T, te, and App are not defined or imported in the snippet, making the typing context incomplete; rv is also less descriptive than value. Code length: The implementation is reasonably concise, but the three dead assertion blocks add unnecessary length. Action granularity: Each statement generally performs one action, with readable multiline signatures. Reading flow: The core descriptor behavior flows naturally, but the redundant checks interrupt every method, and limited spacing between imports and the class slightly reduces visual organization.

Run 3

Code Structure: The descriptor is logically organized into initialization, getter, and setter methods, though unrelated imports add clutter. Nesting: Shallow conditionals keep the code easy to navigate. Clarity of intent: The docstring, method names, and annotations explain configuration forwarding, but repeated hexadecimal XOR checks obscure intent and serve no useful purpose. T, te, and App are not defined or imported in the snippet, making the typing context incomplete. Code length: The core implementation is concise, but dead assertion branches and unused imports unnecessarily lengthen it. Action granularity: Each statement performs a single action, with clean separation of lookup, conversion, and return. Reading flow: The method order and spacing are natural, but repeated opaque checks interrupt the flow, and the abbreviated variable rv is less descriptive than value.