The little ASGI framework that shines. 🌟
This report summarizes scanner evidence for Kludex/starlette, a Python project with 12,657 GitHub stars. SynthScan examined 29,318 lines of code across 132 source files, recording 550 pattern matches distributed across 14 syntactic categories. The legacy adjusted pattern signal is 19.7 (Elevated 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.
Use each vector to guide manual verification of the underlying findings.
Can maintainers explain intent, assumptions, and trade-offs? 456 finding(s).
Are imports declared and package/API names verified? 70 finding(s).
Are wrappers, guards, and repeated structures necessary? 448 finding(s).
Which changes need focused human review? 550 finding(s).
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.
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.
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.
The scanner identified 550 distinct pattern matches across 14 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.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | starlette/responses.py | 157 | def _wrap_websocket_denial_send(self, send: Send) -> Send: | CODE |
| LOW | starlette/routing.py | 553 | def _wrap_gen_lifespan_context( | CODE |
| LOW | starlette/_exception_handler.py | 16 | def _lookup_exception_handler(exc_handlers: ExceptionHandlers, exc: Exception) -> ExceptionHandler | None: | CODE |
| LOW | starlette/_exception_handler.py | 23 | def wrap_app_handling_exceptions(app: ASGIApp, conn: Request | WebSocket) -> ASGIApp: | CODE |
| LOW | starlette/_utils.py | 102 | async def create_collapsing_task_group() -> AsyncGenerator[anyio.abc.TaskGroup, None]: | CODE |
| LOW | starlette/middleware/gzip.py | 33 | def _get_gzip_capacity_limiter() -> anyio.CapacityLimiter: | CODE |
| LOW | tests/test_datastructures.py | 209 | def test_url_from_scope_with_invalid_host(host: bytes) -> None: | CODE |
| LOW | tests/test_datastructures.py | 245 | def test_url_from_scope_with_ipvfuture() -> None: | CODE |
| LOW | tests/test_datastructures.py | 268 | def test_url_from_scope_with_authority_in_path(path: str, expected_path: str, with_host_header: bool) -> None: | CODE |
| LOW⚡ | tests/test_datastructures.py | 328 | def test_mutable_headers_merge() -> None: | CODE |
| LOW⚡ | tests/test_datastructures.py | 337 | def test_mutable_headers_merge_dict() -> None: | CODE |
| LOW⚡ | tests/test_datastructures.py | 346 | def test_mutable_headers_update() -> None: | CODE |
| LOW⚡ | tests/test_datastructures.py | 355 | def test_mutable_headers_update_dict() -> None: | CODE |
| LOW⚡ | tests/test_datastructures.py | 364 | def test_mutable_headers_merge_not_mapping() -> None: | CODE |
| LOW | tests/test_datastructures.py | 380 | def test_mutable_headers_from_scope() -> None: | CODE |
| LOW | tests/test_datastructures.py | 432 | async def test_upload_file_file_input() -> None: | CODE |
| LOW | tests/test_datastructures.py | 446 | async def test_upload_file_without_size() -> None: | CODE |
| LOW | tests/test_datastructures.py | 516 | async def test_upload_file_repr_headers() -> None: | CODE |
| LOW | tests/test_concurrency.py | 16 | async def test_run_until_first_complete() -> None: | CODE |
| LOW | tests/test_concurrency.py | 33 | def test_accessing_context_from_threaded_sync_endpoint( | CODE |
| LOW | tests/test_concurrency.py | 50 | async def test_iterate_in_threadpool() -> None: | CODE |
| LOW | tests/test_templates.py | 37 | def test_templates_autoescape(tmp_path: Path) -> None: | CODE |
| LOW | tests/test_templates.py | 49 | def test_calls_context_processors(tmp_path: Path, test_client_factory: TestClientFactory) -> None: | CODE |
| LOW | tests/test_templates.py | 77 | def test_template_with_middleware(tmpdir: Path, test_client_factory: TestClientFactory) -> None: | CODE |
| LOW | tests/test_templates.py | 103 | def test_templates_with_directories(tmp_path: Path, test_client_factory: TestClientFactory) -> None: | CODE |
| LOW⚡ | tests/test_templates.py | 138 | def test_templates_require_directory_or_environment() -> None: | CODE |
| LOW⚡ | tests/test_templates.py | 143 | def test_templates_require_directory_or_environment_not_both() -> None: | CODE |
| LOW⚡ | tests/test_templates.py | 148 | def test_templates_with_directory(tmpdir: Path) -> None: | CODE |
| LOW⚡ | tests/test_templates.py | 158 | def test_templates_with_environment(tmpdir: Path, test_client_factory: TestClientFactory) -> None: | CODE |
| LOW⚡ | tests/test_endpoints.py | 42 | def test_http_endpoint_route_path_params(client: TestClient) -> None: | CODE |
| LOW⚡ | tests/test_endpoints.py | 48 | def test_http_endpoint_route_method(client: TestClient) -> None: | CODE |
| LOW⚡ | tests/test_endpoints.py | 55 | def test_http_endpoint_route_query_method(client: TestClient) -> None: | CODE |
| LOW⚡ | tests/test_endpoints.py | 62 | async def test_http_endpoint_supports_early_hints() -> None: | CODE |
| LOW | tests/test_endpoints.py | 92 | def test_http_endpoint_does_not_dispatch_non_verb_method(test_client_factory: TestClientFactory) -> None: | CODE |
| LOW | tests/test_endpoints.py | 109 | def test_websocket_endpoint_on_connect(test_client_factory: TestClientFactory) -> None: | CODE |
| LOW | tests/test_endpoints.py | 120 | def test_websocket_endpoint_on_receive_bytes( | CODE |
| LOW | tests/test_endpoints.py | 140 | def test_websocket_endpoint_on_receive_json( | CODE |
| LOW | tests/test_endpoints.py | 160 | def test_websocket_endpoint_on_receive_json_binary( | CODE |
| LOW | tests/test_endpoints.py | 176 | def test_websocket_endpoint_on_receive_text( | CODE |
| LOW | tests/test_endpoints.py | 196 | def test_websocket_endpoint_on_default(test_client_factory: TestClientFactory) -> None: | CODE |
| LOW | tests/test_endpoints.py | 210 | def test_websocket_endpoint_on_default_with_empty_text(test_client_factory: TestClientFactory) -> None: | CODE |
| LOW | tests/test_endpoints.py | 225 | async def test_websocket_endpoint_decode_text_rejects_message_without_text() -> None: | CODE |
| LOW | tests/test_endpoints.py | 250 | async def test_websocket_endpoint_decode_bytes_rejects_message_without_bytes() -> None: | CODE |
| LOW | tests/test_endpoints.py | 272 | def test_websocket_endpoint_on_disconnect( | CODE |
| LOW | tests/test_convertors.py | 63 | def test_default_float_convertor(test_client_factory: TestClientFactory, param: str, status_code: int) -> None: | CODE |
| LOW | tests/test_convertors.py | 86 | def test_default_uuid_convertor(test_client_factory: TestClientFactory, param: str, status_code: int) -> None: | CODE |
| LOW⚡ | tests/test_exceptions.py | 113 | def test_non_standard_status_code(client: TestClient) -> None: | CODE |
| LOW⚡ | tests/test_exceptions.py | 119 | def test_websockets_should_raise(client: TestClient) -> None: | CODE |
| LOW⚡ | tests/test_exceptions.py | 125 | def test_handled_exc_after_response(test_client_factory: TestClientFactory, client: TestClient) -> None: | CODE |
| LOW | tests/test_exceptions.py | 196 | def test_request_in_app_and_handler_is_the_same_object(client: TestClient) -> None: | CODE |
| LOW | tests/test_exceptions.py | 202 | def test_http_exception_does_not_use_threadpool(client: TestClient, monkeypatch: MonkeyPatch) -> None: | CODE |
| LOW | tests/test_exceptions.py | 221 | def test_handlers_annotations() -> None: | CODE |
| LOW | tests/test_testclient.py | 49 | def test_use_testclient_in_endpoint(test_client_factory: TestClientFactory) -> None: | CODE |
| LOW | tests/test_testclient.py | 69 | def test_testclient_headers_behavior() -> None: | CODE |
| LOW | tests/test_testclient.py | 88 | def test_use_testclient_as_contextmanager(test_client_factory: TestClientFactory, anyio_backend_name: str) -> None: | CODE |
| LOW | tests/test_testclient.py | 179 | def test_exception_in_middleware(test_client_factory: TestClientFactory) -> None: | CODE |
| LOW | tests/test_testclient.py | 232 | def test_debug_info_in_response_extensions(test_client_factory: TestClientFactory) -> None: | CODE |
| LOW | tests/test_testclient.py | 250 | def test_debug_info_in_response_extensions_with_template(test_client_factory: TestClientFactory) -> None: | CODE |
| LOW | tests/test_testclient.py | 271 | def test_websocket_blocking_receive(test_client_factory: TestClientFactory) -> None: | CODE |
| LOW | tests/test_testclient.py | 296 | def test_websocket_not_block_on_close(test_client_factory: TestClientFactory) -> None: | CODE |
| 357 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | starlette/responses.py | 1 | CODE | |
| LOW | starlette/config.py | 1 | CODE | |
| LOW | starlette/templating.py | 1 | CODE | |
| LOW | starlette/websockets.py | 1 | CODE | |
| LOW | starlette/applications.py | 1 | CODE | |
| LOW | starlette/concurrency.py | 1 | CODE | |
| LOW | starlette/background.py | 1 | CODE | |
| LOW | starlette/types.py | 6 | CODE | |
| LOW | starlette/types.py | 7 | CODE | |
| LOW | starlette/types.py | 8 | CODE | |
| LOW | starlette/convertors.py | 1 | CODE | |
| LOW | starlette/staticfiles.py | 1 | CODE | |
| LOW | starlette/schemas.py | 1 | CODE | |
| LOW | starlette/routing.py | 1 | CODE | |
| LOW | starlette/authentication.py | 1 | CODE | |
| LOW | starlette/testclient.py | 1 | CODE | |
| LOW | starlette/_exception_handler.py | 1 | CODE | |
| LOW | starlette/exceptions.py | 1 | CODE | |
| LOW | starlette/requests.py | 1 | CODE | |
| LOW | starlette/datastructures.py | 1 | CODE | |
| LOW | starlette/endpoints.py | 1 | CODE | |
| LOW | starlette/formparsers.py | 1 | CODE | |
| LOW | starlette/_utils.py | 1 | CODE | |
| LOW | starlette/status.py | 9 | CODE | |
| LOW | starlette/middleware/gzip.py | 1 | CODE | |
| LOW | starlette/middleware/sessions.py | 1 | CODE | |
| LOW | starlette/middleware/cors.py | 1 | CODE | |
| LOW | starlette/middleware/__init__.py | 1 | CODE | |
| LOW | starlette/middleware/opentelemetry.py | 1 | CODE | |
| LOW | starlette/middleware/body_limit.py | 1 | CODE | |
| LOW | starlette/middleware/trustedhost.py | 1 | CODE | |
| LOW | starlette/middleware/authentication.py | 1 | CODE | |
| LOW | starlette/middleware/exceptions.py | 1 | CODE | |
| LOW | starlette/middleware/errors.py | 1 | CODE | |
| LOW | starlette/middleware/base.py | 1 | CODE | |
| LOW | starlette/middleware/wsgi.py | 1 | CODE | |
| LOW | tests/test_datastructures.py | 1 | CODE | |
| LOW | tests/conftest.py | 1 | CODE | |
| LOW | tests/test_templates.py | 1 | CODE | |
| LOW | tests/test_testclient.py | 1 | CODE | |
| LOW | tests/types.py | 1 | CODE | |
| LOW | tests/test_authentication.py | 1 | CODE | |
| LOW | tests/test_routing.py | 1 | CODE | |
| LOW | tests/test_applications.py | 1 | CODE | |
| LOW | tests/test_requests.py | 1 | CODE | |
| LOW | tests/test_responses.py | 1 | CODE | |
| LOW | tests/test_formparsers.py | 1 | CODE | |
| LOW | tests/middleware/test_gzip.py | 1 | CODE | |
| LOW | tests/middleware/test_trusted_host.py | 1 | CODE | |
| LOW | tests/middleware/test_opentelemetry.py | 1 | CODE | |
| LOW | tests/middleware/test_body_limit.py | 1 | CODE | |
| LOW | tests/middleware/test_https_redirect.py | 1 | CODE | |
| LOW | tests/middleware/test_base.py | 1 | CODE | |
| LOW | benchmarks/routing_benchmark.py | 1 | CODE | |
| LOW | benchmarks/conftest.py | 1 | CODE | |
| LOW | benchmarks/gzip_benchmark.py | 1 | CODE | |
| LOW | benchmarks/json_benchmark.py | 1 | CODE | |
| LOW | benchmarks/__init__.py | 1 | CODE | |
| LOW | benchmarks/file_response_benchmark.py | 1 | CODE | |
| LOW | benchmarks/request_benchmark.py | 1 | CODE | |
| 6 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | starlette/websockets.py | 154 | except WebSocketDisconnect: | CODE |
| HIGH | starlette/websockets.py | 161 | except WebSocketDisconnect: | CODE |
| HIGH | starlette/websockets.py | 168 | except WebSocketDisconnect: | CODE |
| HIGH | starlette/staticfiles.py | 228 | except KeyError: | CODE |
| HIGH | starlette/routing.py | 641 | except NoMatchFound: | CODE |
| HIGH | starlette/routing.py | 452 | except NoMatchFound: | CODE |
| HIGH | starlette/routing.py | 518 | except NoMatchFound: | CODE |
| HIGH | starlette/datastructures.py | 132 | except ValueError: | CODE |
| HIGH | starlette/middleware/body_limit.py | 95 | except _RequestBodyLimitResponseSent: | CODE |
| HIGH | tests/test_testclient.py | 285 | except WebSocketDisconnect: | CODE |
| HIGH | tests/middleware/test_base.py | 1090 | except ClientDisconnect: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | starlette/responses.py | 456 | CODE | |
| LOW | starlette/websockets.py | 65 | CODE | |
| LOW | starlette/staticfiles.py | 115 | CODE | |
| LOW | starlette/schemas.py | 40 | CODE | |
| LOW | starlette/routing.py | 429 | CODE | |
| LOW | starlette/routing.py | 499 | CODE | |
| LOW | starlette/authentication.py | 25 | CODE | |
| LOW | starlette/authentication.py | 32 | CODE | |
| LOW | starlette/testclient.py | 142 | CODE | |
| LOW | starlette/testclient.py | 217 | CODE | |
| LOW | starlette/testclient.py | 288 | CODE | |
| LOW | starlette/testclient.py | 316 | CODE | |
| LOW | starlette/requests.py | 270 | CODE | |
| LOW | starlette/datastructures.py | 27 | CODE | |
| LOW | starlette/datastructures.py | 116 | CODE | |
| LOW | starlette/endpoints.py | 70 | CODE | |
| LOW | starlette/endpoints.py | 91 | CODE | |
| LOW | starlette/formparsers.py | 109 | CODE | |
| LOW | starlette/middleware/gzip.py | 106 | CODE | |
| LOW | starlette/middleware/cors.py | 102 | CODE | |
| LOW | starlette/middleware/opentelemetry.py | 47 | CODE | |
| LOW | starlette/middleware/errors.py | 149 | CODE | |
| LOW | starlette/middleware/base.py | 101 | CODE | |
| LOW | starlette/middleware/base.py | 112 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | starlette/config.py | 90 | default: Any = undefined, | CODE |
| HIGH | starlette/config.py | 98 | default: Any = undefined, | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | starlette/_exception_handler.py | 43 | except Exception as exc: | CODE |
| LOW | starlette/endpoints.py | 85 | except Exception as exc: | CODE |
| LOW | starlette/middleware/opentelemetry.py | 108 | except Exception as exc: | CODE |
| LOW | starlette/middleware/errors.py | 165 | except Exception as exc: | STRING |
| LOW | starlette/middleware/base.py | 150 | except Exception as exc: | CODE |
| LOW⚡ | tests/middleware/test_base.py | 1317 | except Exception: | CODE |
| LOW⚡ | tests/middleware/test_base.py | 1323 | except Exception as e: | CODE |
| LOW | docs/middleware.md | 771 | except Exception as exc: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | starlette/requests.py | 194 | # Create a state instance with a reference to the dict in which it should | COMMENT |
| MEDIUM | starlette/formparsers.py | 119 | # Create the parser. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | starlette/responses.py | 90 | CODE | |
| LOW | starlette/testclient.py | 384 | CODE | |
| LOW | starlette/testclient.py | 432 | CODE | |
| LOW | starlette/middleware/cors.py | 16 | CODE | |
| LOW | tests/test_staticfiles.py | 68 | CODE | |
| LOW | tests/middleware/test_base.py | 133 | CODE | |
| LOW | tests/middleware/test_base.py | 955 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | tests/test_testclient.py | 170 | CODE | |
| MEDIUM | tests/test_routing.py | 754 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | starlette/responses.py | 334 | def set_stat_headers(self, stat_result: os.stat_result) -> None: | CODE |
| LOW | starlette/templating.py | 101 | def _setup_env_defaults(self, env: jinja2.Environment) -> None: | CODE |
| LOW | starlette/status.py | 15 | __all__ = [ | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | starlette/staticfiles.py | 142 | # Check if we have 'index.html' file to serve. | COMMENT |
| LOW | starlette/formparsers.py | 283 | # Write file data, it needs to use await with the UploadFile methods | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | starlette/routing.py | 630 | # returning the response. For plain ASGI apps, just return the response. | COMMENT |
| LOW | starlette/endpoints.py | 51 | # returning the response. For plain ASGI apps, just return the response. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | docs/applications.md | 27 | username = "John Doe" | CODE |
| LOW | docs/applications.md | 65 | app.state.ADMIN_EMAIL = 'admin@example.org' | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | starlette/testclient.py | 217 | def handle_request(self, request: httpx.Request) -> httpx.Response: | CODE |
| LOW | tests/test_routing.py | 826 | async def my_method(self, request: Request) -> None: ... # pragma: no cover | CODE |