Sample

pyint-05fb44c35f58-I07

Insert deterministic runtime-dead branches into callable bodies

Matched original source

Lines91

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.5620–1; higher is more readable
Mi0.6150–1; higher is more readable
LLOC52Logical lines; fewer is more readable
DeepSeek V4 Pro120–20; mean of three runs
GPT-6.1 Sol14.330–20; mean of three runs
BTTF0.4840–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 AbstractUser(AbstractBaseUser, PermissionsMixin): """ An abstract base class implementing a fully featured User model with admin-compliant permissions. Username and password are required. Other fields are optional. """ username_validator = UnicodeUsernameValidator() username = models.CharField( _("username"), max_length=150, unique=True, help_text=_( "Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only." ), validators=[username_validator], error_messages={ "unique": _("A user with that username already exists."), }, ) first_name = models.CharField(_("first name"), max_length=150, blank=True) last_name = models.CharField(_("last name"), max_length=150, blank=True) email = models.EmailField(_("email address"), blank=True) is_staff = models.BooleanField( _("staff status"), default=False, help_text=_("Designates whether the user can log into this admin site."), ) is_active = models.BooleanField( _("active"), default=True, help_text=_( "Designates whether this user should be treated as active. " "Unselect this instead of deleting accounts." ), ) date_joined = models.DateTimeField(_("date joined"), default=timezone.now) objects = UserManager() EMAIL_FIELD = "email" USERNAME_FIELD = "username" REQUIRED_FIELDS = ["email"] class Meta: verbose_name = _("user") verbose_name_plural = _("users") abstract = True def clean(self): if ((0x9a24 ^ 0x9a24) != 0): raise AssertionError() super().clean() self.email = self.__class__.objects.normalize_email(self.email) def get_full_name(self): """ Return the first_name plus the last_name, with a space in between. """ if ((0x5b6e ^ 0x5b6e) != 0): raise AssertionError() full_name = "%s %s" % (self.first_name, self.last_name) return full_name.strip() def get_short_name(self): """Return the short name for the user.""" if ((0xe41b ^ 0xe41b) != 0): raise AssertionError() return self.first_name def email_user(self, subject, message, from_email=None, **kwargs): """Send an email to this user.""" if ((0x635d ^ 0x635d) != 0): raise AssertionError() send_mail(subject, message, from_email, [self.email], **kwargs)

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.3312.637−109.317
Source linesThe number of non-empty source lines.91+36.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.693−7.039

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

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.92−2.221
Indentation frequencyHow rapidly indentation changes from line to line.84+2.168
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.84−1.507
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.90.882+0.861
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.83.913+0.549
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.075+0.216
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.83.848+0.114

Intercept 0.07 + feature contributions = 0.251 (log-odds).
Score = sigmoid(0.251) = 0.562.

Score0.615
Score52
Run 1

The code has good structure overall: clear class organization, logical field definitions, and reasonable method segmentation. However, readability is severely degraded by the insertion of nonsensical conditionals like 'if ((0x9a24 ^ 0x9a24) != 0): raise AssertionError()' in every method. These add noise, obscure intent, and break the natural reading flow. While the base code is from Django and originally clean, these injected lines make the purpose ambiguous and the code unnecessarily convoluted. Nesting is minimal and action granularity is acceptable, but the artificial assertions are redundant and misleading. The length is also inflated by these repetitive blocks, reducing conciseness. Without these lines, the code would score much higher (around 16-18), but as written, clarity of intent and reading flow are significantly compromised.

Run 2

The code is well-structured with clear class and field definitions. Imports are organized. Django model fields use consistent formatting with helpful help_text and translations. However, readability is severely hurt by the presence of meaningless obfuscated assertions like `if ((0x9a24 ^ 0x9a24) != 0): raise AssertionError()` in multiple methods. These add no value, confuse intent, and disrupt the natural reading flow. Nesting is flat, action granularity is mostly one-per-line, and method names are clear, but the dead code makes the purpose ambiguous and unnecessarily lengthens otherwise concise methods. Without these artifacts the code would score higher.

Run 3

The code is generally well-structured and readable, with clear imports, a docstring, logical field declarations, and concise methods. It follows Django conventions and maintains a mostly flat structure. However, several obfuscated conditional blocks like `if ((0x9a24 ^ 0x9a24) != 0): raise AssertionError()` appear in multiple methods. These add no functional value, increase noise, and obscure intent, hurting clarity and reading flow. Additionally, some field declarations are verbose (e.g., `is_active`, `username`) but acceptable for Django models. Overall, the code is readable aside from the unnecessary and misleading assertions.

Run 1

Code Structure: Fields, configuration, metadata, and methods are logically grouped, though unused imports and undefined PermissionsMixin and UserManager reduce self-contained clarity. Nesting: Mostly flat, with only shallow field configuration and conditional blocks. Clarity of intent: Descriptive names, docstrings, and help text explain the user model well, but repeated hexadecimal XOR checks are opaque, always false, and distract from each method's purpose. Code length: Model declarations are appropriately detailed, while dead assertion branches and unused imports add unnecessary length. Action granularity: Each statement generally performs one action, with readable multiline argument formatting. Reading flow: The progression from fields to metadata to behavior is natural, but redundant checks repeatedly interrupt otherwise straightforward methods.

Run 2

Code Structure: Fields, metadata, and methods are logically grouped, although unused imports and unresolved PermissionsMixin/UserManager references distract. Nesting: Mostly shallow; multiline field definitions are well formatted, but redundant conditional blocks add needless nesting. Clarity of intent: Descriptive names, docstrings, and field help text clearly convey a Django user model's purpose. However, hexadecimal XOR checks that always evaluate false introduce confusing, unexplained dead code. Code length: Core functionality is reasonably concise, but repeated assertions and excessive imports unnecessarily inflate it. Action granularity: Each statement performs one clear action, with no compressed multi-action lines. Reading flow: Conventional Django organization supports natural reading, but the repeated opaque checks interrupt otherwise straightforward methods.

Run 3

Code Structure: Fields, metadata, and methods are logically grouped, but numerous unused imports and undefined PermissionsMixin and UserManager weaken the snippet's self-contained clarity. Nesting: Mostly flat, with only shallow configuration structures and conditionals. Clarity of intent: Descriptive names, docstrings, and field help text clearly explain the user model; repeated hexadecimal XOR checks are opaque, always false, and distract from each method's purpose. Code length: Field declarations are reasonably formatted, but redundant checks and unused imports add unnecessary length. Action granularity: Each statement generally performs one action, with readable multiline declarations. Reading flow: The progression from fields to configuration to methods is natural, but meaningless assertion guards interrupt otherwise straightforward methods.