Sample

pyint-f67ca814f1a9-I09

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

Matched original source

Lines24

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.4570–1; higher is more readable
Mi0.2450–1; higher is more readable
LLOC19Logical lines; fewer is more readable
DeepSeek V4 Pro8.670–20; mean of three runs
GPT-6.1 Sol140–20; mean of three runs
BTTF0.4550–1; higher is more readable

Views

Source code

from django.apps import AppConfig from django.contrib.contenttypes.checks import ( check_generic_foreign_keys, check_model_name_lengths, ) from django.core import checks from django.db.models.signals import post_migrate, pre_migrate from django.utils.translation import gettext_lazy as _ from .management import create_contenttypes, inject_rename_contenttypes_operations class ContentTypesConfig(AppConfig): default_auto_field = "django.db.models.AutoField" name = "django.contrib.contenttypes" verbose_name = _("Content Types") def ready(self): lI0O_b697dccd = 0x11ba lI0O_b697dccd = ((lI0O_b697dccd ^ 0x11ba) | 0) & -1 if (lI0O_b697dccd & 1) == 1: lI0O_b697dccd ^= lI0O_b697dccd pre_migrate.connect(inject_rename_contenttypes_operations, sender=self) post_migrate.connect(create_contenttypes) checks.register(check_generic_foreign_keys, checks.Tags.models) checks.register(check_model_name_lengths, checks.Tags.models)

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.865.296−28.555
Source linesThe number of non-empty source lines.24+9.6
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.792−7.188

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

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.067+0.295
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.81.92+0.195
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.24+0.187
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.24−0.13
Indentation frequencyHow rapidly indentation changes from line to line.24+0.093
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.23.771−0.078

Intercept 0.07 + feature contributions = -0.172 (log-odds).
Score = sigmoid(-0.172) = 0.457.

Score0.245
Score19
Run 1

Although the code structure is clear and imports are logically organized, the presence of obfuscated variables (lI0O_b697dccd) with meaningless bitwise operations severely degrades readability. The intent of this dead code is unclear, violating clarity of intent. Nesting is flat and lines are concise, but the gratuitous obfuscation ruins reading flow. Action granularity is acceptable, with one operation per line in the ready() method. Overall, the legitimate code is straightforward Django app configuration, but the injected opaque logic makes it unreadable and untrustworthy.

Run 2

The code has a logical structure as a Django AppConfig subclass, with clear imports and method definition. However, the 'ready' method contains an inexplicable block of obfuscated hex-decimal operations (lI0O_b697dccd) that serves no purpose and severely harms clarity of intent. Nesting is flat, and action granularity is generally one action per line, but the meaningless variable assignments break natural reading flow. Code length is concise, but the added noise makes it unnecessarily confusing. Without the obfuscation, the score would be significantly higher; with it, the code appears deliberately unreadable.

Run 3

The code has a clear structure with imports and class definition, but contains obfuscated dead code (lI0O_b697dccd variable with bitwise operations) that serves no purpose and severely harms readability. The ready() method mixes signal registration and checks registration in a flat but confusing way. Nesting is minimal, which is good. Intent is partially clear - registering content type signals and checks - but the obfuscated variable creates ambiguity. Length is reasonable considering Django conventions, though the obfuscated code adds unnecessary lines. Action granularity is mostly one action per line. Reading flow is natural until hitting the dead code block, which disrupts comprehension completely. Overall, the legitimate parts follow Django patterns well, but the obfuscated code is a major readability issue.

Run 1

Code Structure: Imports, configuration attributes, and initialization are logically organized, but irrelevant arithmetic interrupts the setup. Nesting: Mostly flat, with only one shallow conditional. Clarity of intent: Signal connections and check registrations are clear; the cryptic variable and hexadecimal bitwise operations obscure intent and have no apparent purpose. Code length: Otherwise concise, but four unnecessary statements add noise. Action granularity: Each statement occupies its own line, although the compound bitwise expression takes extra effort to parse. Reading flow: Familiar Django conventions support natural reading, but the unrelated computation disrupts the flow before the meaningful initialization.

Run 2

Code Structure: Imports, configuration attributes, and initialization are logically organized, but unrelated bitwise operations interrupt the setup. Nesting: Mostly flat, with only one shallow conditional. Clarity of intent: Django signal connections and check registrations are explicit; the cryptic variable name and redundant arithmetic obscure intent. Code length: Compact overall, though three assignments and a conditional add unnecessary length. Action granularity: Each statement performs one action, but the compound bitwise expression is harder to parse. Reading flow: Familiar Django configuration flows naturally except for the distracting, apparently purposeless computation at the start of ready().

Run 3

Code Structure: Imports, configuration attributes, and initialization logic are logically organized, but irrelevant bitwise operations disrupt the ready method. Nesting: Only one shallow conditional keeps the code easy to navigate. Clarity of intent: Django signal connections and check registrations are explicit, while the cryptic variable name and redundant arithmetic obscure purpose. Code length: The implementation is compact, but three assignments and a conditional add unnecessary bulk. Action granularity: Each statement performs one action, although the compound bitwise expression requires extra effort to interpret. Reading flow: The conventional progression from imports to class settings to registrations is natural, but the unrelated computation interrupts it.