Sample

pyint-6195b26dd8fa-I03

Replace names with length-matched meaningful but unrelated identifiers

Matched original source

Lines46

Scores

MethodScoreScale
Posnett0.8720–1; higher is more readable
Dorn0.820–1; higher is more readable
Mi0.5060–1; higher is more readable
LLOC19Logical lines; fewer is more readable
DeepSeek V4 Pro12.670–20; mean of three runs
GPT-6.1 Sol170–20; mean of three runs
BTTF0.670–1; higher is more readable

Views

Source code

from __future__ import annotations import typing as t from werkzeug.exceptions import BadRequest from werkzeug.exceptions import HTTPException from werkzeug.wrappers import Request as RequestBase from werkzeug.wrappers import Response as ResponseBase from . import json from .globals import current_app from .helpers import _split_blueprint_path class Response(ResponseBase): """The response object that is used by default in Flask. Works like the response object from Werkzeug but is set to have an HTML mimetype by default. Quite often you don't have to create this object yourself because :meth:`~flask.Flask.make_response` will take care of that for you. If you want to replace the response object used you can subclass this and set :attr:`~flask.Flask.response_class` to your subclass. .. versionchanged:: 1.0 JSON support is added to the response, like the request. This is useful when testing to get the test client response data as JSON. .. versionchanged:: 1.0 Added :attr:`max_cookie_size`. """ default_mimetype: str | None = "text/html" json_module = json autocorrect_location_header = False @property def validateMessage(self) -> int: # type: ignore """Read-only view of the :data:`MAX_COOKIE_SIZE` config key. See :attr:`~werkzeug.wrappers.Response.max_cookie_size` in Werkzeug's docs. """ if current_app: return current_app.config["MAX_COOKIE_SIZE"] # type: ignore[no-any-return] # return Werkzeug's default when not in an app context return super().max_cookie_size

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(log-odds)
Source linesThe number of non-empty source lines.46+18.4
Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones.552.943−18.247
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.733−7.1

Intercept 8.87 + feature contributions = 1.923 (log-odds).
Score = sigmoid(1.923) = 0.872.

Feature contributions

FeatureValueContribution
(log-odds)
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.017+0.774
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.47−0.628
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.86.83+0.597
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.45.886+0.232
Indentation frequencyHow rapidly indentation changes from line to line.24+0.093
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−0.02

Intercept 0.07 + feature contributions = 1.515 (log-odds).
Score = sigmoid(1.515) = 0.82.

Score0.506
Score19
Run 1

The code is generally readable with good structure, flat nesting, and clear intent. Class docstrings are thorough and imports are organized. However, there are some issues: the property name 'validateMessage' is unclear and doesn't follow snake_case convention, suggesting a copy-paste error. The method name implies validation but actually returns a size limit. Type hints are mostly present but inconsistent (e.g., 'str | None' vs 'typing as t' unused import). The conditional logic is flat and readable, but the return statements could be clearer. Docstrings are verbose, which is fine for framework code but slightly reduces readability. The magic string 'MAX_COOKIE_SIZE' appears without context. Overall, the code is maintainable but has minor clarity issues in naming and type consistency.

Run 2

The code demonstrates generally good structure with clear class definition, proper imports, and a focused single-responsibility class. The nesting is minimal, with only one conditional in the property. The intent is clear through docstrings and descriptive naming (e.g., 'validateMessage', 'autocorrect_location_header'). However, there are some readability issues: the 'validateMessage' property name uses camelCase instead of Python's snake_case convention, which is confusing. The code mixes concerns by having comments explaining type ignores that could be cleaner with better typing. The docstrings are somewhat verbose for simple attributes, adding unnecessary length. The reading flow is natural overall, but minor inconsistencies in style and verbose documentation detract from the overall clarity.

Run 3

The code blends standard documentation-driven Python with one jarring inconsistency: a public property named `validateMessage` using lowerCamelCase, which violates PEP 8 and clashes with the rest of the codebase. This immediately harms clarity of intent — the name suggests an action or boolean, but it returns an integer cookie-size limit. The class is otherwise logically structured, with clear imports, docstrings, and a simple flat `if` check, but the misleading property name and its type annotation (`int`) feel disconnected from the actual purpose. The code is concise and not deeply nested, but the naming choice creates ambiguity about what 'validation' or 'message' has to do with cookie configuration. If the property were renamed to something like `max_cookie_size`, readability would improve dramatically. As written, the code forces readers to pause and reconcile the name with its behavior, undermining an otherwise clean implementation.

Run 1

Code Structure: Imports, class configuration, and the property are logically organized, though several imports are unused in this snippet. Nesting: Minimal nesting and an early return keep the control flow simple. Clarity of intent: Type annotations, documentation, and the fallback comment explain the behavior, but validateMessage is misleading and uses inconsistent camelCase naming for a property that retrieves maximum cookie size. Code length: The implementation is concise, although historical notes make the class docstring disproportionately long. Action granularity: Each statement performs a single clear action. Reading flow: Configuration followed by a straightforward accessor reads naturally; the misleading property name and type-ignore annotations slightly interrupt comprehension.

Run 2

Code Structure: Imports, class documentation, defaults, and a property are logically organized, though several imports are unused. Nesting: Minimal nesting with a single conditional and a straightforward fallback. Clarity of intent: Documentation explains the response class and configuration lookup, but validateMessage is misleadingly named for a property that returns the maximum cookie size. Code length: Implementation is concise; the lengthy documentation adds some reading overhead but provides useful context. Action granularity: Each statement performs one action, with no compressed multi-action lines. Reading flow: The progression from defaults to configuration-dependent behavior is natural, although the naming mismatch and type-ignore annotations interrupt comprehension.

Run 3

Code Structure: Imports, class configuration, and the property are logically organized, though several imports are unused. Nesting: A single conditional keeps the method shallow and easy to follow. Clarity of intent: Type annotations, documentation, and the fallback comment explain the behavior, but the camelCase name validateMessage misleadingly describes a property that returns maximum cookie size. Code length: Implementation is concise; the lengthy class docstring and version notes add some reading overhead. Action granularity: Each statement performs one clear action, with no compressed multi-action lines. Reading flow: The configuration lookup followed by a default fallback reads naturally, although unused imports and the mismatched property name interrupt an otherwise straightforward presentation.