Sample

pyint-ef3b2b5f86c2-I09

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

Matched original source

Lines17

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.6970–1; higher is more readable
Mi0.4730–1; higher is more readable
LLOC15Logical lines; fewer is more readable
DeepSeek V4 Pro7.670–20; mean of three runs
GPT-6.1 Sol100–20; mean of three runs
BTTF0.4730–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): lI0O_61c912bf = 0xbbb5 lI0O_61c912bf = ((lI0O_61c912bf ^ 0xbbb5) | 0) & -1 if (lI0O_61c912bf & 1) == 1: lI0O_61c912bf ^= lI0O_61c912bf 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.599.896−19.797
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.885−7.328
Source linesThe number of non-empty source lines.17+6.8

Intercept 8.87 + feature contributions = -11.455 (log-odds).
Score = sigmoid(-11.455) = 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.59+1.166
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.17+0.434
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.07+0.26
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.16.867−0.174
Indentation frequencyHow rapidly indentation changes from line to line.17−0.149
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.17+0.031

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

Score0.473
Score15
Run 1

The code has a clear logical structure with proper imports and a standard Django app config class. The class definition, attributes, and method signature are readable. However, the ready() method contains obfuscated code: a meaningless variable name (lI0O_61c912bf), nonsensical bitwise operations that serve no purpose, and a conditional block that appears to be dead code. This severely impacts clarity of intent and action granularity. The actual meaningful action (connecting the signal) is buried after confusing operations. The code length is misleadingly short but includes unnecessary complexity. Nesting is flat, which is positive, but the reading flow is disrupted by the unexplained obfuscation. The imports are appropriate but unused imports (get_level_tags, SimpleLazyObject, base) suggest incomplete refactoring.

Run 2

The code is poorly readable due to several factors. The class definition and imports are clear, but the 'ready' method contains obfuscated, meaningless logic (e.g., hexadecimal constants, XOR operations, and conditional bit checks) that serves no apparent purpose and obscures intent. This violates clarity of intent and action granularity: multiple operations are crammed into single-line assignments and conditionals. The obfuscated variable name and dead-code manipulation make the function longer than needed and disrupt reading flow. Nesting is low, but that's overshadowed by the confusing logic. Overall, the unnatural, pointless code blocks make this difficult to understand and maintain.

Run 3

The code has a clear structure with a Django AppConfig class and a ready() method, which is logical. However, the ready() method contains obfuscated code with meaningless variable names (lI0O_61c912bf) and unnecessary bitwise operations that serve no apparent purpose. This severely impacts clarity of intent and reading flow. The nesting is minimal and code length is acceptable, but the obfuscated block violates action granularity by mixing multiple operations. The signal connection line is clear, but the preceding cryptic code makes the overall purpose ambiguous and confusing for maintainers.

Run 1

Code Structure: Imports and the AppConfig class are logically organized, but ready() contains unrelated obfuscating operations. Nesting: Only one shallow conditional, so nesting is easy to follow. Clarity of intent: The signal connection is clear, but the cryptic variable name and hexadecimal bitwise operations obscure the method's purpose; update_level_tags is not defined in the snippet. Code length: Short overall, yet several statements are unnecessary to the visible functionality. Action granularity: Each statement occupies its own line, although the compound bitwise expression is harder to parse. Reading flow: Conventional Django setup provides a natural beginning, but the irrelevant calculations interrupt the flow before the meaningful signal registration.

Run 2

Code Structure: Imports and the AppConfig class are logically organized, but irrelevant computation disrupts ready(). Nesting: Only one shallow conditional, so nesting is easy to follow. Clarity of intent: The class metadata and signal connection are clear, while the opaque variable name and redundant bitwise operations obscure intent. Code length: Short overall, but several unnecessary lines inflate a simple initialization method; some imports are unused in this snippet. Action granularity: Each statement occupies its own line, although the bitwise expression combines several operations. Reading flow: Familiar Django setup is interrupted by meaningless arithmetic before the signal connection. update_level_tags is not defined or imported in the snippet, making the final action harder to understand.

Run 3

Code Structure: The imports and AppConfig subclass are logically organized, but irrelevant calculations clutter ready(). Nesting: Mostly flat, with only one shallow conditional. Clarity of intent: The configuration fields and signal connection are clear, but the cryptic variable name and meaningless bitwise operations obscure the method's purpose. Code length: Short overall, yet several lines are unnecessary; unused imports also add noise. Action granularity: Generally one action per line, although the compound bitwise expression requires extra parsing. Reading flow: The conventional Django setup reads naturally until the arbitrary arithmetic interrupts it. update_level_tags is referenced without a visible definition or import, leaving the signal connection's context incomplete.