Sample

pyint-ee88f90d8745-I04

Replace names with deterministic minifier-style shortest identifiers

Matched original source

Lines144

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.4650–1; higher is more readable
Mi0.4420–1; higher is more readable
LLOC74Logical lines; fewer is more readable
DeepSeek V4 Pro2.670–20; mean of three runs
GPT-6.1 Sol90–20; mean of three runs
BTTF0.2650–1; higher is more readable

Views

Source code

import copy import json from django import forms from django.conf import settings from django.core.exceptions import ValidationError from django.core.validators import URLValidator from django.db.models import CASCADE, UUIDField from django.forms.widgets import Select from django.urls import reverse from django.urls.exceptions import NoReverseMatch from django.utils.html import smart_urlquote from django.utils.http import urlencode from django.utils.text import Truncator from django.utils.translation import get_language from django.utils.translation import gettext as _ class RelatedFieldWidgetWrapper(forms.Widget): """ This class is a wrapper to a given widget to add the add icon for the admin interface. """ template_name = "admin/widgets/related_widget_wrapper.html" def __init__( self, j, k, l, m=None, n=False, o=False, p=False, ): self.needs_multipart_form = j.needs_multipart_form self.attrs = j.attrs self.widget = j self.rel = k # Backwards compatible check for whether a user can add related # objects. if m is None: m = l.is_registered(k.model) self.can_add_related = m if not isinstance(j, AutocompleteMixin): self.attrs["data-context"] = "available-source" # Only single-select Select widgets are supported. q = not getattr( j, "allow_multiple_selected", False ) and isinstance(j, Select) self.can_change_related = q and n # XXX: The deletion UX can be confusing when dealing with cascading # deletion. r = getattr(k, "on_delete", None) is CASCADE self.can_delete_related = q and not r and o self.can_view_related = q and p # To check if the related object is registered with this AdminSite. self.admin_site = l self.use_fieldset = j.use_fieldset def __deepcopy__(self, s): t = copy.copy(self) t.widget = copy.deepcopy(self.widget, s) t.attrs = self.widget.attrs s[id(self)] = t return t @property def a(self): return self.widget.is_hidden @property def b(self): return self.widget.media @property def d(self): return self.widget.choices @choices.setter def d(self, u): self.widget.choices = u def e(self, v, w, *x): return reverse( "admin:%s_%s_%s" % (*v, w), current_app=self.admin_site.name, args=x, ) def f(self, y, z, A): from django.contrib.admin.views.main import ( IS_POPUP_VAR, SOURCE_MODEL_VAR, TO_FIELD_VAR, ) B = self.rel.model._meta C = (B.app_label, B.model_name) D = self.rel.get_related_field().name E = self.rel.field.model._meta.app_label F = self.rel.field.model._meta.model_name G = "&".join( "%s=%s" % H for H in [ (TO_FIELD_VAR, D), (IS_POPUP_VAR, 1), (SOURCE_MODEL_VAR, f"{E}.{F}"), ] ) I = { "rendered_widget": self.widget.render(y, z, A), "is_hidden": self.a, "name": y, "url_params": G, "model": B.verbose_name, "model_name": B.model_name, "can_add_related": self.can_add_related, "can_change_related": self.can_change_related, "can_delete_related": self.can_delete_related, "can_view_related": self.can_view_related, "model_has_limit_choices_to": self.rel.limit_choices_to, } if self.can_add_related: I["add_related_url"] = self.e(C, "add") if self.can_delete_related: I["delete_related_template_url"] = self.e( C, "delete", "__fk__" ) if self.can_view_related or self.can_change_related: I["view_related_url_params"] = f"{TO_FIELD_VAR}={D}" I["change_related_template_url"] = self.e( C, "change", "__fk__" ) return I def g(self, J, K, L): return self.widget.value_from_datadict(J, K, L) def h(self, M, N, O): return self.widget.value_omitted_from_data(M, N, O) def i(self, P): return self.widget.id_for_label(P)

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.5669.883−187.106
Source linesThe number of non-empty source lines.144+57.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.465−6.698

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

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.145−4.098
Indentation frequencyHow rapidly indentation changes from line to line.135+3.932
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.135−2.677
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.143.882+1.601
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.74.959+0.49
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.70.841+0.339
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.076+0.202

