Sample
pyint-d86bcf3a3f06-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.697 | 0–1; higher is more readable |
| Mi | 0.484 | 0–1; higher is more readable |
| LLOC | 29 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 7.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 13.33 | 0–20; mean of three runs |
| BTTF | 0.351 | 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. | 1535.276 | −50.664 |
| Source linesThe number of non-empty source lines. | 45 | +18 |
| 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.747 | −7.121 |
Intercept 8.87 + feature contributions = -30.915 (log-odds).
Score = sigmoid(-30.915) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 41 | +0.681 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 45 | −0.557 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 41 | −0.52 |
| 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. | 75.935 | +0.449 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 76 | +0.422 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 44.727 | +0.215 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.089 | +0.075 |
Intercept 0.07 + feature contributions = 0.835 (log-odds).
Score = sigmoid(0.835) = 0.697.
| Score | 0.484 |
|---|
| Score | 29 |
|---|
Run 1
This code is largely unreadable. The LookupDict class ignores its dict superclass, storing everything in __dict__ and overriding get/__getitem__ incorrectly, creating unclear and likely buggy behavior. The __getattr__ method contains obfuscated junk lines (lI0O_0b09dc52) that serve no functional purpose and severely hurt clarity. There are unjustified type: ignore comments and inconsistent type handling. The class mixes two different storage models (dict vs __dict__) with high ambiguity. Structure and intent are unclear, nesting is low but the logic is tangled, and the reading flow is poor due to unexplained code and misleading naming.
Run 2
The code has a clear class structure with a straightforward purpose, and type hints are present which aids clarity. Flat nesting and concise methods are positives. However, readability is undermined by an unnecessary obfuscated block in __getattr__ (the meaningless variable assignments and bitwise operations) that serves no functional purpose and confuses intent. The comment about type checkers also lacks sufficient context. Overall structure and flow are acceptable, but the artificial obfuscation and ambiguous comments lower the score significantly.
Run 3
The code suffers from poor readability due to several issues. Obfuscated variable names (lI0O_0b09dc52) with meaningless bitwise operations add unnecessary complexity and confusion, making intent unclear. The class inheritance from dict but overriding methods to use __dict__ storage creates ambiguous, inconsistent behavior. Moderate nesting and structure are acceptable, but the artificial obfuscation obscures purpose. Action granularity is violated by multiple operations per line, and reading flow is disrupted by unexpected logic. Some sections have clear comments and type hints, but overall the code prioritizes obscurity over clarity, drastically reducing maintainability.
Run 1
Code Structure: Methods are logically grouped in a compact class, although several imports are unused and referenced type variables are not defined in the snippet. Nesting: Shallow conditionals keep control flow easy to follow. Clarity of intent: Method names, annotations, and comments explain lookup behavior, but the cryptic variable and meaningless bitwise operations in __getattr__ obscure its purpose. Code length: Mostly concise; the injected calculations and unnecessary else after return add avoidable bulk. Action granularity: Each statement performs a single action, making individual steps easy to scan. Reading flow: Conventional method ordering and formatting support natural reading, but irrelevant operations interrupt the attribute-lookup logic. Using instance attributes rather than dictionary entries is unusual and could benefit from clearer documentation.
Run 2
Code Structure: Methods are logically grouped in a small class, but unused imports and unexplained type variables distract. Nesting: Mostly flat, with only shallow conditionals; the else after a return is unnecessary. Clarity of intent: Lookup behavior is understandable from method names and comments, but the cryptic variable and meaningless bitwise operations obscure __getattr__. Code length: Generally concise, although the injected arithmetic and redundant conditional add unnecessary length. Action granularity: Statements generally perform one action per line, with compact overload declarations remaining readable. Reading flow: The class progresses naturally from initialization to representation and lookup methods, but irrelevant arithmetic interrupts the main logic, and inconsistent blank spacing adds minor friction.
Run 3
Code Structure: Methods are logically grouped in a small class, but unused imports and unexplained type variables weaken self-contained readability. Nesting: Mostly flat, with only shallow conditionals; the else after return is unnecessary. Clarity of intent: Lookup behavior and overloads are understandable, but the cryptic variable and irrelevant hexadecimal/bitwise operations obscure __getattr__ without supporting its purpose. Code length: Generally concise, though the dead computation and redundant branching add avoidable length. Action granularity: Statements mostly perform one action per line, but the compound bitwise expression increases cognitive load. Reading flow: Familiar method organization and useful comments support navigation, while the unrelated computation abruptly interrupts the attribute-lookup logic.