Sample
pyint-5a706d3e1494-I09
Select one of ten low-readability unrelated code templates per class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.586 | 0–1; higher is more readable |
| Mi | 0.615 | 0–1; higher is more readable |
| LLOC | 47 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 16 | 0–20; mean of three runs |
| GPT-6.1 Sol | 16 | 0–20; mean of three runs |
| BTTF | 0.526 | 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. | 3016.185 | −99.534 |
| Source linesThe number of non-empty source lines. | 86 | +34.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.745 | −7.117 |
Intercept 8.87 + feature contributions = -63.381 (log-odds).
Score = sigmoid(-63.381) = 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. | 87 | −2.044 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 79 | +1.995 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 79 | −1.392 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 85.906 | +0.791 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 83.931 | +0.55 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.069 | +0.267 |
| 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.954 | +0.109 |
Intercept 0.07 + feature contributions = 0.347 (log-odds).
Score = sigmoid(0.347) = 0.586.
| Score | 0.615 |
|---|
| Score | 47 |
|---|
Run 1
The code is highly readable overall. It has clear structure, minimal nesting, and obvious intent, reflecting a typical Django abstract user model. The obfuscated variable in get_short_name is a major exception—it is meaningless, includes dead code (bitwise operations that always result in 0), and breaks the flow. Field definitions are verbose but standard and clear. Granularity is good, with one action per line in methods. Minor import clutter (unused imports) slightly hurts clarity, but the class and method organization is logical and maintainable.
Run 2
The code is generally well-structured with clear separation of model fields, Meta class, and methods. Field definitions are readable with descriptive help_text and validation. However, readability is undermined by the get_short_name method containing three meaningless variables (lI0O_0ce64f89) that serve no purpose—likely obfuscated or leftover debug code. This breaks clarity of intent and adds unnecessary noise. The clean method uses an overly verbose self.__class__.objects.normalize_email call instead of self.objects.normalize_email. Overall structure follows Django conventions well, but the anomalous get_short_name body hurts reading flow and action granularity.
Run 3
The code is generally well-structured and readable, with clear Django model conventions. Imports are organized, field definitions are cleanly formatted, and methods have descriptive docstrings. The use of translation helpers and validators follows standard Django patterns. However, the get_short_name method contains obfuscated variable names and unnecessary manual import assignments (lI0O_0ce64f89) that serve no discernible purpose and severely impact readability. These lines break the natural reading flow and violate the principle of clear intent. The rest of the code maintains good granularity, flat nesting, and appropriate length. The email_user method's use of **kwargs slightly obscures the full signature but is acceptable given Django's send_mail flexibility. Overall, the code would score higher without the obfuscated lines.
Run 1
Code Structure: Fields, metadata, and methods are logically grouped, though unused imports and unresolved PermissionsMixin/UserManager names weaken the snippet's self-containment. Nesting: Shallow nesting and straightforward methods make scanning easy. Clarity of intent: Descriptive field names, help text, and docstrings clearly explain the user model; however, the cryptic variable and pointless bitwise operations in get_short_name obscure an otherwise simple method. Code length: Mostly appropriate for Django model configuration, but unnecessary imports and dead calculations add clutter. Action granularity: Each statement generally performs one action, and multiline field declarations remain easy to follow. Reading flow: The progression from fields to configuration to behavior is natural, with the unexplained calculations interrupting the flow.
Run 2
Code Structure: Fields, metadata, and methods are logically grouped, though unused imports and unresolved PermissionsMixin/UserManager references distract. Nesting: Shallow nesting makes the class easy to scan; multiline field declarations remain manageable. Clarity of intent: Descriptive names, docstrings, and help text clearly explain most behavior, but the cryptic variable and pointless bitwise operations in get_short_name obscure an otherwise simple method. Code length: Mostly appropriate for a Django model, with unnecessary imports and three redundant computation lines adding noise. Action granularity: Each statement performs one action, and arguments are generally formatted clearly. Reading flow: The progression from model fields to configuration and utility methods is natural, interrupted mainly by the unexplained obfuscated computation.
Run 3
Code Structure: The class logically groups model fields, configuration, and methods, although unused imports and unresolved names in this snippet add distraction. Nesting: Shallow nesting and straightforward methods make the code easy to follow. Clarity of intent: Descriptive field names, help text, and docstrings clearly explain most behavior; the cryptic variable and pointless bitwise operations in get_short_name obscure an otherwise simple purpose. Code length: Mostly appropriate for a Django model, but the extra imports and three redundant statements unnecessarily increase length. Action granularity: Statements generally perform one action per line, and multiline field definitions cleanly separate options. Reading flow: Conventional Django organization and consistent formatting support natural reading, interrupted mainly by the unexplained obfuscated computation.