Sample
pyint-83bb70d694a2-I01
Remove comments and docstrings
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.286 | 0–1; higher is more readable |
| Mi | 0.633 | 0–1; higher is more readable |
| LLOC | 40 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 16.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 17 | 0–20; mean of three runs |
| BTTF | 0.659 | 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. | 2796.273 | −92.277 |
| Source linesThe number of non-empty source lines. | 76 | +30.4 |
| 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.695 | −7.042 |
Intercept 8.87 + feature contributions = -60.049 (log-odds).
Score = sigmoid(-60.049) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 76 | +1.892 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 77 | −1.69 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 76 | −1.323 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 75.894 | +0.651 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.078 | +0.18 |
| 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.948 | +0.11 |
Intercept 0.07 + feature contributions = -0.915 (log-odds).
Score = sigmoid(-0.915) = 0.286.
| Score | 0.633 |
|---|
| Score | 40 |
|---|
Run 1
The code is well-structured, with clear separation of model fields, Meta class, and methods. Nesting is minimal, and the field definitions follow Django conventions closely, which improves readability for experienced developers. The clarity of intent is strong, as each field and method has a self-explanatory name and purpose. The code length is appropriate for a Django abstract user model, avoiding unnecessary verbosity. Action granularity is mostly one action per line, though some field definitions span multiple lines for readability—a beneficial trade-off. Reading flow is natural, with model fields grouped logically and methods following fields. Minor issues include an unused import (EmptyManager), a missing newline after the class declaration, and some empty lines inside method bodies. The code assumes familiarity with Django, which is appropriate given its context. Overall, this is a highly readable Django model implementation.
Run 2
The code is highly readable. It follows a logical structure with clear section separation, including all model fields, managers, meta options, and methods in an orderly manner. Nesting is minimal and well-controlled. Each class attribute and method exhibits clear intent, with descriptive names and helpful help_text. The code is concise, avoiding unnecessary verbosity while maintaining completeness. Action granularity is generally one action per line, especially in complex field definitions and method bodies. The reading flow is natural, guiding the reader from field definitions through Meta options to methods. Minor deductions: some blank lines contain trailing whitespace, and a few method docstrings are missing, but these are trivial. Overall, this is an exemplar of Django model code following community best practices.
Run 3
The code is well-structured with clear separation of fields, methods, and Meta class. It uses Django conventions effectively, and each field definition is readable with logical keyword arguments. Nesting is minimal, and the overall flow is natural. Minor deductions: some lines are long (e.g., field definitions), and there are unnecessary blank lines and unused imports that slightly reduce cleanliness. The intent of each method is straightforward, and action granularity is mostly one action per line. Overall, the code is highly readable but could be slightly improved by removing unused imports and reducing line length.
Run 1
Code Structure: Fields, manager, configuration, metadata, and methods are logically grouped, though unused imports add clutter and PermissionsMixin and UserManager lack visible definitions or imports. Nesting: Shallow nesting makes the class easy to scan; multiline field declarations remain clear. Clarity of intent: Descriptive field and method names, plus help text, clearly communicate a Django user model's purpose. Code length: Generally concise, with appropriate detail for field configuration, although unused imports and stray blank lines are unnecessary. Action granularity: Each statement performs one clear action, and short methods avoid combining unrelated operations. Reading flow: The progression from model fields to configuration and behavior is natural, but missing dependencies and inconsistent whitespace slightly interrupt comprehension.
Run 2
Code Structure: Fields, manager, configuration, metadata, and methods are logically grouped using familiar Django conventions, though PermissionsMixin and UserManager are not defined or imported in the snippet. Nesting: Shallow; only field configuration and the Meta class add nesting. Clarity of intent: Descriptive field and method names, along with help text, make the user model's purpose clear. Code length: Mostly concise, but several unused imports and unnecessary blank lines add clutter. Action granularity: Statements generally perform one action each, and multiline field declarations keep options easy to scan. Reading flow: Natural progression from model fields to configuration and behavior; missing dependencies and excess whitespace slightly interrupt an otherwise readable presentation.
Run 3
Code Structure: Fields, manager, configuration, metadata, and methods are logically grouped using standard Django conventions. Nesting: Shallow nesting and straightforward methods make the code easy to follow. Clarity of intent: Descriptive field and method names, along with help text, clearly communicate purpose; however, PermissionsMixin and UserManager are not defined or imported in the snippet. Code length: Mostly concise, though several unused imports and unnecessary blank lines add clutter. Action granularity: Statements generally perform one action per line, while multiline field declarations keep complex options readable. Reading flow: The progression from model declarations to behavior is natural and consistent, with minor interruptions from whitespace and missing dependencies.