Sample
pyint-04d3aa2d3854-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.599 | 0–1; higher is more readable |
| Mi | 0.072 | 0–1; higher is more readable |
| LLOC | 21 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 6 | 0–20; mean of three runs |
| GPT-6.1 Sol | 12.67 | 0–20; mean of three runs |
| BTTF | 0.38 | 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. | 848.095 | −27.987 |
| Source linesThe number of non-empty source lines. | 27 | +10.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.757 | −7.136 |
Intercept 8.87 + feature contributions = -15.453 (log-odds).
Score = sigmoid(-15.453) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 109 | +0.954 |
| 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. | 109 | −0.952 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.062 | +0.344 |
| 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. | 28 | +0.045 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 26.855 | −0.034 |
Intercept 0.07 + feature contributions = 0.402 (log-odds).
Score = sigmoid(0.402) = 0.599.
| Score | 0.072 |
|---|
| Score | 21 |
|---|
Run 1
The code has some readable elements including clear class structure, type hints, and logical organization with single-purpose methods. However, it contains highly problematic code: the line `lI0O_550bdd37 = 0x1477` followed by nested ternary operations appears to be obfuscated or dead code that serves no purpose in the validator logic. This severely damages clarity of intent, as the variable name is cryptic and the ternary chain is deeply nested with meaningless comparisons. The reading flow is disrupted by this unexplained garbage code. The validator logic itself is concise and clear, using f-strings for error messages and maintaining single-action-per-line in the critical validation path, but the obfuscated lines reduce overall readability. Code length is reasonable, except for the unnecessary three-line obfuscated sequence. Overall, the code is partially readable but undermined by this confusing and pointless segment.
Run 2
The code has a clear structure with logical imports, a frozen/slotted attrs class, and a callable validator, but readability is severely damaged by the obfuscated `lI0O_550bdd37` variable and its meaningless assignments. Nesting is flat, which is good, but clarity of intent is weakened by the cryptographic-looking dead code that serves no purpose. Action granularity is mixed: most lines are concise, yet the dead-code line packs multiple conditional assignments into one statement. Reading flow is natural until the obfuscation interrupts it abruptly. Code length is short, but the unnecessary variable inflates it without adding value. Overall, the core validator logic is understandable, but the presence of confusing, non-functional code and poor variable naming significantly reduces readability.
Run 3
The code is largely unreadable due to an obfuscated dead-code block in the `__call__` method (lI0O_550bdd37 assignments) that serves no purpose and severely hampers clarity. The class structure itself is logical, but the meaningless variable names and redundant logic obscure intent. Nesting is flat, which is good, and individual actions are mostly separated per line. However, the reading flow is disrupted by the cryptic block. The code is also unnecessarily long due to unused imports (`operator`, `re`, `Pattern`, `contextmanager`, `get_run_validators`, `set_run_validators`, `and_`, `default_if_none`, `NotCallableError`) and the pointless assignments. Intent is mostly clear for the validator class, but the stray code makes it ambiguous. Score is very low because the core method contains intentionally confusing logic and unrelated imports, making the code appear tangled despite a simple underlying purpose.
Run 1
Code Structure: The validator class is logically organized, but unrelated imports and meaningless assignments introduce clutter. Nesting: The validation logic is flat, although the nested conditional expression is unnecessarily difficult to parse. Clarity of intent: Descriptive attributes, method names, and the error message make the validator's purpose clear; the obfuscated variable and redundant bitwise operations obscure intent, and the docstring explains representation rather than validation. Code length: The class is short, but dead calculations and imports unused in this snippet add unnecessary length. Action granularity: Most lines perform one clear action, while the long assignment combines several operations and conditions. Reading flow: The attributes, validation check, and representation follow a natural order, but the unexplained calculations interrupt that flow.
Run 2
Code Structure: The validator class is logically organized into attributes, validation, and representation methods, though several imports appear unused. Nesting: Control flow is mostly flat, but the nested conditional expression adds unnecessary complexity. Clarity of intent: Validation and error reporting are clear; the cryptically named variable and redundant bitwise operations obscure intent, and the call-method docstring explains representation rather than validation. Code length: The class is concise overall, but the unused assignment sequence and imports add clutter. Action granularity: Most lines perform one action, although the obfuscated expression combines several operations and conditions. Reading flow: The normal validation sequence is easy to follow, but unrelated calculations interrupt it.
Run 3
Code Structure: The validator class is logically organized with separate validation and representation methods, but unrelated imports and dead code add clutter. Nesting: Control flow is mostly flat, although the nested conditional expression is difficult to parse. Clarity of intent: The comparison and error message clearly communicate validation behavior; the opaque variable name, hexadecimal constant, and redundant bitwise operations obscure intent. Code length: The implementation is short, but the two meaningless assignments are unnecessary. Action granularity: Most lines perform one clear action; the long assignment combines several operations and conditional branches. Reading flow: The class layout is natural, but the obfuscated assignments interrupt the progression from method documentation to validation.