Intercept 0.07 + feature contributions = -0.14 (log-odds).
Score = sigmoid(-0.14) = 0.465.

Score0.442
Score74
Run 1

This code is extremely unreadable due to deliberately obfuscated naming. All parameters and methods use meaningless single letters (j, k, l, e, f, g, etc.) instead of descriptive names like 'widget', 'rel', 'admin_site', 'get_url', or 'render'. This obscures the intent and makes the logic impossible to follow without extensive external documentation. While the structure and nesting are technically logical, the reading flow is completely broken by the cryptic identifiers. The action granularity is acceptable, but the code length is inflated with unnecessary temporary variables (A, B, C, D...) that add no clarity. The code violates the core principle of self-documenting code, forcing the reader to decode every line.

Run 2

This code is extremely unreadable due to deliberate obfuscation. Parameters use meaningless single letters (j, k, l, m, n, o, p) instead of descriptive names like 'widget', 'rel', 'admin_site', 'can_add_related'. Methods are named a, b, d, e, f, g, h, i rather than descriptive names like 'is_hidden', 'media', 'get_context', 'build_url'. Local variables are similarly obscured (B, C, D, E, F, G, H, I). This completely destroys clarity of intent and reading flow. The class structure is recognizable but the original Django RelatedFieldWidgetWrapper logic is buried under cryptic aliases. Action granularity is moderate but lost due to the naming chaos. This appears to be intentionally minified or obfuscated source code masquerading as readable Python.

Run 3

This code is extremely unreadable due to deliberately obfuscated naming. Variables like 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P' and methods 'a', 'b', 'd', 'e', 'f', 'g', 'h', 'i' provide zero clarity. Clarity of intent is absent, reading flow is impossible, and action granularity is meaningless when every line requires deciphering. While the structure and nesting are technically preserved from the original Django code, the semantic destruction makes it unmaintainable. The code length is normal, but it is effectively unusable.

Run 1

Code Structure: Methods separate initialization, context construction, and widget delegation logically, but cryptic method names obscure those roles. Nesting: Mostly flat, with shallow conditionals and a simple comprehension, making control flow easy to follow. Clarity of intent: The class name, comments, and descriptive attributes help, but single-letter parameters, variables, and methods severely impair understanding; the mismatched @choices.setter and property d also disrupt interpretation. Code length: Reasonably concise overall, though numerous apparently unused imports and small forwarding methods add clutter. Action granularity: Most lines perform one action, and multiline calls and dictionaries are formatted clearly. Reading flow: Initialization and context assembly follow a natural sequence, but readers must repeatedly trace anonymous identifiers to understand relationships and data flow.

Run 2

Code Structure: Organized into a widget-wrapper class with distinct methods, although the mismatched @choices.setter and renamed property obscure the interface. Nesting: Shallow conditionals and a simple comprehension keep complexity low. Clarity of intent: The class docstring, comments, and descriptive instance attributes help, but single-letter method names, parameters, and local variables severely obscure purpose and data relationships. Code length: Mostly concise, though numerous imports unused in this snippet and excessive wrapping add visual noise. Action granularity: Generally one assignment or operation per line, making individual steps easy to distinguish. Reading flow: Initialization, delegation, and context construction follow a logical sequence, but readers must repeatedly trace opaque identifiers to understand the behavior.

Run 3

Code Structure: The class is logically divided into initialization, properties, URL generation, context construction, and widget delegation, although the choices setter references an undefined property name. Nesting: Mostly flat, with simple conditionals and a shallow comprehension. Clarity of intent: The docstring, comments, and descriptive instance attributes help, but single-letter method names, parameters, and local variables severely obscure meaning. Code length: Reasonably concise, though numerous unused imports and some awkward line wrapping add clutter. Action granularity: Most lines perform one operation; compound expressions remain manageable. Reading flow: Methods follow a sensible sequence, but readers must repeatedly trace opaque identifiers to understand data flow, particularly in context construction.