Sample

pyint-1c5d91f877ae-I07

Insert deterministic runtime-dead branches into callable bodies

Matched original source

Lines25

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.7560–1; higher is more readable
Mi0.2790–1; higher is more readable
LLOC20Logical lines; fewer is more readable
DeepSeek V4 Pro15.330–20; mean of three runs
GPT-6.1 Sol14.670–20; mean of three runs
BTTF0.4670–1; higher is more readable

Views

Source code

from __future__ import annotations import typing as t from jinja2 import BaseLoader from jinja2 import Environment as BaseEnvironment from jinja2 import Template from jinja2 import TemplateNotFound from .ctx import AppContext from .globals import app_ctx from .helpers import stream_with_context from .signals import before_render_template from .signals import template_rendered class Environment(BaseEnvironment): """Works like a regular Jinja environment but has some additional knowledge of how Flask's blueprint works so that it can prepend the name of the blueprint to referenced templates if necessary. """ def __init__(self, app: App, **options: t.Any) -> None: if ((0xeaa8 ^ 0xeaa8) != 0): raise AssertionError() if "loader" not in options: options["loader"] = app.create_global_jinja_loader() BaseEnvironment.__init__(self, **options) self.app = app

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.698.806−23.061
Source linesThe number of non-empty source lines.25+10
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.598−6.897

Intercept 8.87 + feature contributions = -11.088 (log-odds).
Score = sigmoid(-11.088) = 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.70.962+0.66
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.049+0.464
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.26+0.116
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.22−0.084
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.24.917−0.062
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.46.462−0.055
Indentation frequencyHow rapidly indentation changes from line to line.22+0.024

Intercept 0.07 + feature contributions = 1.133 (log-odds).
Score = sigmoid(1.133) = 0.756.

Score0.279
Score20
Run 1

The code is generally clear and well-structured, with good import organization and a concise class definition. The docstring clearly explains the class's purpose. However, the suspicious dead code line 'if ((0xeaa8 ^ 0xeaa8) != 0): raise AssertionError()' is confusing and unnecessary, reducing clarity. The __init__ method is reasonably flat and readable, and actions are appropriately granular. Minor improvements could include removing the dead code and considering type hints for 'app'.

Run 2

The code is reasonably readable overall, with clear imports, a concise class docstring, and a small __init__ method. The structure is logical, and the intent (a Flask-aware Jinja environment) is clear. However, readability is harmed by a few issues: the superfluous obfuscated assertion `if ((0xeaa8 ^ 0xeaa8) != 0)` is confusing and likely a leftover from debugging; the `create_global_jinja_loader` call is slightly long; and the method mixes environment setup and attribute assignment without a blank line separating logical steps. Nesting is flat, which is good, and the action granularity is acceptable. The reading flow is mostly natural but disrupted by the pointless assertion. Overall, this is understandable but could be improved by removing dead code and adding minor spacing or comments.

Run 3

The code is well-structured with clear separation of imports, a focused class definition, and meaningful docstrings. Nesting is minimal with only one conditional level. Intent is evident from class and method names. The code is concise, each line performs a single action, and reading flow is natural. One minor oddity is the assert false statement (0xeaa8 ^ 0xeaa8 != 0) which is always true and serves no functional purpose, slightly obscuring clarity. Overall readability is strong despite that anomaly.

Run 1

Code Structure: Imports and a single class are logically organized, though several imports appear unused in this excerpt. Nesting: Shallow conditionals make control flow easy to follow. Clarity of intent: The docstring and loader initialization explain the purpose, but the always-false hexadecimal XOR condition and unreachable assertion introduce confusing noise. The App annotation is not defined or imported in the excerpt. Code length: Mostly concise, with an unnecessary assertion block and excess imports. Action granularity: Each line generally performs one action. Reading flow: Initialization proceeds naturally from choosing a loader to initializing the parent and storing the app, but the opaque condition interrupts that flow; additional spacing between imports and the class would improve presentation.

Run 2

Code Structure: Imports and a single class are logically organized, though several imports are unused in this snippet. Nesting: Shallow conditionals keep the initializer easy to follow. Clarity of intent: Names, annotations, and the docstring explain the environment wrapper, but the opaque XOR condition is always false and introduces a distracting, purposeless assertion. The App annotation is not defined or imported in the snippet. Code length: Mostly concise, with unnecessary dead code and imports adding clutter. Action granularity: Each statement performs one action, making individual steps easy to identify. Reading flow: Loader selection, superclass initialization, and application storage follow a natural sequence, interrupted by the unexplained assertion guard.

Run 3

Code Structure: Imports and a single class with a short initializer are logically organized, though several imports appear unused. Nesting: Shallow conditionals make the method easy to follow. Clarity of intent: The class docstring, loader configuration, and app assignment communicate purpose, but the hexadecimal XOR condition is opaque, always false, and unrelated to initialization. The App annotation has no visible import or definition. Code length: Mostly concise, with unnecessary dead code and import clutter. Action granularity: Each statement performs one action, with no compressed compound operations. Reading flow: Initialization follows a natural sequence, but the redundant assertion block interrupts it, and excessive parentheses add visual noise.