Sample
pyint-d795e744799a-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.678 | 0–1; higher is more readable |
| Mi | 0.165 | 0–1; higher is more readable |
| LLOC | 21 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 5.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 12.67 | 0–20; mean of three runs |
| BTTF | 0.415 | 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. | 788.274 | −26.013 |
| Source linesThe number of non-empty source lines. | 32 | +12.8 |
| 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.528 | −6.792 |
Intercept 8.87 + feature contributions = -11.135 (log-odds).
Score = sigmoid(-11.135) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 96 | +0.744 |
| 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. | 96 | −0.401 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.056 | +0.393 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 30 | +0.301 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 30 | −0.268 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 33 | −0.132 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 31.835 | +0.035 |
Intercept 0.07 + feature contributions = 0.743 (log-odds).
Score = sigmoid(0.743) = 0.678.
| Score | 0.165 |
|---|
| Score | 21 |
|---|
Run 1
The code has clear structure and reasonable nesting, but readability is severely compromised by obfuscated dead code (lI0O_5bedbc0e bit-twiddling lines) that serve no purpose. Intent is unclear in that block, length is inflated unnecessarily, and reading flow is disrupted. Action granularity is mixed—some lines are fine but the dead code contains multiple operations and ambiguous naming. Overall the validator pattern is recognizable, but the injected noise makes it difficult to trust or maintain.
Run 2
The code has some redeeming structural elements - it's a simple frozen attrs class with a clear single responsibility (regex validation) and maintains reasonable flatness. However, there are critical readability issues. The most severe problem is the dead, obfuscated code inside __call__: three meaningless variable assignments with hex literals and bitwise operations that do nothing before being zeroed out. This is confusing and suggests either injected or leftover debugging code. It completely obscures intent and violates the 'one action per line' and 'clarity of intent' criteria. Beyond that, the function mixes validation, error message construction, and exception raising in a relatively compact block. While the class structure and type hints are clear, the unnatural variable naming (lI0O_5bedbc0e) makes the code appear obfuscated or malicious. The rest of the class is concise and logical, but the dead code drags the overall readability down severely.
Run 3
The code has a clear purpose but contains obfuscated, meaningless variable assignments (lI0O_5bedbc0e) that add no value and severely hurt readability. It mixes imported but unused modules (operator, re, contextmanager) and lacks explanation for the magic number manipulation. The class structure is reasonable but the spurious lines disrupt flow and violate the 'one action per line' principle by including dead code. Nesting is low, which is good, but clarity of intent suffers due to the unrelated numeric operations. The __call__ method is otherwise straightforward, though the docstring is minimal. Overall, the core logic is understandable, but the presence of intentionally confusing code makes it hard to read.
Run 1
Code Structure: Imports and a small validator class are logically organized, but unrelated computation interrupts validation. Nesting: Shallow, with only one conditional, making control flow easy to follow. Clarity of intent: Class attributes, regex matching, and the error message clearly communicate validation intent; the cryptic lI0O_5bedbc0e variable and pointless bitwise operations obscure it. The call-method docstring explains representation customization rather than the method's behavior. Code length: Mostly concise, but three irrelevant assignment lines and several unused imports add noise. Action granularity: Each statement performs one action, and the multiline exception arguments are readable. Reading flow: The class follows a natural attributes–validation–representation sequence, but obfuscated arithmetic breaks the flow before the core check.
Run 2
Code Structure: The validator class is logically organized, with attributes, validation, and representation separated, though several imports are unused in this snippet. Nesting: Minimal nesting makes control flow easy to follow. Clarity of intent: Regex validation and the error message are clear, but the cryptically named variable and pointless bitwise operations obscure the purpose; the __call__ docstring describes class design rather than the method's behavior. Code length: Mostly concise, but three irrelevant assignments and unused imports add unnecessary length. Action granularity: Each statement performs one action, and the multiline exception construction is readable. Reading flow: The overall flow is natural, but unrelated arithmetic interrupts the transition into validation.
Run 3
Code Structure: The validator class logically groups its fields, validation method, and representation, although several imports are unused in this snippet. Nesting: Control flow is shallow, with only one conditional. Clarity of intent: Class and method names, the regex check, and the error message clearly indicate validation behavior, but the cryptic variable and meaningless bitwise operations obscure intent. The docstring explains the callable-class design rather than the method's behavior. Code length: The snippet is compact overall, but three dead-code statements and unused imports add unnecessary length. Action granularity: Each statement performs one action, and the multiline exception construction is easy to scan. Reading flow: The overall progression is natural, but unrelated arithmetic interrupts the path from method entry to validation.