Sample
pyint-81c8771dc685-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.786 | 0–1; higher is more readable |
| Mi | 0.662 | 0–1; higher is more readable |
| LLOC | 24 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 4.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 12 | 0–20; mean of three runs |
| BTTF | 0.46 | 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. | 870.393 | −28.723 |
| Source linesThe number of non-empty source lines. | 31 | +12.4 |
| 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.702 | −7.053 |
Intercept 8.87 + feature contributions = -14.506 (log-odds).
Score = sigmoid(-14.506) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| 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. | 73.969 | +0.532 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 74 | +0.39 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.061 | +0.351 |
| 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. | 32 | −0.097 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 30.773 | +0.02 |
Intercept 0.07 + feature contributions = 1.3 (log-odds).
Score = sigmoid(1.3) = 0.786.
| Score | 0.662 |
|---|
| Score | 24 |
|---|
Run 1
This code is nearly unreadable due to the presence of deliberately obfuscated dead code. The lines assigning and manipulating `lI0O_d8569027` serve no functional purpose and severely violate the 'clarity of intent' and 'code length' criteria, making the logic ambiguous. While the top-level structure of the `_OrValidator` class is standard, the unnecessary imports (`operator`, `re`, `Pattern`, `contextmanager`, etc.) clutter the file and confuse the reader. The core `__call__` method has a clean flat structure for the try/except loop, but the obfuscation destroys the natural reading flow. Action granularity is harmed by the multi-step dead code block. Overall, only the core class skeleton is recognizable, while the surrounding noise makes this extremely difficult to read.
Run 2
The code has some clear structure with appropriate imports and a reasonable class definition, but the obfuscated variable names and unnecessary bit manipulation in __call__ make it confusing. The nesting is shallow and the logic flow (try/except/else with continue/return) is somewhat natural for a validator, but the non-descriptive `lI0O_d8569027` variable is misleading and appears to be dead code. The class purpose is somewhat clear from the name and context, but the implementation contains intentional obfuscation that hurts readability. Action granularity is mixed - some parts are clear, but the variable assignment lines contain multiple operations. The reading flow is disrupted by the irrelevant bit manipulation. The code is relatively concise, but the obfuscation adds unnecessary complexity. Overall, the intent is understandable for experienced Python developers familiar with validators, but the deliberate confusion drags down the score significantly.
Run 3
The code is largely unreadable due to obfuscated and meaningless variable names (lI0O_d8569027) with arbitrary bitwise operations that serve no apparent purpose. The loop structure and validation logic in _OrValidator.__call__ are unnecessarily nested and could be flattened with a helper method. The intent of the obfuscated lines is completely ambiguous, violating the clarity criterion. While imports and class definition are standard, the bizarre variable manipulations break reading flow and make the code appear suspicious or auto-generated. Action granularity is poor: multiple unrelated operations are packed into a few lines. The validators loop itself is readable, but it is overshadowed by the surrounding noise. To improve, remove dead/obfuscated code and use descriptive variable names.
Run 1
Code Structure: Imports and the validator class are logically organized, but unrelated obfuscation disrupts the main method. Nesting: The loop with try/except/else is moderately nested and manageable; the extra conditional adds needless complexity. Clarity of intent: Validator iteration, early success, and final failure are clear, while the cryptic variable and meaningless bitwise operations obscure intent. Code length: The implementation is fairly short, but several lines perform no useful validation work, and multiple imports are unused in this snippet. Action granularity: Statements generally occupy separate lines, although the compound bitwise expression is unnecessarily dense. Reading flow: The validation logic follows a natural progression, but the opening arithmetic detour interrupts it and forces readers to determine whether it matters.
Run 2
Code Structure: The validator class is logically organized, but irrelevant bitwise operations disrupt its core logic, and several imports are unused in this snippet. Nesting: Mostly shallow, with a straightforward loop and try/except/else structure. Clarity of intent: The class name, validator iteration, error message, and representation communicate its purpose clearly; the cryptic variable and unexplained hexadecimal calculations obscure intent. Code length: The implementation is compact overall, but the redundant initialization, transformations, and unreachable conditional add unnecessary length. Action granularity: Each statement occupies its own line, though the compound bitwise expression requires extra interpretation. Reading flow: The validation loop reads naturally, returning on success and raising after all failures, but the preceding obfuscated code interrupts that flow. Catching every Exception also makes it less clear which failures are intended to count as validation failures.
Run 3
Code Structure: The validator class is logically organized, but unused imports and irrelevant bitwise operations clutter it. Nesting: The loop and try/except/else introduce moderate, manageable nesting. Clarity of intent: The validation behavior and error message are clear, but the cryptic variable name and pointless arithmetic obscure the method's opening. Code length: The core implementation is concise; the dead-code block and unused imports unnecessarily lengthen it. Action granularity: Most lines perform one action, although the compound bitwise expression is harder to parse. Reading flow: The validation loop flows naturally and returns on success, but the unrelated initialization interrupts that flow. Catching every Exception also makes it less clear which failures are intended to be ignored.