Repository Analysis

Kludex/starlette

The little ASGI framework that shines. 🌟

17.2 Moderate AI signal View on GitHub
17.2
Adjusted Score
17.2
Raw Score
100%
Time Factor
2026-05-30
Last Push
12,350
Stars
Python
Language
23,936
Lines of Code
110
Files
397
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 0HIGH 5MEDIUM 5LOW 387

Pattern Findings

397 matches across 12 categories. Click a row to expand file-level details.

Hyper-Verbose Identifiers310 hits · 296 pts
SeverityFileLineSnippet
LOWstarlette/responses.py154 def _wrap_websocket_denial_send(self, send: Send) -> Send:
LOWstarlette/routing.py540def _wrap_gen_lifespan_context(
LOWstarlette/_exception_handler.py16def _lookup_exception_handler(exc_handlers: ExceptionHandlers, exc: Exception) -> ExceptionHandler | None:
LOWstarlette/_exception_handler.py23def wrap_app_handling_exceptions(app: ASGIApp, conn: Request | WebSocket) -> ASGIApp:
LOWtests/test_datastructures.py173def test_url_from_scope_with_invalid_host(host: bytes) -> None:
LOWtests/test_datastructures.py231def test_mutable_headers_merge() -> None:
LOWtests/test_datastructures.py240def test_mutable_headers_merge_dict() -> None:
LOWtests/test_datastructures.py249def test_mutable_headers_update() -> None:
LOWtests/test_datastructures.py258def test_mutable_headers_update_dict() -> None:
LOWtests/test_datastructures.py267def test_mutable_headers_merge_not_mapping() -> None:
LOWtests/test_datastructures.py283def test_mutable_headers_from_scope() -> None:
LOWtests/test_datastructures.py335async def test_upload_file_file_input() -> None:
LOWtests/test_datastructures.py349async def test_upload_file_without_size() -> None:
LOWtests/test_datastructures.py419async def test_upload_file_repr_headers() -> None:
LOWtests/test_concurrency.py16async def test_run_until_first_complete() -> None:
LOWtests/test_concurrency.py33def test_accessing_context_from_threaded_sync_endpoint(
LOWtests/test_concurrency.py50async def test_iterate_in_threadpool() -> None:
LOWtests/test_templates.py37def test_templates_autoescape(tmp_path: Path) -> None:
LOWtests/test_templates.py49def test_calls_context_processors(tmp_path: Path, test_client_factory: TestClientFactory) -> None:
LOWtests/test_templates.py77def test_template_with_middleware(tmpdir: Path, test_client_factory: TestClientFactory) -> None:
LOWtests/test_templates.py103def test_templates_with_directories(tmp_path: Path, test_client_factory: TestClientFactory) -> None:
LOWtests/test_templates.py138def test_templates_require_directory_or_environment() -> None:
LOWtests/test_templates.py143def test_templates_require_directory_or_environment_not_both() -> None:
LOWtests/test_templates.py148def test_templates_with_directory(tmpdir: Path) -> None:
LOWtests/test_templates.py158def test_templates_with_environment(tmpdir: Path, test_client_factory: TestClientFactory) -> None:
LOWtests/test_endpoints.py37def test_http_endpoint_route_path_params(client: TestClient) -> None:
LOWtests/test_endpoints.py43def test_http_endpoint_route_method(client: TestClient) -> None:
LOWtests/test_endpoints.py50def test_http_endpoint_does_not_dispatch_non_verb_method(test_client_factory: TestClientFactory) -> None:
LOWtests/test_endpoints.py67def test_websocket_endpoint_on_connect(test_client_factory: TestClientFactory) -> None:
LOWtests/test_endpoints.py78def test_websocket_endpoint_on_receive_bytes(
LOWtests/test_endpoints.py98def test_websocket_endpoint_on_receive_json(
LOWtests/test_endpoints.py118def test_websocket_endpoint_on_receive_json_binary(
LOWtests/test_endpoints.py134def test_websocket_endpoint_on_receive_text(
LOWtests/test_endpoints.py154def test_websocket_endpoint_on_default(test_client_factory: TestClientFactory) -> None:
LOWtests/test_endpoints.py168def test_websocket_endpoint_on_disconnect(
LOWtests/test_convertors.py63def test_default_float_convertor(test_client_factory: TestClientFactory, param: str, status_code: int) -> None:
LOWtests/test_convertors.py86def test_default_uuid_convertor(test_client_factory: TestClientFactory, param: str, status_code: int) -> None:
LOWtests/test_exceptions.py108def test_websockets_should_raise(client: TestClient) -> None:
LOWtests/test_exceptions.py114def test_handled_exc_after_response(test_client_factory: TestClientFactory, client: TestClient) -> None:
LOWtests/test_exceptions.py185def test_request_in_app_and_handler_is_the_same_object(client: TestClient) -> None:
LOWtests/test_exceptions.py191def test_http_exception_does_not_use_threadpool(client: TestClient, monkeypatch: MonkeyPatch) -> None:
LOWtests/test_exceptions.py210def test_handlers_annotations() -> None:
LOWtests/test_testclient.py49def test_use_testclient_in_endpoint(test_client_factory: TestClientFactory) -> None:
LOWtests/test_testclient.py69def test_testclient_headers_behavior() -> None:
LOWtests/test_testclient.py88def test_use_testclient_as_contextmanager(test_client_factory: TestClientFactory, anyio_backend_name: str) -> None:
LOWtests/test_testclient.py179def test_exception_in_middleware(test_client_factory: TestClientFactory) -> None:
LOWtests/test_testclient.py232def test_websocket_blocking_receive(test_client_factory: TestClientFactory) -> None:
LOWtests/test_testclient.py257def test_websocket_not_block_on_close(test_client_factory: TestClientFactory) -> None:
LOWtests/test_testclient.py292def test_client_custom_client(test_client_factory: TestClientFactory) -> None:
LOWtests/test_testclient.py334def test_domain_restricted_cookies(test_client_factory: TestClientFactory, domain: str, ok: bool) -> None:
LOWtests/test_testclient.py360def test_forward_follow_redirects(test_client_factory: TestClientFactory) -> None:
LOWtests/test_testclient.py373def test_forward_nofollow_redirects(test_client_factory: TestClientFactory) -> None:
LOWtests/test_testclient.py383def test_with_duplicate_headers(test_client_factory: TestClientFactory) -> None:
LOWtests/test_testclient.py403def test_raw_path_with_querystring(test_client_factory: TestClientFactory) -> None:
LOWtests/test_testclient.py413def test_websocket_raw_path_without_params(test_client_factory: TestClientFactory) -> None:
LOWtests/test__utils.py54def test_async_partial_object_call() -> None:
LOWtests/test__utils.py76def test_async_nested_partial() -> None:
LOWtests/test__utils.py87def test_async_mocked_async_function() -> None:
LOWtests/test_authentication.py176async def websocket_endpoint_decorated(websocket: WebSocket, additional: str) -> None:
LOWtests/test_authentication.py204def test_invalid_decorator_usage() -> None:
250 more matches not shown…
Unused Imports45 hits · 43 pts
SeverityFileLineSnippet
LOWstarlette/responses.py1
LOWstarlette/config.py1
LOWstarlette/templating.py1
LOWstarlette/websockets.py1
LOWstarlette/applications.py1
LOWstarlette/concurrency.py1
LOWstarlette/background.py1
LOWstarlette/types.py6
LOWstarlette/types.py7
LOWstarlette/types.py8
LOWstarlette/convertors.py1
LOWstarlette/staticfiles.py1
LOWstarlette/schemas.py1
LOWstarlette/routing.py1
LOWstarlette/authentication.py1
LOWstarlette/testclient.py1
LOWstarlette/_exception_handler.py1
LOWstarlette/exceptions.py1
LOWstarlette/requests.py1
LOWstarlette/datastructures.py1
LOWstarlette/endpoints.py1
LOWstarlette/formparsers.py1
LOWstarlette/_utils.py1
LOWstarlette/status.py9
LOWstarlette/middleware/sessions.py1
LOWstarlette/middleware/cors.py1
LOWstarlette/middleware/__init__.py1
LOWstarlette/middleware/trustedhost.py1
LOWstarlette/middleware/authentication.py1
LOWstarlette/middleware/exceptions.py1
LOWstarlette/middleware/errors.py1
LOWstarlette/middleware/base.py1
LOWstarlette/middleware/wsgi.py1
LOWtests/conftest.py1
LOWtests/test_templates.py1
LOWtests/test_testclient.py1
LOWtests/types.py1
LOWtests/test_authentication.py1
LOWtests/test_routing.py1
LOWtests/test_applications.py1
LOWtests/test_requests.py1
LOWtests/test_responses.py1
LOWtests/test_formparsers.py1
LOWtests/middleware/test_gzip.py1
LOWtests/middleware/test_base.py1
Deep Nesting18 hits · 18 pts
SeverityFileLineSnippet
LOWstarlette/websockets.py59
LOWstarlette/staticfiles.py109
LOWstarlette/schemas.py40
LOWstarlette/routing.py420
LOWstarlette/routing.py486
LOWstarlette/authentication.py25
LOWstarlette/authentication.py32
LOWstarlette/testclient.py156
LOWstarlette/testclient.py231
LOWstarlette/testclient.py306
LOWstarlette/requests.py267
LOWstarlette/datastructures.py29
LOWstarlette/endpoints.py70
LOWstarlette/endpoints.py91
LOWstarlette/formparsers.py84
LOWstarlette/middleware/gzip.py48
LOWstarlette/middleware/cors.py107
LOWstarlette/middleware/errors.py149
Cross-File Repetition3 hits · 15 pts
SeverityFileLineSnippet
HIGHtests/test_schemas.py0responses: 200: description: a user. examples: {"username": "tom"}
HIGHtests/test_schemas.py0responses: 200: description: a user. examples: {"username": "tom"}
HIGHdocs/schemas.md0responses: 200: description: a user. examples: {"username": "tom"}
Cross-Language Confusion2 hits · 10 pts
SeverityFileLineSnippet
HIGHstarlette/config.py90 default: Any = undefined,
HIGHstarlette/config.py98 default: Any = undefined,
Self-Referential Comments3 hits · 9 pts
SeverityFileLineSnippet
MEDIUMstarlette/requests.py192 # Create a state instance with a reference to the dict in which it should
MEDIUMstarlette/formparsers.py94 # Create the parser.
MEDIUMstarlette/formparsers.py250 # Create the parser.
Excessive Try-Catch Wrapping7 hits · 8 pts
SeverityFileLineSnippet
LOWstarlette/_exception_handler.py43 except Exception as exc:
LOWstarlette/endpoints.py85 except Exception as exc:
LOWstarlette/middleware/errors.py165 except Exception as exc:
LOWstarlette/middleware/base.py145 except Exception as exc:
LOWtests/middleware/test_base.py1263 except Exception:
LOWtests/middleware/test_base.py1269 except Exception as e:
LOWdocs/middleware.md642 except Exception as exc:
Dead Code2 hits · 4 pts
SeverityFileLineSnippet
MEDIUMtests/test_testclient.py170
MEDIUMtests/test_routing.py697
Redundant / Tautological Comments2 hits · 3 pts
SeverityFileLineSnippet
LOWstarlette/staticfiles.py136 # Check if we have 'index.html' file to serve.
LOWstarlette/formparsers.py256 # Write file data, it needs to use await with the UploadFile methods
AI Slop Vocabulary2 hits · 3 pts
SeverityFileLineSnippet
LOWstarlette/routing.py614 # returning the response. For plain ASGI apps, just return the response.
LOWstarlette/endpoints.py51 # returning the response. For plain ASGI apps, just return the response.
Overly Generic Function Names2 hits · 2 pts
SeverityFileLineSnippet
LOWstarlette/testclient.py231 def handle_request(self, request: httpx.Request) -> httpx.Response:
LOWtests/test_routing.py769 async def my_method(self, request: Request) -> None: ... # pragma: no cover
Fake / Example Data1 hit · 1 pts
SeverityFileLineSnippet
LOWdocs/applications.md27 username = "John Doe"