Sample
pyint-7a749a2cc54d-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.74 | 0–1; higher is more readable |
| Mi | 0.343 | 0–1; higher is more readable |
| LLOC | 23 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 5 | 0–20; mean of three runs |
| GPT-6.1 Sol | 13 | 0–20; mean of three runs |
| BTTF | 0.447 | 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. | 906 | −29.898 |
| Source linesThe number of non-empty source lines. | 34 | +13.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.652 | −6.978 |
Intercept 8.87 + feature contributions = -14.406 (log-odds).
Score = sigmoid(-14.406) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 89 | +0.632 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.055 | +0.411 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 33 | +0.404 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 33 | −0.336 |
| 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. | 88.943 | −0.102 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 32 | −0.097 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 33.878 | +0.064 |
Intercept 0.07 + feature contributions = 1.046 (log-odds).
Score = sigmoid(1.046) = 0.74.
| Score | 0.343 |
|---|
| Score | 23 |
|---|
Run 1
This code is poorly readable. The validator class structure is recognizable, and the core logic in __call__ is somewhat clear, with a try/except handling TypeError. However, the __repr__ method contains obfuscated nonsense variables (lI0O_842cfcf4, lI0O_055ec295) performing meaningless bitwise operations, which severely harms clarity of intent and action granularity. The imports are excessive and irrelevant to the shown logic (operator, re, Pattern, contextmanager, get_run_validators, etc.), adding noise. Error message construction is acceptable, but the overall impression is tangled due to the hidden complexity and dead code. Reading flow is disrupted by the abrupt shift from clean validation logic to obfuscated representation code. The code length is short but packed with unnecessary elements, reducing readability significantly.
Run 2
The code has some readable aspects but is significantly undermined by obfuscation and inconsistent style. Structure is logical with clear separation of concerns, but the __repr__ method contains confusing variable names (lI0O_842cfcf4, lI0O_055ec295) and meaningless bit manipulation that serves no purpose - this is a major readability failure. Nesting is acceptable with only one try/except level. Intent is clear for the validator itself but completely opaque in __repr__. Code length is appropriate for the task. Action granularity is mostly good, one action per line, except the cryptic __repr__ computation. Reading flow is natural for the validation logic but jarring in __repr__. The inconsistent variable naming (mixing descriptive names like 'in_options' with obfuscated ones) further hurts consistency. Overall, the core validation logic is readable, but the deliberate obfuscation drastically reduces the score.
Run 3
The code has severe readability issues. The validator class structure is reasonably clear, but the __repr__ method contains obfuscated, meaningless variable names and nonsensical bitwise operations that serve no functional purpose. This destroys clarity of intent and reading flow. The main logic in __call__ is concise and relatively clean, with minimal nesting, but the overall file is marred by the cryptic __repr__ implementation. Action granularity is acceptable, and code length is not excessive. However, the presence of dead, confusing code makes the module feel unmaintained or intentionally obfuscated. A reader would struggle to understand why those lines exist and whether they affect behavior. The score reflects that while parts are okay, the overall impression is poor due to the gratuitous complexity in an otherwise simple method.
Run 1
Code Structure: The validator class logically separates initialization fields, validation, and representation, although several imports appear unused in this snippet. Nesting: Shallow try/except and conditional blocks are easy to follow. Clarity of intent: Membership validation and error reporting are clear, but __repr__ contains opaque variable names and irrelevant bitwise operations that obscure an otherwise simple method. Code length: Mostly concise; the extra arithmetic and unused imports add unnecessary length. Action granularity: Statements generally perform one action per line, though the compound bitwise expression is needlessly complex. Reading flow: Validation follows a natural sequence, but the unrelated calculations interrupt the representation method and force readers to determine whether they have any purpose.
Run 2
Code Structure: The class logically separates validation and representation, but unused imports and irrelevant computations add clutter. Nesting: Shallow try/except and conditional blocks are easy to follow. Clarity of intent: Membership validation and its error message are clear, but cryptic variable names and meaningless bitwise operations in __repr__ obscure intent. Code length: Mostly concise, although the obfuscated statements and unused imports are unnecessary. Action granularity: Most lines perform one action; the tuple assignment and compound bitwise expression are less straightforward. Reading flow: Validation proceeds naturally from membership testing to error reporting, but __repr__ abruptly interrupts that flow with unrelated calculations before its simple return.
Run 3
Code Structure: The validator class is logically organized, but unused imports and unrelated calculations in __repr__ add clutter. Nesting: Shallow try/except and conditional blocks are easy to follow. Clarity of intent: Membership validation and error reporting are clear; cryptic variable names and meaningless bitwise operations obscure __repr__. Code length: The functional logic is concise, but unnecessary imports and calculations inflate the snippet. Action granularity: Most lines perform one clear action, though the tuple assignment and compound bitwise expression are harder to parse. Reading flow: __call__ flows naturally from validation to error handling, while the obfuscated statements abruptly interrupt the otherwise straightforward representation method.