Sample

pyint-f5b9641e4c08-I02

Shorten method, parameter, and local names without collisions

Matched original source

Lines20

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.5860–1; higher is more readable
Mi0.3650–1; higher is more readable
LLOC15Logical lines; fewer is more readable
DeepSeek V4 Pro100–20; mean of three runs
GPT-6.1 Sol17.670–20; mean of three runs
BTTF0.5350–1; higher is more readable

Views

Source code

from django.apps import AppConfig from django.contrib.contenttypes.checks import ( check_generic_foreign_keys, check_model_name_lengths, ) from django.core import checks from django.db.models.signals import post_migrate, pre_migrate from django.utils.translation import gettext_lazy as _ from .management import create_contenttypes, inject_rename_contenttypes_operations class ContentTypesConfig(AppConfig): default_auto_field = "django.db.models.AutoField" name = "django.contrib.contenttypes" verbose_name = _("Content Types") def rea(self): pre_migrate.connect(inject_rename_contenttypes_operations, sender=self) post_migrate.connect(create_contenttypes) checks.register(check_generic_foreign_keys, checks.Tags.models) checks.register(check_model_name_lengths, checks.Tags.models)

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.659.022−21.748
Source linesThe number of non-empty source lines.20+8
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.587−6.881

Intercept 8.87 + feature contributions = -11.758 (log-odds).
Score = sigmoid(-11.758) = 0.

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
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.058+0.374
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.21+0.293
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.81.952+0.194
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.19.759−0.134
Indentation frequencyHow rapidly indentation changes from line to line.20−0.045

Intercept 0.07 + feature contributions = 0.346 (log-odds).
Score = sigmoid(0.346) = 0.586.

Score0.365
Score15
Run 1

The code has a logical import structure and a clear class definition, but readability is severely hindered by an incorrectly named method 'rea' that likely should be 'ready'. This introduces ambiguity of intent. The method body performs multiple action types (connecting signals and registering checks) without separation or comments, reducing clarity. Nesting is flat and lines are concise, but the overall reading flow is disrupted by the method name and mixed responsibilities. Action granularity is moderate; each line is a distinct action, but the grouping is weak. Code length is fine, but the typo and lack of grouping make it difficult to understand at a glance.

Run 2

The code is well-structured and follows Django conventions. Imports are logically grouped and sorted. The class definition is clean with clear attributes. The method 'rea' is concise but has an unclear name - likely a typo or truncated 'ready' method, which slightly reduces clarity of intent. Each action is on its own line, improving action granularity. The nesting is minimal and flat. The reading flow is natural, with a logical progression from imports to class definition to method body. The main readability issue is the method name 'rea' which should likely be 'ready' - this is a significant clarity concern since it's a standard Django lifecycle method. Otherwise, the code is exemplary in structure, length, and organization.

Run 3

The code has a clear import structure and class definition, but has a critical flaw: the method is named 'rea' instead of 'ready', which breaks the Django AppConfig contract and obscures intent. The method body performs multiple distinct actions — connecting two signals and registering two checks — without separation or comments, reducing action granularity. Naming is otherwise mostly clear, and imports are organized, but the broken method name and dense multi-action method undermine readability. The code is concise but at the cost of clarity; a reader unfamiliar with Django's AppConfig lifecycle would be confused by the incorrect method name and bundled operations.

Run 1

Code Structure: Imports, configuration attributes, and initialization logic are logically grouped. Nesting: Only class and method scopes are present, keeping nesting shallow. Clarity of intent: Descriptive imports and function names make signal connections and check registration clear, but the method name 'rea' is ambiguous and appears to be a typo for Django's 'ready' hook. Code length: The snippet is concise without unnecessary logic. Action granularity: Each statement performs one action. Reading flow: Configuration naturally precedes initialization, and related registrations are adjacent. Minor spacing improvements between import groups and before the class would improve readability.

Run 2

Code Structure: Imports, configuration attributes, and initialization logic are logically grouped. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: Descriptive imports and function names explain the signal connections and check registrations, but the method name 'rea' is unclear and appears to be a typo for Django's 'ready', obscuring its lifecycle purpose. Code length: Compact without unnecessary statements. Action granularity: Each statement performs one clear action. Reading flow: Configuration followed by setup operations reads naturally, though additional blank lines between import groups and before the class would improve visual organization.

Run 3

Code Structure: Imports, configuration attributes, and initialization logic are logically organized in a single class. Nesting: Only class and method indentation is used, making the code easy to scan. Clarity of intent: Descriptive imports and function names clearly communicate signal connections and check registration, but the method name 'rea' is ambiguous and appears to be a typo for Django's 'ready' lifecycle hook. Code length: The code is concise without unnecessary statements. Action granularity: Each statement performs one configuration or registration action. Reading flow: The progression from imports to metadata to initialization is natural, though a blank line before the class would improve visual separation.