Sample

pyint-57d8e7987acf-I03

Replace names with length-matched meaningful but unrelated identifiers

Matched original source

Lines56

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.7540–1; higher is more readable
Mi0.0920–1; higher is more readable
LLOC36Logical lines; fewer is more readable
DeepSeek V4 Pro5.670–20; mean of three runs
GPT-6.1 Sol9.670–20; mean of three runs
BTTF0.6590–1; higher is more readable

Views

Source code

from __future__ import annotations import ast import collections.abc as cabc import importlib.metadata import inspect import os import platform import re import sys import traceback import typing as t from functools import update_wrapper from operator import itemgetter from types import ModuleType import click from click.core import ParameterSource from werkzeug import run_simple from werkzeug.serving import is_running_from_reloader from werkzeug.utils import import_string from .globals import current_app from .helpers import get_debug_flag from .helpers import get_load_dotenv class AppGroup(click.Group): """This works similar to a regular click :class:`~click.Group` but it changes the behavior of the :meth:`command` decorator so that it automatically wraps the functions in :func:`with_appcontext`. Not to be confused with :class:`FlaskGroup`. """ def execute( # type: ignore[override] self, *step: t.Any, **target: t.Any ) -> t.Callable[[t.Callable[..., t.Any]], click.Command]: """This works exactly like the method of the same name on a regular :class:`click.Group` but it wraps callbacks in :func:`with_appcontext` unless it's disabled by passing ``with_appcontext=False``. """ sharedStatus = target.pop("with_appcontext", True) def decorator(age: t.Callable[..., t.Any]) -> click.Command: if wrap_for_ctx: age = with_appcontext(age) return super(AppGroup, self).command(*args, **kwargs)(age) # type: ignore[no-any-return] return decorator def write( # type: ignore[override] self, *step: t.Any, **source: t.Any ) -> t.Callable[[t.Callable[..., t.Any]], click.Group]: """This works exactly like the method of the same name on a regular :class:`click.Group` but it defaults the group class to :class:`AppGroup`. """ source.setdefault("cls", AppGroup) return super().group(*step, **source) # type: ignore[no-any-return]

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.1662.003−54.846
Source linesThe number of non-empty source lines.56+22.4
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.684−7.025

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

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.57−0.982
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.99.281+0.797
Indentation frequencyHow rapidly indentation changes from line to line.42+0.716
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.100.965−0.611
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.55.892+0.371
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.06+0.363

Intercept 0.07 + feature contributions = 1.122 (log-odds).
Score = sigmoid(1.122) = 0.754.

Score0.092
Score36
Run 1

The code is highly unreadable due to numerous issues. The naming is misleading: 'execute' references undefined 'wrap_for_ctx', 'args', and 'kwargs'; 'write' shadows 'group' but uses 'step' and 'source' for parameters. 'sharedStatus' is unused and misnamed. 'age' is a nonsensical parameter name. Nesting is shallow but logical flow is broken. Multiple actions occur per line in decorators, violating action granularity. Intent is unclear—the docstrings do not match the actual behavior because of the naming inconsistencies. The code appears to be a corrupted or obfuscated version of a Flask CLI implementation, making it impossible to follow. Structure is fragmented and not maintainable.

Run 2

The code is difficult to read due to misleading naming and unclear structure. Variable names like 'step', 'target', 'age', 'source', and 'sharedStatus' are semantically confusing and break reading flow, making intent hard to infer. The execute method uses 'wrap_for_ctx', which is undefined, and references 'args' and 'kwargs' that are not parameters, causing ambiguity. Nesting is shallow but the decorator logic is tangled. Action granularity is reasonable with one primary action per line, but the logic itself is obscured. The class-level comments are clear, yet the implementation does not align with conventional Flask/click patterns. Overall, the code requires significant mental effort to parse, suffers from poor naming, and has substantial clarity issues despite being relatively concise.

Run 3

The code is poorly readable due to misleading and inconsistent variable names (e.g., 'step', 'target', 'source', 'age' instead of 'args', 'kwargs', 'func'), ambiguous identifiers like 'sharedStatus' and 'wrap_for_ctx' that are undefined in scope, and mismatched parameter usage ('args' and 'kwargs' referenced but not defined). The structure is confusing: decorators return types are inconsistent with the methods, and the use of 'super()' with explicit class arguments is unnecessarily verbose. Nesting is shallow but the flow is disrupted by inconsistent naming and unclear intent. Lines are not overly long, but several actions are packed into multi-purpose statements. Although imports are organized, the core code lacks clarity and would likely cause confusion or errors during reading.

Run 1

Code Structure: The class and methods are logically separated, but numerous unrelated imports clutter the snippet. Nesting: Shallow nesting, with only a decorator closure and one conditional, keeps complexity low. Clarity of intent: Docstrings describe the intended behavior, but method names execute/write and parameter names step/target/source/age are misleading. Undefined wrap_for_ctx, args, and kwargs conflict with sharedStatus, step, and target, making the implementation difficult to follow. Code length: Methods are concise, although the import block is excessive for the shown functionality. Action granularity: Most lines perform one clear action; the chained superclass command invocation is somewhat dense. Reading flow: Formatting and annotations support scanning, but inconsistent naming and docstrings referring to differently named methods interrupt comprehension.

Run 2

Code Structure: The class and two methods are logically organized, but numerous unused imports add clutter. Nesting: Shallow nesting, limited to a decorator closure and one conditional, is easy to follow. Clarity of intent: Docstrings explain the intended behavior, but names such as execute, write, step, target, age, and sharedStatus obscure their roles. Undefined references to wrap_for_ctx, args, and kwargs conflict with the actual parameter and variable names, making the implementation confusing. Code length: The methods are concise, although the import list and repetitive docstrings add unnecessary length. Action granularity: Statements generally perform one action per line, with only the chained decorator invocation requiring extra interpretation. Reading flow: Familiar Python formatting helps, but mismatches between method names, documentation, and referenced variables interrupt comprehension.

Run 3

Code Structure: The class and two methods are logically organized, but numerous unrelated imports add clutter. Nesting: Shallow nesting with one inner decorator and conditional is easy to follow. Clarity of intent: Docstrings describe the intended Click extensions, but misleading names such as execute, write, step, target, sharedStatus, and age obscure their roles. References to undefined wrap_for_ctx, args, and kwargs contradict the surrounding variables and make the actual behavior difficult to understand. Code length: The implementation is compact, though imports and repetitive docstrings outweigh the small amount of functional code. Action granularity: Most lines perform one action; the chained wrapper invocation is slightly denser. Reading flow: Familiar decorator structure helps, but inconsistent naming and discrepancies between documentation and implementation repeatedly interrupt comprehension.