AI Slop Code RIsk Monitor

litestar-org/litestar

Light, flexible and extensible ASGI framework | Built to scale

43.5 High pattern signal View on GitHub

Maintenance and Governance Review

This report summarizes scanner evidence for litestar-org/litestar, a Python project with 8,508 GitHub stars. SynthScan examined 110,036 lines of code across 1170 source files, recording 3332 pattern matches distributed across 20 syntactic categories. The legacy adjusted pattern signal is 43.5 (High pattern signal); it is not an authorship estimate.

Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.

43.5
Adjusted Signal
43.5
Raw Pattern Score
100%
Time Factor
2026-10-06
Last Push
8.5K
Stars
Python
Language
110.0K
Lines of Code
1.2K
Files
3.3K
Pattern Hits
2026-10-12
Scan Date
0.27
HC Hit Rate

Risk Review · v3

Use each vector to guide manual verification of the underlying findings.

Cognitive Ownership Risk 68.1/100 · HIGH

Can maintainers explain intent, assumptions, and trade-offs? 1992 finding(s).

Hallucinated Dependency & Supply Chain Risk 45.8/100 · MEDIUM

Are imports declared and package/API names verified? 1111 finding(s).

Agent Over-Engineering Ratio 72.0/100 · HIGH

Are wrappers, guards, and repeated structures necessary? 2030 finding(s).

PR Review Velocity Impact 89.9/100 · CRITICAL

Which changes need focused human review? 3332 finding(s).

What These Metrics Mean

Adjusted Signal
Legacy pattern score normalized per 1,000 scanned lines and multiplied by the repository-level time factor. It is not an estimate of AI authorship.
Raw Pattern Score
Sum of severity- and context-weighted pattern findings before applying the time factor.
Time Factor
A coarse multiplier based on repository last-push metadata. It does not identify when individual code was written.
Pattern Hits
Count of configured pattern findings. Review each location and surrounding code before acting.
HC Hit Rate
High- and critical-severity findings per scanned file. Severity is a configured detector weight, not proof of a vulnerability or authorship.
Lines / Files
Scan coverage denominators used by the legacy normalized score.

Pattern-Signal History

This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.

Severity Breakdown

Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.

CRITICAL 25HIGH 288MEDIUM 25LOW 2994

Directory Score Breakdown

This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.

Pattern Findings

The scanner identified 3332 distinct pattern matches across 20 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.

