Sample

pyint-ffc235d6710f-I10

Deterministically remove some optional blank lines and bracketed line breaks

Matched original source

Lines17

Scores

MethodScoreScale
Posnett0.020–1; higher is more readable
Dorn0.7770–1; higher is more readable
Mi0.4310–1; higher is more readable
LLOC9Logical lines; fewer is more readable
DeepSeek V4 Pro17.670–20; mean of three runs
GPT-6.1 Sol180–20; mean of three runs
BTTF0.6030–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
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.683−7.025
Source linesThe number of non-empty source lines.17+6.8

Intercept 8.87 + feature contributions = -3.881 (log-odds).
Score = sigmoid(-3.881) = 0.02.

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
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.18+0.399
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.78+0.361
Indentation frequencyHow rapidly indentation changes from line to line.12−0.322
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.65.056+0.245
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.16.797−0.175
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.12+0.145

Intercept 0.07 + feature contributions = 1.249 (log-odds).
Score = sigmoid(1.249) = 0.777.

Score0.431
Score9
Run 1

The code is highly readable. It has a clear logical structure with a single class inheriting from Django's Feed. Nesting is minimal—just two straightforward methods. Intent is explicitly documented in the docstring, explaining the purpose of adding geo-referenced information. The code is concise, with no unnecessary lines or redundancy. Action granularity is appropriate, with one logical operation per return statement. Reading flow is natural: class declaration, docstring, then two parallel methods that clearly extend feed generation. Minor deductions could be made for reliance on inherited methods like `_get_dynamic_attr`, which may not be immediately obvious to readers unfamiliar with Django's internals, but overall the code is exceptionally clear.

Run 2

The code is concise and well-structured. The class purpose is clearly explained in the docstring. Methods are short, with one action per line, and follow a consistent pattern. There is minimal nesting; only one level of indentation is used. Naming is clear, and the flow is natural: the class is defined, then feed-level extras, then item-level extras. The only minor drawbacks are the dependency on the `GeoRSSFeed` name (which is imported elsewhere or defined earlier) and the use of a private helper that may not be obvious to beginners, but both are understandable in context.

Run 3

The code is highly readable. It has a clear structure with an appropriate docstring explaining its purpose. Nesting is minimal, with flat method definitions. The intent is clear: extending Django's Feed to include geo-referenced geometry data. The code is concise, with no unnecessary lines. Each method performs a single, well-defined action. Reading flow is natural, following a logical top-to-bottom progression. Minor deductions: the missing import for GeoRSSFeed is a minor concern, and the docstring could be slightly more specific about how geometry is included. Overall, excellent readability.

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 and descriptive method names clearly explain geometry support, though GeoRSSFeed is not defined or imported in the snippet, and the docstring contains a minor grammatical error. Code length: Concise, with no unnecessary implementation detail. Action granularity: Each method performs a single return operation on one line. Reading flow: Natural top-to-bottom progression, with parallel methods reinforcing consistency. The unused Atom1Feed and Rss201rev2Feed imports introduce minor distraction.

Run 2

Code Structure: Imports, class documentation, configuration, and methods are logically organized. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: Descriptive method names and the docstring clearly explain how geometry is added to feeds, although GeoRSSFeed is neither defined nor imported in the snippet, and the docstring has a minor grammatical error. Code length: Compact and appropriately concise, though Atom1Feed and Rss201rev2Feed appear unused. Action granularity: Each statement performs one clear action. Reading flow: The progression from class purpose to feed-level and item-level geometry handling is natural, with consistent formatting and parallel method implementations.

Run 3

Code Structure: A well-organized subclass groups two closely related overrides. Nesting: The code is flat, with no conditional or loop nesting. Clarity of intent: Descriptive method names and the docstring explain how geometry is added to feeds, although GeoRSSFeed is not defined or imported in the snippet and the docstring has minor grammatical errors. Code length: The implementation is concise without unnecessary logic. Action granularity: Each method performs one clear action in a single return statement. Reading flow: Imports, class documentation, configuration, and methods follow a natural sequence; an additional blank line before the class would improve formatting.