Sample

pyint-9d2b4481f87c-I09

Select one of ten low-readability unrelated code templates per class

Matched original source

Lines74

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.650–1; higher is more readable
Mi0.3990–1; higher is more readable
LLOC48Logical lines; fewer is more readable
DeepSeek V4 Pro3.670–20; mean of three runs
GPT-6.1 Sol120–20; mean of three runs
BTTF0.4840–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 convert( self, value: t.Any, param: click.Parameter | None, ctx: click.Context | None ) -> t.Any: lI0O_f39e4418, lI0O_7d47cae3 = 0, 0 while lI0O_7d47cae3 < 2: lI0O_f39e4418 ^= (lI0O_7d47cae3 << 1) ^ 0x2 lI0O_7d47cae3 += 1 lI0O_f39e4418 ^= lI0O_f39e4418 try: import ssl except ImportError: raise click.BadParameter( 'Using "--cert" requires Python to be compiled with SSL support.', ctx, param, ) from None try: return self.path_type(value, param, ctx) except click.BadParameter: value = click.STRING(value, param, ctx).lower() # type: ignore[union-attr] if value == "adhoc": try: import cryptography # noqa: F401 except ImportError: raise click.BadParameter( "Using ad-hoc certificates requires the cryptography library.", ctx, param, ) from None return value obj = import_string(value, silent=True) if isinstance(obj, ssl.SSLContext): return obj 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.1921.658−63.415
Source linesThe number of non-empty source lines.74+29.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.527−6.791

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

Feature contributions

FeatureValueContribution
(log-odds)
Indentation frequencyHow rapidly indentation changes from line to line.68+1.615
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.74−1.584
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.68−1.14
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.73.909+0.623
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.85.867+0.581
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.048+0.471
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.973−0.019

Intercept 0.07 + feature contributions = 0.618 (log-odds).
Score = sigmoid(0.618) = 0.65.

Score0.399
Score48
Run 1

The code has a logical structure overall, but the CertParamType.convert method contains obfuscated code (a nonsensical while loop with meaningless variable names) that severely impacts readability. The method's purpose is unclear until the very end, and the nested try-except blocks deeply bury the logic, making the flow difficult to follow. The action granularity is mostly one action per line, but the dead code loop adds confusion. The length is acceptable, but clarity of intent is compromised by the obfuscation and the ambiguous catch-and-reraise pattern. Overall, the code is difficult to read and understand due to the injected nonsensical logic and deep nesting.

Run 2

The code has a logical module structure with imports and a single class, but the `convert` method is confusing. The first block of the method contains two useless loop variables with meaningless names (`lI0O_f39e4418`, `lI0O_7d47cae3`) and performs pointless arithmetic, severely hurting readability and clarity. Nesting is moderate (try/except, if/except), but the intent is muddied by that dead code. Action granularity is mostly one action per line, but the weird loop is not. Reading flow is disrupted by the dead code and by the `try: return self.path_type(...) except click.BadParameter:` pattern, which uses exceptions for control flow in a non-obvious way. Code length is reasonable, but the dead lines inflate it unnecessarily. Overall, the strange inserted code makes it largely unreadable despite otherwise decent structure.

Run 3

The code is severely obfuscated and unreadable. It contains deliberately meaningless variable names (lI0O_f39e4418, lI0O_7d47cae3) and a nonsensical while loop that performs no meaningful function, likely inserted as deliberate obfuscation or a puzzle. The convert method has deeply nested try/except blocks spanning multiple levels (try -> except -> try -> except), obscuring the control flow. Multiple actions are packed into single lines (e.g., value assignment, lowercase conversion, type ignore comment). The reading flow is completely unnatural, with the obfuscated loop interrupting the logical flow at the start. Intent is ambiguous—why is the loop there? What does it compute? Code length is inflated by meaningless constructs. Across all six criteria—structure, nesting, clarity, length, granularity, flow—this code fails dramatically. Even the surrounding Flask/Click boilerplate cannot salvage readability.

Run 1

Code Structure: The class and conversion method are logically organized, but an unrelated computation and numerous unused imports add clutter. Nesting: Nested try/except blocks and conditionals create moderate depth, though early returns help. Clarity of intent: The docstring, descriptive names, and error messages explain certificate handling well; opaque variable names and a computation with no observable effect undermine clarity. Code length: The core logic is reasonably concise, but the redundant loop and unused imports unnecessarily expand it. Action granularity: Most lines perform one action, although the tuple assignment initializes two variables at once. Reading flow: Certificate validation proceeds naturally from file paths to ad-hoc certificates to SSL contexts, but the initial meaningless loop interrupts that flow, and the final bare raise requires tracking the enclosing exception handler.

Run 2

Code Structure: The class and conversion method are logically organized, but an unrelated obfuscated loop disrupts the implementation. Nesting: Several nested try/except and conditional blocks increase reading effort, although the main paths remain manageable. Clarity of intent: The docstring, descriptive API names, and error messages clearly explain certificate handling; meaningless variable names and redundant bitwise operations obscure intent. Code length: The conversion logic is reasonably concise, but the dead computation and numerous imports unused in this snippet add clutter. Action granularity: Most lines perform one action, with only a compact multiple assignment slightly reducing simplicity. Reading flow: File validation, the adhoc fallback, and SSLContext lookup form a natural progression, but the opening loop interrupts that flow, and the final bare raise requires tracking the enclosing exception.

Run 3

Code Structure: The class and conversion method are logically organized, but unrelated imports and a meaningless computation loop add clutter. Nesting: Several nested try/except blocks and conditionals require tracking multiple levels, although early returns help. Clarity of intent: The docstring, descriptive names, and error messages clearly explain certificate handling; opaque variable names and redundant bitwise operations obscure the method's opening. Code length: The actual conversion logic is reasonably concise, but unused imports and dead computation unnecessarily lengthen the snippet. Action granularity: Most lines perform a single action, with one combined initialization slightly reducing consistency. Reading flow: The file-path, ad-hoc certificate, and SSLContext alternatives follow a natural sequence, but the irrelevant opening loop interrupts that flow, and the final bare raise requires remembering the enclosing exception handler.