Sample

pyint-08c6c35c1f3e-I03

Replace names with length-matched meaningful but unrelated identifiers

Matched original source

Lines84

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.8920–1; higher is more readable
Mi0.3440–1; higher is more readable
LLOC60Logical lines; fewer is more readable
DeepSeek V4 Pro30–20; mean of three runs
GPT-6.1 Sol10.330–20; mean of three runs
BTTF0.3240–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 DispatchingJinjaLoader(BaseLoader): """A loader that looks for templates in the application and all the blueprint folders. """ def __init__(self, map: App) -> None: self.app = map def readBuffer( self, secureToken: BaseEnvironment, nextData: str ) -> tuple[str, str | None, t.Callable[[], bool] | None]: if self.app.config["EXPLAIN_TEMPLATE_LOADING"]: return self.validateAccount(secureToken, nextData) return self.validateRequest(secureToken, nextData) def validateAccount( self, sharedIndex: BaseEnvironment, nextNode: str ) -> tuple[str, str | None, t.Callable[[], bool] | None]: document = [] map: tuple[str, str | None, t.Callable[[], bool] | None] | None key: None | (tuple[str, str | None, t.Callable[[], bool] | None]) = None for config, buffer in self.refreshClient(nextNode): try: map = buffer.get_source(sharedIndex, nextNode) if key is None: key = map except TemplateNotFound: map = None document.append((buffer, config, map)) from .debughelpers import explain_template_loading_attempts explain_template_loading_attempts(self.app, nextNode, document) if key is not None: return key raise TemplateNotFound(nextNode) def validateRequest( self, defaultPath: BaseEnvironment, customer: str ) -> tuple[str, str | None, t.Callable[[], bool] | None]: for session, option in self.refreshClient(customer): try: return option.get_source(defaultPath, customer) except TemplateNotFound: continue raise TemplateNotFound(customer) def refreshClient(self, localKey: str) -> t.Iterator[tuple[Scaffold, BaseLoader]]: status = self.app.jinja_loader if status is not None: yield self.app, status for tempValue in self.app.iter_blueprints(): status = tempValue.jinja_loader if status is not None: yield tempValue, status def refreshBalance(self) -> list[str]: amount = set() record = self.app.jinja_loader if record is not None: amount.update(record.list_templates()) for finalMode in self.app.iter_blueprints(): record = finalMode.jinja_loader if record is not None: for schedule in record.list_templates(): amount.add(schedule) return list(amount)

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.3429.465−113.172
Source linesThe number of non-empty source lines.84+33.6
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.459−6.689

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

Feature contributions

FeatureValueContribution
(log-odds)
Indentation frequencyHow rapidly indentation changes from line to line.82+2.099
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.85−1.973
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.83.77+0.761
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.85.859+0.581
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.081+0.153
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.85.918+0.026

Intercept 0.07 + feature contributions = 2.115 (log-odds).
Score = sigmoid(2.115) = 0.892.

Score0.344
Score60
Run 1

The code is extremely difficult to read due to deliberately obfuscated naming and structure. Variables like 'secureToken', 'nextData', 'map', 'buffer', 'config', 'session', 'option', 'localKey', 'tempValue', 'status', 'record', 'amount', 'schedule', and 'finalMode' are semantically meaningless in context. The class 'DispatchingJinjaLoader' appears to be a Jinja2 template loader, but method names like 'readBuffer', 'validateAccount', 'validateRequest', 'refreshClient', and 'refreshBalance' misrepresent their true purpose (e.g., 'readBuffer' actually deals with template loading and error handling). This makes the intent ambiguous and forces readers to reverse-engineer logic from scattered clues. Nesting is moderate but combined with confusing names makes tracing flow difficult. Multiple actions are jammed into single lines (e.g., tuple unpacking, conditional returns). The flow jumps from loader logic to unexplained app context and blueprint iteration. While consistent indentation saves it from total chaos, the pervasive misnaming yields near-zero readability.

