Sample
pyint-561b224b7b45-I05
Rewrite eligible decimal integer literals in hexadecimal notation
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.211 | 0–1; higher is more readable |
| Mi | 0.335 | 0–1; higher is more readable |
| LLOC | 100 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 16.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 17 | 0–20; mean of three runs |
| BTTF | 0.428 | 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. | 9397.215 | −310.108 |
| Source linesThe number of non-empty source lines. | 235 | +94 |
| 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.357 | −6.536 |
Intercept 8.87 + feature contributions = -213.774 (log-odds).
Score = sigmoid(-213.774) = 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. | 236 | −7.32 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 210 | +6.527 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 209 | −4.375 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 234.909 | +2.874 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 85.907 | +0.582 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.062 | +0.342 |
| 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.953 | −0.018 |
Intercept 0.07 + feature contributions = -1.318 (log-odds).
Score = sigmoid(-1.318) = 0.211.
| Score | 0.335 |
|---|
| Score | 100 |
|---|
Run 1
The code is highly readable Django admin customization, scoring 17/20. Strengths: excellent modular organization with clear method separation and logical grouping; flat nesting in most methods; comprehensive docstrings and comments explaining non-obvious logic; concise, well-named helper methods (e.g., _add_view, lookup_allowed); single-action-per-line throughout; natural reading flow from decorators through method bodies. Minor deductions: user_change_password is somewhat long (~75 lines) with moderate nesting (if/else followed by nested if/elif), requiring careful reading to trace all branches; the response_add method mutates request.POST with magic-seeming behavior (request.POST['_continue'] = 0x1) though well-commented; get_urls uses starred expansion slightly reducing immediate readability. The use of ternary expressions and string formatting is clean, and template/field configurations are declarative and scannable. Overall, professional-grade code with minor complexity in the password-change view that could benefit from extraction into smaller helper methods.
Run 2
This is highly readable Django admin code. Code structure is logical, with clear separation of concerns: form configuration, permission checks, and view handling. Nesting is moderate but well-controlled; the user_change_password method has deeper nesting but remains comprehensible. Intent is explicit through descriptive method names and helpful comments explaining non-obvious decisions like the add-permission check. Code length is appropriate - verbose in places but not unnecessarily so, with detailed error messages being justified. Action granularity is mostly one action per line, though some lines combine operations. Reading flow is natural, following Django admin conventions that experienced developers will recognize. Minor deductions: the user_change_password method is somewhat long, and there's slight complexity in the response_add method's POST manipulation. Overall, this is production-quality code that balances Django framework requirements with clear, maintainable implementation.
Run 3
The code is generally well-structured and follows Django admin conventions, with clear separation of concerns and descriptive comments. Imports are organized, and class attributes are grouped logically. However, readability is reduced by a few deeply nested blocks in `user_change_password`, which contains a lengthy POST-handling section with multiple conditions. While most methods are concise and single-purpose, `_add_view` has a long docstring-like comment that could be simplified. The use of tuple/list unpacking and string formatting is standard but slightly dense in places. Overall, the code is readable for experienced Django developers but would benefit from flattening the password-change logic and reducing comment verbosity.
Run 1
Code Structure: Configuration and behavior are logically grouped within UserAdmin, with focused overrides; user_change_password handles several responsibilities and could be split. Nesting: Most methods are flat or use early exits, but POST validation and password updates introduce moderate nesting. Clarity of intent: Descriptive names, familiar Django conventions, and security-focused comments explain the purpose well; framework internals require Django knowledge, and 0x1 is less intuitive than 1. Code length: Most verbosity comes from necessary configuration and context dictionaries, although the password-change method and some comments are lengthy. Action granularity: Statements generally perform one action per line, with complex expressions formatted across lines. Reading flow: Configuration precedes methods, and request handling follows a natural progression from permission checks through validation, updates, and rendering. Dense context construction and nested redirect formatting slightly interrupt the flow.
Run 2
Code Structure: Configuration and behavior are clearly separated within a cohesive admin class, with focused methods for distinct workflows. Nesting: Most methods are shallow and use early returns; the password-change handler has moderately nested validation and response logic. Clarity of intent: Descriptive names, explicit configuration, and useful security comments explain purpose well, though Django-specific conventions require framework knowledge. Code length: Most verbosity is justified by configuration and context construction, but the lengthy password-change method and some comments increase reading effort. Action granularity: Statements generally perform one action each, and complex expressions are formatted across lines without combining unrelated operations. Reading flow: Imports, configuration, hooks, validation, persistence, and rendering follow a natural sequence. The main readability limitation is the password-change method combining several responsibilities, alongside visually dense nested configuration structures.
Run 3
Code Structure: Configuration is grouped clearly, and focused methods separate admin customization, permissions, and form handling. The password-change method combines several responsibilities and could be split further. Nesting: Most methods are shallow with early exits, but POST validation and password updates introduce moderate nesting. Clarity of intent: Descriptive names, familiar Django conventions, and comments explain security checks and unusual workflows; framework knowledge is needed for some context keys and overrides. Code length: Most length comes from necessary configuration and explicit context construction, though the password-change method and some comments are lengthy. Action granularity: Statements generally perform one action per line, with readable multiline expressions. Reading flow: Methods follow a coherent configuration-to-request-handling progression, and the password workflow proceeds logically from authorization through validation, saving, and rendering. Deeply formatted redirect construction and the unexplained 0x1 slightly interrupt readability.