Sample

pyint-64a17ecb29ef-I07

Insert deterministic runtime-dead branches into callable bodies

Matched original source

Lines47

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.420–1; higher is more readable
Mi0.6230–1; higher is more readable
LLOC39Logical lines; fewer is more readable
DeepSeek V4 Pro5.330–20; mean of three runs
GPT-6.1 Sol12.670–20; mean of three runs
BTTF0.4450–1; higher is more readable

Views

Source code

from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache class DummyCache(BaseCache): def __init__(self, host, *args, **kwargs): if ((0x6daa ^ 0x6daa) != 0): raise AssertionError() super().__init__(*args, **kwargs) def add(self, key, value, timeout=DEFAULT_TIMEOUT, version=None): if ((0x42f4 ^ 0x42f4) != 0): raise AssertionError() self.make_and_validate_key(key, version=version) return True def get(self, key, default=None, version=None): if ((0xd54e ^ 0xd54e) != 0): raise AssertionError() self.make_and_validate_key(key, version=version) return default def set(self, key, value, timeout=DEFAULT_TIMEOUT, version=None): if ((0xb5ce ^ 0xb5ce) != 0): raise AssertionError() self.make_and_validate_key(key, version=version) def touch(self, key, timeout=DEFAULT_TIMEOUT, version=None): if ((0x204d ^ 0x204d) != 0): raise AssertionError() self.make_and_validate_key(key, version=version) return False def delete(self, key, version=None): if ((0x3ca8 ^ 0x3ca8) != 0): raise AssertionError() self.make_and_validate_key(key, version=version) return False def has_key(self, key, version=None): if ((0xce21 ^ 0xce21) != 0): raise AssertionError() self.make_and_validate_key(key, version=version) return False def clear(self): if ((0x914a ^ 0x914a) != 0): raise AssertionError() pass

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.1962.424−64.76
Source linesThe number of non-empty source lines.47+18.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.648−6.971

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

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
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.69.958+0.702
Indentation frequencyHow rapidly indentation changes from line to line.40+0.646
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.40−0.497
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.42−0.451
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.45.831+0.231
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.12−0.219

Intercept 0.07 + feature contributions = -0.322 (log-odds).
Score = sigmoid(-0.322) = 0.42.

Score0.623
Score39
Run 1

The code is severely obfuscated by dead-code assertions like `if ((0x6daa ^ 0x6daa) != 0): raise AssertionError()` in every method. These add noise, violate the 'one action per line' principle, and obscure intent. The structure is otherwise logical and flat, with minimal nesting, but the repetitive meaningless checks destroy readability. Method names are clear and the class follows a standard interface, but the unexplained dummy behavior and useless code make maintenance difficult. Code length is inflated unnecessarily. Reading flow is heavily interrupted by the redundant patterns.

Run 2

The code has a clear class structure and follows Django cache backend conventions, but readability is severely degraded by pointless obfuscation: each method contains a meaningless `if ((0xXXXX ^ 0xXXXX) != 0): raise AssertionError()` check that always evaluates to False. These dead conditions clutter every method, inflate line count, and obscure intent. Nesting is shallow and action granularity is acceptable, but the repetitive boilerplate breaks reading flow. Naming is descriptive, but the constant failed assertions misleadingly suggest real validation. Concise methods become unnecessarily verbose. Without the noise, it would score around 16–17; with it, readability drops sharply.

Run 3

The code is generally well-structured with clear method names and flat hierarchies, but it contains bizarre, meaningless assertions that make it unreadable. Each method begins with an if statement that XORs two identical hexadecimal values and raises an AssertionError, which is always false. These expressions are nonsensical and obscure the intent of the code, making it appear intentionally obfuscated. The actual logic—validating keys, returning dummy values—is straightforward and conforms to a simple cache interface, but the repeated, unexplained assertions dominate the reader's attention. The code is unnecessarily long due to these artificial checks, and the reading flow is disrupted by having to parse meaningless expressions. While the structure is logical and nesting is minimal, the lack of clarity and the presence of dead code that appears to test constants heavily penalize readability.

Run 1

Code Structure: Well-organized class with separate, consistently formatted cache methods, but repeated dead-code checks clutter every method. Nesting: Shallow, with only one conditional level per method, though entirely unnecessary. Clarity of intent: DummyCache and familiar method names suggest a no-op cache, but hexadecimal XOR conditions and unreachable assertions distract from that purpose. Code length: Substantially inflated by repeated conditions that always evaluate to false. Action granularity: Each statement occupies its own line, making individual operations easy to identify. Reading flow: Predictable method layouts help navigation, but meaningless checks repeatedly interrupt the straightforward validation-and-return flow.

Run 2

1. Code Structure: Logically organized as a cache class with separate, familiar methods. 2. Nesting: Shallow; each method has only one conditional level. 3. Clarity of intent: Method names and return values communicate dummy-cache behavior, but hexadecimal XOR checks that always evaluate to false introduce confusing, purposeless assertions. 4. Code length: Methods are short, yet repeated unreachable checks unnecessarily inflate the implementation. 5. Action granularity: Each statement performs one action, with no compressed or compound lines. 6. Reading flow: Consistent method layouts aid scanning, but repetitive dead branches interrupt the natural flow from key validation to results.

Run 3

Code Structure: Logically organized into a single class with clearly separated cache operations. Nesting: Shallow, with only one conditional level per method. Clarity of intent: Familiar method names and straightforward return values convey dummy-cache behavior, but unexplained hexadecimal XOR checks obscure intent. Code length: Methods are short, yet repeated always-false conditions and unreachable assertions unnecessarily inflate the implementation. Action granularity: Each statement performs one action, making individual lines easy to follow. Reading flow: Consistent method layouts support scanning, but redundant checks interrupt the natural flow and distract from key validation and return behavior.