Sample
pyint-99a4b85217f3-I03
Replace names with length-matched meaningful but unrelated identifiers
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.828 | 0–1; higher is more readable |
| Mi | 0.182 | 0–1; higher is more readable |
| LLOC | 20 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 8 | 0–20; mean of three runs |
| GPT-6.1 Sol | 13.67 | 0–20; mean of three runs |
| BTTF | 0.45 | 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. | 1260.698 | −41.603 |
| Source linesThe number of non-empty source lines. | 32 | +12.8 |
| 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.719 | −7.079 |
Intercept 8.87 + feature contributions = -27.012 (log-odds).
Score = sigmoid(-27.012) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 85 | +0.567 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.052 | +0.435 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 33 | −0.132 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 25 | +0.128 |
| 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. | 84.939 | +0.068 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 31.837 | +0.035 |
Intercept 0.07 + feature contributions = 1.569 (log-odds).
Score = sigmoid(1.569) = 0.828.
| Score | 0.182 |
|---|
| Score | 20 |
|---|
Run 1
The code is difficult to read due to deeply nested logic, unclear variable names, and inconsistent naming conventions. The comments do not clarify variable purposes. The `delete` method mixes multiple responsibilities (clause splitting, SQL generation, exception handling) in one block. Variable names like `token`, `record`, `balance`, `region`, `duration`, `source`, `localItem`, and `pendingEvent` obscure intent. The exception handling flow disrupts natural reading. The overall structure lacks modularity and clear separation of concerns.
Run 2
The code has a clear structure and follows Django compiler conventions, but readability is reduced by unclear variable names. Names like 'token', 'record', 'balance', 'duration', 'source', 'region', 'localItem', and 'pendingEvent' obscure the intent—these appear to be placeholders or obfuscated names that don't reflect their actual purpose (e.g., 'duration' likely represents FROM clause SQL fragments). The nesting level is low, which is good, and the control flow is straightforward. However, the try/except/else pattern adds cognitive overhead, and the comment partially explains the logic but doesn't clarify the variable roles. The code is concise and maintains one action per line, but the reading flow suffers because the domain logic is not immediately apparent due to poor naming. Action granularity is adequate, and the overall organization aligns with Django's SQL compiler patterns, but the intent remains ambiguous without additional context.
Run 3
The code has a clear purpose but suffers from poor readability due to cryptic variable names (region, duration, source, token, localItem, pendingEvent) that obscure their roles. The single delete() method mixes multiple responsibilities: constructing SQL fragments, handling exceptions, and managing tuple parameters. Nesting is shallow, which is good, but the flow is disjointed—variables are built incrementally with side effects (source.extend) inside an except/else block, making the final return value hard to trace. Comments help explain the 'why' but not the 'what' of variable names. Action granularity is generally one per line, yet lines like tuple(source) and the assignment of localItem, pendingEvent compress multiple actions. The code lacks helper methods to isolate WHERE compilation and FROM clause handling. Overall, it requires careful reading to understand the SQL assembly logic and data flow.
Run 1
Code Structure: The method is logically organized into eligibility checks, SQL construction, condition compilation, and return. Nesting: Shallow nesting and an early return keep control flow manageable; the try/except/else adds modest complexity. Clarity of intent: Detailed comments explain the optimization and SQL limitations, but unrelated names such as token, record, balance, region, duration, and pendingEvent obscure what the values represent. Mixed naming styles also reduce consistency. Code length: The implementation is concise, although several imports are unused in this snippet. Action granularity: Statements generally perform one action per line; tuple unpacking groups related results appropriately. Reading flow: Execution proceeds naturally from checks to query assembly, but understanding the misleading variable names and inherited compiler behavior requires additional effort.
Run 2
Code Structure: The method is logically organized into eligibility checks, SQL construction, condition compilation, and return, though several imports appear unused. Nesting: Shallow nesting and an early return keep complexity manageable. Clarity of intent: Explanatory comments clearly justify the specialized DELETE syntax, but arbitrary names such as token, record, balance, region, duration, localItem, and pendingEvent obscure their SQL roles. Code length: The implementation is reasonably concise without excessive abstraction. Action granularity: Most lines perform one operation; tuple unpacking naturally groups related results. Reading flow: Execution proceeds naturally, but inconsistent naming styles and the empty FullResultSet handler require additional interpretation.
Run 3
Code Structure: Imports and a focused compiler subclass provide logical organization, although several imports are unused. Nesting: Shallow control flow and an early return keep complexity manageable. Clarity of intent: Detailed comments explain the SQL optimization and limitations, but names such as token, record, balance, region, duration, and pendingEvent obscure their actual roles. The method name delete also contrasts with its SQL-generation behavior and delegation to as_sql. Code length: The implementation is compact without excessive fragmentation; comments are useful rather than redundant. Action granularity: Most lines perform one operation, and tuple unpacking is reasonable. Reading flow: The progression from eligibility checks through query construction to return is natural, but misleading variable names and mixed naming conventions repeatedly interrupt comprehension.