Sample

pyint-7c3c8fab7bc5-I02

Shorten method, parameter, and local names without collisions

Matched original source

Lines56

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.7630–1; higher is more readable
Mi0.110–1; higher is more readable
LLOC36Logical lines; fewer is more readable
DeepSeek V4 Pro80–20; mean of three runs
GPT-6.1 Sol100–20; mean of three runs
BTTF0.7090–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 com( # type: ignore[override] self, *arg: t.Any, **kwa: 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``. """ wrap = kwa.pop("with_appcontext", True) def decorator(f2: t.Callable[..., t.Any]) -> click.Command: if wrap_for_ctx: f2 = with_appcontext(f2) return super(AppGroup, self).command(*args, **kwargs)(f2) # type: ignore[no-any-return] return decorator def gro( # type: ignore[override] self, *arg2: t.Any, **kwa2: 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`. """ kwa2.setdefault("cls", AppGroup) return super().group(*arg2, **kwa2) # 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.1666.442−54.993
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.715−7.073

Intercept 8.87 + feature contributions = -30.795 (log-odds).
Score = sigmoid(-30.795) = 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.100+0.809
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.99.947−0.568
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.842+0.371
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.06+0.354

Intercept 0.07 + feature contributions = 1.167 (log-odds).
Score = sigmoid(1.167) = 0.763.

Score0.11
Score36
Run 1

The code structure is reasonable with clear class-level docstrings, but the actual method implementations are confusing and appear to contain errors. The method names 'com' and 'gro' are truncated, likely intended to be 'command' and 'group', severely harming readability. Variable names like 'f2', 'kwa', 'arg2', and 'kwa2' are unclear. There is a likely bug: 'wrap_for_ctx' is referenced but not defined, and 'args'/'kwargs' are not defined in the decorator. Nesting is shallow, but intent is obscured by the naming and missing references. Code length is concise, but too concise at the expense of clarity. Action granularity is mostly one action per line, but the mixed type comments add noise. Overall, the code seems broken and would be very difficult to understand or maintain without significant renaming and fixes to the undefined variables.

Run 2

The code appears to be a corrupted or intentionally obfuscated fragment of a Flask CLI class. Several identifiers are mismatched: the method 'com' likely should be 'command' and 'gro' should be 'group'. Variable names like 'f2', 'kwa', and 'kwa2' are unclear, and variables such as 'wrap_for_ctx', 'args', and 'kwargs' are referenced but not defined in scope. This creates ambiguity and breaks the logical structure, making the code hard to follow without guessing intent. Nesting is minimal, which is positive, but clarity of intent is severely compromised by the naming and missing definitions. Code length is reasonable, but action granularity and reading flow suffer due to inconsistent parameter names and broken references. Overall, while some structure (imports, class definition) is present, the poor naming and likely copy-paste errors make the code largely unreadable.

Run 3

The code is moderately readable but has several major issues. Naming is inconsistent and unclear: `com` instead of `command`, `gro` instead of `group`, `f2`, `arg2`, `kwa2`, and mix-matched names like `arg` vs `args`, `kwa` vs `kwargs`. The `decorator` function references undefined variables (`wrap_for_ctx`, `args`, `kwargs`), making the logic appear broken. The `com` and `gro` abbreviations save characters but hurt clarity. Docstrings are helpful, and the structure is logical, but the inconsistent indentation and naming reduce readability. The code is relatively flat, but the nested decorator and super() call combine actions, making it harder to follow. Overall, the intent is partially clear from docstrings, but execution is muddled by poor naming and apparent bugs. It reads like incomplete refactoring rather than finished code.

Run 1

1. Code Structure: Methods and the inner decorator are logically organized, but numerous unused imports add clutter. 2. Nesting: Shallow nesting makes the control flow easy to follow. 3. Clarity of intent: Docstrings explain the intended behavior, but abbreviated names such as com, gro, kwa, and f2 obscure meaning. Inconsistent references to wrap_for_ctx, args, and kwargs instead of the defined wrap, arg, and kwa make the implementation confusing. 4. Code length: The methods are concise, although the import block is disproportionately long for this snippet. 5. Action granularity: Statements generally perform one action per line, with a reasonably understandable chained decorator call. 6. Reading flow: Familiar class and decorator patterns support natural reading, but misleading override comments and method documentation, inconsistent naming, and undefined references interrupt it.

Run 2

Code Structure: Methods are logically grouped in a small class, but numerous unused imports clutter the excerpt. Nesting: Shallow nesting, with only a decorator closure and one conditional, is easy to follow. Clarity of intent: Type annotations and docstrings explain the intended behavior, but abbreviated names such as com, gro, arg2, and kwa2 obscure meaning. More seriously, wrap_for_ctx, args, and kwargs do not match the defined wrap, arg, and kwa, making the implementation confusing and apparently broken. Code length: The implementation is concise, though imports and repetitive documentation add overhead. Action granularity: Statements generally perform one action per line. Reading flow: The class and methods follow a natural sequence, but inconsistent identifiers, misleading references to methods of the same name, and dense import formatting interrupt comprehension.

Run 3

Code Structure: The class cleanly separates command and group behavior, but numerous unused imports clutter the snippet. Nesting: Shallow nesting with one inner decorator and a conditional is easy to follow. Clarity of intent: Docstrings and type annotations explain the intended behavior, but abbreviated names such as com, gro, kwa, and f2 obscure meaning. More seriously, wrap_for_ctx, args, and kwargs do not match the defined wrap, arg, and kwa, making the implementation confusing and apparently broken. Code length: Methods are concise, although the import block is disproportionately long. Action granularity: Statements generally perform one action per line. Reading flow: The overall layout is conventional, but inconsistent naming and docstrings referring to methods of the same name undermine a natural reading flow.