Sample
pyint-1fa9899cba62-I09
Select one of ten low-readability unrelated code templates per class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.752 | 0–1; higher is more readable |
| Mi | 0.377 | 0–1; higher is more readable |
| LLOC | 23 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 7 | 0–20; mean of three runs |
| GPT-6.1 Sol | 11.33 | 0–20; mean of three runs |
| BTTF | 0.191 | 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. | 939.489 | −31.003 |
| Source linesThe number of non-empty source lines. | 30 | +12 |
| 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.746 | −7.12 |
Intercept 8.87 + feature contributions = -17.253 (log-odds).
Score = sigmoid(-17.253) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 76.516 | +0.43 |
| 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. | 76.968 | +0.405 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.071 | +0.249 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 28 | +0.231 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 28 | −0.222 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 31 | −0.061 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 29.744 | +0.006 |
Intercept 0.07 + feature contributions = 1.108 (log-odds).
Score = sigmoid(1.108) = 0.752.
| Score | 0.377 |
|---|
| Score | 23 |
|---|
Run 1
The code is generally readable, with clear intent and sensible structure, but it includes a suspicious, obfuscated block in `check()` that appears to be dead code or an artifact of obfuscation. This block (`lI0O_a7d7ff2f`) adds unnecessary complexity and obscures an otherwise simple type check. The code is mostly flat, concise, and uses descriptive method names, which helps readability. However, the obfuscated variable and pointless conditional logic violate clarity of intent and add cognitive overhead. The remaining methods are straightforward and follow a clear pattern of serialization. Overall, it would be highly readable without the dead code block.
Run 2
The code fails on nearly all readability criteria. The `check` method contains absurd, non-functional obfuscation: a variable named `lI0O_a7d7ff2f` initialized to zero, followed by conditionals that never execute and do nothing. This obscures the trivial and clear intent of `isinstance(value, dict)`. The structure is tangled and misleading, with dead code that confuses rather than clarifies. Nesting is shallow but unnecessary. The `tag = to_json` alias creates redundant indirection without value. Reading flow is broken by this nonsense block. Action granularity is acceptable, but clarity of intent is destroyed. The only readable parts are the imports and docstring, both of which are standard. Overall, this code would be unacceptable in any production codebase and is nearly unreadable, despite being functionally simple once the dead code is removed.
Run 3
The code is highly unreadable due to a nonsensical variable name and meaningless obfuscation logic in the check method. The dummy conditional block with random variable lI0O_a7d7ff2f adds confusion and obscures intent. Import statements are unnecessarily verbose (multiple lines for simple imports from the same module). The class structure is mostly flat and logical, but the check method's bizarre logic violates clarity of intent and action granularity. The to_json method is clear and concise, and comments there aid understanding, but overall the code's readability is severely impacted by the obfuscation and inconsistent style.
Run 1
Code Structure: Imports and class methods are logically organized, but the check method contains unrelated dead code. Nesting: Most code is flat; the unnecessary nested conditionals add avoidable complexity. Clarity of intent: Dictionary detection and value tagging are clear, but the cryptic variable and bitwise expressions obscure the check method's simple purpose. Code length: The snippet is short overall, yet several lines could be replaced by a direct isinstance return. Action granularity: Each statement generally performs one action, and the dictionary comprehension is compact and conventional. Reading flow: The class reads naturally except for the distracting obfuscation before the dictionary check. The undefined-in-snippet JSONTag base also requires external context.
Run 2
Code Structure: The class and methods are logically organized, but unrelated imports and dead logic clutter the snippet. Nesting: The nested conditional in check is unnecessary and distracts from an otherwise flat implementation. Clarity of intent: Method names, type hints, and the JSON-key comment clarify the purpose, while the cryptic variable and bitwise operations obscure a simple dictionary type check. Code length: The implementation is unnecessarily long because the obfuscating block has no effect on the result. Action granularity: Each statement generally performs one action, although the bitwise condition is needlessly complex. Reading flow: The progression from check to serialization is natural, but the irrelevant computations interrupt it; JSONTag's definition is also absent from the provided context.
Run 3
Code Structure: The class and methods are logically organized, but numerous unused imports and an unexplained JSONTag base class distract from the small implementation. Nesting: The dictionary conversion is flat, while check contains unnecessary nested conditionals. Clarity of intent: Method names, type hints, and the comment clarify dictionary handling, but the obfuscated variable and irrelevant bitwise arithmetic obscure an otherwise simple type check. Code length: The snippet is unnecessarily long because of imports and dead logic that could be removed without changing behavior. Action granularity: Statements generally perform one action per line; the dictionary comprehension is compact and understandable. Reading flow: The progression from checking a value to converting it and defining an alias is natural, but the meaningless logic interrupts that flow.