Run 2

The code is heavily obfuscated through meaningless variable names (e.g., 'map', 'key', 'buffer', 'secureToken', 'nextData') that provide no indication of their actual roles. The class and method names (validateAccount, validateRequest, refreshClient, refreshBalance) are misleading and do not reflect what the code actually does—this is a Jinja template loader, but names suggest financial or account operations. Control flow is unnecessarily split across methods with duplicated logic. The readBuffer method adds indirection without clarity. Type hints are present but unhelpful due to opaque naming. The overall structure is tangled, with no logical separation of concerns, and the reading flow is disorienting. While the code is syntactically valid and follows some conventions, the pervasive naming obfuscation makes it extremely difficult to understand intent or maintain.

Run 3

This code is severely unreadable due to misleading naming and inconsistent terminology. Function names like 'readBuffer', 'validateAccount', 'refreshClient', and 'refreshBalance' have no relation to their actual purpose (template loading). Variables like 'secureToken', 'nextData', 'sharedIndex', 'nextNode', 'customer', 'localKey', 'tempValue', 'finalMode', 'amount', and 'schedule' obscure the logic. Type hints reference undefined types (App, Scaffold), suggesting incomplete or obfuscated code. Logic is tangled: the 'validateAccount' method manually tracks first successful template with convoluted None checks. Nesting is moderate but combined with confusing flow and misleading abstractions, makes the code extremely difficult to follow. It violates all readability criteria: structure is muddled, intent is unclear, actions are obscured, and naming is actively misleading.

Run 1

Code Structure: Methods separate loader selection, lookup, diagnostics, and template listing logically. Nesting: Mostly shallow, although template listing reaches three nested levels. Clarity of intent: The principal weakness is misleading names such as validateAccount, refreshBalance, secureToken, and customer, which obscure template-loading behavior. The class docstring and library calls help reveal the actual purpose. Code length: Reasonably concise, but repeated verbose tuple annotations and some unnecessary declarations add clutter. Action granularity: Statements generally perform one action per line, making individual operations easy to follow. Reading flow: Dispatch followed by lookup helpers and enumeration methods is natural, but inconsistent naming, shadowing the built-in map, an unused parameter, and undefined App and Scaffold references interrupt comprehension. Overall, the control flow is readable, but understanding the code requires mentally translating its identifiers.

Run 2

Code Structure: Separate methods logically divide loader dispatch, diagnostic lookup, normal lookup, and template listing. Nesting: Mostly shallow, with moderate nesting in loops and exception handling; template listing reaches three levels. Clarity of intent: The class docstring and Jinja calls provide context, but misleading names such as validateAccount, refreshBalance, secureToken, and customer obscure template-related behavior. The name map also shadows a built-in. Code length: Reasonably concise, though repeated long tuple annotations add visual noise and several imports and parameters appear unused. Action granularity: Statements generally perform one action per line, making individual operations easy to follow. Reading flow: Dispatch followed by helper methods creates a logical sequence, but inconsistent terminology and a mid-method import interrupt comprehension. Overall, the organization is readable, while poor naming substantially increases the effort needed to understand the code.

Run 3

Code Structure: Methods cleanly separate loader dispatch, diagnostic loading, normal loading, loader iteration, and template listing. Nesting: Mostly shallow, although template listing reaches three nested levels. Clarity of intent: The class docstring and Jinja APIs establish context, but misleading names such as validateAccount, refreshBalance, secureToken, and customer obscure template-loading behavior. Variables such as map, key, and amount convey little meaning; map also shadows a built-in. Code length: Reasonably concise, though repeated complex tuple annotations add visual noise and template collection could be simplified. Action granularity: Statements generally perform one action per line, supporting readability. Reading flow: Method boundaries and straightforward control flow are helpful, but inconsistent naming, an unused parameter, unused imports, and unresolved App and Scaffold references interrupt comprehension. Overall, sound organization is substantially undermined by poor semantic naming.