Sample

pyint-b39a70bd97ec-I04

Replace names with deterministic minifier-style shortest identifiers

Matched original source

Lines60

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.8150–1; higher is more readable
Mi0.3670–1; higher is more readable
LLOC25Logical lines; fewer is more readable
DeepSeek V4 Pro12.330–20; mean of three runs
GPT-6.1 Sol13.330–20; mean of three runs
BTTF0.6070–1; higher is more readable

Views

Source code

from __future__ import annotations import typing as t from . import typing as ft from .globals import current_app from .globals import request class MethodView(View): """Dispatches request methods to the corresponding instance methods. For example, if you implement a ``get`` method, it will be used to handle ``GET`` requests. This can be useful for defining a REST API. :attr:`methods` is automatically set based on the methods defined on the class. See :doc:`views` for a detailed guide. .. code-block:: python class CounterAPI(MethodView): def get(self): return str(session.get("counter", 0)) def post(self): session["counter"] = session.get("counter", 0) + 1 return redirect(url_for("counter")) app.add_url_rule( "/counter", view_func=CounterAPI.as_view("counter") ) """ def __init_subclass__(cls, **b: t.Any) -> None: super().__init_subclass__(**b) if "methods" not in cls.__dict__: c = set() for d in cls.__bases__: if getattr(d, "methods", None): c.update(d.methods) # type: ignore[attr-defined] for e in http_method_funcs: if hasattr(cls, e): c.add(e.upper()) if c: cls.methods = c def a(self, **f: t.Any) -> ft.ResponseReturnValue: g = getattr(self, request.method.lower(), None) # If the request method is HEAD and we don't have a handler for it # retry with GET. if g is None and request.method == "HEAD": g = getattr(self, "get", None) assert g is not None, f"Unimplemented method {request.method!r}" return current_app.ensure_sync(g)(**f) # 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.1176−38.808
Source linesThe number of non-empty source lines.60+24
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.449−6.674

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

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.61−1.123
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.049+0.465
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.76.984+0.438
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.59.872+0.427
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.76.967+0.405
Indentation frequencyHow rapidly indentation changes from line to line.33+0.404
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398

Intercept 0.07 + feature contributions = 1.484 (log-odds).
Score = sigmoid(1.484) = 0.815.

Score0.367
Score25
Run 1

The code has a clear class structure and docstring, but readability suffers significantly due to poor variable naming (a, b, c, d, e, f, g). The `__init_subclass__` method contains a deeply nested conditional structure that makes the logic hard to follow. While the code is concise, the intent is obscured by single-letter variable names that provide no context about their purpose. The flow within the methods is somewhat disorganized - `a()` (which appears to be the dispatch method) is not descriptively named. Action granularity is generally good with one logical operation per line, but the loop in `__init_subclass__` could benefit from better structure. The docstring and comments are clear, but they don't compensate for the obscure implementation details. Overall, the code works but requires significant effort to understand.

Run 2

The code is moderately readable but suffers from several issues. The class docstring is excellent and improves clarity, but the method names ('a', 'b', 'c', 'e', 'f', 'g', 'd') are meaningless single letters that obscure intent. The variable 'c' as a set and 'g' as a handler function require mental mapping. Nesting is shallow, which is good, but the logic in '__init_subclass__' could be extracted into helper methods for better action granularity. The 'a' method (likely 'dispatch_request') has a clear flow but the letter-based naming undermines readability. The code is not unnecessarily long, and the reading flow is logical, but the obfuscated names significantly reduce clarity of intent and make the code harder to follow than necessary.

Run 3

The code has clear structure with a well-documented class and method, making the intent understandable. Nesting is minimal with only one level of conditional logic. The method names (a, b, f, g) are not descriptive, which reduces clarity, but the docstring compensates by explaining the class behavior. Code length is concise and appropriate for the task. Action granularity is good—most lines perform a single operation, though some lines combine checks and operations. Reading flow is natural, with imports, class definition, docstring, and methods in logical order. The main drawback is the non-descriptive variable names, which slightly obscure intent.

Run 1

Code Structure: The class logically separates automatic HTTP-method discovery from request dispatch, although View and http_method_funcs are undefined in this snippet. Nesting: Mostly shallow, with moderate nesting in subclass initialization that remains easy to follow. Clarity of intent: The detailed class docstring and HEAD fallback comment explain the purpose, but names such as a, b, c, d, e, f, and g obscure method and variable roles. Code length: Implementation is concise; the longer docstring provides useful documentation and an example rather than unnecessary verbosity. Action granularity: Most lines perform one clear action, though the final return combines handler synchronization and invocation. Reading flow: Imports, documentation, initialization, and dispatch follow a natural order, but cryptic identifiers and the mismatch between the descriptive class documentation and the method name a interrupt comprehension.

Run 2

Code Structure: The class logically separates method discovery from request dispatch, although View and http_method_funcs are not defined or imported in the snippet. Nesting: Method discovery has moderate nesting, while dispatch remains mostly flat. Clarity of intent: The detailed docstring and HEAD fallback comment explain the purpose, but names such as a, b, c, d, e, f, and g obscure method roles and variable meanings. Code length: The implementation is concise; the lengthy docstring provides useful documentation and an example. Action granularity: Most lines perform one clear action, although the final return combines synchronization and invocation. Reading flow: Discovery, fallback, validation, and dispatch follow a natural sequence, but cryptic identifiers and missing context interrupt comprehension.

Run 3

Code Structure: The class logically separates subclass initialization from request dispatch, though View and http_method_funcs are undefined in the excerpt. Nesting: Initialization has moderate nesting through conditionals and loops; dispatch remains flat and easy to follow. Clarity of intent: The detailed class docstring and HEAD fallback comment explain the overall purpose, but names such as a, b, c, d, e, f, and g obscure method responsibilities and variable roles. Code length: The implementation is concise; the lengthy docstring provides useful documentation and an example rather than redundant code. Action granularity: Most lines perform one action, although the final return combines synchronization and handler invocation. Reading flow: Imports, documentation, initialization, and dispatch follow a natural sequence, but cryptic identifiers and missing surrounding definitions interrupt comprehension.