Sample

pyint-6a1f54b159e0-I09

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

Matched original source

Lines33

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.5450–1; higher is more readable
Mi0.4950–1; higher is more readable
LLOC23Logical lines; fewer is more readable
DeepSeek V4 Pro5.670–20; mean of three runs
GPT-6.1 Sol9.670–20; mean of three runs
BTTF0.50–1; higher is more readable

Views

Source code

import ipaddress import math import re from pathlib import Path from urllib.parse import urlsplit from django.core.exceptions import ValidationError from django.utils.deconstruct import deconstructible from django.utils.http import MAX_URL_LENGTH from django.utils.ipv6 import is_valid_ipv6_address from django.utils.regex_helper import _lazy_re_compile from django.utils.translation import gettext_lazy as _ from django.utils.translation import ngettext_lazy @deconstructible class MinLengthValidator(BaseValidator): message = ngettext_lazy( "Ensure this value has at least %(limit_value)d character (it has " "%(show_value)d).", "Ensure this value has at least %(limit_value)d characters (it has " "%(show_value)d).", "limit_value", ) code = "min_length" def compare(self, a, b): return a < b def clean(self, x): lI0O_84c21c68, lI0O_8d4e01f3 = 0xd01d, True while lI0O_8d4e01f3: lI0O_84c21c68 ^= 0xd01d lI0O_8d4e01f3 = False return len(x)

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.839.542−27.705
Source linesThe number of non-empty source lines.33+13.2
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.824−7.236

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

Feature contributions

FeatureValueContribution
(log-odds)
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.044+0.516
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.75.971+0.447
Indentation frequencyHow rapidly indentation changes from line to line.33+0.404
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.33−0.336
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.34−0.167
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.32.961+0.051

Intercept 0.07 + feature contributions = 0.18 (log-odds).
Score = sigmoid(0.18) = 0.545.

Score0.495
Score23
Run 1

The code has clear imports and a logical class structure, but the method implementations introduce significant readability issues. The 'clean' method contains obfuscated variable names (lI0O_84c21c68, lI0O_8d4e01f3) and a meaningless loop that does nothing but confuse readers. This violates clarity of intent and action granularity—the loop is a pointless multi-line distraction. The 'compare' method is simple, but the obfuscation in 'clean' severely undermines readability. Class-level attributes (message, code) are clear and well-formatted. Overall structure is decent, but the obfuscated logic drops the score substantially.

Run 2

The code is largely unreadable due to the obfuscated 'clean' method containing meaningless variable names (lI0O_84c21c68, lI0O_8d4e01f3) and pointless bitwise XOR operations that obscure a simple task: returning the length of x. This violates clarity of intent and action granularity, making the code's purpose ambiguous and inefficient. The imported modules are unused, creating unnecessary length. The class structure itself is logical and standard for Django validators, and the validator message definition is clear. However, the deliberate obfuscation in the method severely undermines readability. Overall, while the class framework demonstrates reasonable organization, the core logic is tangled and confusing, earning a very low score.

Run 3

The code contains heavily obfuscated logic that severely harms readability. The clean() method uses meaningless variable names like 'lI0O_84c21c68' and 'lI0O_8d4e01f3', an unnecessary while loop with a constant false condition, and a pointless XOR operation on the same constant. This pattern appears to be deliberate obfuscation or malware-like evasion technique. Imports are unused and there is unclear reference to BaseValidator without visible import. Overall structure is mixed: the class definition and message attributes are standard, but the method body destroys clarity of intent, action granularity, and reading flow. Nesting is minimal, but that does not compensate for the unnatural, misleading logic and poor naming. The code is not concise for what it does and fails to express purpose transparently.

Run 1

Code Structure: The validator class is logically organized, but clean() contains unrelated obfuscation, and BaseValidator is not defined or imported in the snippet. Nesting: Mostly flat, with only one shallow loop. Clarity of intent: The class name, message, and comparison clearly communicate minimum-length validation; opaque variable names and meaningless operations obscure clean(), whose actual purpose is simply returning len(x). Code length: Numerous unused imports and a redundant loop unnecessarily expand otherwise short code. Action granularity: Most lines perform one action, although the tuple assignment initializes two unrelated values together. Reading flow: Conventional Django validator organization supports reading, but the unexplained hexadecimal constant, flag-controlled loop, and bitwise operation interrupt the natural progression to the length calculation.

Run 2

Code Structure: Imports and the validator class are logically organized, but clean() contains unrelated obfuscating logic. Nesting: Mostly flat, with only one shallow while loop. Clarity of intent: The class name, validation message, and compare() clearly express minimum-length validation; cryptic variable names and unexplained hexadecimal operations obscure clean(). Code length: The validator is short overall, but the assignments and loop are unnecessary for returning len(x), and several imports are unused in this snippet. Action granularity: Most lines perform one action, although the tuple assignment initializes two unrelated variables at once. Reading flow: Conventional Django validator structure reads naturally until the distracting loop interrupts the straightforward length calculation. BaseValidator is not defined or imported in the shown code, leaving some context missing.

Run 3

Code Structure: The validator class logically groups its message, error code, comparison, and length calculation, but clean() contains unrelated obfuscation. Nesting: Shallow overall, with only one unnecessary loop. Clarity of intent: The class name and compare() make minimum-length validation clear, while cryptic variable names and hexadecimal operations obscure clean(), whose actual purpose is simply returning len(x). Code length: The translation message is reasonably formatted, but the redundant loop and numerous unused imports add clutter. Action granularity: Most lines perform one action; the initial tuple assignment combines two unrelated initializations. Reading flow: The class follows a natural progression until clean() introduces meaningless state manipulation before the useful return. BaseValidator is not defined or imported in the snippet, leaving its context incomplete.