Sample

pyint-82f810058f55-I01

Remove comments and docstrings

Matched original source

Lines27

Scores

MethodScoreScale
Posnett0.0070–1; higher is more readable
Dorn0.8260–1; higher is more readable
Mi0.5590–1; higher is more readable
LLOC17Logical lines; fewer is more readable
DeepSeek V4 Pro14.670–20; mean of three runs
GPT-6.1 Sol16.670–20; mean of three runs
BTTF0.6840–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): default_mimetype: str | None = "text/html" json_module = json autocorrect_location_header = False @property def max_cookie_size(self) -> int: if current_app: return current_app.config["MAX_COOKIE_SIZE"] 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.533.397−17.602
Source linesThe number of non-empty source lines.27+10.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.636−6.954

Intercept 8.87 + feature contributions = -4.887 (log-odds).
Score = sigmoid(-4.887) = 0.007.

Feature contributions

FeatureValueContribution
(log-odds)
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.58.893+1.171
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.0−0.804
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.044+0.517
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398
Indentation frequencyHow rapidly indentation changes from line to line.27+0.197
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.28+0.045
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.26.817−0.035

Intercept 0.07 + feature contributions = 1.558 (log-odds).
Score = sigmoid(1.558) = 0.826.

Score0.559
Score17
Run 1

The code is generally readable due to its simple class structure, type hints, and descriptive naming, but it suffers from inconsistent formatting and unnecessary blank lines. The inheritance from Werkzeug's Response is clear, and properties are logically ordered. However, the excessive vertical whitespace between the property definition and its body (three blank lines) disrupts reading flow, and the indentation of the return statements is inconsistent. The `json_module` and `autocorrect_location_header` attributes are understandable but lack immediate context. Overall, the structure is sound, but formatting inconsistencies and minor verbosity reduce clarity.

Run 2

The code is generally readable but has some issues. The imports and class definition are clear, though the blank spacing is inconsistent (extra blank lines after class declaration and before method). The docstring is missing, which hurts clarity of intent. The method has good flat structure with minimal nesting, but the conditional return could be clearer. Action granularity is good - one action per line. Naming is clear for max_cookie_size and the config key. The use of type hints and future annotations shows good practice. However, the inconsistent whitespace and lack of explanatory comments for the config value or the autocorrect_location_header flag reduce readability. Overall, it's comprehensible but could benefit from minor cleanup and documentation to reach higher readability.

Run 3

The code is generally readable and well-structured. It uses type hints, clear imports, and logical class organization. The nesting is minimal, action granularity is appropriate, and intent is mostly clear. However, there are minor issues: excessive blank lines disrupt reading flow, the `max_cookie_size` property logic could be clearer (e.g., a comment explaining the fallback), and the `if current_app:` check is somewhat implicit about what `current_app` being falsy means. These slightly reduce clarity and flow but do not significantly harm readability.

Run 1

Code Structure: The class is logically organized, with configuration attributes followed by a property, although several imports are unused. Nesting: A single conditional keeps nesting shallow. Clarity of intent: Descriptive names and type annotations make the cookie-size lookup and superclass fallback clear. Code length: The implementation is concise, but excessive blank lines and unused imports add clutter. Action granularity: Each statement performs one action, making individual operations easy to follow. Reading flow: The flow from class defaults to application configuration and then fallback is natural; inconsistent whitespace slightly disrupts visual readability.

Run 2

Code Structure: The Response subclass logically groups configuration attributes and a related property, but unused imports add clutter. Nesting: A single conditional keeps the code flat and easy to follow. Clarity of intent: Descriptive names make the cookie-size configuration lookup and fallback clear, though the class-level settings lack context. Code length: The implementation is concise, but excessive blank lines and unnecessary imports reduce compactness. Action granularity: Each statement performs one clear action. Reading flow: The property naturally checks application configuration before falling back to the superclass, but inconsistent whitespace and spacing between imports and the class interrupt an otherwise straightforward flow.

Run 3

Code Structure: The imports, class attributes, and property are logically organized, though several imports appear unused. Nesting: A single conditional keeps the method shallow and easy to follow. Clarity of intent: Descriptive names make the response configuration and cookie-size override understandable, although the application-context check requires framework knowledge. Code length: The implementation is concise, but excessive blank lines and trailing whitespace add visual clutter. Action granularity: Each statement performs one action, with no compressed or compound operations. Reading flow: The property naturally checks application configuration before falling back to the superclass; inconsistent spacing slightly disrupts an otherwise straightforward flow.