Sample

pyint-b1be62fc2037-I04

Replace names with deterministic minifier-style shortest identifiers

Matched original source

Lines69

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.890–1; higher is more readable
Mi0.4150–1; higher is more readable
LLOC43Logical lines; fewer is more readable
DeepSeek V4 Pro110–20; mean of three runs
GPT-6.1 Sol120–20; mean of three runs
BTTF0.3850–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 CertParamType(click.ParamType): # type: ignore[type-arg] """Click option type for the ``--cert`` option. Allows either an existing file, the string ``'adhoc'``, or an import for a :class:`~ssl.SSLContext` object. """ name = "path" def __init__(self) -> None: self.path_type = click.Path(exists=True, dir_okay=False, resolve_path=True) def a( self, b: t.Any, c: click.Parameter | None, d: click.Context | None ) -> t.Any: try: import ssl except ImportError: raise click.BadParameter( 'Using "--cert" requires Python to be compiled with SSL support.', d, c, ) from None try: return self.path_type(b, c, d) except click.BadParameter: b = click.STRING(b, c, d).lower() # type: ignore[union-attr] if b == "adhoc": try: import cryptography # noqa: F401 except ImportError: raise click.BadParameter( "Using ad-hoc certificates requires the cryptography library.", d, c, ) from None return b e = import_string(b, silent=True) if isinstance(e, ssl.SSLContext): return e raise

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.1694.374−55.914
Source linesThe number of non-empty source lines.69+27.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.359−6.539

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

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.70−1.442
Indentation frequencyHow rapidly indentation changes from line to line.63+1.442
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.86.929+0.598
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.68.841+0.552
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.047+0.486
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
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.86.929−0.017

Intercept 0.07 + feature contributions = 2.087 (log-odds).
Score = sigmoid(2.087) = 0.89.

Score0.415
Score43
Run 1

The code mixes reasonable imports and structure with severely degraded clarity. The method 'a' with parameters 'b', 'c', 'd' obscures intent; parameter names should describe their purpose (e.g., 'value', 'param', 'ctx'). The CertParamType class has a clear purpose but is undermined by these opaque names. The nested try/except blocks (SSL check, path conversion, cryptography import) create a deep hierarchy that disrupts reading flow, despite each action being on its own line. The logic is tangled: a path conversion failure triggers string fallback, then a conditional 'adhoc' branch, then an import_string check with a silent failure mode. Error handling is reasonable, but the overall structure lacks clarity. The code length is moderate, yet improved naming and flattened logic would significantly boost readability. Imports are thorough but not excessive.

Run 2

The code is moderately readable. Structure is generally logical, with clear separation of imports, class definition, and a conversion method. However, the method 'a' violates several readability criteria: its single-letter name obscures intent (likely intended to override 'convert'), and parameter names 'b', 'c', 'd', 'e' are non-descriptive. Nesting is somewhat deep — a try block contains another try block and multiple conditionals, creating three or more indentation levels. Intent is partially clear from docstrings and error messages but undermined by poor naming. While the code length is acceptable, action granularity and reading flow suffer due to dense lines and exception re-raising. The reliance on type comments for mypy and the 'raise' without arguments at the end further dilutes clarity. Overall, it is understandable for experienced Flask/Click developers but fails to consistently follow readable naming and simplicity principles.

Run 3

The code has a clear purpose and follows consistent formatting, but readability is significantly hampered by unhelpful names like `a`, `b`, `c`, `d`, and `e` in the main method. The logic in that method is deeply nested (three levels) and mixes several distinct actions—importing SSL, parsing the path, checking for 'adhoc', and importing a string—which violates the principle of one action per block. The exception handling obscures the primary flow, and the use of bare `raise` inside an `except` block is subtle. While the class structure, type hints, and docstring are good, the core logic requires careful reading to understand. Renaming parameters and breaking the method into smaller helper methods would improve clarity and reading flow substantially.

Run 1

Code Structure: The class separates initialization from certificate handling, but numerous unused imports clutter the snippet. Nesting: Nested try/except blocks and conditional checks require careful tracking, although early returns reduce complexity. Clarity of intent: The class docstring and error messages explain the purpose, but method name 'a' and variables 'b', 'c', 'd', and 'e' obscure roles and make the logic harder to follow. Code length: The implementation is reasonably concise, but the import list is disproportionately long. Action granularity: Most lines perform one action, with conventional multiline calls improving readability. Reading flow: Processing follows a logical sequence—SSL availability, file validation, ad-hoc certificates, then SSLContext imports—but exception-driven fallback, reassignment of 'b', and the final bare raise make the flow less explicit.

Run 2

Code Structure: The class logically groups certificate validation, but the large import block is mostly unrelated to this snippet. Nesting: Several nested try/except and conditional blocks add moderate complexity. Clarity of intent: The docstring and descriptive error messages explain the purpose, but names such as a, b, c, d, and e obscure the method's role and data flow. Code length: The implementation is reasonably concise, though unused imports add clutter. Action granularity: Most lines perform one operation, with multiline calls formatted clearly. Reading flow: Validation progresses logically from file paths to ad-hoc certificates to SSLContext imports, but exception-driven fallback and the final bare raise require careful tracing.

Run 3

Code Structure: The class cleanly groups certificate-option handling, and validation follows a logical sequence, although many imports are unused in this snippet. Nesting: Nested exception handlers and conditionals add moderate complexity, especially in the ad-hoc certificate branch. Clarity of intent: The docstring and descriptive error messages explain the purpose, but the method name 'a' and parameters 'b', 'c', 'd', and 'e' obscure roles and operations. Code length: The implementation is reasonably concise, though the extensive import list adds clutter. Action granularity: Most lines perform one action, with clear formatting for multiline calls. Reading flow: File validation, ad-hoc handling, and SSLContext lookup form a sensible progression, but exception-driven branching, reassignment of 'b', and the final bare raise require extra attention.