Sample
pyint-0149e57aa199-I12
Inline all eligible single-use intermediate local variables
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.587 | 0–1; higher is more readable |
| Mi | 0.615 | 0–1; higher is more readable |
| LLOC | 43 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 17 | 0–20; mean of three runs |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs |
| BTTF | 0.67 | 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. | 2832.346 | −93.467 |
| Source linesThe number of non-empty source lines. | 83 | +33.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.67 | −7.005 |
Intercept 8.87 + feature contributions = -58.402 (log-odds).
Score = sigmoid(-58.402) = 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. | 84 | −1.938 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 76 | +1.892 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 76 | −1.323 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 82.918 | +0.749 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 82.024 | +0.519 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.069 | +0.273 |
| 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. | 83.929 | +0.11 |
Intercept 0.07 + feature contributions = 0.352 (log-odds).
Score = sigmoid(0.352) = 0.587.
| Score | 0.615 |
|---|
| Score | 43 |
|---|
Run 1
The code is largely readable and follows Django conventions well. It demonstrates clear structure, flat nesting, and natural reading flow, with field definitions organized logically. Intent is explicit through model fields and method names, and the code is concise. However, a few minor issues prevent a higher score: the get_full_name method contains an unnecessary blank line before the return, and some field definitions and help texts are quite verbose. The imports are slightly scattered but are mostly grouped. Overall, this is very readable Python/Django code.
Run 2
The code is highly readable. It follows a logical structure with clear separation of imports, model fields, Meta class, and methods. Nesting is minimal, with only one level used in field definitions and method bodies. The intent is explicit through descriptive names, docstrings, and Django conventions. Code length is appropriate; fields and methods are concise without sacrificing clarity. Each field and method performs a single action or represents a single concept, enhancing action granularity. Reading flow is natural: imports, class definition, fields, configuration, then methods. Minor deductions: the `get_full_name` method has a slightly awkward string formatting approach, and the import block is long but standard for Django models.
Run 3
The code exhibits strong readability overall. It is well-structured, with logical grouping of fields, configuration, and methods. Nesting is minimal, mostly limited to model field definitions and method bodies. The intent of each section and method is clear, aided by descriptive names and helpful docstrings. Code length is appropriate for an abstract user model, though the verbose Django field definitions add some length. Action granularity is generally one action per line, with each field and statement on its own line. Reading flow is natural, progressing from imports to class definition, fields, configuration, and finally methods. The code is clean and consistent, typical of production-quality Django code.
Run 1
Code Structure: Fields, manager, configuration, metadata, and methods are logically grouped; unused imports and unresolved PermissionsMixin/UserManager references slightly weaken the standalone presentation. Nesting: Shallow nesting and straightforward methods make scanning easy. Clarity of intent: Descriptive names, docstrings, and field help text clearly communicate the model's purpose. Code length: Mostly concise; multiline field declarations improve readability, though unused imports add clutter. Action granularity: Each statement performs a focused action, with no compressed sequences of unrelated operations. Reading flow: The progression from model definition to configuration and behavior is natural and consistent, with only minor formatting distractions.
Run 2
Code Structure: Fields, manager, configuration, metadata, and methods are logically grouped. Nesting: Shallow nesting makes the class easy to scan; multiline field declarations remain manageable. Clarity of intent: Descriptive names, docstrings, and field help text clearly communicate purpose, though PermissionsMixin and UserManager are not defined or imported in the snippet. Code length: Mostly concise, with useful declarative detail, but several unused imports add clutter. Action granularity: Statements generally perform one action each, with no compressed multi-statement lines. Reading flow: The progression from model definition to utility methods is natural and consistent. Minor whitespace issues and older string formatting slightly detract from an otherwise highly readable implementation.
Run 3
Code Structure: Fields, manager, configuration, metadata, and methods are logically grouped, though unused imports and undefined PermissionsMixin/UserManager references reduce self-contained clarity. Nesting: Shallow, with only standard class, method, and metadata nesting. Clarity of intent: Descriptive names, field help text, and concise docstrings clearly communicate the user model's purpose. Code length: Mostly concise; multiline field declarations improve readability, but unnecessary imports add clutter. Action granularity: Each statement performs a single clear action, with no compressed multi-action lines. Reading flow: Natural progression from model fields to configuration and behavior, supported by consistent formatting; a stray blank line and older string formatting are minor distractions.