Sample
pyint-4608f74ce0df-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.206 | 0–1; higher is more readable |
| Mi | 0.335 | 0–1; higher is more readable |
| LLOC | 102 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 14 | 0–20; mean of three runs |
| GPT-6.1 Sol | 16 | 0–20; mean of three runs |
| BTTF | 0.426 | 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. | 9575.851 | −316.003 |
| Source linesThe number of non-empty source lines. | 237 | +94.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.377 | −6.566 |
Intercept 8.87 + feature contributions = -218.899 (log-odds).
Score = sigmoid(-218.899) = 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. | 238 | −7.391 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 212 | +6.596 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 212 | −4.444 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 236.909 | +2.902 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 86.971 | +0.599 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.062 | +0.337 |
| 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. | 86.941 | −0.017 |
Intercept 0.07 + feature contributions = -1.348 (log-odds).
Score = sigmoid(-1.348) = 0.206.
| Score | 0.335 |
|---|
| Score | 102 |
|---|
Run 1
This is Django admin code with reasonable structure and clarity, but it contains one major readability issue that drags the score down. The class organization is logical: fieldsets, forms, and list displays are clearly defined, and methods like get_fieldsets and get_form are concise and well-purposed. However, the user_change_password method is excessively long — spanning nearly 80 lines with multiple nested conditionals, form handling, redirect logic, and context building all crammed together. This violates action granularity and nesting principles. The function juggles many responsibilities (permission checks, form validation, password state handling, messaging, redirects, template context) without extraction into helper methods. Additionally, there is dead code: the nonsensical variable `lI0O_d60ed066` and its obfuscated boolean assignments at the start of user_change_password serve no purpose and actively harm clarity. The add_view/_add_view split is good for separating transaction logic from permission checks. Comments are helpful where present, especially explaining Django's permission design. Overall, the code is maintainable by experienced Django developers but suffers from one bloated method and unexplained artifacts, preventing a higher readability score.
Run 2
The code is generally well-structured and readable, with clear separation of concerns, logical grouping of imports, and descriptive method names. It uses Django admin conventions effectively. However, readability is reduced by a long, deeply nested `user_change_password` method that handles multiple responsibilities (permission checks, form validation, session updates, redirects, context building) with several levels of nesting. There are also minor issues: an obscure obfuscated variable (`lI0O_d60ed066`) that serves no purpose, a `get_object` result checked after a permission check (reversed logic), and a long string concatenation for an error message. The action granularity is mostly one action per line, and the reading flow follows Django admin patterns, but the password-change method would benefit from extraction into helper methods. Overall it is readable but not exemplary.
Run 3
The code is structured logically with clear separation of methods, but has significant readability issues. The `user_change_password` method is over 80 lines with multiple nested conditionals (if/else inside if blocks), reducing clarity. There's an obviously obfuscated variable (`lI0O_d60ed066`) that appears to be a debugging artifact, which is confusing and should be removed. The method handles multiple responsibilities (permission checks, form validation, context building, response creation), violating action granularity. However, the code uses clear naming, follows Django conventions, and includes helpful comments explaining non-obvious logic. The `fieldsets` structure is well-organized, and import management is clean. The `_add_view` method shows good separation with a clear comment explaining the permission logic. Overall readability is moderate, dragged down primarily by the overly long method and the obfuscated variable.
Run 1
Code Structure: Imports, declarative admin configuration, and focused override methods are logically organized. The password-change handler combines validation, persistence, messaging, redirects, and rendering, making it less cohesive. Nesting: Most methods are shallow, but POST handling contains several nested conditionals and a visually dense redirect expression. Clarity of intent: Descriptive names and explanatory security comments make most behavior clear; the unused lI0O_d60ed066 variable and opaque hexadecimal operations introduce confusing, purposeless noise. Code length: Configuration accounts for much of the justified length, though the password handler and some comments are lengthy. Action granularity: Statements generally perform one action per line, with consistent multiline formatting for complex expressions. Reading flow: Configuration followed by request-handling methods provides a natural progression, and early returns simplify branching. Framework-specific conventions require Django familiarity, while the obfuscated statements interrupt otherwise readable flow.
Run 2
Code Structure: Configuration and behavior are logically organized within a Django admin class, with focused helper methods. Nesting: Most methods are shallow, although password-change handling has several nested branches. Clarity of intent: Descriptive names, conventional Django patterns, and explanatory comments make the purpose clear; the unused, obfuscated lI0O_d60ed066 assignments introduce needless ambiguity. Code length: Most verbosity supports configuration or security explanations, but user_change_password is long and combines validation, persistence, messaging, redirection, and rendering. Action granularity: Statements generally perform one action per line, with readable multiline calls and dictionaries. Reading flow: Configuration followed by lifecycle methods provides a natural progression, and guard clauses help; the obfuscated lines and lengthy password workflow interrupt otherwise consistent flow.
Run 3
Code Structure: Configuration and behavior are logically organized within a Django admin class, with focused methods, although user_change_password handles several responsibilities. Nesting: Most methods are shallow and use early exits; POST validation and redirect construction introduce moderate nesting. Clarity of intent: Descriptive names, familiar framework conventions, and explanatory comments clarify permissions and password workflows. However, the unused lI0O_d60ed066 assignments and opaque hexadecimal expression are distracting and unexplained. Code length: Most verbosity supports explicit configuration and security behavior, but the password-change method is lengthy and the dead assignments add unnecessary code. Action granularity: Statements generally perform one action per line, with consistently formatted multiline expressions. Reading flow: Configuration followed by view hooks creates a natural progression, and spacing separates logical stages; the obfuscated statements interrupt an otherwise coherent flow.