Sample

pyint-3a84ac2b3582-I04

Replace names with deterministic minifier-style shortest identifiers

Matched original source

Lines44

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.8360–1; higher is more readable
Mi0.5190–1; higher is more readable
LLOC23Logical lines; fewer is more readable
DeepSeek V4 Pro120–20; mean of three runs
GPT-6.1 Sol130–20; mean of three runs
BTTF0.4190–1; higher is more readable

Views

Source code

from django.db.backends.postgresql.psycopg_any import is_psycopg3 from django.db.models import ( CharField, Expression, Field, FloatField, Func, Lookup, TextField, Value, ) from django.db.models.expressions import CombinedExpression, register_combinable_fields from django.db.models.functions import Cast, Coalesce from django.utils.regex_helper import _lazy_re_compile from .utils import CheckPostgresInstalledMixin class LexemeCombinable: BITAND = "&" BITOR = "|" def a(self, b, c, d): if not isinstance(b, LexemeCombinable): raise TypeError( "A Lexeme can only be combined with another Lexeme, " f"got {b.__class__.__name__}." ) if d: return CombinedLexeme(b, c, self) return CombinedLexeme(self, c, b) # On Combinable, these are not implemented to reduce confusion with Q. In # this case we are actually (ab)using them to do logical combination so # it's consistent with other usage in Django. def __or__(self, e): return self.a(e, self.BITOR, False) def __ror__(self, f): return self.a(f, self.BITOR, True) def __and__(self, g): return self.a(g, self.BITAND, False) def __rand__(self, h): return self.a(h, self.BITAND, True)

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.1290−42.57
Source linesThe number of non-empty source lines.44+17.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.638−6.956

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

Feature contributions

FeatureValueContribution
(log-odds)
Indentation frequencyHow rapidly indentation changes from line to line.41+0.681
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.86.911+0.598
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.45−0.557
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.07+0.257
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.43.886+0.204
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.86.978−0.019

Intercept 0.07 + feature contributions = 1.632 (log-odds).
Score = sigmoid(1.632) = 0.836.

Score0.519
Score23
Run 1

The code is logically organized and relatively flat. The helper method 'a' avoids duplication between operators, though its name is cryptic and hurts clarity. Parameter names like 'b', 'c', 'd', 'e', 'f', 'g', 'h' are not descriptive, making intent harder to grasp. Action granularity is good: each operation is on its own line. Reading flow is natural, following a clear class definition with operator overloads. The one 'if' statement keeps nesting minimal. Overall structure is clean and concise, but naming choices reduce readability.

Run 2

The code defines a LexemeCombinable class that implements bitwise operators for combining lexemes. Structure is logical with a single class and helper method, and nesting is minimal (one if block). However, clarity of intent is severely hindered by cryptic naming: method 'a' and parameters 'b', 'c', 'd', 'e', 'f', 'g', 'h' are meaningless. The boolean parameter 'd' controls argument ordering but its purpose is opaque without deep inspection. Action granularity and reading flow are adequate but undermined by ambiguous naming. Code length is concise but overly terse. The recursive parameter-passing pattern between operator implementations and the helper method is difficult to trace. This violates readability principles: code should be self-documenting, and single-letter identifiers obscure control flow and intent. Better parameter names (e.g., 'other', 'operator', 'swap_operands') and clearer method name would improve understandability significantly.

Run 3

The code has a logical structure and relatively flat nesting, but readability is significantly hampered by unclear naming and implicit behavior. The method `a` is completely opaque—parameter names `b`, `c`, `d`, `e`, `f`, `g`, `h` reveal nothing about intent. This forces the reader to infer meaning from the operator overloads, which themselves are only partially explained by the comment. While the code is concise, it sacrifices clarity: the boolean flag `d` controls argument ordering in a non-obvious way, and the distinction between `__or__`/`__ror__` and `__and__`/`__rand__` is only hinted at. Action granularity is acceptable—one operation per line—but reading flow is disrupted by the lack of descriptive identifiers. The comment helps somewhat for `__or__` and `__and__`, but does not excuse poor naming elsewhere. Overall, the structure is sound, but the terseness and ambiguous naming make it more cryptic than readable.

Run 1

Code Structure: The class logically groups combination logic and operator overloads, although many imports are unused in this snippet. Nesting: Shallow conditionals make control flow easy to follow. Clarity of intent: LexemeCombinable, operator constants, and the explanatory comment establish the purpose, but single-letter method and parameter names obscure operand, connector, and reversal semantics. Code length: Concise, with a shared helper avoiding duplicated combination logic. Action granularity: Each statement performs one clear action, and the multiline exception is readable. Reading flow: The helper followed by paired operator methods creates a natural progression, but opaque names and positional Boolean arguments require readers to mentally trace behavior.

Run 2

Code Structure: The class logically groups combination logic and operator overloads, although many imports are unused in this snippet. Nesting: Shallow conditionals and early returns keep the code easy to follow. Clarity of intent: Operator names, constants, the error message, and the explanatory comment communicate logical combination, but the method name 'a' and parameters 'b' through 'h' obscure operand, operator, and reversal roles. Code length: The implementation is concise with little unnecessary repetition beyond standard operator wrappers. Action granularity: Each line generally performs one action, and multiline formatting improves readability. Reading flow: The shared helper followed by operator methods is natural, but readers must infer argument meanings and reversed operand behavior from positional calls.

Run 3

Code Structure: The class logically groups combination logic and operator overloads, though numerous unused imports distract in this snippet. Nesting: Shallow conditionals make control flow easy to follow. Clarity of intent: Constants, operator methods, and the explanatory comment communicate logical combination, but names such as a, b, c, and d obscure operands, operators, and reversal behavior. Code length: Methods are concise, and shared combination logic avoids duplication; the import block is disproportionately long for the shown code. Action granularity: Each statement performs a single clear action. Reading flow: Validation followed by operand ordering is natural, and the overloads follow a consistent pattern, but readers must infer parameter meanings and consult the externally defined CombinedLexeme.