An ASGI web server, for Python. 🦄
This report presents the forensic synthetic code analysis of Kludex/uvicorn, a Python project with 10,828 GitHub stars. SynthScan v2.0 examined 18,408 lines of code across 109 source files, recording 319 pattern matches distributed across 9 syntactic categories. The overall adjusted score of 19.3 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 319 distinct pattern matches across 9 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 | tests/conftest.py | 42 | def tls_certificate_authority() -> trustme.CA: | CODE |
| LOW⚡ | tests/conftest.py | 58 | def tls_ca_certificate_pem_path(tls_certificate_authority: trustme.CA): | CODE |
| LOW⚡ | tests/conftest.py | 64 | def tls_ca_certificate_private_key_path(tls_certificate_authority: trustme.CA): | CODE |
| LOW⚡ | tests/conftest.py | 70 | def tls_certificate_private_key_encrypted_path(tls_certificate): | CODE |
| LOW⚡ | tests/conftest.py | 86 | def tls_certificate_private_key_path(tls_certificate: trustme.CA): | CODE |
| LOW⚡ | tests/conftest.py | 92 | def tls_certificate_key_and_chain_path(tls_certificate: trustme.LeafCert): | CODE |
| LOW⚡ | tests/conftest.py | 98 | def tls_certificate_server_cert_path(tls_certificate: trustme.LeafCert): | CODE |
| LOW | tests/conftest.py | 111 | def reload_directory_structure(tmp_path_factory: pytest.TempPathFactory): | CODE |
| LOW | tests/test_server.py | 90 | async def test_shutdown_on_early_exit_during_startup(unused_tcp_port: int): | CODE |
| LOW | tests/test_server.py | 125 | def test_run_exits_with_startup_failure_on_unloadable_app() -> None: | CODE |
| LOW | tests/test_server.py | 140 | async def test_request_than_limit_max_requests_warn_log( | CODE |
| LOW | tests/test_server.py | 153 | async def test_limit_max_requests_jitter( | CODE |
| LOW | tests/test_server.py | 206 | async def test_contextvars_preserved_by_default( | CODE |
| LOW | tests/test_server.py | 229 | async def test_reset_contextvars_asyncio( | CODE |
| LOW | tests/test_ssl.py | 106 | async def test_run_ssl_context_factory_default( | CODE |
| LOW | tests/test_ssl.py | 133 | async def test_run_ssl_context_factory_custom( | CODE |
| LOW | tests/test_ssl.py | 159 | def test_ssl_context_factory_mutates_default( | CODE |
| LOW | tests/test_ssl.py | 182 | def test_default_ssl_context_factory_requires_ssl_certfile() -> None: | CODE |
| LOW | tests/test_ssl.py | 193 | def test_ssl_context_factory_must_return_ssl_context() -> None: | CODE |
| LOW | tests/test_ssl.py | 202 | def test_ssl_ciphers_applied_when_set( | CODE |
| LOW | tests/test_ssl.py | 216 | def test_is_ssl_true_when_only_factory_set() -> None: | CODE |
| LOW | tests/utils.py | 51 | def get_asyncio_default_loop_per_os() -> type[asyncio.AbstractEventLoop]: | CODE |
| LOW⚡ | tests/test_compat.py | 17 | def test_asyncio_run__default_loop_factory() -> None: | CODE |
| LOW⚡ | tests/test_compat.py | 21 | def test_asyncio_run__custom_loop_factory() -> None: | CODE |
| LOW⚡ | tests/test_compat.py | 25 | def test_asyncio_run__passing_a_non_awaitable_callback_should_throw_error() -> None: | CODE |
| LOW | tests/test_config.py | 30 | def mocked_logging_config_module(mocker: MockerFixture) -> MagicMock: | CODE |
| LOW | tests/test_config.py | 56 | def test_config_should_reload_is_set(app: ASGIApplication, expected_should_reload: bool) -> None: | CODE |
| LOW | tests/test_config.py | 62 | def test_should_warn_on_invalid_reload_configuration(tmp_path: Path, caplog: pytest.LogCaptureFixture) -> None: | CODE |
| LOW | tests/test_config.py | 91 | def test_non_existant_reload_dir_is_not_set(reload_directory_structure: Path, caplog: pytest.LogCaptureFixture) -> None: | CODE |
| LOW | tests/test_config.py | 102 | def test_reload_subdir_removal(reload_directory_structure: Path) -> None: | CODE |
| LOW | tests/test_config.py | 112 | def test_reload_included_dir_is_added_to_reload_dirs( | CODE |
| LOW | tests/test_config.py | 129 | def test_reload_dir_subdirectories_are_removed( | CODE |
| LOW | tests/test_config.py | 151 | def test_reload_excluded_subdirectories_are_removed( | CODE |
| LOW | tests/test_config.py | 168 | def test_reload_includes_exclude_dir_patterns_are_matched( | CODE |
| LOW | tests/test_config.py | 208 | def test_app_unimportable_module() -> None: | CODE |
| LOW | tests/test_config.py | 214 | def test_app_unimportable_other(caplog: pytest.LogCaptureFixture) -> None: | CODE |
| LOW | tests/test_config.py | 369 | def test_log_config_yaml_missing_pyyaml(mocked_logging_config_module: MagicMock, mocker: MockerFixture) -> None: | CODE |
| LOW | tests/test_config.py | 476 | def test_config_log_effective_level(log_level: int, uvicorn_logger_level: int) -> None: | CODE |
| LOW | tests/test_config.py | 495 | def test_config_log_level_case_insensitive(log_level: str) -> None: | CODE |
| LOW | tests/test_config.py | 502 | def test_ws_websockets_emits_deprecation_warning() -> None: | CODE |
| LOW | tests/test_config.py | 530 | def test_bind_unix_socket_works_with_reload_or_workers( | CODE |
| LOW | tests/test_config.py | 551 | def test_bind_fd_works_with_reload_or_workers(reload: bool, workers: int): # pragma: py-win32 | CODE |
| LOW | tests/test_config.py | 586 | def test_bind_stdin_works_with_reload_or_workers( | CODE |
| LOW | tests/test_config.py | 608 | def test_config_use_subprocess(reload: bool, workers: int, expected: bool): | CODE |
| LOW | tests/test_config.py | 614 | def test_warn_when_using_reload_and_workers(caplog: pytest.LogCaptureFixture) -> None: | CODE |
| LOW | tests/test_config.py | 639 | def test_custom_loop__importable_custom_loop_setup_function() -> None: | CODE |
| LOW | tests/test_config.py | 651 | def test_custom_loop__not_importable_custom_loop_setup_function(caplog: pytest.LogCaptureFixture) -> None: | CODE |
| LOW | tests/test_config.py | 665 | def test_setup_event_loop_is_removed(caplog: pytest.LogCaptureFixture) -> None: | CODE |
| LOW | tests/test_lifespan.py | 92 | def test_lifespan_auto_with_error(): | CODE |
| LOW | tests/test_lifespan.py | 110 | def test_lifespan_on_with_error(): | CODE |
| LOW | tests/test_lifespan.py | 131 | def test_lifespan_with_failed_startup(mode, raise_exception, caplog): | CODE |
| LOW | tests/test_lifespan.py | 210 | def test_lifespan_with_failed_shutdown(mode, raise_exception, caplog): | CODE |
| LOW | tests/test_cli.py | 80 | def test_cli_call_change_reload_run() -> None: | CODE |
| LOW | tests/test_cli.py | 92 | def test_cli_call_multiprocess_run() -> None: | CODE |
| LOW | tests/test_cli.py | 128 | def test_cli_incomplete_app_parameter() -> None: | CODE |
| LOW | tests/test_cli.py | 164 | def test_ignore_environment_variable_when_set_on_cli(): | CODE |
| LOW | tests/test_cli.py | 195 | def test_set_app_via_environment_variable(): | CODE |
| LOW | tests/test_main.py | 80 | def test_run_invalid_app_config_combination(caplog: pytest.LogCaptureFixture) -> None: | CODE |
| LOW | tests/test_main.py | 91 | def test_run_fails_fast_in_parent_on_bad_app_path( | CODE |
| LOW | tests/test_main.py | 111 | def test_run_skips_eager_app_import_with_workers(monkeypatch: pytest.MonkeyPatch) -> None: | CODE |
| 133 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/conftest.py | 1 | CODE | |
| LOW | tests/test_subprocess.py | 1 | CODE | |
| LOW | tests/test_server.py | 1 | CODE | |
| LOW | tests/test_ssl.py | 1 | CODE | |
| LOW | tests/utils.py | 1 | CODE | |
| LOW | tests/test_compat.py | 1 | CODE | |
| LOW | tests/test_config.py | 1 | CODE | |
| LOW | tests/custom_loop_utils.py | 1 | CODE | |
| LOW | tests/test_default_headers.py | 1 | CODE | |
| LOW | tests/middleware/test_logging.py | 1 | CODE | |
| LOW | tests/middleware/test_logging.py | 22 | CODE | |
| LOW | tests/middleware/test_logging.py | 23 | CODE | |
| LOW | tests/middleware/test_proxy_headers.py | 1 | CODE | |
| LOW | tests/middleware/test_wsgi.py | 1 | CODE | |
| LOW | tests/importer/circular_import_b.py | 2 | CODE | |
| LOW | tests/importer/circular_import_a.py | 2 | CODE | |
| LOW | tests/importer/raise_import_error.py | 5 | CODE | |
| LOW | tests/supervisors/test_multiprocess.py | 1 | CODE | |
| LOW | tests/supervisors/test_reload.py | 1 | CODE | |
| LOW | tests/benchmarks/ws.py | 1 | CODE | |
| LOW | tests/benchmarks/test_http.py | 1 | CODE | |
| LOW | tests/benchmarks/http.py | 1 | CODE | |
| LOW | tests/benchmarks/test_ws.py | 1 | CODE | |
| LOW | tests/protocols/test_utils.py | 1 | CODE | |
| LOW | tests/protocols/test_websocket.py | 1 | CODE | |
| LOW | tests/protocols/test_websocket.py | 39 | CODE | |
| LOW | tests/protocols/test_websocket.py | 40 | CODE | |
| LOW | tests/protocols/test_http.py | 1 | CODE | |
| LOW | uvicorn/logging.py | 1 | CODE | |
| LOW | uvicorn/_types.py | 31 | CODE | |
| LOW | uvicorn/server.py | 1 | CODE | |
| LOW | uvicorn/_ansi.py | 1 | CODE | |
| LOW | uvicorn/config.py | 1 | CODE | |
| LOW | uvicorn/_subprocess.py | 6 | CODE | |
| LOW | uvicorn/__init__.py | 1 | CODE | |
| LOW | uvicorn/__init__.py | 2 | CODE | |
| LOW | uvicorn/__init__.py | 2 | CODE | |
| LOW | uvicorn/__init__.py | 2 | CODE | |
| LOW | uvicorn/workers.py | 1 | CODE | |
| LOW | uvicorn/_compat.py | 1 | CODE | |
| LOW | uvicorn/_compat.py | 11 | CODE | |
| LOW | uvicorn/_compat.py | 13 | CODE | |
| LOW | uvicorn/main.py | 1 | CODE | |
| LOW | uvicorn/middleware/asgi2.py | 1 | CODE | |
| LOW | uvicorn/middleware/asgi2.py | 1 | CODE | |
| LOW | uvicorn/middleware/asgi2.py | 1 | CODE | |
| LOW | uvicorn/middleware/asgi2.py | 1 | CODE | |
| LOW | uvicorn/middleware/proxy_headers.py | 1 | CODE | |
| LOW | uvicorn/middleware/message_logger.py | 4 | CODE | |
| LOW | uvicorn/middleware/message_logger.py | 4 | CODE | |
| LOW | uvicorn/middleware/message_logger.py | 4 | CODE | |
| LOW | uvicorn/middleware/message_logger.py | 4 | CODE | |
| LOW | uvicorn/middleware/message_logger.py | 4 | CODE | |
| LOW | uvicorn/middleware/message_logger.py | 4 | CODE | |
| LOW | uvicorn/middleware/wsgi.py | 1 | CODE | |
| LOW | uvicorn/supervisors/statreload.py | 1 | CODE | |
| LOW | uvicorn/supervisors/__init__.py | 1 | CODE | |
| LOW | uvicorn/supervisors/__init__.py | 6 | CODE | |
| LOW | uvicorn/supervisors/watchfilesreload.py | 1 | CODE | |
| LOW | uvicorn/supervisors/basereload.py | 1 | CODE | |
| 18 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | uvicorn/protocols/websockets/wsproto_impl.py | 0 | called by the transport when the write buffer exceeds the high water mark. | STRING |
| HIGH | uvicorn/protocols/http/h11_impl.py | 0 | called by the transport when the write buffer exceeds the high water mark. | STRING |
| HIGH | uvicorn/protocols/http/httptools_impl.py | 0 | called by the transport when the write buffer exceeds the high water mark. | STRING |
| HIGH | uvicorn/protocols/websockets/wsproto_impl.py | 0 | called by the transport when the write buffer drops below the low water mark. | STRING |
| HIGH | uvicorn/protocols/http/h11_impl.py | 0 | called by the transport when the write buffer drops below the low water mark. | STRING |
| HIGH | uvicorn/protocols/http/httptools_impl.py | 0 | called by the transport when the write buffer drops below the low water mark. | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/conftest.py | 182 | CODE | |
| LOW | tests/test_server.py | 90 | CODE | |
| LOW | tests/test_server.py | 95 | CODE | |
| LOW | tests/supervisors/test_reload.py | 71 | CODE | |
| LOW | tests/protocols/test_websocket.py | 456 | CODE | |
| LOW | tests/protocols/test_websocket.py | 492 | CODE | |
| LOW | tests/protocols/test_websocket.py | 463 | CODE | |
| LOW | tests/protocols/test_websocket.py | 495 | CODE | |
| LOW | uvicorn/server.py | 103 | CODE | |
| LOW | uvicorn/config.py | 146 | CODE | |
| LOW | uvicorn/config.py | 191 | CODE | |
| LOW | uvicorn/config.py | 380 | CODE | |
| LOW | uvicorn/middleware/proxy_headers.py | 28 | CODE | |
| LOW | uvicorn/middleware/proxy_headers.py | 108 | CODE | |
| LOW | uvicorn/supervisors/watchfilesreload.py | 37 | CODE | |
| LOW | uvicorn/lifespan/on.py | 102 | CODE | |
| LOW | uvicorn/protocols/websockets/websockets_sansio_impl.py | 160 | CODE | |
| LOW | uvicorn/protocols/websockets/websockets_sansio_impl.py | 372 | CODE | |
| LOW | uvicorn/protocols/websockets/websockets_impl.py | 267 | CODE | |
| LOW | uvicorn/protocols/websockets/wsproto_impl.py | 168 | CODE | |
| LOW | uvicorn/protocols/websockets/wsproto_impl.py | 352 | CODE | |
| LOW | uvicorn/protocols/http/h11_impl.py | 178 | CODE | |
| LOW | uvicorn/protocols/http/h11_impl.py | 414 | CODE | |
| LOW | uvicorn/protocols/http/httptools_impl.py | 420 | CODE | |
| LOW | uvicorn/protocols/http/httptools_impl.py | 463 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | tests/middleware/test_proxy_headers.py | 80 | ## ----------------------------- | COMMENT |
| MEDIUM | tests/middleware/test_proxy_headers.py | 117 | ## ----------------------------- | COMMENT |
| MEDIUM | tests/middleware/test_proxy_headers.py | 157 | ## ----------------------------- | COMMENT |
| MEDIUM | tests/middleware/test_proxy_headers.py | 194 | ## ----------------------------- | COMMENT |
| MEDIUM | tests/middleware/test_proxy_headers.py | 231 | ## ----------------------------- | COMMENT |
| MEDIUM | tests/middleware/test_proxy_headers.py | 268 | ## ----------------------------- | COMMENT |
| MEDIUM | tests/middleware/test_proxy_headers.py | 305 | ## ----------------------------- | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/benchmarks/http.py | 109 | def set_protocol(self, protocol: asyncio.Protocol) -> None: | CODE |
| LOW | uvicorn/__init__.py | 5 | __all__ = ["main", "run", "Config", "Server"] | CODE |
| LOW | uvicorn/_compat.py | 8 | __all__ = ["asyncio_run", "iscoroutinefunction"] | CODE |
| LOW | uvicorn/supervisors/__init__.py | 16 | __all__ = ["Multiprocess", "ChangeReload"] | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | uvicorn/server.py | 155 | # Create a socket using UNIX domain socket. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/test_main.py | 36 | except Exception: # pragma: no cover | CODE |
| LOW | tests/protocols/test_websocket.py | 1076 | except Exception as exc: | CODE |
| LOW | tests/protocols/test_http.py | 957 | except Exception: # pragma: no cover | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | uvicorn/config.py | 191 | CODE | |
| LOW | uvicorn/main.py | 494 | CODE |