Sample

pyint-528b367447da-I01

Remove comments and docstrings

Matched original source

Lines13

Scores

MethodScoreScale
Posnett0.0050–1; higher is more readable
Dorn0.580–1; higher is more readable
Mi0.30–1; higher is more readable
LLOC8Logical lines; fewer is more readable
DeepSeek V4 Pro14.670–20; mean of three runs
GPT-6.1 Sol170–20; mean of three runs
BTTF0.4450–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): 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.371.385−12.256
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.701−7.051
Source linesThe number of non-empty source lines.13+5.2

Intercept 8.87 + feature contributions = -5.237 (log-odds).
Score = sigmoid(-5.237) = 0.005.

Feature contributions

FeatureValueContribution
(log-odds)
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.10+0.682
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.73.929+0.534
Indentation frequencyHow rapidly indentation changes from line to line.13−0.287
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.072+0.239
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.12.76−0.231
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.13+0.123

Intercept 0.07 + feature contributions = 0.324 (log-odds).
Score = sigmoid(0.324) = 0.58.

Score0.3
Score8
Run 1

The code is short and logically structured, but suffers from several readability issues. The class inherits from a base class imported as `BaseFeed` yet references `GeoRSSFeed`, which is not imported or defined locally—a major clarity gap. The methods are concise and perform one action, but `_get_dynamic_attr` is used without context, leaving intent ambiguous. There is also an unnecessary blank line after the class declaration. The straightforward linear reading flow is good, but the missing import and unexplained helper reduce overall readability. With better imports and a brief comment or docstring, the score would be higher.

Run 2

The code is reasonably clear with a logical class structure and minimal nesting. However, it lacks context: GeoRSSFeed is used but not imported or defined, and the purpose of dynamic attributes/widgets is unclear without surrounding code. The class has an unnecessary blank line, and method names imply behavior not fully shown. Overall structure is readable, but missing context reduces clarity.

Run 3

The code is concise and mostly clear, with a logical structure. The class inheritance and feed_type assignment show clear intent. The two methods are short, flat, and follow a single-action-per-line style. However, readability is slightly reduced by the unimplemented `GeoRSSFeed` reference (undefined in the snippet) and the reliance on the inherited `_get_dynamic_attr` method, which may not be obvious to all readers.

Run 1

Code Structure: A small, logically organized subclass groups related feed customization methods. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: Method names and geometry keys clearly convey their purpose, though GeoRSSFeed is not defined or imported in the snippet, and the dynamic attribute lookup requires framework knowledge. Code length: Concise, with no unnecessary implementation detail, but unused imports and extra blank lines add minor clutter. Action granularity: Each method performs one clear action in a single return statement. Reading flow: Imports, class configuration, and methods follow a natural order; inconsistent whitespace slightly reduces polish.

Run 2

Code Structure: A small, logically organized class groups two related feed-customization methods. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: Method names and geometry keys clearly convey their purpose, though GeoRSSFeed is not defined or imported in the snippet, and the imported feed generators are unused. Code length: Concise, with only minor unnecessary whitespace and imports. Action granularity: Each statement performs one focused action. Reading flow: Imports, class configuration, and methods follow a natural order; extra blank lines slightly disrupt the presentation.

Run 3

Code Structure: A small, logically organized subclass with two related methods. Nesting: Flat and easy to scan, with no nested control flow. Clarity of intent: Method names and geometry keys communicate feed-level and item-level customization, though GeoRSSFeed is undefined in the snippet and the imported feed generators are unused. Code length: Concise, with only some unnecessary blank space. Action granularity: Each return performs one clear action on its own line. Reading flow: Natural progression from imports to class configuration to methods; unresolved and unused names slightly interrupt understanding.