Sample

pyint-560120bd996f-I04

Replace names with deterministic minifier-style shortest identifiers

Matched original source

Lines67

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.8810–1; higher is more readable
Mi0.520–1; higher is more readable
LLOC41Logical lines; fewer is more readable
DeepSeek V4 Pro50–20; mean of three runs
GPT-6.1 Sol110–20; mean of three runs
BTTF0.2810–1; higher is more readable

Views

Source code

from itertools import chain from django.core.exceptions import ( NON_FIELD_ERRORS, FieldError, ImproperlyConfigured, ValidationError, ) from django.core.validators import ProhibitNullCharactersValidator from django.db.models.utils import AltersData, get_blank_choice_label from django.forms.fields import ChoiceField, Field from django.forms.forms import BaseForm, DeclarativeFieldsMetaclass from django.forms.formsets import BaseFormSet, formset_factory from django.forms.utils import ErrorList from django.forms.widgets import ( HiddenInput, MultipleHiddenInput, RadioSelect, SelectMultiple, ) from django.utils.choices import BaseChoiceIterator from django.utils.hashable import make_hashable from django.utils.text import capfirst, get_text_list from django.utils.translation import gettext from django.utils.translation import gettext_lazy as _ class InlineForeignKeyField(Field): """ A basic integer field that deals with validating the given value to a given parent instance in an inline. """ widget = HiddenInput default_error_messages = { "invalid_choice": _("The inline value did not match the parent instance."), } def __init__(self, c, *d, e=False, f=None, **g): self.parent_instance = c self.pk_field = e self.to_field = f if self.parent_instance is not None: if self.to_field: g["initial"] = getattr(self.parent_instance, self.to_field) else: g["initial"] = self.parent_instance.pk g["required"] = False super().__init__(*d, **g) def a(self, h): if h in self.empty_values: if self.pk_field: return None # if there is no value act as we did before. return self.parent_instance # ensure we compare the values as equal types. if self.to_field: i = getattr(self.parent_instance, self.to_field) else: i = self.parent_instance.pk if str(h) != str(i): raise ValidationError( self.error_messages["invalid_choice"], code="invalid_choice" ) return self.parent_instance def b(self, j, k): return False

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.2318.706−76.517
Source linesThe number of non-empty source lines.67+26.8
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.517−6.775

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

Feature contributions

FeatureValueContribution
(log-odds)
Indentation frequencyHow rapidly indentation changes from line to line.62+1.407
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.68−1.371
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.66.929+0.526
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.81.765+0.515
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.065+0.309
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.82.971+0.151

Intercept 0.07 + feature contributions = 2.005 (log-odds).
Score = sigmoid(2.005) = 0.881.

Score0.52
Score41
Run 1

The code is heavily obfuscated by poor naming: variables like 'c', 'd', 'e', 'f', 'g' and methods 'a', 'b' make intent unclear. The single-letter names destroy clarity, even though the logic itself is reasonably simple. Structure is somewhat organized (imports, class, methods), but nesting is moderate and readability suffers from constant need to decode parameter meanings. Action granularity is acceptable—mostly one action per line—but reading flow is disrupted by ambiguous names. The docstring and comments provide some context, but they can't compensate for the uninformative identifiers.

Run 2

The code suffers from several readability issues. While imports and class docstring are clear, the method signatures use cryptic single-letter parameter names (c, d, e, f, g, h, i, j, k) that obscure intent. The __init__ method mixes positional and keyword arguments in a confusing way. Methods are named 'a' and 'b' instead of descriptive names like 'clean' or 'has_changed', making the class's purpose unclear. The nesting level is moderate but variable naming forces readers to constantly track what each letter represents. Action granularity is acceptable with one operation per line, but the reading flow is disrupted by unclear parameter names. The code structure follows Django conventions (imports organized, class with docstring), but the obfuscated naming severely impacts clarity of intent. Overall, this appears to be deliberately minified or obfuscated Django form field code that would be significantly more readable with proper variable and method names.

Run 3

This code is severely unreadable due to obfuscated names (c, d, e, f, g, h, i, j, k) that obscure intent. The class structure is intact, but method names a(), b() and parameter names provide zero clarity about purpose or behavior. Nesting is shallow, which is good, but action granularity suffers due to dense conditional blocks combining multiple logical operations. Reading flow is unnatural because readers must constantly guess parameter meanings. Imports are organized but unused (many Django imports are irrelevant to visible code). Code length is concise but at the expense of clarity—overly terse variable names make it cryptic. Overall structure suggests this was intentionally renamed from a real Django field into an unreadable form, making evaluation impossible on intent and maintainability.

Run 1

Code Structure: The class is logically divided into initialization, validation, and a small override, but many unused imports add clutter. Nesting: Conditional nesting is shallow and manageable, with early returns simplifying validation. Clarity of intent: Descriptive attributes, the docstring, and comments explain the general purpose, but single-letter method names and parameters obscure meaning and make framework behavior harder to recognize. Code length: The implementation is reasonably concise, though the import block is disproportionately large for the shown functionality. Action granularity: Statements generally perform one action per line, and multiline formatting is clear. Reading flow: Initialization followed by validation provides a natural progression, but readers must repeatedly infer what unnamed parameters represent; the unexplained method returning False further interrupts understanding.

Run 2

Code Structure: The class is logically organized into initialization, validation, and a small override, but numerous unused imports add clutter. Nesting: Mostly shallow, with manageable two-level conditionals. Clarity of intent: The class name, attributes, docstring, and comments explain the general purpose, but single-letter method names and parameters obscure specific responsibilities and data roles. Code length: The implementation is reasonably concise, though the import block is disproportionately long for the functionality shown. Action granularity: Statements generally perform one action per line, and multiline calls are clearly formatted. Reading flow: Initialization followed by validation provides a natural progression, but cryptic identifiers force readers to infer meaning repeatedly; the unconditional return in method b is also unexplained.

Run 3

Code Structure: The class is logically divided into initialization, validation, and a small auxiliary method, but numerous unused imports add clutter. Nesting: Conditional nesting is shallow and manageable, with early returns simplifying validation. Clarity of intent: The class name, attributes, docstring, and comments explain its general purpose, but single-letter method names and parameters obscure operations and argument roles. Code length: The implementation is reasonably concise, although the import block is disproportionate to the code shown. Action granularity: Statements generally perform one action per line, and formatting cleanly separates assignments, conditions, and exceptions. Reading flow: Initialization and validation follow a natural sequence, but opaque identifiers force readers to infer meaning repeatedly, and the unexplained method returning False interrupts understanding.