Sample
pyint-8a61fd33005a-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.454 | 0–1; higher is more readable |
| Mi | 0.655 | 0–1; higher is more readable |
| LLOC | 63 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 12.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 16 | 0–20; mean of three runs |
| BTTF | 0.358 | 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. | 3226.686 | −106.481 |
| Source linesThe number of non-empty source lines. | 133 | +53.2 |
| 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.445 | −6.668 |
Intercept 8.87 + feature contributions = -51.079 (log-odds).
Score = sigmoid(-51.079) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 134 | −3.708 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 103 | +2.826 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 103 | −1.943 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 132.833 | +1.447 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 81.687 | +0.514 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.05 | +0.459 |
| 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. | 82.955 | +0.152 |
Intercept 0.07 + feature contributions = -0.184 (log-odds).
Score = sigmoid(-0.184) = 0.454.
| Score | 0.655 |
|---|
| Score | 63 |
|---|
Run 1
Overall, the code is fairly readable, with good structure, modular methods, and clear docstrings. Naming and purpose are mostly clear. However, the code contains a suspicious, obfuscated variable `lI0O_1e0ea428` in the `_set_secret` method, which severely hurts clarity and seems like injected or auto-generated code. It introduces needless complexity and ambiguity. Nesting is reasonable, though `check_token` has some depth due to multiple `try/except` blocks and a `for...else`. Action granularity is mostly one action per line, and reading flow is natural. The code is a bit longer than necessary in some areas, but not excessively so.
Run 2
The code demonstrates good structure with clear method names, docstrings, and flat nesting. However, it contains a severe readability violation: the `_set_secret` method includes a nonsensical obfuscated variable (`lI0O_1e0ea428`) with a dead-code branch that serves no purpose. This completely undermines clarity of intent and appears malicious or accidental. Several lines chain multiple operations (slicing `hexdigest()[::2]`, inline comment on same line), reducing action granularity and reading flow. The token parsing loop uses `for...else`, which is idiomatic but may confuse some readers. Property getters and setters for secrets are logically organized, but the obfuscation alone drops the score dramatically despite otherwise decent Django-style code.
Run 3
The code is generally well-structured with clear class organization, good method separation, and descriptive naming. The PasswordResetTokenGenerator class follows a logical flow, and most methods have single responsibilities. However, there's a significant readability issue in the _set_secret method with meaningless obfuscated variables (lI0O_1e0ea428) that serve no purpose and break the reading flow. The check_token method has moderate nesting but remains reasonably clear. Comments are helpful in explaining complex logic, particularly in _make_hash_value. Action granularity is generally good with one action per line, though some lines like the salted_hmac call with slicing could be clearer. The reading flow is mostly natural with good use of blank lines between logical sections. The code length is appropriate for the complexity of the task, but the obfuscated code prevents a higher score as it appears to be intentional obfuscation or a formatting error.
Run 1
Code Structure: Well-organized class with focused methods separating configuration, token generation, validation, and hashing. Nesting: Mostly shallow, with early returns keeping validation straightforward; the redundant nested conditionals in _set_secret are an exception. Clarity of intent: Descriptive method names, docstrings, and comments explain the password-reset workflow, but the cryptic variable and meaningless bitwise operations in _set_secret obscure an otherwise simple assignment. Code length: Generally appropriate, though the dead logic adds unnecessary lines. Action granularity: Statements usually perform one action per line, and multiline calls are readable. Reading flow: Methods follow a coherent progression, but the unusual multiline hexdigest slicing and Python's less familiar for-else construct slightly interrupt scanning. Overall, the code is readable despite a conspicuous localized obfuscation.
Run 2
Code Structure: Well-organized class with focused methods separating configuration, token generation, validation, and hashing. Nesting: Mostly shallow, with early returns simplifying validation; the unnecessary nested conditionals in _set_secret detract. Clarity of intent: Descriptive names, docstrings, and comments explain the password-reset workflow, but the obfuscated variable and dead arithmetic in _set_secret are confusing. Code length: Generally appropriate for the functionality; documentation is useful, while the injected no-op block adds needless length. Action granularity: Most lines perform one clear action; chained HMAC generation and slicing are slightly dense. Reading flow: Methods follow a coherent progression, and validation steps are easy to follow. However, the unusual multiline slice formatting and less immediately obvious for-else construct interrupt otherwise natural reading.
Run 3
Code Structure: Well-organized class with focused methods separating configuration, token generation, validation, and hashing. Nesting: Mostly shallow, with early returns simplifying validation; the unnecessary nested conditionals in _set_secret detract. Clarity of intent: Descriptive method names, docstrings, and comments clearly explain the password-reset workflow, but the obfuscated variable and dead arithmetic in _set_secret are confusing. Code length: Generally appropriate for the functionality; documentation is useful, while the setter's irrelevant logic adds needless length. Action granularity: Most lines perform one clear action, although chained HMAC generation and slicing require closer reading. Reading flow: Validation proceeds naturally from parsing through signature verification to expiration checking. The loop-else construct and awkwardly split hexdigest slice introduce minor friction, and the unrelated setter logic interrupts otherwise coherent flow.