Sample
pyint-35f9d5772f7d-I06
Invert eligible conditions and exchange their branches
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 | 18 | 0–20; mean of three runs |
| GPT-6.1 Sol | 18 | 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 highly readable with a clear, logical structure. Imports are grouped and ordered conventionally, the class definition is clean and properly extends AppConfig, and the single method `ready` has a clear intent of connecting a signal. Nesting is minimal, with only one level of class-method indentation. Action granularity is appropriate — one action per statement. The reading flow is natural: config metadata first, then behavior. The only minor deduction is that the imported `base`, `get_level_tags`, and `SimpleLazyObject` are unused, and the function `update_level_tags` is not defined in this snippet; these could cause ambiguity about intent. Overall, concise and well-structured code.
Run 2
The code is concise and well-structured. It imports only necessary dependencies, defines a clear AppConfig subclass with an appropriate name and verbose_name, and connects a signal handler in the ready method. Nesting is minimal, with a single method definition. Clarity of intent is high — the purpose is obviously to configure the messages app and respond to settings changes. Code length is appropriate, avoiding unnecessary verbosity. Each action is on its own line, improving readability. Reading flow is natural, following the typical Django app config pattern. The only minor deduction is the import of `base` from `django.contrib.messages.storage` and `SimpleLazyObject`, which are unused in the shown snippet and could cause confusion. Overall, it is highly readable.
Run 3
The code demonstrates excellent readability through a clean, logical structure. Imports are organized and properly grouped (Django core, contrib, utils). The class definition is concise with clear attribute assignments and a single, focused method. Nesting is flat—there are no conditional blocks or nested functions. Intent is unambiguous: this is a Django app configuration that connects a settings change handler. Code length is minimal and appropriate for the task. Action granularity is well-balanced, with one clear operation per line. Reading flow follows natural Python conventions: imports, class declaration, attributes, then behavior. Minor deductions could be argued for having all imports at module level (standard practice) and the bare signal connect without a disconnect handler, but these are more about completeness than readability.
Run 1
Code Structure: Imports and the app configuration class are logically organized. Nesting: Only the shallow nesting required for a class and method is present. Clarity of intent: The class attributes and signal connection clearly express app configuration and startup behavior, though update_level_tags is not defined or imported in the snippet, and several imports appear unused. Code length: The implementation is concise, with minor import clutter. Action granularity: Each statement performs one action. Reading flow: The progression from imports to configuration to initialization is natural; an additional blank line before the class would improve formatting.
Run 2
Code Structure: Imports, app configuration, and initialization are logically organized. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: The class clearly configures Django's messages app and registers a settings-change handler, though update_level_tags is neither defined nor imported in the snippet, and several imports appear unused. Code length: Very concise, with no unnecessary implementation detail. Action granularity: Each statement performs a single action. Reading flow: Natural progression from imports to configuration attributes to initialization; an additional blank line before the class would improve conventional Python formatting.
Run 3
Code Structure: Imports and a single configuration class are logically organized, though several imports are unused in this snippet. Nesting: Minimal, with only a class and its method. Clarity of intent: Descriptive names clearly indicate Django messages configuration and signal registration, but update_level_tags is neither defined nor imported, leaving its origin unclear. Code length: Very concise, with no unnecessary implementation. Action granularity: Each statement performs one action. Reading flow: Natural progression from imports to configuration attributes to initialization behavior; an additional blank line before the class would improve standard Python formatting.