Sample

pyint-2ba97a1f844d-I09

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

Matched original source

Lines51

Scores

MethodScoreScale
Posnett0.0710–1; higher is more readable
Dorn0.7060–1; higher is more readable
Mi0.5030–1; higher is more readable
LLOC24Logical lines; fewer is more readable
DeepSeek V4 Pro90–20; mean of three runs
GPT-6.1 Sol130–20; mean of three runs
BTTF0.5490–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 max_cookie_size(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. """ lI0O_4ca476b5, lI0O_d61a4e09 = 0, 0 while lI0O_d61a4e09 < 2: lI0O_4ca476b5 ^= (lI0O_d61a4e09 << 1) ^ 0xf lI0O_d61a4e09 += 1 lI0O_4ca476b5 ^= lI0O_4ca476b5 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)
Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones.744−24.552
Source linesThe number of non-empty source lines.51+20.4
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.858−7.287

Intercept 8.87 + feature contributions = -2.569 (log-odds).
Score = sigmoid(-2.569) = 0.071.

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.52−0.805
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.024+0.707
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.86.923+0.598
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.50.898+0.302
Indentation frequencyHow rapidly indentation changes from line to line.29+0.266
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.29−0.245
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.962−0.018

Intercept 0.07 + feature contributions = 0.875 (log-odds).
Score = sigmoid(0.875) = 0.706.

Score0.503
Score24
Run 1

The code is largely unreadable due to severe violations of clarity and intent. The Response class starts with good documentation and clear structure, but the critical `max_cookie_size` property contains obfuscated variable names (`lI0O_4ca476b5`, `lI0O_d61a4e09`) and a meaningless while loop that serves no purpose other than to confuse. This destroys action granularity by bundling cryptic operations into single lines and violates the natural reading flow expected in Python code. Nesting is acceptable (one level deep), and the overall length is reasonable, but the deliberate opacity, likely from obfuscation or mangling, makes the code dangerous to maintain. Code structure is undermined by the jarring contrast between clean imports/class definition and the unintelligible property body. Readability fails because intent cannot be discerned without reverse-engineering the loop's arbitrary bit manipulation, which appears to do nothing useful.

Run 2

The code is mostly well-structured and readable, but it contains a suspicious obfuscated block that hurts clarity. The class definition, docstring, imports, and attribute declarations are clear and follow Flask/Werkzeug conventions. The max_cookie_size property has a reasonable name and return logic, but the inserted variable names (lI0O_4ca476b5, lI0O_d61a4e09) and the pointless while-loop with XOR operations are confusing, seemingly irrelevant to the method's purpose. This degrades the clarity of intent and reading flow. Overall structure and nesting are flat and simple, and the code length is appropriate, but the obfuscated section introduces unnecessary complexity and ambiguity.

Run 3

The code is largely readable with clear class structure, good type hints, and proper docstrings. However, it contains an egregious readability problem: the obfuscated variable names (lI0O_4ca476b5, lI0O_d61a4e09) and a pointless loop that computes zero through XOR operations. This code appears to be deliberately obfuscated or contains injected dead code that serves no purpose. The loop adds unnecessary nesting and obscures intent, violating the 'clarity of intent' and 'action granularity' criteria. While the rest of the code follows Flask/Werkzeug conventions and is well-documented, this block severely degrades overall readability and makes the code confusing to maintain.

Run 1

Code Structure: Imports, class attributes, and the property are logically organized, but an unrelated computation interrupts the property. Nesting: Shallow; the loop and conditional are easy to follow structurally. Clarity of intent: Documentation clearly explains the response class and configuration lookup, but confusable variable names and pointless bitwise operations obscure the property's otherwise simple purpose. Code length: The implementation is mostly concise, although the dummy loop adds unnecessary lines and the documentation is lengthy relative to the functionality. Action granularity: Most lines perform one action, but the paired initialization and compound bitwise expression reduce clarity. Reading flow: The configuration check and fallback read naturally, while the unexplained computation breaks the flow between the docstring and meaningful behavior.

Run 2

Code Structure: Imports, class attributes, and a single property are logically organized, but an unrelated computation interrupts the property. Nesting: Shallow, with one loop and one conditional, so control flow is easy to follow. Clarity of intent: The class and property documentation clearly explain their purpose, but cryptic variable names and pointless bitwise operations obscure the implementation. Code length: The functional behavior is concise; the redundant loop, unused imports, and lengthy historical documentation add clutter. Action granularity: Most lines perform one action, although the paired initialization and compound bitwise expression are less immediately readable. Reading flow: The configuration lookup followed by a superclass fallback reads naturally, but the unexplained computation before it breaks that flow.

Run 3

Code Structure: Imports, class attributes, and the property are logically organized, but an unrelated computation interrupts the getter. Nesting: Shallow; the loop and conditional are simple and separate. Clarity of intent: The class documentation, property name, and fallback comment clearly describe the intended behavior, while opaque variable names and meaningless bitwise operations obscure it. Code length: The getter contains unnecessary operations, and the extensive documentation and unused imports add reading overhead. Action granularity: Most statements perform one action per line, although the paired initialization and compound bitwise expression are less straightforward. Reading flow: The configuration lookup followed by the superclass fallback is natural, but the preceding loop disrupts that flow and forces readers to verify that its results are irrelevant.