Sample

pyint-1bfa96335a19-I02

Shorten method, parameter, and local names without collisions

Matched original source

Lines13

Scores

MethodScoreScale
Posnett0.0020–1; higher is more readable
Dorn0.7980–1; higher is more readable
Mi0.4850–1; higher is more readable
LLOC11Logical lines; fewer is more readable
DeepSeek V4 Pro12.670–20; mean of three runs
GPT-6.1 Sol16.330–20; mean of three runs
BTTF0.6010–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 rea(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.612−6.919
Source linesThe number of non-empty source lines.13+5.2

Intercept 8.87 + feature contributions = -6.327 (log-odds).
Score = sigmoid(-6.327) = 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.39
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.895−0.23

Intercept 0.07 + feature contributions = 1.377 (log-odds).
Score = sigmoid(1.377) = 0.798.

Score0.485
Score11
Run 1

The code is readable in its simplicity but has significant issues. The structure is minimal but incomplete, with an ambiguous method named `rea` that lacks a clear purpose. The nesting and code length are fine, but clarity of intent is poor due to the unclear method name and unused imports. Action granularity is acceptable—each line does one thing—but the reading flow is disrupted by the meaningless method name. The unused imports (get_level_tags, SimpleLazyObject, base, update_level_tags) reduce readability by adding noise. Overall, the code would be moderately readable to someone familiar with Django, but the unexplained method and unused imports lower its score.

Run 2

The code is short and mostly readable, but has several issues. The class definition is clear, with obvious imports and a straightforward config pattern typical of Django apps. However, the method named 'rea' is ambiguous—likely a typo for 'ready'—which obscures intent and breaks convention. The method body contains a single clear action, but the overall structure is incomplete or truncated (no indentation issues, but missing logic). The unused imports (base, get_level_tags, SimpleLazyObject) add noise and reduce clarity. Nesting is flat and line length is fine, but the misleading method name and dead imports lower readability. If this is intended as a Django AppConfig, the method should be 'ready' and include proper signal connection logic.

Run 3

The code has a clear basic structure with a config class and imports, but several issues hurt readability. The method name 'rea' is ambiguous and likely a typo. The method has poor clarity of intent—it connects a signal but the method name doesn't convey what it does. The unused import 'base' and 'get_level_tags' adds noise. The missing function 'update_level_tags' makes the code non-functional. The class has only one method, and it's not clear when this method is called or by whom. Nesting and action granularity are fine (flat, one action per line), but the overall reading flow suffers from the ambiguous method name and unclear purpose. The code length is concise but at the cost of missing context.

Run 1

Code Structure: Imports and a small configuration class are logically organized, though several imports are unused. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: Class metadata is clear, but the method name 'rea' is ambiguous and likely a typo for 'ready'; update_level_tags is not defined or imported in the snippet, obscuring the signal connection. Code length: Concise, with little unnecessary code beyond unused imports. Action granularity: Each statement performs one action. Reading flow: Natural top-to-bottom progression, although the unclear method name and unresolved callback interrupt understanding.

Run 2

Code Structure: Imports and a single configuration class are logically organized, though several imports are unused. Nesting: Minimal, with only a class and method. Clarity of intent: The class metadata is clear, but the method name 'rea' is ambiguous and appears to be a misspelling of Django's 'ready' hook; 'update_level_tags' is not defined or imported in the snippet. Code length: Short and focused, aside from unused imports. Action granularity: Each statement performs one action. Reading flow: Natural top-to-bottom progression, slightly weakened by the unclear method name and unresolved callback.

Run 3

Code Structure: Imports, configuration attributes, and the method are logically organized, though several imports are unused. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: The app configuration is clear, but the ambiguous method name 'rea' (possibly intended as 'ready') and the undefined 'update_level_tags' obscure the initialization behavior. Code length: Short and concise, with unnecessary imports adding some clutter. Action granularity: Each statement performs a single action. Reading flow: Natural top-to-bottom progression, although the unexplained callback and unclear method name interrupt understanding.