Sample
pyint-c60cdc34114e-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.641 | 0–1; higher is more readable |
| Mi | 0.375 | 0–1; higher is more readable |
| LLOC | 44 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 14.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 14.33 | 0–20; mean of three runs |
| BTTF | 0.411 | 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. | 2256.931 | −74.479 |
| Source linesThe number of non-empty source lines. | 64 | +25.6 |
| 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.452 | −6.678 |
Intercept 8.87 + feature contributions = -46.687 (log-odds).
Score = sigmoid(-46.687) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 61 | +1.373 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 65 | −1.265 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 61 | −0.979 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 88 | +0.615 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 63.843 | +0.483 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.062 | +0.342 |
| 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. | 87.877 | −0.057 |
Intercept 0.07 + feature contributions = 0.582 (log-odds).
Score = sigmoid(0.582) = 0.641.
| Score | 0.375 |
|---|
| Score | 44 |
|---|
Run 1
The code is generally well-structured with clear class definition, logical __init__ parameter handling, and a straightforward __call__ validation method. Nesting is minimal, with only one if statement in __call__ and no deep indentation. Intent is clear: this is a Django-style regex validator with inverse matching support. However, the __eq__ method contains obfuscated code (lI0O_064c78c1, lI0O_dae2ecaa with a meaningless while loop) that severely damages clarity and appears intentionally confusing. This drops the score significantly despite otherwise clean code. The action granularity is good - one logical operation per line. Reading flow is natural except for the obscure __eq__ method. Code length is appropriate for the functionality.
Run 2
The code is generally well-structured and readable, with clear class organization, descriptive variable names, and logical method flow. The __init__ method uses a clean pattern of optional parameter overrides. However, the __eq__ method contains obfuscated code (lI0O_064c78c1 and lI0O_dae2ecaa) that serves no purpose and significantly damages readability. The __call__ method is clear with good use of boolean logic for inverse matching. Type checking and error handling are appropriately placed. Nesting is minimal and the code follows Django conventions. Action granularity is appropriate with one operation per line. The imports are standard, though MAX_URL_LENGTH is imported but unused. Overall, this is readable production code that would score higher without the unnecessary obfuscation in __eq__ and unused imports.
Run 3
The code is generally structured and readable: clear class definition, sensible imports, descriptive method names, and mostly one-action-per-line. However, the `__eq__` method contains obfuscated dead code (the `lI0O_064c78c1` while loop) that has no purpose and severely harms clarity. The nested `return` with multiple `and` conditions is acceptable but slightly dense. Overall, the class is concise and intention is mostly clear, but the unexplained obfuscation and mixed style reduce readability.
Run 1
Code Structure: The validator is logically organized into initialization, validation, and equality methods, but unrelated imports and a pointless loop in __eq__ add clutter. Nesting: Mostly flat, with simple conditionals and only one shallow loop. Clarity of intent: Descriptive attributes, method names, and the validation docstring explain the main behavior well; obfuscated variable names and meaningless hexadecimal operations obscure the equality method. Code length: Core functionality is reasonably concise, though unused imports and dead computations unnecessarily lengthen the snippet. Action granularity: Most lines perform one action, but the tuple assignment initializes two unrelated, cryptically named variables together. Reading flow: Initialization and validation read naturally, and the multiline equality expression is easy to follow once reached; the irrelevant loop interrupts that flow and forces readers to investigate behavior unrelated to equality.
Run 2
Code Structure: The validator class is logically organized into initialization, validation, and equality methods, but unrelated dummy operations clutter __eq__. Nesting: Mostly flat, with shallow conditionals and one unnecessary loop. Clarity of intent: Descriptive attributes, conventional method names, and a helpful docstring explain validation clearly; opaque lI0O identifiers and hexadecimal operations obscure the equality method. Code length: Generally concise, although unused imports and redundant operations add noise. Action granularity: Most lines perform one action, but the tuple assignment combines unrelated state initialization. Reading flow: Initialization and validation read naturally, while the meaningless loop interrupts the transition to an otherwise straightforward equality comparison.
Run 3
Code Structure: The class is logically organized into initialization, validation, and equality methods, but irrelevant operations clutter __eq__, and several imports are unused. Nesting: Control flow is shallow, with straightforward conditionals and a single loop. Clarity of intent: Descriptive class attributes, method names, and the validation docstring convey purpose well; however, cryptic variable names and a pointless hexadecimal XOR loop obscure equality checking. Code length: Most code is appropriately concise, though the redundant loop and unused imports add unnecessary length. Action granularity: Statements generally perform one action per line, except the unrelated two-variable initialization in __eq__. Reading flow: Initialization and validation read naturally, and the multiline equality expression is easy to follow once past the distracting obfuscated block.