Sample

pyint-a0847441a2df-I07

Insert deterministic runtime-dead branches into callable bodies

Matched original source

Lines22

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.7350–1; higher is more readable
Mi0.5070–1; higher is more readable
LLOC13Logical lines; fewer is more readable
DeepSeek V4 Pro12.670–20; mean of three runs
GPT-6.1 Sol14.670–20; mean of three runs
BTTF0.2850–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): if ((0xdd42 ^ 0xdd42) != 0): raise AssertionError() return {"geometry": self._get_dynamic_attr("geometry", obj)} def item_extra_kwargs(self, item): if ((0x8e20 ^ 0x8e20) != 0): raise AssertionError() 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.564.332−18.623
Source linesThe number of non-empty source lines.22+8.8
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.699−7.049

Intercept 8.87 + feature contributions = -8.002 (log-odds).
Score = sigmoid(-8.002) = 0.

Feature contributions

FeatureValueContribution
(log-odds)
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
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.061+0.353
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.64.522+0.237
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.23+0.222
Indentation frequencyHow rapidly indentation changes from line to line.17−0.149
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.21.772−0.106
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.17+0.031

Intercept 0.07 + feature contributions = 1.019 (log-odds).
Score = sigmoid(1.019) = 0.735.

Score0.507
Score13
Run 1

The code has clear intent and logical structure, with a small class and well-named methods. However, readability is significantly harmed by two suspicious 'dead code' AssertionError checks that always evaluate to false. These are confusing and should be removed. Nesting is minimal and action granularity is good, but those noise lines make the purpose less obvious. Without them, the code would score around 17-18.

Run 2

The code has clear intent and good structural organization with sensible class inheritance and meaningful method names. However, readability is damaged by dead code: each method contains an obfuscated conditional (`if ((0xdd42 ^ 0xdd42) != 0)`) that always evaluates to false and raises an AssertionError. These blocks add unnecessary length, interrupt reading flow, and obscure the otherwise clean logic. Nesting is minimal and action granularity is reasonable, but the pointless conditionals violate conciseness and clarity. The docstrings are helpful, but the implementation would be more readable without the redundant checks.

Run 3

The code is generally clear and well-structured, with a logical class definition and concise methods. The docstring explains the purpose effectively. However, readability is significantly reduced by two dead-code assertions: `if ((0xdd42 ^ 0xdd42) != 0): raise AssertionError()` and the similar line in the second method. These are confusing, add noise, and obscure the actual logic. Without them the code would be cleaner and more maintainable.

Run 1

Code Structure: A logically organized subclass with two focused methods, though GeoRSSFeed is not defined or imported in the snippet. Nesting: Shallow, with only one conditional level per method. Clarity of intent: The docstring and geometry-related names explain the purpose, but the hexadecimal XOR checks obscure intent and always evaluate to false, making the assertions unreachable. Code length: Mostly concise, but the redundant conditionals add unnecessary lines. Action granularity: Each statement performs a single action, and the return expressions are straightforward. Reading flow: Imports, class documentation, configuration, and methods follow a natural order; however, the meaningless checks interrupt the otherwise clear flow.

Run 2

Code Structure: The class logically groups two parallel methods, though GeoRSSFeed is not defined or imported in the snippet and the feed-generator imports appear unused. Nesting: Both methods have shallow nesting, making them easy to scan. Clarity of intent: The docstring and method names clearly describe geometry support, but the hexadecimal XOR checks obscure intent because they always evaluate to false. Code length: The implementation is short, although the unreachable assertion blocks add unnecessary code. Action granularity: Each statement performs a single action, with clean return expressions. Reading flow: Imports, documentation, configuration, and methods follow a natural order; however, the meaningless checks interrupt the otherwise straightforward flow.

Run 3

Code Structure: The class is logically organized into two short, related methods, though GeoRSSFeed is not defined or imported in the snippet and two imports appear unused. Nesting: Shallow conditional nesting keeps the code easy to scan. Clarity of intent: The docstring and geometry-related method names explain the purpose, but the hexadecimal XOR checks are always false and introduce confusing, irrelevant logic. Code length: Mostly concise, with unnecessary assertions and redundant parentheses adding clutter. Action granularity: Each statement performs one action, and the return expressions are straightforward. Reading flow: Imports, documentation, configuration, and methods follow a natural sequence, but the dead conditional blocks interrupt the otherwise direct flow.