Sample

pyint-d3dddd8d6d32-I09

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

Matched original source

Lines26

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.2080–1; higher is more readable
Mi0.1760–1; higher is more readable
LLOC19Logical lines; fewer is more readable
DeepSeek V4 Pro80–20; mean of three runs
GPT-6.1 Sol12.330–20; mean of three runs
BTTF0.4090–1; higher is more readable

Views

Source code

from collections.abc import Iterable from django.apps import apps from django.contrib import auth from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager from django.contrib.auth.hashers import make_password from django.contrib.contenttypes.models import ContentType from django.core.exceptions import PermissionDenied from django.core.mail import send_mail from django.db import models from django.db.models.manager import EmptyManager from django.utils import timezone from django.utils.translation import gettext_lazy as _ from .validators import UnicodeUsernameValidator class PermissionManager(models.Manager): use_in_migrations = True def get_by_natural_key(self, codename, app_label, model): lI0O_a6a6d121 = 0xadeb lI0O_a6a6d121 = (0 if (lI0O_a6a6d121 ^ lI0O_a6a6d121) == 0 else 1) if (lI0O_a6a6d121 & 0) == 0 else 2 return self.get( codename=codename, content_type=ContentType.objects.db_manager(self.db).get_by_natural_key( app_label, model ), )

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.1108.116−36.568
Source linesThe number of non-empty source lines.26+10.4
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.719−7.078

Intercept 8.87 + feature contributions = -24.376 (log-odds).
Score = sigmoid(-24.376) = 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.108.963−0.95
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.063+0.327
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.26−0.176
Indentation frequencyHow rapidly indentation changes from line to line.26+0.162
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.27+0.08
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.25.882−0.048

Intercept 0.07 + feature contributions = -1.339 (log-odds).
Score = sigmoid(-1.339) = 0.208.

Score0.176
Score19
Run 1

The code is largely unreadable due to the presence of an obfuscated variable name `lI0O_a6a6d121` with a confusing, dead-code assignment line that serves no purpose in `get_by_natural_key`. This severely undermines clarity of intent and action granularity, making a simple method appear convoluted and ambiguous. The structure and nesting are otherwise acceptable, as the method body is flat and the imports are logically grouped, but the obfuscation dominates the readability assessment. The method itself is concise, but the extraneous line adds unnecessary length and breaks reading flow. Overall, the code would be much more readable if the dead code and nonsense variable were removed and the method returned the query directly.

Run 2

The code has clear imports and a logical class structure, but readability is undermined by the obfuscated variable 'lI0O_a6a6d121' and its confusing, multi-line bitwise operations that serve no apparent purpose. This breaks action granularity and clarity of intent. The PermissionManager method itself is concise and follows Django conventions, but the extraneous logic makes the overall code ambiguous. Nesting is flat and structure is organized, yet the reading flow is disrupted by the meaningless variable assignment. Removing the dead code would significantly improve readability.

Run 3

The code structure is mostly obscured by the presence of a nonsensical variable assignment (lI0O_a6a6d121) that serves no purpose and disrupts clarity of intent. The nesting is minimal and the method is short, but the arbitrary logic around the variable adds confusion. Action granularity is acceptable, with one primary action per line, but the reading flow is broken by the meaningless variable. Imports and class structure are standard but the overall effect is that the code appears obfuscated. The method itself is concise and functional, but the unrelated variable destroys readability. The code reads more like a puzzle than a maintainable contribution.

Run 1

Code Structure: Imports and the manager class are logically organized, but unrelated dummy assignments disrupt the method. Nesting: The lookup is moderately nested and readable; the nested conditional expression adds needless complexity. Clarity of intent: The method name and lookup arguments clearly convey natural-key retrieval, while the cryptic variable and bitwise operations obscure intent. Code length: The method is short, but two unnecessary statements and numerous imports unused in this snippet reduce concision. Action granularity: Most lines contain one action, although the conditional assignment combines several operations. Reading flow: Conventional Django formatting supports a natural flow, but the obfuscated assignments interrupt the progression to the return statement.

Run 2

Code Structure: The manager class and method are logically organized, but unrelated assignments interrupt the meaningful logic. Nesting: Structural nesting is shallow, although the nested conditional expression is difficult to parse. Clarity of intent: The method name and ORM lookup clearly indicate natural-key retrieval; the cryptic variable and pointless bitwise operations obscure that purpose. Code length: The method is mostly concise, but the unused variable assignments and numerous unused imports add unnecessary clutter. Action granularity: Statements generally perform one action per line, though the long conditional assignment combines several operations. Reading flow: Conventional Django formatting makes the final lookup easy to follow, but the obfuscated assignments disrupt an otherwise natural progression.

Run 3

Code Structure: The manager class and method are logically organized, but irrelevant assignments and many unused imports distract from the core operation. Nesting: The return expression has modest, understandable nesting, while the nested conditional assignment adds needless complexity. Clarity of intent: The method name and query arguments clearly indicate a natural-key lookup; the opaque variable name and redundant bitwise expressions obscure that purpose. Code length: The actual lookup is concise, but the imports and two unnecessary assignments inflate the snippet. Action granularity: Each statement occupies its own line, although the conditional assignment packs several operations into one difficult-to-scan expression. Reading flow: Standard Django conventions and the formatted query support natural reading, but the unrelated obfuscated statements interrupt the flow.