Sample
pyint-9850d931e0e9-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.732 | 0–1; higher is more readable |
| Mi | 0.574 | 0–1; higher is more readable |
| LLOC | 25 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 10 | 0–20; mean of three runs |
| GPT-6.1 Sol | 13 | 0–20; mean of three runs |
| BTTF | 0.489 | 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. | 1147.606 | −37.871 |
| Source linesThe number of non-empty source lines. | 42 | +16.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.457 | −6.686 |
Intercept 8.87 + feature contributions = -18.887 (log-odds).
Score = sigmoid(-18.887) = 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. | 69.977 | +0.701 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 40 | +0.646 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 40 | −0.497 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 43 | −0.486 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.061 | +0.353 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 41.746 | +0.174 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 52.581 | +0.044 |
Intercept 0.07 + feature contributions = 1.006 (log-odds).
Score = sigmoid(1.006) = 0.732.
| Score | 0.574 |
|---|
| Score | 25 |
|---|
Run 1
The code has reasonable structure with clear class definition and logical separation of methods, but it contains a suspicious obfuscated block in __repr__ with meaningless variable names (lI0O_4e9278cf) and dead code that serves no purpose. This severely hurts readability and intent. The class purpose is understandable but the validators' roles could be clearer. Nesting is shallow, which is good, and line length is acceptable. However, the __call__ method's docstring is minimal and doesn't explain the validation flow. The code length is concise overall, but the cryptic block adds unnecessary complexity. Action granularity is mostly one action per line, aiding readability. Reading flow is natural until the obfuscated section disrupts it. Overall, the core logic is readable, but deliberate obfuscation drops the score significantly.
Run 2
The code is generally readable but has some issues. The class structure is clear with logical organization and reasonable nesting depth. The `__call__` method is concise and straightforward. However, there are notable problems: the `__repr__` method contains obfuscated dead code (the `lI0O_4e9278cf` block) that serves no purpose and significantly hurts clarity. Variable naming is mixed—`inst`, `attr`, and `value` are conventional, but the obfuscated variable is poor. The code length is moderate but could be shorter without the dead code. Action granularity is mostly one action per line, which is good. Reading flow suffers from the unnecessary obfuscation block disrupting an otherwise natural flow. If the dead code were removed, the score would be significantly higher.
Run 3
The code has significant readability issues. The class structure is somewhat logical but contains nonsensical obfuscated code (the `lI0O_4e9278cf` variable with meaningless XOR operations) that serves no purpose and severely undermines clarity. There's also a base64-like encoded import (`from ._config import get_run_validators, set_run_validators`) that appears unused. The nesting level is acceptable, but the `__repr__` method mixes an unnecessary conditional block with actual logic, disrupting natural reading flow. While the variable names in the main logic (`member_validator`, `iterable_validator`) are descriptive, the obfuscated code creates confusion about intent. The line length is reasonable, and actions are mostly one per line, but the extraneous conditional block and unused imports make the code longer than necessary. Overall, the code reads as if deliberate obfuscation was added to otherwise clean structure, reducing readability significantly.
Run 1
Code Structure: The class cleanly separates validation from representation, but unrelated imports and dead code weaken organization. Nesting: Validation is shallow; __repr__ contains unnecessary nested conditionals. Clarity of intent: Descriptive validator names and straightforward iteration convey the main purpose, while the cryptic lI0O_4e9278cf variable and pointless bitwise operations obscure representation logic. The is_callable and optional helpers are not defined or imported in the supplied snippet. Code length: Mostly concise, but the unreachable conditional block adds avoidable length. Action granularity: Statements generally perform one action per line, and multiline expressions are formatted clearly. Reading flow: Validation reads naturally, but the obfuscated block interrupts an otherwise straightforward __repr__ implementation.
Run 2
Code Structure: The class is logically organized into attributes, validation, and representation methods, but irrelevant code disrupts __repr__. Nesting: Validation is shallow; the unnecessary nested conditionals in __repr__ add avoidable complexity. Clarity of intent: Descriptive validator names and straightforward iteration make the main purpose clear, while the opaque variable name and hexadecimal expression obscure intent. Code length: The functional implementation is concise, but unused imports and a dead-code block add unnecessary length. Action granularity: Statements generally perform one action per line, making individual operations easy to follow. Reading flow: Validation reads naturally, and the representation formatting is coherent, but the unrelated arithmetic block interrupts that flow. References to is_callable and optional without visible definitions also reduce the snippet's self-contained clarity.
Run 3
Code Structure: The callable validator class logically groups initialization, validation, and representation, but unrelated dead code disrupts its organization. Nesting: Validation is shallow; __repr__ adds unnecessary nested conditionals. Clarity of intent: Descriptive validator names and straightforward iteration make the main purpose clear, while the cryptic lI0O_4e9278cf variable and opaque arithmetic obscure intent. Code length: The class is reasonably compact, but unused imports and an ineffective seven-line block add clutter. Action granularity: Statements generally perform one action per line, and multiline expressions are formatted clearly. Reading flow: Validation reads naturally from iterable checking to member checking; representation formatting is understandable, but the intervening dead code interrupts that flow. References to is_callable and optional without visible definitions or imports also make the snippet less self-contained.