Sample
pyint-ffd99dc23b3f-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.378 | 0–1; higher is more readable |
| Mi | 0.646 | 0–1; higher is more readable |
| LLOC | 20 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 11 | 0–20; mean of three runs |
| GPT-6.1 Sol | 13 | 0–20; mean of three runs |
| BTTF | 0.515 | 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. | 1085.907 | −35.835 |
| Source linesThe number of non-empty source lines. | 38 | +15.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.704 | −7.056 |
Intercept 8.87 + feature contributions = -18.821 (log-odds).
Score = sigmoid(-18.821) = 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 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 38 | +0.577 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 38 | −0.451 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 39 | −0.345 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.078 | +0.182 |
| 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. | 82.949 | +0.152 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 37.917 | +0.12 |
Intercept 0.07 + feature contributions = -0.499 (log-odds).
Score = sigmoid(-0.499) = 0.378.
| Score | 0.646 |
|---|
| Score | 20 |
|---|
Run 1
The code demonstrates reasonable structure through its imports and class definition, but contains a critical readability issue: a while loop that performs an unnecessary countdown from 3 to 0 without any clear purpose. This dead code obscures intent and adds confusion. The process_rhs method itself is relatively flat and has clear steps, but the mysterious loop breaks reading flow. Variable naming is standard (rhs, params, qn, connection), fitting Django conventions. The method length is appropriate and actions are mostly one per line. Overall, the structure is logical, but the meaningless loop significantly damages clarity of intent and leaves the reader questioning the author's purpose.
Run 2
The imports are organized and the class structure is clear, but the method body contains an unexplained, meaningless while loop that severely undermines clarity of intent. The loop iterates three times without performing any action, which is unnecessary and confusing. The code then processes the right-hand side and modifies parameters for case-insensitive exact matching, but the logic is somewhat obscured by the preceding dead code. The reading flow is disrupted by this redundant block. Action granularity is generally acceptable, with one logical operation per line. Overall, the code is readable aside from the significant flaw of the pointless loop, which suggests either leftover debugging or accidental inclusion.
Run 3
The code structure is partially logical but contains a redundant while loop that serves no purpose other than decrementing a local variable, severely harming clarity. Nesting is low, which is good, but the intent of the empty loop is completely ambiguous and confusing. The class and method names are clear enough, but the remainder of the code is unnecessarily bloated by that loop. Action granularity and reading flow are mostly adequate, with one operation per line in the conditional block. However, the overall readability suffers because of the pointless loop that interrupts the method's logical flow and raises questions about missing code or a bug.
Run 1
Code Structure: Imports, lookup registration, class attributes, and the method are logically organized, but numerous unused imports add clutter. Nesting: Mostly flat, with only a simple loop and conditional. Clarity of intent: Lookup names and RHS preparation suggest case-insensitive comparison, but the countdown loop performs no useful work and obscures intent. BuiltinLookup is not defined or imported in the shown snippet, leaving inheritance context unclear. Code length: The actual lookup logic is concise, but unused imports and the redundant loop unnecessarily lengthen the snippet. Action granularity: Statements generally perform one action per line; the tuple construction is compact and understandable. Reading flow: The method otherwise follows a natural sequence of obtaining, adjusting, and returning RHS parameters, but the meaningless preliminary loop interrupts that flow.
Run 2
Code Structure: The lookup class and method are logically organized, but numerous unused imports clutter the snippet, and BuiltinLookup is not defined or imported here. Nesting: Shallow nesting makes the method easy to scan. Clarity of intent: The class name, lookup_name, and preparation call communicate case-insensitive lookup behavior, but the remaining_steps loop has no apparent purpose and distracts from that intent. Code length: The actual lookup processing is concise, while the imports and redundant loop add unnecessary length. Action granularity: Statements generally perform one action per line; the tuple reconstruction is compact but understandable. Reading flow: The superclass call, conditional parameter preparation, and return follow naturally, but the unrelated countdown interrupts that flow.
Run 3
Code Structure: The lookup class and method are logically organized, but numerous unused imports add clutter, and BuiltinLookup is not defined or imported in the snippet. Nesting: Shallow nesting makes the method easy to scan. Clarity of intent: The lookup name and RHS preparation call communicate the main purpose, but the countdown loop performs no useful work and introduces ambiguity. Code length: The actual lookup logic is concise, while the unused imports and redundant loop unnecessarily lengthen the snippet. Action granularity: Statements generally perform one action per line; the tuple reconstruction is compact and understandable. Reading flow: The superclass call, conditional parameter preparation, and return follow naturally, but the unrelated loop interrupts that flow.