Sample
pyint-f806c2a2d855-I08
Select one of ten high-readability unrelated code templates per class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.362 | 0–1; higher is more readable |
| Mi | 0.623 | 0–1; higher is more readable |
| LLOC | 18 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 7.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 14 | 0–20; mean of three runs |
| BTTF | 0.359 | 0–1; higher is more readable |
Views
Loading feature diagnosis…
Source regions
Feature contributions
Feature contributions
| Feature | Value | Contribution (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. | 1230.842 | −40.618 |
| Source linesThe number of non-empty source lines. | 26 | +10.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.61 | −6.914 |
Intercept 8.87 + feature contributions = -28.262 (log-odds).
Score = sigmoid(-28.262) = 0.
Feature contributions
| Feature | Value | Contribution (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.075 | +0.214 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 26 | −0.176 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 26 | +0.162 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 27 | +0.08 |
| 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. | 88 | −0.062 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 25.82 | −0.049 |
Intercept 0.07 + feature contributions = -0.565 (log-odds).
Score = sigmoid(-0.565) = 0.362.
| Score | 0.623 |
|---|
| Score | 18 |
|---|
Run 1
The code structure is muddled by unrelated temperature logic inside a database lookup method, obscuring intent. Nesting is shallow but the spheroid expression is compressed. Action granularity is mixed—some lines do one thing, others do multiple. Reading flow is disrupted by the irrelevant temperature block. Variable names like 'sql' and 'dist_sql' are unclear. Overall, it is longer than needed and fails to clearly express its purpose.
Run 2
The code has some strengths but also significant issues. The imports are logical, and the function is relatively short. However, the big problem is the presence of unrelated, dead code: four variables about temperature (morning_temperature, evening_temperature, lower_temperature) are defined and manipulated but never used. This severely hurts clarity of intent and reading flow, as a reader must first wade through meaningless logic before reaching the actual purpose of the method. Structure and nesting are okay — only one conditional exists, and it is flat. Code length is fine, but the irrelevant block makes it longer than necessary. Action granularity is acceptable, with assignment and return statements on individual lines. Overall, the core logic is understandable once the dead code is ignored, but the presence of that unrelated block makes the code ambiguous and confusing, dragging the score down significantly.
Run 3
The code has several readability problems. The `as_sql` method contains unrelated logic—temperature variables (`morning_temperature`, `evening_temperature`, `lower_temperature`) that appear to be leftover or debugging code, making the intent ambiguous. The method performs multiple actions without clear separation: temperature computation, spheroid detection, expression compilation, and SQL assembly. The ternary-like `spheroid` assignment combines a boolean expression with `or None`, reducing clarity. Multiple actions occur per line, especially in the final return statement where string formatting and tuple unpacking are compressed. Variable names like `sql`, `params`, `dist_sql`, `dist_params` are generic and do not convey their roles well. The reading flow jumps from unrelated temperature logic to database operations, confusing the reader. The nested expression `compiler.compile(distance_expr.resolve_expression(compiler.query))` buries important operations. Overall, the code is difficult to follow and maintain.
Run 1
Code Structure: The method is logically organized around building and compiling a distance expression, but unrelated temperature calculations disrupt cohesion. Nesting: Only one shallow conditional keeps complexity low. Clarity of intent: Descriptive names and GIS operations communicate the main purpose, while unused temperature variables, unused imports, and the unexplained spheroid-or-None expression add ambiguity. Code length: The SQL generation is reasonably concise, but irrelevant statements unnecessarily lengthen the snippet. Action granularity: Most statements perform one clear action; compiling a resolved expression combines two operations but remains readable. Reading flow: Expression construction, compilation, distance processing, and return follow a natural sequence, although the temperature block distracts from that flow.
Run 2
Code Structure: The method has a coherent SQL-generation sequence, but unrelated temperature calculations and apparently unused imports add clutter. Nesting: Only one shallow conditional; the code is easy to scan. Clarity of intent: Lookup-related names and method calls convey the main purpose, while the unused temperature variables distract and the spheroid expression requires interpretation. Code length: The core implementation is concise, but the temperature block is unnecessary. Action granularity: Most lines perform one action; nested calls in compilation modestly increase reading effort. Reading flow: Distance-expression creation, compilation, parameter processing, and return follow a natural progression, disrupted by the irrelevant opening block. The base class is not defined or imported in the snippet, limiting standalone understanding.
Run 3
Code Structure: The lookup logic is organized within a single method, but unrelated temperature calculations disrupt cohesion. Nesting: Only one shallow conditional keeps the code easy to follow. Clarity of intent: Descriptive GIS method and variable names clarify SQL generation, while unused temperature variables, the missing definition or import of DistanceLookupBase, and the boolean-or-None spheroid expression reduce clarity. Code length: The method is compact, but irrelevant calculations and apparently unused imports add clutter. Action granularity: Most lines perform one action; nested compilation and expression resolution slightly increase cognitive load. Reading flow: SQL expression creation, compilation, distance processing, and return follow a natural sequence, though the temperature block interrupts that flow.