Sample

pyint-dc6a7d313abe-I03

Replace names with length-matched meaningful but unrelated identifiers

Matched original source

Lines18

Scores

MethodScoreScale
Posnett0.030–1; higher is more readable
Dorn0.7770–1; higher is more readable
Mi0.4690–1; higher is more readable
LLOC9Logical lines; fewer is more readable
DeepSeek V4 Pro15.670–20; mean of three runs
GPT-6.1 Sol150–20; mean of three runs
BTTF0.5290–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 validateBalance(self, key): return {"geometry": self._get_dynamic_attr("geometry", key)} def validateMessage(self, flag): return {"geometry": self._get_dynamic_attr("item_geometry", flag)}

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.679−7.019

Intercept 8.87 + feature contributions = -3.475 (log-odds).
Score = sigmoid(-3.475) = 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.522
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.81−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.25 (log-odds).
Score = sigmoid(1.25) = 0.777.

Score0.469
Score9
Run 1

The code is generally readable with clear class structure, concise methods, and flat nesting. Docstring explains intent well. Minor issues: ambiguous method names (validateBalance, validateMessage) don't reflect their purpose, and some parameters (key, flag) lack clarity.

Run 2

The code is generally clear and well-organized, with a logical class structure and minimal nesting. The docstring explains the purpose, and each method performs a single action per line. However, readability is reduced by questionable naming choices: 'validateBalance' and 'validateMessage' do not reflect their actual behavior of returning geometry data, and parameters 'key' and 'flag' are overly generic. The methods are concise but their intent is ambiguous without external context. Overall, the code is maintainable but could benefit from clearer names.

Run 3

The code is generally readable with a clear purpose and logical organization. It follows the Django Feed structure, imports are clean, and the class and methods are concise. The methods are short, one action per line, and the flow is natural. However, the method names `validateBalance` and `validateMessage` are ambiguous: they do not actually validate anything, but rather return a dictionary containing a geometry attribute. This mismatch between intent and behavior reduces clarity. Additionally, the parameter names `key` and `flag` are vague and do not convey their meaning, making the code slightly harder to follow. The docstring is helpful for understanding the subclass's purpose, but the overall readability would improve with better naming that reflects the actual behavior. Nesting is flat and code length is appropriate.

Run 1

Code Structure: The class is logically organized with a docstring, configuration attribute, and two small methods, though GeoRSSFeed has no visible definition or import and two imports are unused. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: The docstring explains the geographic feed extension, but validateBalance and validateMessage do not describe their actual geometry-retrieval behavior; key and flag are also vague parameter names. Code length: The snippet is concise without unnecessary implementation detail. Action granularity: Each statement performs one clear action, with simple dictionary returns. Reading flow: The imports-to-class-to-methods sequence is natural, but misleading method names and the unexplained feed type interrupt understanding.

Run 2

Code Structure: Imports, a class docstring, configuration, and methods are logically organized, although GeoRSSFeed is not defined or imported in the snippet and both feed-generator imports are unused. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: The docstring explains the geographic feed extension, but validateBalance and validateMessage misleadingly suggest validation rather than geometry retrieval; key and flag are also vague parameter names. Code length: The implementation is concise, with no unnecessary logic. Action granularity: Each method performs a single return operation, keeping actions clearly separated. Reading flow: The top-to-bottom layout is natural, but inconsistent naming conventions and the mismatch between method names and behavior interrupt understanding.

Run 3

Code Structure: Imports, class documentation, configuration, and methods are logically organized, although GeoRSSFeed is not defined or imported in the snippet and the feed-generator imports are unused. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: The docstring explains the geospatial feed purpose, but validateBalance and validateMessage do not describe their geometry-related behavior; key and flag are similarly vague parameter names. Code length: Compact, with no unnecessary implementation complexity. Action granularity: Each method performs one straightforward return operation, and statements are separated cleanly. Reading flow: The class reads naturally from documentation to configuration to methods, but the mismatch between method names and behavior interrupts understanding.