Sample
pyint-7176af28b773-I01
Remove comments and docstrings
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.076 | 0–1; higher is more readable |
| Mi | 0.335 | 0–1; higher is more readable |
| LLOC | 98 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 15.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 16 | 0–20; mean of three runs |
| BTTF | 0.416 | 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. | 9366.713 | −309.102 |
| Source linesThe number of non-empty source lines. | 229 | +91.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.283 | −6.425 |
Intercept 8.87 + feature contributions = -215.057 (log-odds).
Score = sigmoid(-215.057) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 229 | +7.184 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 230 | −7.107 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 229 | −4.834 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 228.909 | +2.79 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.074 | +0.225 |
| 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.974 | −0.019 |
Intercept 0.07 + feature contributions = -2.496 (log-odds).
Score = sigmoid(-2.496) = 0.076.
| Score | 0.335 |
|---|
| Score | 98 |
|---|
Run 1
This Django admin configuration is highly readable. The class is logically organized with clear class attributes for forms, fieldsets, and display options. Methods are well-named and each has a single clear purpose. Nesting is minimal, with only necessary conditional blocks in views. Helper methods like `_add_view` and `lookup_allowed` improve readability. Comments are sparse but useful where present. The code follows Django conventions closely, making intent obvious to experienced Django developers. Minor deductions for some longer methods (e.g., `user_change_password`) and a few blank-line oddities, but overall structure and flow are excellent.
Run 2
The code is moderately readable. It has clear structure with logical organization into methods and the Admin class, and the import list is well-grouped. However, readability is reduced by several factors: multiple empty comment lines and placeholder comments suggesting incomplete documentation; very long lines, especially the error message string and method signatures; and some deeply nested logic in `user_change_password`. The intent is mostly clear due to descriptive method names, but the granularity varies — some lines contain multiple logical actions, while others are broken up unnecessarily. The reading flow is natural in places, but the excessive blank lines and incomplete comments disrupt it. Overall, it's understandable but could be improved with cleaner formatting, removal of dead comments, and simplifying nested conditionals.
Run 3
The code is generally readable with clear intent and logical organization, but has some issues. The class structure and method separation are good, with each method having a clear purpose. Imports are well-organized. However, readability suffers from several factors: multiple methods contain suspicious empty comments (e.g., `#`, `#@`), suggesting unfinished or unclear documentation. The `user_change_password` method is quite long and contains nested logic that could be extracted. Action granularity varies - some long method chains and conditional blocks make it harder to follow. The `lookup_allowed` and `get_form` methods have blank comment lines that are confusing. While the code is not deeply nested, the combination of long methods, empty comments, and mixed abstraction levels prevents a higher score. The template context dictionary is verbose but clear. Overall, functional and readable, but could benefit from method extraction and cleanup of empty comments.
Run 1
Code Structure: Configuration and behavior are logically organized within a single admin class, with focused methods for most responsibilities. Nesting: Most methods are flat, but user_change_password contains several nested conditionals and a deeply formatted redirect expression. Clarity of intent: Descriptive method names, variables, and messages communicate purpose well; framework-specific behavior and permission requirements lack explanatory comments. Code length: Most code is necessary, though excessive blank lines and the lengthy password-change method reduce concision. Action granularity: Statements generally perform one action per line, making state changes easy to follow. Reading flow: Configuration precedes overrides, and request handling follows a recognizable validation-save-response sequence. However, irregular whitespace and the combination of validation, persistence, messaging, and rendering in one method interrupt the flow.
Run 2
Code Structure: Configuration and behavior are logically grouped in a single admin class, with focused overrides; user_change_password handles several responsibilities. Nesting: Most methods are shallow, but POST handling contains several nested conditionals and a deeply formatted redirect. Clarity of intent: Descriptive method names, variables, and messages make the purpose clear, though Django-specific conventions and unexplained permission/password rules require framework knowledge. Code length: Most length comes from necessary configuration and context dictionaries, but excessive blank lines add noise and the password handler could be split into helpers. Action granularity: Statements generally perform one action per line, with readable multiline expressions. Reading flow: Configuration precedes behavior naturally, and guard clauses simplify control flow; irregular whitespace and the long password-change method interrupt otherwise coherent progression.
Run 3
Code Structure: Configuration and distinct admin behaviors are organized into clearly named methods, although user_change_password combines validation, persistence, messaging, and rendering. Nesting: Most methods are shallow and use early returns; the password POST handler has moderately deep conditional nesting. Clarity of intent: Descriptive names and standard Django APIs make the purpose clear, but subtle permission and password-submission rules lack explanatory comments. Code length: Most length comes from necessary configuration and context dictionaries, though excessive blank lines and the long password handler reduce concision. Action granularity: Statements generally perform one action per line, with multiline expressions formatted clearly. Reading flow: Imports, configuration, and methods follow a coherent progression; large whitespace gaps and nested redirect construction occasionally interrupt the flow.