Sample

pyint-8a3d3804ac61-I04

Replace names with deterministic minifier-style shortest identifiers

Matched original source

Lines97

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.4850–1; higher is more readable
Mi0.270–1; higher is more readable
LLOC37Logical lines; fewer is more readable
DeepSeek V4 Pro60–20; mean of three runs
GPT-6.1 Sol130–20; mean of three runs
BTTF0.1910–1; higher is more readable

Views

Source code

from __future__ import annotations import dataclasses import decimal import json import typing as t import uuid import weakref from datetime import date from werkzeug.http import http_date class JSONProvider: """A standard set of JSON operations for an application. Subclasses of this can be used to customize JSON behavior or use different JSON libraries. To implement a provider for a specific library, subclass this base class and implement at least :meth:`dumps` and :meth:`loads`. All other methods have default implementations. To use a different provider, either subclass ``Flask`` and set :attr:`~flask.Flask.json_provider_class` to a provider class, or set :attr:`app.json <flask.Flask.json>` to an instance of the class. :param app: An application instance. This will be stored as a :class:`weakref.proxy` on the :attr:`_app` attribute. .. versionadded:: 2.2 """ def __init__(self, g: App) -> None: self._app: App = weakref.proxy(g) def a(self, h: t.Any, **i: t.Any) -> str: """Serialize data as JSON. :param obj: The data to serialize. :param kwargs: May be passed to the underlying JSON library. """ raise NotImplementedError def b(self, j: t.Any, k: t.IO[str], **l: t.Any) -> None: """Serialize data as JSON and write to a file. :param obj: The data to serialize. :param fp: A file opened for writing text. Should use the UTF-8 encoding to be valid JSON. :param kwargs: May be passed to the underlying JSON library. """ k.write(self.a(j, **l)) def c(self, m: str | bytes, **n: t.Any) -> t.Any: """Deserialize data as JSON. :param s: Text or UTF-8 bytes. :param kwargs: May be passed to the underlying JSON library. """ raise NotImplementedError def d(self, o: t.IO[t.AnyStr], **p: t.Any) -> t.Any: """Deserialize data as JSON read from a file. :param fp: A file opened for reading text or UTF-8 bytes. :param kwargs: May be passed to the underlying JSON library. """ return self.c(o.read(), **p) def e( self, q: tuple[t.Any, ...], r: dict[str, t.Any] ) -> t.Any: if q and r: raise TypeError("app.json.response() takes either args or kwargs, not both") if not q and not r: return None if len(q) == 1: return q[0] return q or r def f(self, *s: t.Any, **u: t.Any) -> Response: """Serialize the given arguments as JSON, and return a :class:`~flask.Response` object with the ``application/json`` mimetype. The :func:`~flask.json.jsonify` function calls this method for the current application. Either positional or keyword arguments can be given, not both. If no arguments are given, ``None`` is serialized. :param args: A single value to serialize, or multiple values to treat as a list to serialize. :param kwargs: Treat as a dict to serialize. """ v = self.e(s, u) return self._app.response_class(self.a(v), mimetype="application/json")

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.2041.875−67.382
Source linesThe number of non-empty source lines.97+38.8
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.569−6.853

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

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.96−2.363
Indentation frequencyHow rapidly indentation changes from line to line.50+0.992
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.96.82+0.944
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.50−0.727
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.87.98+0.615
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.049+0.468
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.87.969−0.061

Intercept 0.07 + feature contributions = -0.061 (log-odds).
Score = sigmoid(-0.061) = 0.485.

Score0.27
Score37
Run 1

The code is difficult to read due to heavily obfuscated naming. Parameters like 'g', 'a', 'b', 'c', 'd', 'e', 'f', 'h', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 'u' and return variables like 'v' provide no context, making the code's intent extremely ambiguous. The structure and logical flow are sound, but the readability is severely hampered by the single-letter naming. While docstrings describe the methods, they do not clarify the parameter meanings within the method bodies. The nesting and code length are reasonable, but the obfuscation makes it unreadable despite the relatively flat structure and single-action-per-line adherence.

Run 2

The code structure is reasonable and flat, with short methods and docstrings. However, clarity of intent is severely damaged by meaningless single-letter names for app, args, kwargs, fp, etc. This obscures what each method does. Reading flow is disrupted because the reader must constantly map obfuscated names back to the docstring descriptions. Code length is concise but action granularity is mixed—some methods pack multiple actions into one line. The docstrings are good, but they cannot compensate for the poor naming. Overall, the logic is simple, but the identifier choices make the code cryptic and difficult to read, dragging the score down substantially despite the clean structure.

Run 3

The code suffers severely from obfuscated naming and misleading documentation. Method names like 'a', 'b', 'c', 'd', 'e', 'f' and parameters like 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 'u', 'v' completely obscure intent. Docstrings describe clear operations (dumps, loads, dump, load, response) but do not match the actual method names, creating cognitive dissonance. Structure is logical and nesting is minimal, but the meaningless identifiers destroy clarity. Code length is reasonable, but every line requires mental translation. Reading flow is broken by constantly mapping abstract letters to concepts. The type hints and class structure are good, but they cannot compensate for the cryptic naming. This appears to be deliberately obfuscated Flask/JSON provider code; in production, this would be unmaintainable and extremely error-prone.

Run 1

Code Structure: The class logically groups serialization, deserialization, argument normalization, and response creation, with small, focused methods. Nesting: Control flow is flat, using simple conditions and early returns. Clarity of intent: Class documentation and type hints explain the overall purpose, but single-letter method and parameter names obscure individual operations. Docstrings reference names such as dumps, loads, obj, and kwargs that do not match the actual identifiers, increasing confusion. App and Response also lack visible definitions or imports. Code length: Implementations are concise, although extensive documentation dominates the snippet. Action granularity: Statements generally perform one clear operation per line; composed calls remain manageable. Reading flow: Method ordering is natural, but cryptic identifiers force readers to repeatedly consult documentation and trace calls.

Run 2

Code Structure: Methods are logically organized within a provider class, separating serialization, deserialization, and response creation. Nesting: Minimal nesting and early returns make control flow easy to follow. Clarity of intent: Docstrings explain the operations, but single-letter method and parameter names obscure their purpose; documented parameter names do not match the signatures. App and Response also lack visible imports or definitions. Code length: Implementations are concise, although extensive documentation dominates the snippet and several imports are unused. Action granularity: Most lines perform one clear action; composed calls are simple enough to understand. Reading flow: The progression from basic operations to response handling is natural, but opaque names force readers to repeatedly consult docstrings and trace calls.

Run 3

Code Structure: Methods are logically organized within a provider class, separating serialization, file operations, argument handling, and response creation. Nesting: Shallow conditionals and early returns keep control flow simple. Clarity of intent: Extensive docstrings and type hints explain the operations, but single-letter method and parameter names obscure their roles; documented parameter names also do not match the signatures. Code length: Implementations are concise, although lengthy documentation dominates the snippet and several imports appear unused. Action granularity: Most lines perform one action, with only straightforward nested calls combining reading, serialization, or response construction. Reading flow: The progression from basic operations to response handling is natural, but readers must repeatedly map opaque identifiers to documented concepts. App and Response annotations lack visible definitions or imports, adding contextual uncertainty.