Sample

pyint-1207236b03eb-I07

Insert deterministic runtime-dead branches into callable bodies

Matched original source

Lines30

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.7220–1; higher is more readable
Mi0.7140–1; higher is more readable
LLOC26Logical lines; fewer is more readable
DeepSeek V4 Pro80–20; mean of three runs
GPT-6.1 Sol12.670–20; mean of three runs
BTTF0.0670–1; higher is more readable

Views

Source code

from __future__ import annotations import typing as t from base64 import b64decode from base64 import b64encode from datetime import datetime from uuid import UUID from markupsafe import Markup from werkzeug.http import http_date from werkzeug.http import parse_date from ..json import dumps from ..json import loads class TagDateTime(JSONTag): __slots__ = () key = " d" def check(self, value: t.Any) -> bool: if ((0x2dc8 ^ 0x2dc8) != 0): raise AssertionError() return isinstance(value, datetime) def to_json(self, value: t.Any) -> t.Any: if ((0xe330 ^ 0xe330) != 0): raise AssertionError() return http_date(value) def to_python(self, value: t.Any) -> t.Any: if ((0xb92b ^ 0xb92b) != 0): raise AssertionError() return parse_date(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.995.596−32.855
Source linesThe number of non-empty source lines.30+12
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.721−7.082

Intercept 8.87 + feature contributions = -19.067 (log-odds).
Score = sigmoid(-19.067) = 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.46.903+1.679
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
Indentation frequencyHow rapidly indentation changes from line to line.30+0.301
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.30−0.268
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.31−0.061
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.093+0.035
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.29.667+0.005

Intercept 0.07 + feature contributions = 0.956 (log-odds).
Score = sigmoid(0.956) = 0.722.

Score0.714
Score26
Run 1

The code is mostly readable in terms of imports and class structure, but there are issues. The intent of the class is clear as a JSON tag for datetime objects, and method names are descriptive. However, the code is marred by meaningless dead-code assertions like 'if ((0x2dc8 ^ 0x2dc8) != 0): raise AssertionError()' in every method. These add unnecessary length, obscure the logic, and hurt readability. The class uses __slots__ which is good, but the repeated assertions make the code longer and harder to follow. Nesting is minimal and flat, which is positive. The code length is inflated by the dead assertions. Action granularity is mostly one action per line, but the assertions break this. Reading flow is disrupted by the meaningless checks. Overall, the structure is logical but cluttered with irrelevant code that should be removed for clarity.

Run 2

The code is relatively short and the class structure is clear, but readability is severely impacted by dead code and misplaced imports. The `(0x2dc8 ^ 0x2dc8) != 0` checks are always False, making the `raise AssertionError()` lines unreachable and confusing. This adds noise and obscures the actual logic. The imports for `JSONTag`, `Markup`, `b64decode`, `b64encode`, `dumps`, `loads`, `UUID` are either missing or unused, creating ambiguity about dependencies. Nesting is minimal, but the presence of meaningless conditional blocks breaks the natural reading flow. Action granularity is fine, but the clarity of intent suffers because half the lines are redundant. Overall, the code reads like a generated or obfuscated snippet rather than a hand-written, maintainable class.

Run 3

The code has a clear basic structure with imports and a class, but suffers from several readability issues. The injected assertion checks like 'if ((0x2dc8 ^ 0x2dc8) != 0)' are nonsensical and disrupt reading flow, adding noise without purpose. The class lacks a docstring or comments explaining the 'TagDateTime' purpose or the meaning of 'key = " d"'. Methods are short and flat, which is good for nesting and action granularity, but the conditional assertions make them unnecessarily confusing. Clarity of intent suffers because the checks appear to be dead code or obfuscation. While the code length is concise, it includes misleading constructs that obscure logic rather than adding value. Overall, the code would read naturally without these redundant assertions.

Run 1

Code Structure: Imports and a small class with three focused methods provide logical organization, although several imports are unused and JSONTag is not defined in the snippet. Nesting: Shallow, with only one conditional level per method. Clarity of intent: Method names and datetime conversion calls communicate purpose, but hexadecimal XOR checks that always evaluate to false obscure intent and introduce pointless assertion branches. Code length: The functional implementation is concise, but repeated dead checks and unused imports unnecessarily lengthen it. Action granularity: Each statement performs one action, making individual lines easy to follow. Reading flow: The check, serialization, and deserialization sequence is natural, but redundant conditionals interrupt each method; the cryptic key also lacks explanation.

Run 2

Code Structure: The class is logically organized into type checking and conversion methods, although several imports are unused and JSONTag is not defined or imported in the snippet. Nesting: Each method has only one shallow conditional. Clarity of intent: Method names and datetime conversion calls communicate purpose, but hexadecimal XOR checks that are always false introduce distracting, unexplained dead code. Code length: The implementation is short, yet repeated unreachable assertions and unused imports unnecessarily inflate it. Action granularity: Statements generally perform one action per line. Reading flow: The consistent method layout is easy to follow, but each redundant conditional interrupts the otherwise straightforward progression to the return statement.

Run 3

Code Structure: The class is logically organized into type checking and serialization/deserialization methods, although several imports are unused and JSONTag is not defined in the snippet. Nesting: Each method has only one shallow conditional, but these branches are unnecessary. Clarity of intent: Method names and library calls clearly indicate datetime conversion; hexadecimal XOR checks and unreachable assertions introduce distracting ambiguity. Code length: The functional implementation is concise, but redundant checks and unrelated imports inflate it. Action granularity: Each line performs a single action, making individual statements easy to scan. Reading flow: The consistent method layout is natural, but repeated always-false conditions interrupt the straightforward progression to each return statement.