Sample
pyint-00d8e68cd80f-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.667 | 0–1; higher is more readable |
| Mi | 0.643 | 0–1; higher is more readable |
| LLOC | 21 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 12 | 0–20; mean of three runs |
| GPT-6.1 Sol | 14.67 | 0–20; mean of three runs |
| BTTF | 0.387 | 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. | 746.61 | −24.638 |
| Source linesThe number of non-empty source lines. | 25 | +10 |
| 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.649 | −6.974 |
Intercept 8.87 + feature contributions = -12.742 (log-odds).
Score = sigmoid(-12.742) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| 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. | 59.962 | +1.126 |
| 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.068 | +0.277 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 25 | −0.153 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 25 | +0.128 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 26 | +0.116 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 24.689 | −0.065 |
Intercept 0.07 + feature contributions = 0.694 (log-odds).
Score = sigmoid(0.694) = 0.667.
| Score | 0.643 |
|---|
| Score | 21 |
|---|
Run 1
The code defines a PassList class that serializes list items using a parent serializer, but contains a confusing, dead-code while loop (`remaining_steps = 3; while remaining_steps > 0: remaining_steps -= 1`) that serves no purpose and harms readability. The class itself is small and mostly clear: the check method is straightforward, and to_json is concise. However, the redundant loop obscures intent, adds unnecessary length, and disrupts reading flow. Nesting is low and structure is otherwise logical, but the meaningless loop drastically lowers clarity and action granularity. Imports are organized, but many appear unused in this snippet, adding noise. Overall, the code is understandable but marred by dead code and unused imports, suggesting a need for cleanup before it could be considered highly readable.
Run 2
The code structure is partially clear with a single class and method definitions, but the 'check' and 'to_json' methods are trivial and the while loop with 'remaining_steps' appears to be a deliberate no-op placeholder that adds confusion rather than functionality. The intent of the loop is ambiguous and unnecessary, hurting readability. Nesting is flat, which is good, but action granularity suffers due to the list comprehension combining iteration and serialization in one expression. The import block is organized but includes unused modules. Overall, the code is concise but contains an odd, purposeless construct that obscures intent.
Run 3
The code has a clear class structure and imports are organized, but there's a confusing while loop in to_json that serves no purpose (decrementing remaining_steps from 3 to 0 without any effect). This dead code obscures the actual intent, which is simply to serialize list items. The method could be a single line return statement. Action granularity is poor in that loop - multiple meaningless operations. The tag alias adds minor confusion (tag = to_json) without clear benefit. Overall the code is readable at a surface level but the pointless loop makes the logic ambiguous and unnecessarily longer than needed.
Run 1
Code Structure: Imports and a small class are logically organized, though several imports are unused in the snippet and JSONTag is not defined or imported. Nesting: Very shallow, with only a simple loop and list comprehension. Clarity of intent: check clearly identifies lists, and to_json tags their elements, but the remaining_steps loop performs no meaningful work and obscures the purpose. Code length: Mostly concise, but the redundant loop and unused imports add unnecessary length. Action granularity: Each statement occupies its own line, and the comprehension expresses a single transformation cleanly. Reading flow: Method order is natural and formatting is consistent, although the pointless loop interrupts the transformation logic and the tag alias requires a small interpretive step.
Run 2
Code Structure: The class is logically organized into small methods, but numerous unused imports and the undefined JSONTag base class distract from its purpose. Nesting: The code is shallow, with only one simple loop. Clarity of intent: check clearly identifies lists, and the comprehension clearly tags their elements; however, the pointless countdown loop obscures intent, and tag = to_json may require contextual knowledge. Code length: The methods are concise overall, but the countdown and unused imports add unnecessary length. Action granularity: Each statement performs one action, and the list comprehension is compact without being difficult to read. Reading flow: The class reads naturally from checking to serialization, but irrelevant imports and the no-op loop interrupt the flow.
Run 3
Code Structure: Imports and a small class are logically organized, though JSONTag is not defined or imported in the snippet and several imports appear unused. Nesting: Methods are shallow, with only one simple loop. Clarity of intent: check clearly identifies lists, and the comprehension clearly tags each item; however, the countdown loop has no apparent purpose and distracts from serialization. Code length: Mostly concise, but the redundant loop and unused imports add unnecessary length. Action granularity: Each statement performs a single action, and the comprehension is easy to understand. Reading flow: Method order is natural and tag = to_json provides a compact alias, but unrelated imports and the unexplained loop interrupt the flow.