Sample

pyint-b86cd72c0dbb-I11

Split eligible integer literals into pairs of short-named intermediate variables

Matched original source

Lines18

Scores

MethodScoreScale
Posnett0.030–1; higher is more readable
Dorn0.7780–1; higher is more readable
Mi0.430–1; higher is more readable
LLOC9Logical lines; fewer is more readable
DeepSeek V4 Pro17.330–20; mean of three runs
GPT-6.1 Sol180–20; mean of three runs
BTTF0.6010–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_extra_kwargs(self, obj): return {"geometry": self._get_dynamic_attr("geometry", obj)} def item_extra_kwargs(self, item): return {"geometry": self._get_dynamic_attr("item_geometry", item)}

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.684−7.026

Intercept 8.87 + feature contributions = -3.482 (log-odds).
Score = sigmoid(-3.482) = 0.03.

Feature contributions

FeatureValueContribution
(log-odds)
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.043+0.525
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.797−0.161
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.13+0.123

Intercept 0.07 + feature contributions = 1.252 (log-odds).
Score = sigmoid(1.252) = 0.778.

Score0.43
Score9
Run 1

The code is concise, with clear intent and logical structure. Each method performs a single action, and nesting is minimal. The class docstring effectively explains the purpose and extension mechanism. However, readability is slightly reduced because the GeoRSSFeed class and _get_dynamic_attr method are not shown, requiring some Django-specific context to fully understand the implementation.

Run 2

The code is highly readable due to its clear structure, minimal nesting, and concise implementation. It logically organizes a Django Feed subclass with a focused purpose: adding geo-referenced content to feeds via geometry methods. The two short methods each perform a single action (extracting dynamic attributes and returning them as keyword arguments), adhering to good action granularity. The reading flow is natural, moving from class declaration to method definitions. While the docstring is somewhat lengthy relative to the code, it is informative and justified. The only minor concern is that `GeoRSSFeed` is referenced but not imported or defined in the snippet, which could confuse a reader lacking context. Overall, clarity of intent is excellent, and the code avoids unnecessary complexity or length.

Run 3

The code is highly readable with a clear, logical structure. It defines a single class with a focused purpose: extending Django's Feed to support geo-referenced data. Nesting is minimal—just two short methods, each returning a dictionary. Intent is unambiguous, supported by a concise docstring and descriptive method names. The code is concise, avoiding unnecessary verbosity while remaining explicit. Each method performs one clear action: gathering dynamic geometry attributes and returning them as keyword arguments. Reading flow is natural; the class declaration, docstring, and methods follow a logical progression. Minor deductions: no type hints, which could improve clarity, and 'GeoRSSFeed' is referenced but not defined in this snippet, requiring external context.

Run 1

Code Structure: A logically organized subclass groups two closely related feed customization methods. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: Descriptive method names and a helpful docstring explain how geometry is added, although GeoRSSFeed is not defined or imported in the snippet, and the docstring has minor grammatical errors. Code length: Concise, with no unnecessary implementation complexity; the unused Atom1Feed and Rss201rev2Feed imports add slight clutter. Action granularity: Each method performs a single clear return operation, without packing unrelated actions onto one line. Reading flow: Imports, class documentation, configuration, and methods follow a natural order, with consistent formatting.

Run 2

Code Structure: The class is logically organized, with a descriptive docstring, a configuration attribute, and two related methods. Nesting: The code is flat, with no nested control flow. Clarity of intent: Method names and the docstring clearly explain how geometry is added to feeds, although GeoRSSFeed is not defined or imported in the snippet, and the imported feed-generator classes are unused. Code length: The implementation is concise and avoids unnecessary logic. Action granularity: Each method performs one clear return operation without packing unrelated actions onto a line. Reading flow: The progression from imports to documentation, configuration, and methods is natural; minor spacing and grammatical improvements would make it more polished.

Run 3

Code Structure: The class logically groups its configuration and two closely related methods. Nesting: Methods are flat, with no conditional or loop nesting. Clarity of intent: Descriptive method names and the docstring clearly explain support for geographic feed metadata, although GeoRSSFeed is not defined or imported in the snippet. Code length: The implementation is concise; the unused Atom1Feed and Rss201rev2Feed imports add minor clutter. Action granularity: Each statement performs one clear action. Reading flow: Imports, documentation, configuration, and methods follow a natural sequence, and the parallel method implementations are easy to compare. Minor docstring grammar issues and the missing GeoRSSFeed context slightly reduce readability.