Hyper-Verbose Identifiers1743 hits · 1826 pts
SeverityFileLineSnippetContext
LOWtools/prepare_release.py109 async def get_closing_issues_references(self, pr_number: int) -> list[int]:CODE
LOWtools/prepare_release.py180 async def _get_first_time_contributions(self, prs: dict[str, list[PRInfo]]) -> list[PRInfo]:CODE
LOWtools/sphinx_ext/missing_references.py36def get_module_global_imports(module_import_path: str, reference_target_source_obj: str) -> set[str]:CODE
LOWtools/sphinx_ext/missing_references.py52def on_warn_missing_reference(app: Sphinx, domain: str, node: Node) -> bool | None:CODE
LOWtests/conftest.py105def file_store_create_directories(tmp_path: Path) -> FileStore:CODE
LOWtests/conftest.py111def file_store_create_directories_flag_false(tmp_path: Path) -> FileStore:CODE
LOWtests/conftest.py129def cookie_session_backend_config() -> CookieBackendConfig:CODE
LOWtests/conftest.py149def server_side_session_config() -> ServerSideSessionConfig:CODE
LOWtests/conftest.py154def server_side_session_backend(server_side_session_config: ServerSideSessionConfig) -> ServerSideSessionBackend:CODE
LOWtests/conftest.py169def session_backend_config_memory(memory_store: MemoryStore) -> ServerSideSessionConfig:CODE
LOWtests/conftest.py179def cookie_session_middleware(CODE
LOW⚡tests/conftest.py301def disable_warn_implicit_sync_to_thread() -> Generator[None, None, None]:CODE
LOW⚡tests/conftest.py310def disable_warn_sync_to_thread_with_async(monkeypatch: MonkeyPatch) -> None:CODE
LOW⚡tests/conftest.py315def enable_warn_implicit_sync_to_thread(monkeypatch: MonkeyPatch) -> None:CODE
LOWtests/helpers.py66def get_schema_for_field_definition(CODE
LOWtests/unit/test_pagination.py83def test_classic_pagination_data_shape(paginator: Any) -> None:CODE
LOWtests/unit/test_pagination.py109def test_classic_pagination_openapi_schema(paginator: Any) -> None:CODE
LOWtests/unit/test_pagination.py144def test_limit_offset_pagination_data_shape(paginator: Any) -> None:CODE
LOWtests/unit/test_pagination.py168def test_limit_offset_pagination_openapi_schema(paginator: Any) -> None:CODE
LOWtests/unit/test_pagination.py225def test_cursor_pagination_data_shape(paginator: Any) -> None:CODE
LOWtests/unit/test_pagination.py248def test_cursor_pagination_openapi_schema(paginator: Any) -> None:CODE
LOW⚡tests/unit/test_concurrency.py45def test_sync_to_thread_asyncio(loop: AbstractEventLoop) -> None:CODE
LOW⚡tests/unit/test_concurrency.py53def test_get_set_asyncio_executor() -> None:CODE
LOW⚡tests/unit/test_concurrency.py60def test_get_set_trio_capacity_limiter() -> None:CODE
LOW⚡tests/unit/test_concurrency.py67def test_asyncio_uses_executor(mocker: MockerFixture, loop: AbstractEventLoop) -> None:CODE
LOWtests/unit/test_concurrency.py78def test_set_asyncio_executor_from_running_loop_raises(loop: AbstractEventLoop) -> None:CODE
LOWtests/unit/test_concurrency.py98def test_set_trio_capacity_limiter_from_async_context_raises() -> None:CODE
LOWtests/unit/test_concurrency.py108def test_sync_to_thread_unsupported_lib(mocker: MockerFixture, loop: AbstractEventLoop) -> None:CODE
LOWtests/unit/conftest.py12def reset_cached_dto_backends() -> Generator[None, None, None]:CODE
LOWtests/unit/conftest.py21def use_experimental_dto_backend(request: FixtureRequest) -> bool:CODE
LOWtests/unit/test_websocket_class_resolution.py33def test_websocket_class_resolution_of_layers(CODE
LOWtests/unit/test_websocket_class_resolution.py78def test_listener_websocket_class_resolution_of_layers(CODE
LOWtests/unit/test_parsers.py102def test_query_parsing_of_escaped_values(values: tuple[tuple[str, str], tuple[str, str]]) -> None:CODE
LOWtests/unit/test_di.py115def test_provider_equality_check() -> None:CODE
LOW⚡tests/unit/test_di.py141async def test_provide_for_callable(fn: Any, exp: Any, anyio_backend: str) -> None:CODE
LOW⚡tests/unit/test_di.py146def test_sync_callable_without_sync_to_thread_warns() -> None:CODE
LOW⚡tests/unit/test_di.py155def test_async_callable_with_sync_to_thread_warns(sync_to_thread: bool) -> None:CODE
LOW⚡tests/unit/test_di.py163def test_generator_with_sync_to_thread_warns() -> None:CODE
LOWtests/unit/test_di.py181def test_dependency_has_async_callable(dep: Any, exp: bool) -> None:CODE
LOWtests/unit/test_di.py194def test_dependency_has_sync_generator(dep: Any, exp: bool) -> None:CODE
LOWtests/unit/test_di.py207def test_dependency_has_async_generator(dep: Any, exp: bool) -> None:CODE
LOWtests/unit/test_di.py211def test_raises_when_dependency_is_not_callable() -> None:CODE
LOWtests/unit/test_di.py223def test_raises_when_generator_dependency_is_cached(dep: Any) -> None:CODE
LOWtests/unit/test_di.py228def test_provide_raises_on_unsafe_signature_access() -> None:CODE
LOWtests/unit/test_di.py242async def test_stateful_sync_generator_with_cleanup() -> None:CODE
LOWtests/unit/test_di.py281async def test_stateful_async_generator_with_cleanup() -> None:CODE
LOWtests/unit/test_di.py319def test_bound_async_generator_method_detection() -> None:CODE
LOWtests/unit/test_di.py339def test_bound_sync_generator_method_detection() -> None:CODE
LOW⚡tests/unit/test_typing.py157def test_field_definition_from_annotation(annotation: Any, expected: dict[str, Any]) -> None:CODE
LOW⚡tests/unit/test_typing.py162def test_field_definition_kwarg_definition_from_extras() -> None:CODE
LOW⚡tests/unit/test_typing.py170def test_field_definition_kwarg_definition_from_kwargs() -> None:CODE
LOW⚡tests/unit/test_typing.py175def test_field_definition_with_annotated_kwarg_definition() -> None:CODE
LOW⚡tests/unit/test_typing.py181def test_field_definition_from_union_annotation() -> None:CODE
LOW⚡tests/unit/test_typing.py211def test_field_definition_is_type_var_predicate() -> None:CODE
LOW⚡tests/unit/test_typing.py218def test_field_definition_is_union_predicate() -> None:CODE
LOW⚡tests/unit/test_typing.py226def test_field_definition_is_optional_predicate() -> None:CODE
LOW⚡tests/unit/test_typing.py235def test_field_definition_is_dataclass_predicate() -> None:CODE
LOW⚡tests/unit/test_typing.py281def test_field_definition_has_inner_subclass_of() -> None:CODE
LOW⚡tests/unit/test_typing.py288def test_field_definition_equality() -> None:CODE
LOW⚡tests/unit/test_typing.py298def test_field_definition_hash() -> None:CODE
1683 more matches not shown…
Unused Imports1051 hits · 993 pts
SeverityFileLineSnippetContext
LOWtools/build_docs.py1CODE
LOWtools/prepare_release.py1CODE
LOWtools/sphinx_ext/missing_references.py1CODE
LOWtools/sphinx_ext/__init__.py1CODE
LOWtools/sphinx_ext/run_examples.py1CODE
LOWtools/sphinx_ext/changelog.py11CODE
LOWtests/conftest.py3CODE
LOWtests/conftest.py16CODE
LOWtests/docker_service_fixtures.py1CODE
LOWtests/helpers.py1CODE
LOWtests/unit/test_concurrency.py1CODE
LOWtests/unit/test_typing.py1CODE
LOWtests/unit/test_guards.py14CODE
LOWtests/unit/test_guards.py15CODE
LOWtests/unit/test_stores.py1CODE
LOWtests/unit/test_app.py1CODE
LOWtests/unit/test_dto/conftest.py1CODE
LOWtests/unit/test_dto/test_msgspec.py1CODE
LOWtests/unit/test_dto/__init__.py1CODE
LOWtests/unit/test_dto/test_integration.py1CODE
LOWtests/unit/test_dto/test_interface.py1CODE
LOWtests/unit/test_dto/test_factory/test_base_dto.py1CODE
LOWtests/unit/test_dto/test_factory/test_dataclass_dto.py1CODE
LOWtests/unit/test_dto/test_factory/__init__.py1CODE
LOWtests/unit/test_dto/test_factory/test_field.py1CODE
LOWtests/unit/test_dto/test_factory/test_integration.py3CODE
LOWtests/unit/test_dto/test_factory/test_integration.py33CODE
LOW…unit/test_dto/test_factory/test_backends/test_utils.py1CODE
LOW…s/unit/test_dto/test_factory/test_backends/conftest.py1CODE
LOW…t/test_dto/test_factory/test_backends/test_base_dto.py3CODE
LOW…t/test_dto/test_factory/test_backends/test_backends.py3CODE
LOWtests/unit/test_types/test_protocols.py1CODE
LOWtests/unit/test_connection/test_connection_caching.py1CODE
LOWtests/unit/test_connection/test_request.py7CODE
LOWtests/unit/test_connection/test_websocket.py6CODE
LOWtests/unit/test_static_files/test_html_mode.py1CODE
LOWtests/unit/test_static_files/conftest.py1CODE
LOW…unit/test_static_files/test_file_serving_resolution.py1CODE
LOW…unit/test_static_files/test_static_files_validation.py1CODE
LOW…/unit/test_middleware/test_allowed_hosts_middleware.py1CODE
LOW…/unit/test_middleware/test_allowed_hosts_middleware.py14CODE
LOW…/unit/test_middleware/test_allowed_hosts_middleware.py14CODE
LOW…/unit/test_middleware/test_allowed_hosts_middleware.py14CODE
LOW…test_middleware/test_base_authentication_middleware.py24CODE
LOWtests/unit/test_middleware/test_base_middleware.py18CODE
LOWtests/unit/test_middleware/test_base_middleware.py18CODE
LOWtests/unit/test_middleware/test_base_middleware.py18CODE
LOWtests/unit/test_middleware/test_base_middleware.py18CODE
LOWtests/unit/test_middleware/test_base_middleware.py18CODE
LOWtests/unit/test_middleware/test_middleware_handling.py18CODE
LOWtests/unit/test_middleware/test_middleware_handling.py18CODE
LOWtests/unit/test_middleware/test_middleware_handling.py18CODE
LOWtests/unit/test_middleware/test_middleware_handling.py18CODE
LOWtests/unit/test_middleware/test_cors_middleware.py13CODE
LOWtests/unit/test_middleware/test_logging_middleware.py23CODE
LOWtests/unit/test_middleware/test_logging_middleware.py24CODE
LOWtests/unit/test_middleware/test_logging_middleware.py26CODE
LOW…unit/test_middleware/test_response_cache_middleware.py1CODE
LOW…sts/unit/test_middleware/test_rate_limit_middleware.py23CODE
LOWtests/unit/test_middleware/test_session/conftest.py7CODE
991 more matches not shown…
Cross-File Repetition156 hits · 780 pts
SeverityFileLineSnippetContext
HIGHtests/unit/test_connection/test_request.py0a large part of the tests in this file were adapted from: https://github.com/encode/starlette/blob/master/tests/test_resSTRING
HIGHtests/unit/test_response/test_redirect_response.py0a large part of the tests in this file were adapted from: https://github.com/encode/starlette/blob/master/tests/test_resSTRING
HIGHtests/unit/test_response/test_streaming_response.py0a large part of the tests in this file were adapted from: https://github.com/encode/starlette/blob/master/tests/test_resSTRING
HIGHdocs/examples/sqla/sqlalchemy_sync_repository.py0this provides a simple example demonstrating how to override the join options for the repository.STRING
HIGHdocs/examples/sqla/sqlalchemy_repository_extension.py0this provides a simple example demonstrating how to override the join options for the repository.STRING
HIGHdocs/examples/sqla/sqlalchemy_async_repository.py0this provides a simple example demonstrating how to override the join options for the repository.STRING
HIGHdocs/examples/routing/mount_custom_app.py0asgi-callable. args: scope: the asgi connection scope. receive: the asgi receive function. send: the asgi send function.STRING
HIGHlitestar/middleware/allowed_hosts.py0asgi-callable. args: scope: the asgi connection scope. receive: the asgi receive function. send: the asgi send function.STRING
HIGHlitestar/middleware/csrf.py0asgi-callable. args: scope: the asgi connection scope. receive: the asgi receive function. send: the asgi send function.STRING
HIGHlitestar/middleware/authentication.py0asgi-callable. args: scope: the asgi connection scope. receive: the asgi receive function. send: the asgi send function.STRING
HIGHlitestar/middleware/rate_limit.py0asgi-callable. args: scope: the asgi connection scope. receive: the asgi receive function. send: the asgi send function.STRING
HIGHlitestar/middleware/compression/middleware.py0asgi-callable. args: scope: the asgi connection scope. receive: the asgi receive function. send: the asgi send function.STRING
HIGHlitestar/plugins/opentelemetry/middleware.py0asgi-callable. args: scope: the asgi connection scope. receive: the asgi receive function. send: the asgi send function.STRING
HIGHlitestar/plugins/prometheus/middleware.py0asgi-callable. args: scope: the asgi connection scope. receive: the asgi receive function. send: the asgi send function.STRING
HIGHlitestar/middleware/_internal/exceptions/middleware.py0asgi-callable. args: scope: the asgi connection scope. receive: the asgi receive function. send: the asgi send function.STRING
HIGHlitestar/middleware/session/base.py0asgi-callable. args: scope: the asgi connection scope. receive: the asgi receive function. send: the asgi send function.STRING
HIGHlitestar/controller.py0:class:`abstractdto <.dto.base_dto.abstractdto>` to use for serializing outbound response data.STRING
HIGHlitestar/config/app.py0:class:`abstractdto <.dto.base_dto.abstractdto>` to use for serializing outbound response data.STRING
HIGHlitestar/handlers/websocket_handlers/listener.py0:class:`abstractdto <.dto.base_dto.abstractdto>` to use for serializing outbound response data.STRING
HIGHlitestar/controller.py0a mapping of names to types for use in forward reference resolution during signature modelling.STRING
HIGHlitestar/config/app.py0a mapping of names to types for use in forward reference resolution during signature modelling.STRING
HIGHlitestar/handlers/websocket_handlers/listener.py0a mapping of names to types for use in forward reference resolution during signature modelling.STRING
HIGHlitestar/controller.py0type_decoders: a sequence of tuples, each composed of a predicate testing for type identity and a msgspec hook for deserSTRING
HIGHlitestar/config/app.py0type_decoders: a sequence of tuples, each composed of a predicate testing for type identity and a msgspec hook for deserSTRING
HIGHlitestar/handlers/websocket_handlers/listener.py0type_decoders: a sequence of tuples, each composed of a predicate testing for type identity and a msgspec hook for deserSTRING
HIGHlitestar/controller.py0type_encoders: a mapping of types to callables that transform them into types supported for serialization.STRING
HIGHlitestar/config/app.py0type_encoders: a mapping of types to callables that transform them into types supported for serialization.STRING
HIGHlitestar/security/base.py0type_encoders: a mapping of types to callables that transform them into types supported for serialization.STRING
HIGHlitestar/security/jwt/auth.py0type_encoders: a mapping of types to callables that transform them into types supported for serialization.STRING
HIGHlitestar/security/session_auth/auth.py0type_encoders: a mapping of types to callables that transform them into types supported for serialization.STRING
HIGHlitestar/handlers/websocket_handlers/listener.py0type_encoders: a mapping of types to callables that transform them into types supported for serialization.STRING
HIGHlitestar/middleware/session/server_side.py0key to use for the cookie inside the header, e.g. ``session=<data>`` where ``session`` is the cookie key and ``<data>`` STRING
HIGHlitestar/middleware/session/client_side.py0key to use for the cookie inside the header, e.g. ``session=<data>`` where ``session`` is the cookie key and ``<data>`` STRING
HIGHlitestar/middleware/session/base.py0key to use for the cookie inside the header, e.g. ``session=<data>`` where ``session`` is the cookie key and ``<data>`` STRING
HIGHlitestar/middleware/session/server_side.py0scopes for the middleware - options are ``http`` and ``websocket`` with the default being bothSTRING
HIGHlitestar/middleware/session/client_side.py0scopes for the middleware - options are ``http`` and ``websocket`` with the default being bothSTRING
HIGHlitestar/middleware/session/base.py0scopes for the middleware - options are ``http`` and ``websocket`` with the default being bothSTRING
HIGHlitestar/middleware/session/server_side.py0path fragment that must exist in the request url for the cookie to be valid. defaults to ``/``.STRING
HIGHlitestar/middleware/session/client_side.py0path fragment that must exist in the request url for the cookie to be valid. defaults to ``/``.STRING
HIGHlitestar/middleware/session/base.py0path fragment that must exist in the request url for the cookie to be valid. defaults to ``/``.STRING
HIGHlitestar/datastructures/cookie.py0path fragment that must exist in the request url for the cookie to be valid. defaults to ``/``.STRING
HIGHlitestar/security/jwt/auth.py0path fragment that must exist in the request url for the cookie to be valid. defaults to ``/``.STRING
HIGHlitestar/middleware/session/server_side.py0forbids javascript to access the cookie via 'document.cookie'.STRING
HIGHlitestar/middleware/session/client_side.py0forbids javascript to access the cookie via 'document.cookie'.STRING
HIGHlitestar/middleware/session/base.py0forbids javascript to access the cookie via 'document.cookie'.STRING
HIGHlitestar/middleware/session/server_side.py0controls whether or not a cookie is sent with cross-site requests. defaults to 'lax'.STRING
HIGHlitestar/middleware/session/client_side.py0controls whether or not a cookie is sent with cross-site requests. defaults to 'lax'.STRING
HIGHlitestar/middleware/session/base.py0controls whether or not a cookie is sent with cross-site requests. defaults to 'lax'.STRING
HIGHlitestar/security/jwt/auth.py0controls whether or not a cookie is sent with cross-site requests. defaults to 'lax'.STRING
HIGHlitestar/datastructures/cookie.py0controls whether or not a cookie is sent with cross-site requests. defaults to 'lax'.STRING
HIGHlitestar/middleware/session/server_side.py0a pattern or list of patterns to skip in the session middleware.STRING
HIGHlitestar/middleware/session/client_side.py0a pattern or list of patterns to skip in the session middleware.STRING
HIGHlitestar/middleware/session/base.py0a pattern or list of patterns to skip in the session middleware.STRING
HIGHlitestar/middleware/session/server_side.py0an identifier to use on routes to disable the session middleware for a particular route.STRING
HIGHlitestar/middleware/session/client_side.py0an identifier to use on routes to disable the session middleware for a particular route.STRING
HIGHlitestar/middleware/session/base.py0an identifier to use on routes to disable the session middleware for a particular route.STRING
HIGHlitestar/repository/abc/_async.py0add multiple ``data`` to the collection. args: data: instance to be added to the collection. returns: the added instanceSTRING
HIGHlitestar/repository/abc/_sync.py0add multiple ``data`` to the collection. args: data: instance to be added to the collection. returns: the added instanceSTRING
HIGHlitestar/repository/testing/generic_mock_repository.py0add multiple ``data`` to the collection. args: data: instance to be added to the collection. returns: the added instanceSTRING
HIGHlitestar/repository/abc/_async.py0delete instance identified by ``item_id``. args: item_id: identifier of instance to be deleted. returns: the deleted insSTRING
96 more matches not shown…
Docstring Block Structure102 hits · 510 pts
SeverityFileLineSnippetContext
HIGH…examples/sqla/sqlalchemy_repository_bulk_operations.py36Loads JSON file with the specified fixture name Args: fixtures_path (Path): The path to look for fixtures STRING
HIGHlitestar/controller.py266Validate that the combination of path and decorator method or type are unique on the controller. Args: STRING
HIGHlitestar/data_extractors.py147Extract data from the connection, returning a dictionary of values. Notes: - The value for ``body``STRING
HIGHlitestar/app.py826Receives a route handler name and returns an optional dictionary containing the route handler instance and list STRING
HIGHlitestar/app.py863Receives a route handler name and path parameter values and returns the url path to the handler with filled pathSTRING
HIGHlitestar/middleware/authentication.py96Receive the http connection and return an :class:`AuthenticationResult`. Notes: - This method must STRING
HIGHlitestar/middleware/rate_limit.py193Create ratelimit response headers. Notes: * see the `IETF RateLimit draft <https://datatracker.ietfSTRING
HIGHlitestar/middleware/session/client_side.py74Given serializable data, including pydantic models and numpy types, dump it into a bytes string, encrypt, encodeSTRING
HIGHlitestar/middleware/session/base.py118Serialize data into bytes for storage in the backend. Args: data: Session data of the current scopeSTRING
HIGHlitestar/middleware/session/base.py172Load session data from a connection and return it as a dictionary to be used in the current application scope. STRING
HIGHlitestar/repository/abc/_async.py63Delete instance identified by ``item_id``. Args: item_id: Identifier of instance to be deleted. STRING
HIGHlitestar/repository/abc/_async.py101Get instance identified by ``item_id``. Args: item_id: Identifier of the instance to be retrieved. STRING
HIGHlitestar/repository/abc/_async.py116Get an instance specified by the ``kwargs`` filters if it exists. Args: **kwargs: Instance attributSTRING
HIGHlitestar/repository/abc/_async.py152Update instance with the attribute values present on ``data``. Args: data: An instance that should STRING
HIGHlitestar/repository/abc/_async.py167Update multiple instances with the attribute values present on instances in ``data``. Args: data: ASTRING
HIGHlitestar/repository/abc/_async.py182Update or create instance. Updates instance with the attribute values present on ``data``, or creates a new insSTRING
HIGHlitestar/repository/abc/_async.py201Update or create multiple instances. Update instances with the attribute values present on ``data``, or create STRING
HIGHlitestar/repository/abc/_async.py244Filter the collection by kwargs. Has ``AND`` semantics where multiple kwargs name/value pairs are provided. STRING
HIGHlitestar/repository/abc/_sync.py65Delete instance identified by ``item_id``. Args: item_id: Identifier of instance to be deleted. STRING
HIGHlitestar/repository/abc/_sync.py103Get instance identified by ``item_id``. Args: item_id: Identifier of the instance to be retrieved. STRING
HIGHlitestar/repository/abc/_sync.py118Get an instance specified by the ``kwargs`` filters if it exists. Args: **kwargs: Instance attributSTRING
HIGHlitestar/repository/abc/_sync.py154Update instance with the attribute values present on ``data``. Args: data: An instance that should STRING
HIGHlitestar/repository/abc/_sync.py169Update multiple instances with the attribute values present on instances in ``data``. Args: data: ASTRING
HIGHlitestar/repository/abc/_sync.py184Update or create instance. Updates instance with the attribute values present on ``data``, or creates a new insSTRING
HIGHlitestar/repository/abc/_sync.py203Update or create multiple instances. Update instances with the attribute values present on ``data``, or create STRING
HIGHlitestar/repository/abc/_sync.py246Filter the collection by kwargs. Has ``AND`` semantics where multiple kwargs name/value pairs are provided. STRING
HIGHlitestar/repository/testing/generic_mock_repository.py127Delete instance identified by ``item_id``. Args: item_id: Identifier of instance to be deleted. STRING
HIGHlitestar/repository/testing/generic_mock_repository.py176Get instance identified by ``item_id``. Args: item_id: Identifier of the instance to be retrieved. STRING
HIGHlitestar/repository/testing/generic_mock_repository.py223Get instance identified by query filters. Args: **kwargs: Instance attribute value filters. STRING
HIGHlitestar/repository/testing/generic_mock_repository.py262Update instance with the attribute values present on ``data``. Args: data: An instance that should STRING
HIGHlitestar/repository/testing/generic_mock_repository.py281Update instances with the attribute values present on ``data``. Args: data: A list of instances thaSTRING
HIGHlitestar/repository/testing/generic_mock_repository.py302Update or create instance. Updates instance with the attribute values present on ``data``, or creates a new insSTRING
HIGHlitestar/repository/testing/generic_mock_repository.py507Delete instance identified by ``item_id``. Args: item_id: Identifier of instance to be deleted. STRING
HIGHlitestar/repository/testing/generic_mock_repository.py555Get instance identified by ``item_id``. Args: item_id: Identifier of the instance to be retrieved. STRING
HIGHlitestar/repository/testing/generic_mock_repository.py601Get instance identified by query filters. Args: **kwargs: Instance attribute value filters. STRING
HIGHlitestar/repository/testing/generic_mock_repository.py640Update instance with the attribute values present on ``data``. Args: data: An instance that should STRING
HIGHlitestar/repository/testing/generic_mock_repository.py659Update instances with the attribute values present on ``data``. Args: data: A list of instances thaSTRING
HIGHlitestar/repository/testing/generic_mock_repository.py680Update or create instance. Updates instance with the attribute values present on ``data``, or creates a new insSTRING
HIGHlitestar/_asgi/routing_trie/traversal.py25Traverses the application route mapping and retrieves the correct node for the request url. Args: root_nodeSTRING
HIGHlitestar/_asgi/routing_trie/traversal.py68Retrieve the handler tuple from the node. Args: node: The trie node to parse. method: The scope's mSTRING
HIGHlitestar/_asgi/routing_trie/traversal.py98Parse path parameters into a dictionary of values. Args: parameter_definitions: The parameter definitions tSTRING
HIGHlitestar/_asgi/routing_trie/traversal.py124Given a scope object, retrieve the asgi_handlers and is_mount boolean values from correct trie node. Args: STRING
HIGHlitestar/_asgi/routing_trie/validate.py16Recursively traverses the trie from the given node upwards. Args: node: A trie node. Raises: ISTRING
HIGHlitestar/_kwargs/extractors.py283Extract the body from the request instance. Notes: - this extractor sets a Coroutine as the value in the kwSTRING
HIGHlitestar/_kwargs/extractors.py299Extract the data from request and insert it into the kwargs injected to the handler. Notes: - this extractoSTRING
HIGHlitestar/_kwargs/extractors.py316Extract the data from request and insert it into the kwargs injected to the handler. Notes: - this extractoSTRING
HIGHlitestar/_kwargs/kwargs_model.py214Get parameter_definitions for the construction of KwargsModel instance. Args: path_parameters: Any STRING
HIGHlitestar/_kwargs/kwargs_model.py287Pre-determine what parameters are required for a given combination of route + route handler. It is executed duriSTRING
HIGHlitestar/_kwargs/parameter_definition.py31Create a ParameterDefinition for the given FieldDefinition. Args: field_definition: FieldDefinition instancSTRING
HIGHlitestar/response/base.py159Emit the response body. Args: send: The ASGI send function. receive: The ASGI receive fSTRING
HIGHlitestar/connection/base.py300Return the url for a given route handler / handler name. Args: name: The ``name`` of the route handSTRING
HIGHlitestar/datastructures/headers.py71Create headers from a send-message. Args: scope: The ASGI connection scope. Returns: STRING
HIGHlitestar/datastructures/headers.py121Construct a header from a message object. Args: message: :class:`Message <.types.Message>`. STRING
HIGHlitestar/datastructures/headers.py138Add a header to the scope. Notes: - This method keeps duplicates. Args: key: STRING
HIGHlitestar/datastructures/headers.py153Get all values of a header. Args: key: Header key. default: Default value to return if STRING
HIGHlitestar/datastructures/headers.py178Extend a multivalued header. Notes: - A multivalues header is a header that can take a comma separaSTRING
HIGHlitestar/datastructures/state.py84Get the value for the corresponding key from the wrapped state object using subscription notation. Args: STRING
HIGHlitestar/datastructures/state.py114Get the value for the corresponding key from the wrapped state object using attribute notation. Args: STRING
HIGHlitestar/datastructures/state.py242Delete the value from the key from the wrapped state object using subscription notation. Args: key:STRING
HIGHlitestar/datastructures/state.py286Delete the value from the key from the wrapped state object using attribute notation. Args: key: KeSTRING
42 more matches not shown…
Hallucination Indicators25 hits · 250 pts
SeverityFileLineSnippetContext
CRITICALtests/unit/test_middleware/test_csrf_middleware.py202 data = {"_csrf_token": html_soup.body.div.form.input.attrs.get("value")} # type: ignore[union-attr]CODE
CRITICALtests/unit/test_utils/test_helpers.py7from litestar.utils.helpers import envflag, get_name, unique_name_for_scope, unwrap_partialCODE
CRITICALtests/unit/test_openapi/test_schema.py60from litestar.utils.helpers import get_nameCODE
CRITICAL…sts/unit/test_plugins/test_attrs/test_schema_plugin.py9from litestar.utils.helpers import get_nameCODE
CRITICAL…/unit/test_plugins/test_pydantic/test_schema_plugin.py14from litestar.utils.helpers import get_nameCODE
CRITICALtests/unit/test_testing/test_test_client.py31from litestar.utils.helpers import get_exception_groupCODE
CRITICAL.github/workflows/pr-merged.yml33 const linkedIssues = res.repository.pullRequest.closingIssuesReferences.edges.map(CODE
CRITICAL.github/workflows/notify_released_issues/notify.js10 const opts = github.rest.issues.listComments.endpoint.merge({CODE
CRITICALlitestar/di.py12from litestar.utils.helpers import unwrap_partialCODE
CRITICALlitestar/dto/_codegen_backend.py34from litestar.utils.helpers import unique_name_for_scopeCODE
CRITICALlitestar/_kwargs/kwargs_model.py40from litestar.utils.helpers import get_exception_groupCODE
CRITICALlitestar/response/redirect.py13from litestar.utils.helpers import get_enum_string_valueCODE
CRITICALlitestar/response/sse.py17from litestar.utils.helpers import get_enum_string_valueCODE
CRITICALlitestar/response/file.py18from litestar.utils.helpers import get_enum_string_valueCODE
CRITICALlitestar/response/streaming.py12from litestar.utils.helpers import get_enum_string_valueCODE
CRITICALlitestar/response/base.py15from litestar.utils.helpers import get_enum_string_valueCODE
CRITICALlitestar/utils/predicates.py40from litestar.utils.helpers import unwrap_partialCODE
CRITICALlitestar/cli/commands/core.py13from litestar.utils.helpers import envflagCODE
CRITICALlitestar/cli/commands/core.py34from litestar.utils.helpers import unwrap_partialCODE
CRITICALlitestar/_openapi/path_item.py14from litestar.utils.helpers import unwrap_partialCODE
CRITICALlitestar/_openapi/schema_generation/utils.py5from litestar.utils.helpers import get_nameCODE
CRITICALlitestar/_openapi/schema_generation/examples.py13from polyfactory.utils.helpers import unwrap_annotationCODE
CRITICALlitestar/_openapi/schema_generation/schema.py45from litestar.utils.helpers import get_nameCODE
CRITICALlitestar/handlers/base.py29from litestar.utils.helpers import unwrap_partialCODE
CRITICALlitestar/handlers/websocket_handlers/_utils.py13from litestar.utils.helpers import unwrap_partialCODE
Cross-Language Confusion14 hits · 82 pts
SeverityFileLineSnippetContext
HIGH…t/test_dto/test_factory/test_backends/test_backends.py77RAW = b'{"a":1,"nested":{"a":1,"b":"two"},"nested_list":[{"a":1,"b":"two"}],"nested_mapping":{"a":{"a":1,"b":"two"}},"inCODE
HIGH…t/test_dto/test_factory/test_backends/test_backends.py79COLLECTION_RAW = b'[{"a":1,"nested":{"a":1,"b":"two"},"nested_list":[{"a":1,"b":"two"}],"nested_mapping":{"a":{"a":1,"b"CODE
HIGH…st_middleware/test_session/test_client_side_backend.py246 assert header_content.startswith(b"session=null;")CODE
HIGH⚡…st_openapi/test_typescript_converter/test_converter.py334 gender?: "A" | "F" | "M" | "O" | ("A" | "F" | "M" | "O")[] | null;CODE
HIGH⚡…st_openapi/test_typescript_converter/test_converter.py335 lucky_number?: 2 | 7 | null;CODE
HIGH⚡…st_openapi/test_typescript_converter/test_converter.py345 export type ResponseBody = undefined;CODE
HIGHlitestar/openapi/plugins.py258 b",undefined,document.getElementById('redoc-container'))</script></body>",STRING
HIGHlitestar/openapi/plugins.py499 if (csrf_token !== undefined) {{CODE
HIGHlitestar/testing/client/sync_client.py108 self.exit_stack.push(super().__exit__)CODE
HIGH⚡litestar/_openapi/typescript_converter/converter.py201 return TypeScriptType("RequestBody", undefined)CODE
HIGH⚡litestar/_openapi/typescript_converter/converter.py207 parse_schema(schema) if body.required else TypeScriptUnion((parse_schema(schema), undefined)),CODE
HIGH⚡litestar/_openapi/typescript_converter/converter.py210 return TypeScriptType("RequestBody", undefined)CODE
HIGHlitestar/_openapi/schema_generation/schema.py292 """Return if the field is undefined, taking into account undefined types defined by plugins"""STRING
HIGHlitestar/_openapi/schema_generation/schema.py455 # nullable scalars are expressed as 'type: [X, null]' rather than 'oneOf: [X, null]',COMMENT
Empty Error Handlers16 hits · 80 pts
SeverityFileLineSnippetContext
HIGHtests/conftest.py329except RuntimeError:CODE
HIGHtests/conftest.py343except RuntimeError:CODE
HIGHdocs/examples/websockets/stream_and_receive_listener.py26except WebSocketDisconnect:CODE
HIGHlitestar/concurrency.py77except sniffio.AsyncLibraryNotFoundError:CODE
HIGHlitestar/concurrency.py98except sniffio.AsyncLibraryNotFoundError:CODE
HIGHlitestar/app.py443except ImportError:CODE
HIGHlitestar/app.py504except ImportError:CODE
HIGHlitestar/app.py964except KeyError:CODE
HIGHlitestar/file_system.py151except ImportError:CODE
HIGHlitestar/file_system.py516except ValueError:CODE
HIGHlitestar/_asgi/asgi_router.py102except KeyError:CODE
HIGHlitestar/connection/websocket.py187except WebSocketDisconnect:CODE
HIGHlitestar/stores/file.py91except OSError:CODE
HIGHlitestar/_openapi/schema_generation/examples.py40except ValueError:CODE
HIGHlitestar/handlers/websocket_handlers/stream.py81except StopAsyncIteration:CODE
HIGHlitestar/handlers/websocket_handlers/listener.py303except WebSocketDisconnect:CODE
AI Structural Patterns58 hits · 58 pts
SeverityFileLineSnippetContext
LOWtests/conftest.py192CODE
LOWlitestar/params.py281CODE
LOWlitestar/params.py414CODE
LOWlitestar/data_extractors.py81CODE
LOWlitestar/static_files.py45CODE
LOWlitestar/app.py169CODE
LOWlitestar/router.py79CODE
LOWlitestar/middleware/logging.py48CODE
LOWlitestar/response/redirect.py36CODE
LOWlitestar/response/redirect.py85CODE
LOWlitestar/response/sse.py192CODE
LOWlitestar/response/file.py73CODE
LOWlitestar/response/file.py227CODE
LOWlitestar/response/template.py35CODE
LOWlitestar/response/streaming.py35CODE
LOWlitestar/response/base.py58CODE
LOWlitestar/response/base.py259CODE
LOWlitestar/response/base.py272CODE
LOWlitestar/security/jwt/auth.py160CODE
LOWlitestar/security/jwt/auth.py511CODE
LOWlitestar/security/jwt/auth.py767CODE
LOWlitestar/security/jwt/middleware.py45CODE
LOWlitestar/security/jwt/middleware.py183CODE
LOWlitestar/plugins/pydantic/__init__.py57CODE
LOWlitestar/plugins/pydantic/plugins/init.py55CODE
LOWlitestar/testing/request_factory.py130CODE
LOWlitestar/testing/request_factory.py235CODE
LOWlitestar/testing/request_factory.py312CODE
LOWlitestar/testing/request_factory.py361CODE
LOWlitestar/testing/request_factory.py415CODE
LOWlitestar/testing/request_factory.py469CODE
LOWlitestar/testing/request_factory.py523CODE
LOWlitestar/testing/helpers.py54CODE
LOWlitestar/testing/helpers.py309CODE
LOWlitestar/testing/client/async_client.py126CODE
LOWlitestar/testing/client/sync_client.py43CODE
LOWlitestar/testing/client/sync_client.py125CODE
LOWlitestar/handlers/asgi_handlers.py140CODE
LOWlitestar/handlers/asgi_handlers.py34CODE
LOWlitestar/handlers/base.py77CODE
LOWlitestar/handlers/websocket_handlers/stream.py127CODE
LOWlitestar/handlers/websocket_handlers/route_handler.py165CODE
LOWlitestar/handlers/websocket_handlers/route_handler.py26CODE
LOWlitestar/handlers/websocket_handlers/listener.py415CODE
LOWlitestar/handlers/websocket_handlers/listener.py438CODE
LOWlitestar/handlers/websocket_handlers/listener.py462CODE
LOWlitestar/handlers/websocket_handlers/listener.py69CODE
LOWlitestar/handlers/websocket_handlers/listener.py94CODE
LOWlitestar/handlers/websocket_handlers/listener.py120CODE
LOWlitestar/handlers/http_handlers/base.py133CODE
LOWlitestar/handlers/http_handlers/decorators.py62CODE
LOWlitestar/handlers/http_handlers/decorators.py234CODE
LOWlitestar/handlers/http_handlers/decorators.py402CODE
LOWlitestar/handlers/http_handlers/decorators.py574CODE
LOWlitestar/handlers/http_handlers/decorators.py746CODE
LOWlitestar/handlers/http_handlers/decorators.py918CODE
LOWlitestar/handlers/http_handlers/decorators.py1089CODE
LOWlitestar/channels/plugin.py38CODE
Deep Nesting48 hits · 46 pts
SeverityFileLineSnippetContext
LOWtools/prepare_release.py323CODE
LOWtools/sphinx_ext/run_examples.py72CODE
LOWtools/sphinx_ext/run_examples.py125CODE
LOWtests/unit/test_connection/test_connection_caching.py107CODE
LOWtests/unit/test_connection/test_connection_caching.py117CODE
LOWtests/unit/test_connection/test_connection_caching.py134CODE
LOWtests/unit/test_cli/test_core_commands.py358CODE
LOWtests/unit/test_response/test_sse.py68CODE
LOWtests/unit/test_response/test_sse.py70CODE
LOWtests/unit/test_response/test_sse.py71CODE
LOWtests/unit/test_testing/test_test_client.py261CODE
LOWtests/unit/test_testing/test_test_client.py309CODE
LOWtests/unit/test_template/test_template.py164CODE
LOWtests/e2e/test_router_registration.py45CODE
LOWtests/e2e/test_router_registration.py58CODE
LOWlitestar/_multipart.py62CODE
LOWlitestar/static_files.py253CODE
LOWlitestar/app.py509CODE
LOWlitestar/app.py660CODE
LOWlitestar/typing.py72CODE
LOWlitestar/typing.py450CODE
LOWlitestar/file_system.py281CODE
LOWlitestar/dto/base_dto.py255CODE
LOWlitestar/middleware/constraints.py232CODE
LOWlitestar/middleware/compression/middleware.py86CODE
LOWlitestar/middleware/compression/middleware.py119CODE
LOWlitestar/_asgi/routing_trie/mapping.py61CODE
LOWlitestar/_kwargs/kwargs_model.py278CODE
LOWlitestar/_kwargs/kwargs_model.py460CODE
LOWlitestar/response/template.py100CODE
LOWlitestar/connection/request.py180CODE
LOWlitestar/connection/request.py249CODE
LOWlitestar/datastructures/headers.py451CODE
LOWlitestar/config/compression.py71CODE
LOWlitestar/plugins/pydantic/dto.py86CODE
LOWlitestar/cli/_utils.py354CODE
LOWlitestar/openapi/config.py134CODE
LOWlitestar/openapi/spec/base.py52CODE
LOWlitestar/_openapi/responses.py287CODE
LOWlitestar/_openapi/responses.py130CODE
LOWlitestar/_openapi/responses.py212CODE
LOWlitestar/_openapi/typescript_converter/converter.py48CODE
LOWlitestar/_openapi/typescript_converter/converter.py140CODE
LOWlitestar/_openapi/schema_generation/schema.py297CODE
LOWlitestar/_openapi/schema_generation/schema.py646CODE
LOWlitestar/_signature/model.py137CODE
LOWlitestar/_signature/model.py225CODE
LOWlitestar/handlers/websocket_handlers/stream.py27CODE
Modern Structural Boilerplate37 hits · 35 pts
SeverityFileLineSnippetContext
LOWtools/prepare_release.py383def update_pyproject_version(new_version: str) -> None:CODE
LOWtests/unit/test_middleware/test_middleware_handling.py20logger = logging.getLogger(__name__)CODE
LOWtests/unit/test_middleware/test_logging_middleware.py292 async def set_session(request: Request) -> None:CODE
LOW…st_middleware/test_session/test_client_side_backend.py150 def set_session_data(request: Request) -> None:CODE
LOWtests/unit/test_testing/test_test_client.py111 async def set_session_data(request: Request) -> None:CODE
LOWtests/unit/test_testing/test_test_client.py156 async def set_session_data(request: Request) -> None:CODE
LOWdocs/conf.py17__all__ = ["setup"]CODE
LOWdocs/examples/responses/background_tasks_1.py7logger = logging.getLogger(__name__)CODE
LOWdocs/examples/responses/background_tasks_2.py6logger = logging.getLogger(__name__)CODE
LOWdocs/examples/responses/background_tasks_3.py7logger = logging.getLogger(__name__)CODE
LOWdocs/examples/testing/test_get_session_data.py9def set_session_data(request: Request) -> None:CODE
LOWdocs/examples/testing/test_get_session_data_async.py9def set_session_data(request: Request) -> None:CODE
LOW…/examples/application_state/using_application_state.py11logger = logging.getLogger(__name__)CODE
LOW…/examples/application_state/using_application_state.py14def set_state_on_startup(app: Litestar) -> None:CODE
LOWdocs/examples/onboarding/flask/request_state.py4def set_user_on_request(request: Request) -> None:CODE
LOWdocs/examples/onboarding/fastapi/background_tasks.py6logger = logging.getLogger(__name__)CODE
LOWlitestar/concurrency.py71def set_asyncio_executor(executor: ThreadPoolExecutor | None) -> None:CODE
LOWlitestar/concurrency.py92def set_trio_capacity_limiter(limiter: trio.CapacityLimiter | None) -> None:CODE
LOWlitestar/app.py989 def update_openapi_schema(self) -> None:CODE
LOWlitestar/dto/data_structures.py57def _set_nested_dict_value(d: dict[str, Any], keys: list[str], value: Any) -> None:CODE
LOWlitestar/middleware/csrf.py163 def _set_cookie_if_needed(self, message: HTTPSendMessage, token: str) -> None:CODE
LOWlitestar/middleware/rate_limit.py165 async def set_cached_history(self, key: str, cache_object: CacheObject, store: Store) -> None:CODE
LOWlitestar/middleware/_internal/response_cache.py21__all__ = ["ResponseCacheMiddleware"]CODE
LOWlitestar/response/base.py256 def set_cookie(self, /, cookie: Cookie) -> None: ...CODE
LOWlitestar/response/base.py315 def set_header(self, key: str, value: Any) -> None:CODE
LOWlitestar/response/base.py327 def set_etag(self, etag: str | ETag) -> None:CODE
LOWlitestar/connection/base.py270 def set_session(self, value: dict[str, Any] | DataContainerType | EmptyType) -> None:CODE
LOWlitestar/plugins/prometheus/controller.py30__all__ = [CODE
LOWlitestar/cli/__init__.py31__all__ = ["litestar_group"]CODE
LOWlitestar/testing/client/_base.py90async def _set_session_data(client: TestClient | AsyncTestClient, data: dict[str, Any]) -> None:CODE
LOWlitestar/testing/client/async_client.py195 def set_session_data(request: Request) -> None:STRING
LOWlitestar/testing/client/async_client.py210 async def set_session_data(self, data: dict[str, Any]) -> None:CODE
LOWlitestar/testing/client/sync_client.py194 def set_session_data(request: Request) -> None:STRING
LOWlitestar/testing/client/sync_client.py209 def set_session_data(self, data: dict[str, Any]) -> None:CODE
LOWlitestar/_openapi/responses.py212 def set_success_response_headers(self, response: OpenAPIResponse) -> None:CODE
LOWlitestar/_openapi/datastructures.py183 def set_reference_paths(name: str, registered_schema: RegisteredSchema) -> None:CODE
LOWlitestar/events/listener.py16logger = logging.getLogger(__name__)CODE
Slop Phrases9 hits · 27 pts
SeverityFileLineSnippetContext
MEDIUMdocs/examples/security/using_session_auth.py98 # and again, you can add whatever logic is required here, weCOMMENT
MEDIUM…etheus/using_prometheus_exporter_with_extra_configs.py36# The given options are not necessary, you can use the default onesCOMMENT
MEDIUM…a_transfer_objects/factory/tutorial/initial_pattern.py19 # For demonstration purposes, a placeholder Person instance is returnedCOMMENT
MEDIUM…er_objects/factory/tutorial/field_renaming_strategy.py36 # For demonstration purposes, a placeholder Person instance is returnedCOMMENT
MEDIUM…_objects/factory/tutorial/nested_collection_exclude.py33 # For demonstration purposes, a placeholder Person instance is returnedCOMMENT
MEDIUM…er_objects/factory/tutorial/explicit_field_renaming.py36 # For demonstration purposes, a placeholder Person instance is returnedCOMMENT
MEDIUM…ransfer_objects/factory/tutorial/simple_dto_exclude.py24 # For demonstration purposes, a placeholder Person instance is returnedCOMMENT
MEDIUM…_transfer_objects/factory/tutorial/max_nested_depth.py36 # For demonstration purposes, a placeholder Person instance is returnedCOMMENT
MEDIUM…ta_transfer_objects/factory/tutorial/nested_exclude.py32 # For demonstration purposes, a placeholder Person instance is returnedCOMMENT
Fake / Example Data21 hits · 24 pts
SeverityFileLineSnippetContext
LOW…est_plugins/test_pydantic/test_plugin_serialization.py112 email_str=pydantic_v2.TypeAdapter(pydantic_v2.EmailStr).validate_python("info@example.org"),CODE
LOW…est_plugins/test_pydantic/test_plugin_serialization.py113 name_email=pydantic_v2.NameEmail("info", "info@example.org"),CODE
LOW…est_plugins/test_pydantic/test_plugin_serialization.py143 ("email_str", "info@example.org"),CODE
LOW⚡tests/unit/test_security/test_jwt/test_auth.py151 fake_token = Token(CODE
LOW⚡tests/unit/test_security/test_jwt/test_auth.py159 response = client.get("/my-endpoint", headers={auth_header: jwt_auth.format_auth_header(fake_token)})CODE
LOW⚡tests/unit/test_security/test_jwt/test_auth.py345 fake_token = Token(CODE
LOW⚡tests/unit/test_security/test_jwt/test_auth.py354 response = client.get("/my-endpoint", headers={auth_header: jwt_auth.format_auth_header(fake_token)})CODE
LOW⚡tests/unit/test_security/test_jwt/test_auth.py357 client.cookies = {auth_cookie: jwt_auth.format_auth_header(fake_token)}CODE
LOWtests/unit/test_security/test_jwt/test_token.py30@pytest.mark.parametrize("token_extras", [None, {"email": "test@test.com"}])CODE
LOWtests/examples/test_dto/test_example_apps.py70 "address": {"street": "123 Main St"},CODE
LOWtests/examples/test_parameters/test_path_parameters.py12 assert response.json() == {"id": 1, "name": "John Doe"}CODE
LOW…/test_parameters/test_header_and_cookies_parameters.py23 assert response.json() == {"id": 1, "name": "John Doe"}CODE
LOW…ples/data_transfer_objects/factory/excluding_fields.py52 data.address = Address(street="123 Main St", city="Anytown", state="NY", zip="12345")CODE
LOW…mples/data_transfer_objects/factory/included_fields.py49 data.address = Address(street="123 Main St", city="Anytown", state="NY", zip="12345")CODE
LOW…er_objects/factory/tutorial/field_renaming_strategy.py37 address = Address(street="123 Main St", city="Cityville", country="Countryland")CODE
LOW…_objects/factory/tutorial/nested_collection_exclude.py34 address = Address(street="123 Main St", city="Cityville", country="Countryland")CODE
LOW…er_objects/factory/tutorial/explicit_field_renaming.py37 address = Address(street="123 Main St", city="Cityville", country="Countryland")CODE
LOW…_transfer_objects/factory/tutorial/max_nested_depth.py37 address = Address(street="123 Main St", city="Cityville", country="Countryland")CODE
LOW…ta_transfer_objects/factory/tutorial/nested_exclude.py33 address = Address(street="123 Main St", city="Cityville", country="Countryland")CODE
LOW…cs/examples/parameters/header_and_cookie_parameters.py19 1: User(id=1, name="John Doe"),CODE
LOWdocs/examples/parameters/path_parameters_1.py13USER_DB = {1: User(id=1, name="John Doe")}CODE
Self-Referential Comments9 hits · 21 pts
SeverityFileLineSnippetContext
MEDIUM…etheus/using_prometheus_exporter_with_extra_configs.py35# Creating the instance of PrometheusConfig with our own custom options.COMMENT
MEDIUM…etheus/using_prometheus_exporter_with_extra_configs.py48# Creating the litestar app instance with our custom PrometheusConfig and PrometheusController.COMMENT
MEDIUM…amples/plugins/prometheus/using_prometheus_exporter.py12 # Creating the litestar app instance with our custom PrometheusConfig and PrometheusController.COMMENT
MEDIUMdocs/examples/caching/cache_response_filter.py13# Create the app with a custom cache response filterCOMMENT
MEDIUM⚡litestar/testing/request_factory.py97 # Create a GET requestSTRING
MEDIUM⚡litestar/testing/request_factory.py103 # Create a POST requestSTRING
MEDIUM⚡litestar/testing/request_factory.py109 # Create a request with a special headerSTRING
MEDIUM⚡litestar/testing/request_factory.py115 # Create a request with a media typeSTRING
MEDIUMlitestar/_openapi/schema_generation/schema.py625 # This method is only called for enums, so this branch is always executedCOMMENT
Excessive Try-Catch Wrapping17 hits · 20 pts
SeverityFileLineSnippetContext
LOWtests/unit/test_app.py238 except Exception as e:CODE
MEDIUMtests/unit/test_app.py235def my_route_handler() -> None:CODE
LOW…t/test_middleware/test_exception_handler_middleware.py300 except Exception as e:CODE
LOWdocs/examples/sqla/sqlalchemy_repository_crud.py44 except Exception: # noqa: BLE001CODE
LOWlitestar/data_extractors.py315 except Exception as exc:CODE
LOWlitestar/middleware/logging.py137 except Exception:CODE
LOWlitestar/middleware/_internal/exceptions/middleware.py131 except Exception as exc:CODE
LOWlitestar/_asgi/asgi_router.py108 except Exception:CODE
LOWlitestar/_kwargs/cleanup.py126 except Exception as cleanup_exc: # noqa: BLE001CODE
LOWlitestar/plugins/prometheus/middleware.py162 except Exception:CODE
MEDIUMlitestar/cli/_utils.py564 console.print(f"Error: {e}. Invalid regex pattern supplied: '{pattern}'. Omitting from querying results.")CODE
LOWlitestar/testing/client/async_client.py122 except Exception as exc:CODE
LOWlitestar/testing/client/sync_client.py121 except Exception as exc:CODE
LOWlitestar/_signature/model.py178 except Exception as e: # noqa: BLE001CODE
LOWlitestar/events/listener.py74 except Exception as exc:CODE
LOWlitestar/channels/backends/psycopg.py122 except Exception as exc: # noqa: BLE001 - listener failures are forwarded to stream consumersCODE
MEDIUMlitestar/channels/backends/psycopg.py115def _listen(self) -> None:CODE
Overly Generic Function Names10 hits · 10 pts
SeverityFileLineSnippetContext
LOWtests/unit/test_utils/test_sync.py9 def my_method(self, value: int) -> None:CODE
LOWtests/unit/test_utils/test_sync.py28 async def my_method(self, value: int) -> None:CODE
LOWtests/unit/test_utils/test_sync.py45 def my_function(new_value: int) -> None:CODE
LOWtests/unit/test_utils/test_sync.py60 async def my_function(new_value: int) -> None:CODE
LOWtests/unit/test_openapi/test_schema.py194 def test_function(self, summed: NamedDependency[int], handler_param: FromQuery[int]) -> str:CODE
LOW…jection/test_websocket_handler_dependency_injection.py100 async def test_function(CODE
LOW…e/test_dependency_injection/test_inter_dependencies.py33 def test_function(self, summed: NamedDependency[int]) -> str:CODE
LOW…cy_injection/test_http_handler_dependency_injection.py98 def test_function(first: NamedDependency[int], second: NamedDependency[bool], third: NamedDependency[str]) -> None:CODE
LOW…test_dependency_injection/test_injection_of_classes.py34 def test_function(self, container: NamedDependency[HandlerDependency]) -> str:CODE
LOWlitestar/testing/transport.py219 def handle_request(self, request: Request) -> Response:CODE
Over-Commented Block8 hits · 8 pts
SeverityFileLineSnippetContext
LOWdocs/examples/security/using_session_auth.py61 # we received log-in data via post.COMMENT
LOWdocs/examples/lifecycle_hooks/before_request.py21# run: /?name=LukeCOMMENT
LOWlitestar/static_files.py261 for directory in directories:COMMENT
LOWlitestar/_asgi/routing_trie/mapping.py221 if app.allowed_hosts:COMMENT
LOWlitestar/_asgi/routing_trie/mapping.py241 # request -->COMMENT
LOWlitestar/connection/__init__.py1# Some code in this module was adapted from https://github.com/encode/starlette/blob/master/starlette/requests.py andCOMMENT
LOWlitestar/connection/__init__.py21# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"COMMENT
LOWlitestar/_openapi/datastructures.py141 if (existing_type := self._component_type_map[key]) != field and f"{field.raw!r}" != f"{existing_type.raw!r}":COMMENT
Dead Code3 hits · 6 pts
SeverityFileLineSnippetContext
MEDIUMtests/unit/test_response/test_sse.py231CODE
MEDIUMtests/unit/test_response/test_sse.py298CODE
MEDIUMtests/unit/test_response/test_sse.py318CODE
Modern AI Meta-Vocabulary1 hit · 4 pts
SeverityFileLineSnippetContext
MEDIUM⚡…t/test_handlers/test_websocket_handlers/test_stream.py62 # ensure dependency injection also works with 'socket' presentCOMMENT
AI Slop Vocabulary3 hits · 4 pts
SeverityFileLineSnippetContext
LOWdocs/examples/security/using_session_auth.py80 # you can do whatever we want here. In this case, we will simply return the user data:COMMENT
LOWdocs/examples/security/using_session_auth.py99 # will simply return the user:COMMENT
LOWlitestar/_signature/model.py295 # DTOs have already validated their data, so we can just use Any hereCOMMENT
Redundant / Tautological Comments1 hit · 2 pts
SeverityFileLineSnippetContext
LOWdocs/examples/security/jwt/using_token_revocation.py42 # Check if the token is already revoked in the BLOCKLISTCOMMENT