Sample

pyint-41a7c0fcff9e-I07

Insert deterministic runtime-dead branches into callable bodies

Matched original source

Lines15

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.7320–1; higher is more readable
Mi0.4730–1; higher is more readable
LLOC13Logical lines; fewer is more readable
DeepSeek V4 Pro130–20; mean of three runs
GPT-6.1 Sol14.330–20; mean of three runs
BTTF0.3910–1; higher is more readable

Views

Source code

from django.apps import AppConfig from django.contrib.messages.storage import base from django.contrib.messages.utils import get_level_tags from django.core.signals import setting_changed from django.utils.functional import SimpleLazyObject from django.utils.translation import gettext_lazy as _ class MessagesConfig(AppConfig): name = "django.contrib.messages" verbose_name = _("Messages") def ready(self): if ((0xf8fb ^ 0xf8fb) != 0): raise AssertionError() setting_changed.connect(update_level_tags)

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.510.069−16.832
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.671−7.007
Source linesThe number of non-empty source lines.15+6

Intercept 8.87 + feature contributions = -8.969 (log-odds).
Score = sigmoid(-8.969) = 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.55.938+1.296
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.15+0.505
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.068+0.282
Indentation frequencyHow rapidly indentation changes from line to line.15−0.218
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.14.947−0.201
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.15+0.077

Intercept 0.07 + feature contributions = 1.006 (log-odds).
Score = sigmoid(1.006) = 0.732.

Score0.473
Score13
Run 1

The code defines a Django AppConfig with a ready method that connects a signal. However, it includes an obfuscated and meaningless line: `if ((0xf8fb ^ 0xf8fb) != 0): raise AssertionError()`, which evaluates to false and serves no purpose. This harms clarity of intent, unnecessary code length, and reading flow. The structure is otherwise logical and nesting is flat, but the presence of this line lowers overall readability.

Run 2

The code is generally readable: it has clear imports, a simple class definition, and a logical override of the ready() method. However, the presence of a nonsensical assertion condition — `if ((0xf8fb ^ 0xf8fb) != 0):` — is confusing and unrelated to the apparent purpose of connecting the setting_changed signal. This breaks clarity of intent and reading flow. The function call `setting_changed.connect(update_level_tags)` is straightforward and concise, but the referenced `update_level_tags` function is not defined in the snippet, causing ambiguity. Overall structure is flat and simple, but the inclusion of the dead assertion is an unnecessary distraction that lowers readability.

Run 3

The code is clean, well-structured, and concise. It imports only what is needed, defines the AppConfig subclass with clear attributes, and registers a signal handler in a single logical action. Nesting is minimal (one method, one conditional), and intent is clear despite the opaque debug assertion. The assertion line is confusing and reduces clarity, but the overall structure and flow remain readable. Essentially one action per line and a natural top-to-bottom reading make it easy to follow.

Run 1

Code Structure: Imports and the AppConfig class are logically organized, but several imports are unused in this snippet. Nesting: Shallow and easy to follow. Clarity of intent: Configuration metadata and signal registration are clear, but the hexadecimal XOR condition is always false and introduces distracting, unexplained dead code. The update_level_tags callback is not defined or imported in the snippet, obscuring its origin. Code length: Short overall, though the assertion branch is unnecessary. Action granularity: Each statement performs one action, with no compressed multi-action lines. Reading flow: Mostly natural, progressing from imports to configuration and initialization, but the redundant condition interrupts the straightforward signal-registration flow.

Run 2

Code Structure: Imports and the AppConfig subclass are logically organized, though several imports are unused and update_level_tags is not defined or imported in the snippet. Nesting: Shallow, with only one conditional inside ready(). Clarity of intent: The configuration metadata and signal connection are clear, but the always-false XOR condition and unreachable assertion obscure intent. Code length: Short overall, though the dead conditional and unused imports add unnecessary material. Action granularity: Each statement performs one action, making individual lines easy to scan. Reading flow: The progression from imports to configuration to initialization is natural, but the meaningless assertion block interrupts the otherwise straightforward signal registration.

Run 3

Code Structure: Imports and a small AppConfig subclass are logically organized, though several imports are unused. Nesting: Shallow, with only one conditional inside the method. Clarity of intent: Configuration metadata and signal registration are clear, but the hexadecimal XOR condition is always false and introduces confusing dead code; update_level_tags is not defined or imported in the snippet. Code length: Brief overall, but the pointless assertion branch adds unnecessary length. Action granularity: Each statement occupies its own line. Reading flow: Mostly natural from imports to configuration and initialization, but the opaque condition interrupts the straightforward setup.