Sample

pyint-38e7391d459e-SRC

Unmodified source class

Lines13

Scores

MethodScoreScale
Posnett0.0020–1; higher is more readable
Dorn0.7990–1; higher is more readable
Mi0.480–1; higher is more readable
LLOC11Logical lines; fewer is more readable
DeepSeek V4 Pro17.330–20; mean of three runs
GPT-6.1 Sol180–20; mean of three runs
BTTF0.7520–1; higher is more readable

Views

Source code

from django.apps import AppConfig from django.contrib.messages.storage import base from django.contrib.messages.utils import get_level_tags from django.core.signals import setting_changed from django.utils.functional import SimpleLazyObject from django.utils.translation import gettext_lazy as _ class MessagesConfig(AppConfig): name = "django.contrib.messages" verbose_name = _("Messages") def ready(self): setting_changed.connect(update_level_tags)

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(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

FeatureValueContribution
(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.

Score0.48
Score11
Run 1

The code is highly readable with a clear, logical structure. It follows conventional Django app configuration patterns, making the intent immediately recognizable. The imports are organized and each serves a clear purpose. The class has a simple inheritance structure, and the methods are flat with no nesting. The `ready` method contains a single, well-named action that clearly communicates its purpose. There is minimal but sufficient code length for the functionality provided. One minor point could be the unused import `base` and `get_level_tags` if they are not referenced elsewhere in the file, but this does not significantly impact readability. Overall, the code is concise, well-organized, and easy to follow.

Run 2

The code is highly readable with clear, logical structure. Imports are organized and specific, the class definition is minimal with clear attributes, and the signal connection in ready() is straightforward. There is no unnecessary nesting, and each line serves a single purpose. Action granularity is appropriate, and the reading flow is natural. Minor improvements could include grouping imports by source (Django core vs contrib) or adding a blank line after class attributes, but overall it is concise and clean.

Run 3

The code is concise and well-structured. The class definition is minimal with clear purpose via verbose_name and ready method. Imports are orderly and include only relevant modules. Nesting is minimal. However, the `update_level_tags` function referenced from `django.contrib.messages.utils` is not imported directly, making the code slightly less readable without checking that module. Some imports (base, get_level_tags, SimpleLazyObject) appear unused, which could confuse readers. Overall the code is readable but could be improved by removing unused imports.

Run 1

Code Structure: Imports followed by a single configuration class provide logical organization, though several imports are unused. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: Class attributes clearly identify the Django app, and ready() visibly connects a settings-change handler; however, update_level_tags is not defined or imported in the snippet, obscuring its behavior. Code length: Very concise, with little unnecessary code beyond the unused imports. Action granularity: Each line performs one action or declaration. Reading flow: Natural top-to-bottom progression from dependencies to configuration and initialization, with minor distraction from unused imports.

Run 2

Code Structure: Imports and app configuration are logically organized, though three unused imports add clutter. Nesting: Minimal nesting makes the code easy to follow. Clarity of intent: The class clearly configures Django's messages app and registers a settings-change handler, but update_level_tags is not defined or imported in the snippet, leaving its source unclear. Code length: Short and focused, apart from unused imports. Action granularity: Each line performs a single clear action. Reading flow: Natural progression from imports to configuration attributes to initialization; an additional blank line before the class would improve formatting.

Run 3

Code Structure: Imports and application configuration are logically organized, though several imports are unused in the snippet. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: Descriptive names clearly indicate message-app configuration and signal registration, but update_level_tags is not defined or imported in the provided code. Code length: Compact, with no unnecessary implementation detail, aside from unused imports. Action granularity: Each assignment and registration occupies its own line. Reading flow: Natural progression from imports to class metadata to initialization behavior; an additional blank line before the class would improve conventional formatting.