Sample

pyint-f6303498dcd6-I02

Shorten method, parameter, and local names without collisions

Matched original source

Lines18

Scores

MethodScoreScale
Posnett0.0310–1; higher is more readable
Dorn0.7750–1; higher is more readable
Mi0.5880–1; higher is more readable
LLOC9Logical lines; fewer is more readable
DeepSeek V4 Pro16.330–20; mean of three runs
GPT-6.1 Sol150–20; mean of three runs
BTTF0.5390–1; higher is more readable

Views

Source code

from django.contrib.syndication.views import Feed as BaseFeed from django.utils.feedgenerator import Atom1Feed, Rss201rev2Feed class Feed(BaseFeed): """ This is a subclass of the `Feed` from `django.contrib.syndication`. This allows users to define a `geometry(obj)` and/or `item_geometry(item)` methods on their own subclasses so that geo-referenced information may placed in the feed. """ feed_type = GeoRSSFeed def feed(self, obj2): return {"geometry": self._get_dynamic_attr("geometry", obj2)} def item2(self, ite): return {"geometry": self._get_dynamic_attr("item_geometry", ite)}

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.379.567−12.526
Source linesThe number of non-empty source lines.18+7.2
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.656−6.984

Intercept 8.87 + feature contributions = -3.439 (log-odds).
Score = sigmoid(-3.439) = 0.031.

Feature contributions

FeatureValueContribution
(log-odds)
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.045+0.508
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.77.947+0.364
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.19+0.364
Indentation frequencyHow rapidly indentation changes from line to line.13−0.287
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.65.737+0.256
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.17.886−0.16
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.13+0.123

Intercept 0.07 + feature contributions = 1.237 (log-odds).
Score = sigmoid(1.237) = 0.775.

Score0.588
Score9
Run 1

The code demonstrates good structure with a clear class hierarchy and single-purpose methods. Nesting is minimal and non-problematic. Intent is clearly documented via docstring explaining the GeoRSS extension purpose. Code length is concise and appropriate for the functionality. Action granularity is acceptable—each method handles one concern, though the parameter names 'obj2' and 'ite' are slightly unclear abbreviations that reduce readability. Reading flow is natural, with logical progression from imports through class definition to method implementations. Minor concerns: missing import for GeoRSSFeed (assumed external), unclear parameter naming, and the docstring could be more explicit about the GeoRSSFeed class. Overall, this is highly readable code with clear purpose and clean organization, losing points mainly for parameter naming and implicit dependency.

Run 2

The code is clear and well-structured: it imports necessary components, defines a subclass with a descriptive docstring, and overrides two simple methods. Nesting is minimal, and intent is communicated effectively via naming and documentation. The method names 'feed' and 'item2' are somewhat ambiguous—'feed' clashes conceptually with the class name and 'item2' lacks clarity (perhaps 'item_attributes' would be better). Code length is concise, with one action per line. Reading flow is natural. Minor improvements could include renaming parameters ('obj2' and 'ite' are unclear) and methods to better reflect their purpose.

Run 3

The code is concise and readable, with clear imports, a docstring explaining the subclass's purpose, and simple method overrides. Structure is logical, nesting is minimal, and intent is well-communicated through method names and comments. Minor readability issues include ambiguous parameter names like 'obj2' and 'ite' (likely typos or placeholders), and the feed_type assignment assumes GeoRSSFeed is defined elsewhere, which could confuse readers without context. Overall, it is easy to follow but could benefit from more descriptive parameter names.

Run 1

Code Structure: Imports, class documentation, configuration, and methods are logically organized. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: The docstring explains the geographic-feed purpose, but names such as feed, item2, obj2, and ite obscure method roles. GeoRSSFeed is not defined or imported in the snippet, while Atom1Feed and Rss201rev2Feed are unused, adding uncertainty. Code length: The implementation is concise without unnecessary logic. Action granularity: Each statement performs one clear action. Reading flow: The top-to-bottom flow is natural, though clearer method and parameter names and cleaned-up imports would improve readability.

Run 2

Code Structure: The small class is logically organized, with a descriptive docstring, configuration attribute, and two methods. Nesting: Minimal nesting makes it easy to scan. Clarity of intent: The docstring explains the geographic-feed extension, and the geometry keys are clear, but names such as obj2, ite, and item2 are vague. GeoRSSFeed is not defined or imported in the snippet, and the imported feed generators are unused, creating uncertainty. Code length: Concise, with little unnecessary code beyond the unused imports. Action granularity: Each method performs one straightforward return operation, without packing unrelated actions together. Reading flow: The progression from imports to documentation to methods is natural, although inconsistent naming and the unresolved feed type interrupt comprehension.

Run 3

Code Structure: The small subclass logically groups feed configuration and geometry helpers, though GeoRSSFeed is neither defined nor imported in the snippet, and two imports are unused. Nesting: Methods are flat, with no nested control flow. Clarity of intent: The docstring explains the geographic-feed purpose, and the geometry keys are descriptive; however, feed, item2, obj2, and ite are vague or inconsistent names that obscure their roles. Code length: The implementation is concise without unnecessary procedural code. Action granularity: Each statement performs one clear action. Reading flow: Imports, class documentation, configuration, and methods follow a natural order, although the missing GeoRSSFeed reference and ambiguous method names interrupt understanding.