Sample
pyint-63e3cb60c1bc-I01
Remove comments and docstrings
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0.002 | 0–1; higher is more readable |
| Dorn | 0.799 | 0–1; higher is more readable |
| Mi | 0.48 | 0–1; higher is more readable |
| LLOC | 11 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 17 | 0–20; mean of three runs |
| GPT-6.1 Sol | 18.33 | 0–20; mean of three runs |
| BTTF | 0.752 | 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. | 408.424 | −13.478 |
| 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.62 | −6.93 |
| Source linesThe number of non-empty source lines. | 13 | +5.2 |
Intercept 8.87 + feature contributions = -6.338 (log-odds).
Score = sigmoid(-6.338) = 0.002.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| 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. | 55.857 | +1.299 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 14 | +0.541 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.057 | +0.393 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 13 | −0.287 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 12.912 | −0.229 |
Intercept 0.07 + feature contributions = 1.379 (log-odds).
Score = sigmoid(1.379) = 0.799.
| Score | 0.48 |
|---|
| Score | 11 |
|---|
Run 1
The code is clean, concise, and well-structured. It imports only necessary modules, defines a single clear class with logical attributes, and registers a signal in the `ready` method — each on its own line. Nesting is minimal, intent is evident (Django app configuration for messages), and the reading flow is natural. The only minor drawback is that `update_level_tags` is referenced but not defined in this snippet, which slightly obscures full intent without surrounding context.
Run 2
The code is clean and readable. It imports necessary modules, defines a single class with a clear purpose, and has a simple method that connects a signal. The structure is logical, with class attributes followed by the ready method. Nesting is minimal, with no conditional or loop complexity. Intent is clear from naming: MessagesConfig is a Django app config for messages, and ready connects a signal. Code length is concise with no redundancy. Action granularity is acceptable, as the signal connection is a single action. Reading flow is natural, following import, class definition, attributes, then method. Minor deductions could be for the unused imports (base, get_level_tags, SimpleLazyObject) which may cause confusion, though they may be intentional for module-level side effects. Overall, this is straightforward Django boilerplate code that is easy to understand.
Run 3
The code is well-structured and highly readable. It follows standard Django app configuration patterns with clear imports and a single class definition. The class has a clear purpose, and the `ready` method contains one logical action (connecting a signal) per line. Nesting is minimal, with only the class and method levels. The reading flow is natural: imports first, then class definition, then method. The code is concise without being overly terse. Minor deductions: the import of `base` from `django.contrib.messages.storage` appears unused, which slightly reduces clarity of intent, and the `SimpleLazyObject` import also seems unnecessary. These unused imports could confuse readers about the code's actual dependencies and purpose. Overall, the code is exemplary in structure, granularity, and length, with only minor import hygiene issues preventing a perfect score.
Run 1
Code Structure: Logically organized imports followed by a focused Django app configuration class. Nesting: Minimal, with only a class and a method. Clarity of intent: The class metadata and signal registration clearly express their purpose, although update_level_tags is not defined or imported in the snippet. Code length: Concise, but several unused imports add clutter. Action granularity: Each statement performs one action. Reading flow: Natural top-to-bottom progression from dependencies to configuration and initialization.
Run 2
Code Structure: Imports and the app configuration class are logically organized, though several imports are unused in the snippet. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: The class clearly configures Django's messages app, and ready() registers a settings-change handler; however, update_level_tags is not defined or imported here, leaving its origin unclear. Code length: Compact and appropriate, aside from unused imports. Action granularity: Each statement performs one action. Reading flow: Natural progression from imports to configuration attributes to initialization behavior, though an additional blank line before the top-level class would improve formatting.
Run 3
Code Structure: Imports and a small AppConfig class are logically organized, though several imports appear unused. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: The class metadata and signal connection clearly express application initialization, but update_level_tags is neither defined nor imported in the snippet, leaving its behavior unclear. Code length: Very concise, with no unnecessary implementation complexity. Action granularity: Each statement performs one action. Reading flow: Natural progression from imports to configuration to startup behavior; an additional blank line before the class would improve conventional formatting.