The little ASGI framework that shines. 🌟
This report presents the forensic synthetic code analysis of Kludex/starlette, a Python project with 12,474 GitHub stars. SynthScan v2.0 examined 24,316 lines of code across 110 source files, recording 419 pattern matches distributed across 13 syntactic categories. The overall adjusted score of 17.1 places this repository in the Moderate AI signal band.
The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).
This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.
Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.
This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.
The scanner identified 419 distinct pattern matches across 13 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. 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 diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | starlette/responses.py | 154 | def _wrap_websocket_denial_send(self, send: Send) -> Send: | CODE |
| LOW | starlette/routing.py | 540 | 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 | 83 | async def create_collapsing_task_group() -> AsyncGenerator[anyio.abc.TaskGroup, None]: | CODE |
| LOW | tests/test_datastructures.py | 184 | def test_url_from_scope_with_invalid_host(host: bytes) -> None: | CODE |
| LOW | tests/test_datastructures.py | 209 | 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 | 269 | def test_mutable_headers_merge() -> None: | CODE |
| LOW⚡ | tests/test_datastructures.py | 278 | def test_mutable_headers_merge_dict() -> None: | CODE |
| LOW⚡ | tests/test_datastructures.py | 287 | def test_mutable_headers_update() -> None: | CODE |
| LOW⚡ | tests/test_datastructures.py | 296 | def test_mutable_headers_update_dict() -> None: | CODE |
| LOW⚡ | tests/test_datastructures.py | 305 | def test_mutable_headers_merge_not_mapping() -> None: | CODE |
| LOW | tests/test_datastructures.py | 321 | def test_mutable_headers_from_scope() -> None: | CODE |
| LOW | tests/test_datastructures.py | 373 | async def test_upload_file_file_input() -> None: | CODE |
| LOW | tests/test_datastructures.py | 387 | async def test_upload_file_without_size() -> None: | CODE |
| LOW | tests/test_datastructures.py | 457 | 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 | 37 | def test_http_endpoint_route_path_params(client: TestClient) -> None: | CODE |
| LOW⚡ | tests/test_endpoints.py | 43 | def test_http_endpoint_route_method(client: TestClient) -> None: | CODE |
| LOW⚡ | tests/test_endpoints.py | 50 | def test_http_endpoint_does_not_dispatch_non_verb_method(test_client_factory: TestClientFactory) -> None: | CODE |
| LOW | tests/test_endpoints.py | 67 | def test_websocket_endpoint_on_connect(test_client_factory: TestClientFactory) -> None: | CODE |
| LOW | tests/test_endpoints.py | 78 | def test_websocket_endpoint_on_receive_bytes( | CODE |
| LOW | tests/test_endpoints.py | 98 | def test_websocket_endpoint_on_receive_json( | CODE |
| LOW | tests/test_endpoints.py | 118 | def test_websocket_endpoint_on_receive_json_binary( | CODE |
| LOW | tests/test_endpoints.py | 134 | def test_websocket_endpoint_on_receive_text( | CODE |
| LOW | tests/test_endpoints.py | 154 | def test_websocket_endpoint_on_default(test_client_factory: TestClientFactory) -> None: | CODE |
| LOW | tests/test_endpoints.py | 168 | 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 | 108 | def test_websockets_should_raise(client: TestClient) -> None: | CODE |
| LOW | tests/test_exceptions.py | 114 | def test_handled_exc_after_response(test_client_factory: TestClientFactory, client: TestClient) -> None: | CODE |
| LOW | tests/test_exceptions.py | 185 | def test_request_in_app_and_handler_is_the_same_object(client: TestClient) -> None: | CODE |
| LOW | tests/test_exceptions.py | 191 | def test_http_exception_does_not_use_threadpool(client: TestClient, monkeypatch: MonkeyPatch) -> None: | CODE |
| LOW | tests/test_exceptions.py | 210 | def test_handlers_annotations() -> None: | CODE |
| LOW | tests/test_testclient.py | 50 | def test_use_testclient_in_endpoint(test_client_factory: TestClientFactory) -> None: | CODE |
| LOW | tests/test_testclient.py | 70 | def test_testclient_headers_behavior() -> None: | CODE |
| LOW | tests/test_testclient.py | 89 | def test_use_testclient_as_contextmanager(test_client_factory: TestClientFactory, anyio_backend_name: str) -> None: | CODE |
| LOW | tests/test_testclient.py | 180 | def test_exception_in_middleware(test_client_factory: TestClientFactory) -> None: | CODE |
| LOW | tests/test_testclient.py | 233 | def test_websocket_blocking_receive(test_client_factory: TestClientFactory) -> None: | CODE |
| LOW | tests/test_testclient.py | 258 | def test_websocket_not_block_on_close(test_client_factory: TestClientFactory) -> None: | CODE |
| LOW | tests/test_testclient.py | 293 | def test_client_custom_client(test_client_factory: TestClientFactory) -> None: | CODE |
| LOW | tests/test_testclient.py | 335 | def test_domain_restricted_cookies(test_client_factory: TestClientFactory, domain: str, ok: bool) -> None: | CODE |
| LOW | tests/test_testclient.py | 361 | def test_forward_follow_redirects(test_client_factory: TestClientFactory) -> None: | CODE |
| LOW | tests/test_testclient.py | 374 | def test_forward_nofollow_redirects(test_client_factory: TestClientFactory) -> None: | CODE |
| LOW | tests/test_testclient.py | 384 | def test_with_duplicate_headers(test_client_factory: TestClientFactory) -> None: | CODE |
| LOW | tests/test_testclient.py | 404 | def test_raw_path_with_querystring(test_client_factory: TestClientFactory) -> None: | CODE |
| LOW | tests/test_testclient.py | 414 | def test_websocket_raw_path_without_params(test_client_factory: TestClientFactory) -> None: | CODE |
| LOW | tests/test__utils.py | 58 | def test_async_partial_object_call() -> None: | CODE |
| LOW | tests/test__utils.py | 80 | def test_async_nested_partial() -> None: | CODE |
| LOW | tests/test__utils.py | 91 | def test_async_mocked_async_function() -> None: | CODE |
| 262 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/sessions.py | 1 | CODE | |
| LOW | starlette/middleware/cors.py | 1 | CODE | |
| LOW | starlette/middleware/__init__.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/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_base.py | 1 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | starlette/websockets.py | 59 | CODE | |
| LOW | starlette/staticfiles.py | 109 | CODE | |
| LOW | starlette/schemas.py | 40 | CODE | |
| LOW | starlette/routing.py | 420 | CODE | |
| LOW | starlette/routing.py | 486 | CODE | |
| LOW | starlette/authentication.py | 25 | CODE | |
| LOW | starlette/authentication.py | 32 | CODE | |
| LOW | starlette/testclient.py | 150 | CODE | |
| LOW | starlette/testclient.py | 225 | CODE | |
| LOW | starlette/testclient.py | 300 | CODE | |
| LOW | starlette/requests.py | 268 | CODE | |
| LOW | starlette/endpoints.py | 70 | CODE | |
| LOW | starlette/endpoints.py | 91 | CODE | |
| LOW | starlette/formparsers.py | 105 | CODE | |
| LOW | starlette/middleware/gzip.py | 48 | CODE | |
| LOW | starlette/middleware/cors.py | 107 | CODE | |
| LOW | starlette/middleware/errors.py | 149 | 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 |
|---|---|---|---|---|
| MEDIUM | starlette/requests.py | 193 | # Create a state instance with a reference to the dict in which it should | COMMENT |
| MEDIUM | starlette/formparsers.py | 115 | # Create the parser. | COMMENT |
| MEDIUM | starlette/formparsers.py | 271 | # Create the parser. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | starlette/responses.py | 89 | CODE | |
| LOW | starlette/testclient.py | 381 | CODE | |
| LOW | starlette/testclient.py | 429 | CODE | |
| LOW | starlette/testclient.py | 539 | CODE | |
| LOW | starlette/testclient.py | 570 | CODE | |
| LOW | starlette/testclient.py | 601 | CODE | |
| LOW | starlette/middleware/cors.py | 16 | CODE | |
| LOW | tests/test_staticfiles.py | 56 | CODE | |
| LOW | tests/middleware/test_base.py | 137 | CODE | |
| LOW | tests/middleware/test_base.py | 957 | 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/errors.py | 165 | except Exception as exc: | STRING |
| LOW | starlette/middleware/base.py | 145 | except Exception as exc: | CODE |
| LOW⚡ | tests/middleware/test_base.py | 1277 | except Exception: | CODE |
| LOW⚡ | tests/middleware/test_base.py | 1283 | except Exception as e: | CODE |
| LOW | docs/middleware.md | 642 | except Exception as exc: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | tests/test_testclient.py | 171 | CODE | |
| MEDIUM | tests/test_routing.py | 697 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | starlette/responses.py | 330 | 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 | 136 | # Check if we have 'index.html' file to serve. | COMMENT |
| LOW | starlette/formparsers.py | 277 | # Write file data, it needs to use await with the UploadFile methods | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | starlette/routing.py | 614 | # 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 | starlette/testclient.py | 225 | def handle_request(self, request: httpx.Request) -> httpx.Response: | CODE |
| LOW | tests/test_routing.py | 769 | async def my_method(self, request: Request) -> None: ... # pragma: no cover | CODE |
| 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 |