Sample

pyint-dc4ee8ba69d4-I01

Remove comments and docstrings

Matched original source

Lines45

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.6780–1; higher is more readable
Mi0.3780–1; higher is more readable
LLOC33Logical lines; fewer is more readable
DeepSeek V4 Pro160–20; mean of three runs
GPT-6.1 Sol16.670–20; mean of three runs
BTTF0.6410–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): def command( self, *args: t.Any, **kwargs: t.Any ) -> t.Callable[[t.Callable[..., t.Any]], click.Command]: wrap_for_ctx = kwargs.pop("with_appcontext", True) def decorator(f: t.Callable[..., t.Any]) -> click.Command: if wrap_for_ctx: f = with_appcontext(f) return super(AppGroup, self).command(*args, **kwargs)(f) return decorator def group( self, *args: t.Any, **kwargs: t.Any ) -> t.Callable[[t.Callable[..., t.Any]], click.Group]: kwargs.setdefault("cls", AppGroup) return super().group(*args, **kwargs)

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.1600.806−52.827
Source linesThe number of non-empty source lines.45+18
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.625−6.938

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

Feature contributions

FeatureValueContribution
(log-odds)
Indentation frequencyHow rapidly indentation changes from line to line.45+0.819
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.70.891+0.663
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.46−0.592
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.44.806+0.216
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.1−0.026

Intercept 0.07 + feature contributions = 0.744 (log-odds).
Score = sigmoid(0.744) = 0.678.

Score0.378
Score33
Run 1

The code is generally readable with clear structure: imports are organized, class methods are logically named, and the AppGroup class has a clear purpose. The nested decorator functions add one level of nesting but remain manageable. Intent is clear through descriptive names and docstrings (though docstrings are absent—type hints help). The code is concise without unnecessary verbosity. However, there are minor issues: inconsistent use of super() (super(AppGroup, self) vs super()), trailing whitespace, and the decorator pattern could be slightly clearer with explicit return type annotations. Overall, the code is well-structured and easy to follow for someone familiar with Flask and Click patterns.

Run 2

The code is mostly readable with clear structure and appropriate use of type hints. The AppGroup class extends click.Group in a logical manner, with methods that follow consistent patterns. Nesting is minimal, limited to decorator closures which are standard for Click applications. Intent is clearly conveyed through method names and docstrings (though docstrings could be more explicit). The code is concise without being too terse. Action granularity is generally good - one main action per line in most cases. Reading flow is natural, with imports organized sensibly. Minor deductions: inconsistent use of super() (mixing 'super(AppGroup, self)' with 'super()'), and some minor formatting inconsistencies like trailing whitespace. The decorator pattern, while necessary for Click integration, adds a small cognitive load but is implemented cleanly. Overall, this is solid, maintainable code that would be easy for experienced Python developers to understand.

Run 3

The code is generally well-structured and readable. It uses clear type hints and docstrings are implied through clean naming. The AppGroup class is logically organized with two methods that follow similar patterns, making the code predictable. Nesting is minimal—only one level of function decorator inside each method. The intent is clear: extending click.Group to support Flask's app context. The code is concise, though the decorator functions add some length but are necessary. Each logical action is on its own line, improving readability. The reading flow is natural: imports are grouped, class definition is clear, and methods are ordered logically. Minor deductions: no explicit docstrings for method parameters, and the unused imports (os, re, sys, etc.) suggest broader context not shown here. The with_appcontext reference is undefined in this snippet, which could confuse readers without the full file. Overall, well-written click extension code.

Run 1

Code Structure: The class cleanly separates command and group customization, but numerous unused imports clutter this snippet. Nesting: The nested decorator is appropriate and shallow, with only one conditional. Clarity of intent: Method names, type annotations, and with_appcontext convey purpose, although wrap_for_ctx is abbreviated and the context-wrapping dependency is not defined or imported here. Code length: The methods are concise, but the import block and excessive blank lines add unnecessary length. Action granularity: Each statement performs one clear action; the chained decorator invocation is slightly denser. Reading flow: The methods follow a natural setup, delegation, and return sequence, while inconsistent whitespace and the explicit super(AppGroup, self) call add minor friction.

Run 2

Code Structure: The class logically separates command decoration from subgroup creation, though many unrelated imports clutter the snippet. Nesting: Shallow nesting, with only a nested decorator and a single conditional, is easy to follow. Clarity of intent: Descriptive method names and type annotations communicate purpose, but missing docstrings and the externally defined with_appcontext leave some behavior implicit. Code length: The implementation is concise, although unused imports and excessive blank space add noise. Action granularity: Each statement performs a distinct action; the chained superclass command invocation is slightly dense. Reading flow: Control flow is natural and predictable, but inconsistent whitespace and unnecessarily split short signatures interrupt scanning.

Run 3

Code Structure: The class logically separates command decoration from subgroup creation, although numerous unused imports distract from this snippet. Nesting: Shallow nesting, with one inner decorator and a simple conditional, is easy to follow. Clarity of intent: Method names, type annotations, and the with_appcontext option communicate purpose, but the externally defined with_appcontext function and absent docstrings leave some context implicit. Code length: The methods are concise, while the extensive import block and redundant blank space add unnecessary length. Action granularity: Each statement performs one clear action; chained command construction remains manageable. Reading flow: Execution flows naturally from option extraction to decorator creation and return, then subgroup configuration. Inconsistent whitespace and the explicit super(AppGroup, self) invocation slightly interrupt an otherwise clean presentation.