Sample

pyint-437cfd594365-I04

Replace names with deterministic minifier-style shortest identifiers

Matched original source

Lines21

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.4050–1; higher is more readable
Mi0.5750–1; higher is more readable
LLOC13Logical lines; fewer is more readable
DeepSeek V4 Pro8.330–20; mean of three runs
GPT-6.1 Sol110–20; mean of three runs
BTTF0.2510–1; higher is more readable

Views

Source code

from django.contrib.gis.db.models.fields import BaseSpatialField from django.contrib.gis.measure import Distance from django.db import NotSupportedError from django.db.models import Expression, Lookup, Transform from django.db.models.sql.query import Query from django.utils.regex_helper import _lazy_re_compile class DistanceLookupFromFunction(DistanceLookupBase): def a(self, b, c): d = ( len(self.rhs_params) == 2 and self.rhs_params[-1] == "spheroid" ) or None e = c.ops.distance_expr_for_lookup( self.lhs, self.rhs, spheroid=d ) f, g = b.compile(e.resolve_expression(b.query)) h, i = self.process_distance(b, c) return ( "%(func)s %(op)s %(dist)s" % {"func": f, "op": self.op, "dist": h}, (*g, *i), )

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.1106.954−36.529
Source linesThe number of non-empty source lines.21+8.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.647−6.971

Intercept 8.87 + feature contributions = -26.231 (log-odds).
Score = sigmoid(-26.231) = 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
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.78.955+0.321
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.22+0.257
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.20.837−0.119
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.21−0.061
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.101−0.039
Indentation frequencyHow rapidly indentation changes from line to line.21−0.011

Intercept 0.07 + feature contributions = -0.386 (log-odds).
Score = sigmoid(-0.386) = 0.405.

Score0.575
Score13
Run 1

The code is difficult to read due to meaningless variable names (a, b, c, d, e, f, g, h, i) that obscure their purpose. The method 'a' gives no indication of its functionality. The expression `len(self.rhs_params) == 2 and self.rhs_params[-1] == 'spheroid'` or None is confusing logic that returns None instead of False. Multiple operations are packed into single lines, violating the one-action-per-line principle. The string formatting with positional variables (func, op, dist) makes the return statement opaque. While the code is relatively flat (no deep nesting), it lacks clarity of intent. The structure follows a logical sequence but is poorly named. Overall, this code requires significant effort to understand despite being short. Better variable names, clearer boolean logic, and splitting complex expressions would dramatically improve readability. The code appears to be a Django database lookup function, but the obfuscated naming makes it nearly unreadable.

Run 2

This code is extremely difficult to read due to heavily obfuscated names. Variables like 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i' give no indication of their purpose, making the logic almost impossible to follow without external context. The method name 'a' is equally unhelpful. While the code is relatively flat and concise, it mixes multiple actions into single lines (e.g., compiling expressions and unpacking results), and the intent of the operation is completely obscured by the opaque naming. The reading flow is poor because a reader must decode each variable's role by carefully tracing types and usage. The structure itself is not inherently tangled, but the lack of meaningful identifiers defeats the benefits of the otherwise simple structure.

Run 3

The code is a single method with clear structure: it computes a spheroid flag, obtains a distance expression, compiles it, processes distance, and returns formatted SQL with parameters. Nesting is minimal (one inline conditional and a boolean expression). Intent is somewhat obscured by cryptic parameter names (a, b, c, d, e, f, g, h, i) and reliance on internal Django ORM mechanisms. Length is appropriate for the task. Action granularity is reasonable, though the boolean expression on line 10 does multiple operations in one line. Reading flow is logical top-to-bottom. Overall, the pattern is consistent and the code is concise, but readability suffers from poor naming.

Run 1

Code Structure: The method follows a logical sequence: determine a flag, construct an expression, compile it, process distance, and return SQL with parameters. Nesting: It is flat, with no nested control flow. Clarity of intent: Domain-specific calls suggest a distance lookup, but the method name 'a' and variables 'b' through 'i' obscure roles and require readers to infer meaning. Code length: The implementation is concise, though several imports appear unused in this snippet. Action granularity: Each statement generally performs one cohesive action; tuple unpacking is appropriate, although compilation includes expression resolution inline. Reading flow: Execution order is natural and formatting is consistent, but anonymous identifiers make the data flow difficult to track. The absent definition or import of DistanceLookupBase also leaves some context unclear.

Run 2

Code Structure: The method follows a logical sequence: determine the spheroid option, build and compile an expression, process distance, and return SQL with parameters. Nesting: Flat control flow makes it easy to scan. Clarity of intent: The class name and API calls suggest a spatial distance lookup, but the method name 'a' and variables 'b' through 'i' obscure roles and require inference. Code length: The method is concise, though several unused imports add clutter in this snippet. Action granularity: Most statements perform one coherent action; tuple unpacking is appropriate, although expression resolution and compilation share a line. Reading flow: Execution order is natural, but cryptic identifiers and the subtle 'or None' conversion interrupt comprehension.

Run 3

Code Structure: The method is logically organized into constructing an expression, compiling it, processing distance, and returning SQL with parameters. Nesting: Minimal nesting makes the control flow easy to follow. Clarity of intent: The descriptive class and framework method names provide context, but the method name 'a' and variables 'b' through 'i' obscure roles and require readers to infer meaning. Code length: The implementation is concise, although some multiline formatting adds visual overhead. Action granularity: Each statement performs a distinct step; tuple unpacking naturally groups related outputs. Reading flow: The sequence is linear and coherent, but cryptic naming interrupts comprehension. Unused imports and a base class not defined in the snippet add contextual noise.