Sample
pyint-d61b14bbd229-SRC
Unmodified source class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.589 | 0–1; higher is more readable |
| Mi | 0.615 | 0–1; higher is more readable |
| LLOC | 44 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 17.33 | 0–20; mean of three runs |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs |
| BTTF | 0.677 | 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. | 2844.331 | −93.863 |
| 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.669 | −7.004 |
Intercept 8.87 + feature contributions = -58.796 (log-odds).
Score = sigmoid(-58.796) = 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.068 | +0.283 |
| 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.952 | +0.109 |
Intercept 0.07 + feature contributions = 0.361 (log-odds).
Score = sigmoid(0.361) = 0.589.
| Score | 0.615 |
|---|
| Score | 44 |
|---|
Run 1
The code is clear and well-structured, with a standard Django model layout that separates imports, fields, Meta, and methods. Nesting is minimal, with only one conditional-free method chain. Field definitions are verbose but justified by Django best practices and internationalization. The only readability issues are slight verbosity in field help texts and a minor naming inconsistency (using 'staff status' vs 'active'), but these don't significantly reduce clarity. Overall, it reads naturally and follows established patterns.
Run 2
This Django abstract user model demonstrates excellent readability. The code structure follows Django's conventional model definition pattern, making it immediately recognizable to framework users. Existing imports are organized and mostly used. Nesting is minimal, with fields and methods kept at predictable indentation levels. Each model field is clearly defined with descriptive help_text and validation, showing clear intent. Action granularity is appropriate: each field, method, and Meta option occupies its own line without unnecessary verbosity. Reading flow is natural—imports, class declaration, fields, Meta, methods—mirroring standard Django practices. Minor deductions include some long field definitions that span multiple lines (though this is idiomatic Django) and a few unused imports at the top, which slightly reduces clarity. Overall, this is highly readable, well-structured code that would be easily maintainable by any Django developer.
Run 3
The code is well-structured and highly readable. It follows Django conventions, with clear separation of imports, model fields, Meta options, and methods. The class and method names are descriptive, and docstrings explain their purpose. Field definitions are logically grouped and formatted consistently, with helpful help_text and error_messages for clarity. Nesting is minimal, and each line focuses on a single action or attribute. The use of translation wrappers and validators is standard and does not hinder readability. The only minor drawback is the slightly long import block, but it is organized and justified by the model's dependencies. Overall, this is an exemplary implementation of a Django abstract user model.
Run 1
Code Structure: Fields, manager, configuration, metadata, and methods are logically grouped within a single model class. Nesting: Shallow nesting, limited primarily to field arguments and the Meta class, makes scanning easy. Clarity of intent: Descriptive names, docstrings, and field help text clearly communicate purpose; however, PermissionsMixin and UserManager are undefined in the provided snippet, weakening self-contained clarity. Code length: Appropriately concise for a declarative Django model, though several unused imports add clutter. Action granularity: Statements generally perform one action each, with complex field declarations formatted across readable lines. Reading flow: The progression from model definition to configuration and utility methods is natural and consistent. Minor import cleanup and clearer dependency context would improve readability.
Run 2
Code Structure: Fields, manager, configuration, metadata, and methods are logically grouped. Nesting: Shallow nesting keeps the class easy to scan; multiline field declarations are well formatted. Clarity of intent: Descriptive names, docstrings, and help text clearly explain the user model, although 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, and field options appear on separate lines. Reading flow: The progression from model fields to configuration and behavior is natural and consistent with Django conventions.
Run 3
Code Structure: Fields, manager, configuration, metadata, and methods are logically grouped. Nesting: Shallow nesting keeps the class easy to scan; multiline field definitions are clear rather than tangled. Clarity of intent: Descriptive names, docstrings, and field help text explain the model well, though PermissionsMixin and UserManager are not defined or imported in the snippet. Code length: Appropriately concise for a Django model, but several unused imports add clutter. Action granularity: Each statement performs a distinct action, with no compressed multi-action lines. Reading flow: The progression from model fields to configuration and behavior is natural and consistent.