Sample
pyint-2eb29e8c542c-I05
Rewrite eligible decimal integer literals in hexadecimal notation
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.589 | 0–1; higher is more readable |
| Mi | 0.632 | 0–1; higher is more readable |
| LLOC | 44 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 17.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 17 | 0–20; mean of three runs |
| BTTF | 0.598 | 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.675 | −7.012 |
Intercept 8.87 + feature contributions = -58.805 (log-odds).
Score = sigmoid(-58.805) = 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.906 | +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.284 |
| 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.976 | +0.108 |
Intercept 0.07 + feature contributions = 0.361 (log-odds).
Score = sigmoid(0.361) = 0.589.
| Score | 0.632 |
|---|
| Score | 44 |
|---|
Run 1
The code is well-structured, with clear separation of imports, class definition, field declarations, and methods. It follows Django model conventions, making intent obvious to experienced developers. Nesting is minimal and readability is high. However, a few issues prevent a higher score: use of hexadecimal max_length (0x96) is less intuitive than 150, the UserManager reference is undefined in the snippet, and some methods like clean() rely on implicit class behavior. Minor inconsistencies in docstring style also slightly affect flow. Overall, it is concise and maintainable.
Run 2
The code is highly readable. It follows a logical structure: imports, class definition, field declarations, Meta class, and methods. Nesting is minimal—only field definitions use multi-line patterns, which is standard for Django models. The intent is clear: it defines an abstract user model with standard fields and methods. Code length is appropriate; each field and method is concise and necessary. Action granularity is excellent, with one logical action per line or block. Reading flow is natural, from imports to class definition to fields to methods, matching typical Django conventions. Minor deductions for using `0x96` instead of `150` (slightly less clear) and the lack of type hints, but overall it's very clean and maintainable.
Run 3
The code demonstrates excellent readability. It follows Django model conventions with clear separation of imports, class definition, fields, Meta, and methods. Fields are logically grouped and consistently formatted. The use of gettext_lazy, meaningful help_text, and validators makes intent explicit. Methods are short, focused, and self-documenting with appropriate docstrings. Nesting is minimal. One minor readability concern is the use of hexadecimal values (0x96) instead of plain integers for max_length, which may be less intuitive to some developers. Overall, the code is well-structured, flat, concise, and follows a natural reading flow.
Run 1
Code Structure: Fields, manager, configuration, metadata, and methods are logically grouped, although numerous unused imports add clutter and PermissionsMixin and UserManager lack visible definitions or imports. Nesting: Shallow nesting and straightforward methods make the code easy to scan. Clarity of intent: Descriptive names, docstrings, and field help text communicate purpose clearly; hexadecimal max_length values obscure the familiar limit of 150. Code length: Appropriately concise for a Django model, with some unnecessary import overhead. Action granularity: Statements generally perform one action each, and multiline field declarations improve readability. Reading flow: The progression from model fields to configuration and behavior is natural, with consistent formatting and spacing.
Run 2
Code Structure: Fields, configuration, metadata, and methods are logically grouped, although PermissionsMixin and UserManager are not defined or imported in the snippet. Nesting: Shallow nesting and straightforward methods make the code easy to scan. Clarity of intent: Descriptive names, docstrings, and field help text explain the model well; hexadecimal max_length values obscure the otherwise simple limit of 150. Code length: Mostly concise, with useful multiline formatting, but numerous unused imports add clutter. Action granularity: Statements generally perform one action per line, and field declarations are neatly separated. Reading flow: The progression from model fields to settings and behavior is natural, with consistent indentation and spacing.
Run 3
Code Structure: Fields, manager, configuration, metadata, and methods are logically grouped, although PermissionsMixin and UserManager are not defined or imported in the snippet. Nesting: Shallow nesting makes the class easy to follow; multiline field declarations remain clear. Clarity of intent: Descriptive names, docstrings, and help text explain the model well, but hexadecimal max_length values obscure the straightforward limit of 150. Code length: Appropriate for a declarative Django model, though several unused imports add clutter. Action granularity: Statements generally perform one action each, and field options are neatly separated. Reading flow: The progression from model fields to configuration and behavior is natural, with consistent formatting and short methods.