Repository Analysis

Kludex/uvicorn

An ASGI web server, for Python. 🦄

19.3 Moderate AI signal View on GitHub

Analysis Overview

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).

19.3
Adjusted Score
19.3
Raw Score
100%
Time Factor
2026-07-09
Last Push
10.8K
Stars
Python
Language
18.4K
Lines of Code
109
Files
319
Pattern Hits
2026-07-14
Scan Date
0.06
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

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.

Severity Breakdown

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.

CRITICAL 0HIGH 6MEDIUM 8LOW 305

Directory Score Breakdown

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.

Pattern Findings

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.

Hyper-Verbose Identifiers193 hits · 194 pts
SeverityFileLineSnippetContext
LOWtests/conftest.py42def tls_certificate_authority() -> trustme.CA:CODE
LOWtests/conftest.py58def tls_ca_certificate_pem_path(tls_certificate_authority: trustme.CA):CODE
LOWtests/conftest.py64def tls_ca_certificate_private_key_path(tls_certificate_authority: trustme.CA):CODE
LOWtests/conftest.py70def tls_certificate_private_key_encrypted_path(tls_certificate):CODE
LOWtests/conftest.py86def tls_certificate_private_key_path(tls_certificate: trustme.CA):CODE
LOWtests/conftest.py92def tls_certificate_key_and_chain_path(tls_certificate: trustme.LeafCert):CODE
LOWtests/conftest.py98def tls_certificate_server_cert_path(tls_certificate: trustme.LeafCert):CODE
LOWtests/conftest.py111def reload_directory_structure(tmp_path_factory: pytest.TempPathFactory):CODE
LOWtests/test_server.py90async def test_shutdown_on_early_exit_during_startup(unused_tcp_port: int):CODE
LOWtests/test_server.py125def test_run_exits_with_startup_failure_on_unloadable_app() -> None:CODE
LOWtests/test_server.py140async def test_request_than_limit_max_requests_warn_log(CODE
LOWtests/test_server.py153async def test_limit_max_requests_jitter(CODE
LOWtests/test_server.py206async def test_contextvars_preserved_by_default(CODE
LOWtests/test_server.py229async def test_reset_contextvars_asyncio(CODE
LOWtests/test_ssl.py106async def test_run_ssl_context_factory_default(CODE
LOWtests/test_ssl.py133async def test_run_ssl_context_factory_custom(CODE
LOWtests/test_ssl.py159def test_ssl_context_factory_mutates_default(CODE
LOWtests/test_ssl.py182def test_default_ssl_context_factory_requires_ssl_certfile() -> None:CODE
LOWtests/test_ssl.py193def test_ssl_context_factory_must_return_ssl_context() -> None:CODE
LOWtests/test_ssl.py202def test_ssl_ciphers_applied_when_set(CODE
LOWtests/test_ssl.py216def test_is_ssl_true_when_only_factory_set() -> None:CODE
LOWtests/utils.py51def get_asyncio_default_loop_per_os() -> type[asyncio.AbstractEventLoop]:CODE
LOWtests/test_compat.py17def test_asyncio_run__default_loop_factory() -> None:CODE
LOWtests/test_compat.py21def test_asyncio_run__custom_loop_factory() -> None:CODE
LOWtests/test_compat.py25def test_asyncio_run__passing_a_non_awaitable_callback_should_throw_error() -> None:CODE
LOWtests/test_config.py30def mocked_logging_config_module(mocker: MockerFixture) -> MagicMock:CODE
LOWtests/test_config.py56def test_config_should_reload_is_set(app: ASGIApplication, expected_should_reload: bool) -> None:CODE
LOWtests/test_config.py62def test_should_warn_on_invalid_reload_configuration(tmp_path: Path, caplog: pytest.LogCaptureFixture) -> None:CODE
LOWtests/test_config.py91def test_non_existant_reload_dir_is_not_set(reload_directory_structure: Path, caplog: pytest.LogCaptureFixture) -> None:CODE
LOWtests/test_config.py102def test_reload_subdir_removal(reload_directory_structure: Path) -> None:CODE
LOWtests/test_config.py112def test_reload_included_dir_is_added_to_reload_dirs(CODE
LOWtests/test_config.py129def test_reload_dir_subdirectories_are_removed(CODE
LOWtests/test_config.py151def test_reload_excluded_subdirectories_are_removed(CODE
LOWtests/test_config.py168def test_reload_includes_exclude_dir_patterns_are_matched(CODE
LOWtests/test_config.py208def test_app_unimportable_module() -> None:CODE
LOWtests/test_config.py214def test_app_unimportable_other(caplog: pytest.LogCaptureFixture) -> None:CODE
LOWtests/test_config.py369def test_log_config_yaml_missing_pyyaml(mocked_logging_config_module: MagicMock, mocker: MockerFixture) -> None:CODE
LOWtests/test_config.py476def test_config_log_effective_level(log_level: int, uvicorn_logger_level: int) -> None:CODE
LOWtests/test_config.py495def test_config_log_level_case_insensitive(log_level: str) -> None:CODE
LOWtests/test_config.py502def test_ws_websockets_emits_deprecation_warning() -> None:CODE
LOWtests/test_config.py530def test_bind_unix_socket_works_with_reload_or_workers(CODE
LOWtests/test_config.py551def test_bind_fd_works_with_reload_or_workers(reload: bool, workers: int): # pragma: py-win32CODE
LOWtests/test_config.py586def test_bind_stdin_works_with_reload_or_workers(CODE
LOWtests/test_config.py608def test_config_use_subprocess(reload: bool, workers: int, expected: bool):CODE
LOWtests/test_config.py614def test_warn_when_using_reload_and_workers(caplog: pytest.LogCaptureFixture) -> None:CODE
LOWtests/test_config.py639def test_custom_loop__importable_custom_loop_setup_function() -> None:CODE
LOWtests/test_config.py651def test_custom_loop__not_importable_custom_loop_setup_function(caplog: pytest.LogCaptureFixture) -> None:CODE
LOWtests/test_config.py665def test_setup_event_loop_is_removed(caplog: pytest.LogCaptureFixture) -> None:CODE
LOWtests/test_lifespan.py92def test_lifespan_auto_with_error():CODE
LOWtests/test_lifespan.py110def test_lifespan_on_with_error():CODE
LOWtests/test_lifespan.py131def test_lifespan_with_failed_startup(mode, raise_exception, caplog):CODE
LOWtests/test_lifespan.py210def test_lifespan_with_failed_shutdown(mode, raise_exception, caplog):CODE
LOWtests/test_cli.py80def test_cli_call_change_reload_run() -> None:CODE
LOWtests/test_cli.py92def test_cli_call_multiprocess_run() -> None:CODE
LOWtests/test_cli.py128def test_cli_incomplete_app_parameter() -> None:CODE
LOWtests/test_cli.py164def test_ignore_environment_variable_when_set_on_cli():CODE
LOWtests/test_cli.py195def test_set_app_via_environment_variable():CODE
LOWtests/test_main.py80def test_run_invalid_app_config_combination(caplog: pytest.LogCaptureFixture) -> None:CODE
LOWtests/test_main.py91def test_run_fails_fast_in_parent_on_bad_app_path(CODE
LOWtests/test_main.py111def test_run_skips_eager_app_import_with_workers(monkeypatch: pytest.MonkeyPatch) -> None:CODE
133 more matches not shown…
Unused Imports78 hits · 76 pts
SeverityFileLineSnippetContext
LOWtests/conftest.py1CODE
LOWtests/test_subprocess.py1CODE
LOWtests/test_server.py1CODE
LOWtests/test_ssl.py1CODE
LOWtests/utils.py1CODE
LOWtests/test_compat.py1CODE
LOWtests/test_config.py1CODE
LOWtests/custom_loop_utils.py1CODE
LOWtests/test_default_headers.py1CODE
LOWtests/middleware/test_logging.py1CODE
LOWtests/middleware/test_logging.py22CODE
LOWtests/middleware/test_logging.py23CODE
LOWtests/middleware/test_proxy_headers.py1CODE
LOWtests/middleware/test_wsgi.py1CODE
LOWtests/importer/circular_import_b.py2CODE
LOWtests/importer/circular_import_a.py2CODE
LOWtests/importer/raise_import_error.py5CODE
LOWtests/supervisors/test_multiprocess.py1CODE
LOWtests/supervisors/test_reload.py1CODE
LOWtests/benchmarks/ws.py1CODE
LOWtests/benchmarks/test_http.py1CODE
LOWtests/benchmarks/http.py1CODE
LOWtests/benchmarks/test_ws.py1CODE
LOWtests/protocols/test_utils.py1CODE
LOWtests/protocols/test_websocket.py1CODE
LOWtests/protocols/test_websocket.py39CODE
LOWtests/protocols/test_websocket.py40CODE
LOWtests/protocols/test_http.py1CODE
LOWuvicorn/logging.py1CODE
LOWuvicorn/_types.py31CODE
LOWuvicorn/server.py1CODE
LOWuvicorn/_ansi.py1CODE
LOWuvicorn/config.py1CODE
LOWuvicorn/_subprocess.py6CODE
LOWuvicorn/__init__.py1CODE
LOWuvicorn/__init__.py2CODE
LOWuvicorn/__init__.py2CODE
LOWuvicorn/__init__.py2CODE
LOWuvicorn/workers.py1CODE
LOWuvicorn/_compat.py1CODE
LOWuvicorn/_compat.py11CODE
LOWuvicorn/_compat.py13CODE
LOWuvicorn/main.py1CODE
LOWuvicorn/middleware/asgi2.py1CODE
LOWuvicorn/middleware/asgi2.py1CODE
LOWuvicorn/middleware/asgi2.py1CODE
LOWuvicorn/middleware/asgi2.py1CODE
LOWuvicorn/middleware/proxy_headers.py1CODE
LOWuvicorn/middleware/message_logger.py4CODE
LOWuvicorn/middleware/message_logger.py4CODE
LOWuvicorn/middleware/message_logger.py4CODE
LOWuvicorn/middleware/message_logger.py4CODE
LOWuvicorn/middleware/message_logger.py4CODE
LOWuvicorn/middleware/message_logger.py4CODE
LOWuvicorn/middleware/wsgi.py1CODE
LOWuvicorn/supervisors/statreload.py1CODE
LOWuvicorn/supervisors/__init__.py1CODE
LOWuvicorn/supervisors/__init__.py6CODE
LOWuvicorn/supervisors/watchfilesreload.py1CODE
LOWuvicorn/supervisors/basereload.py1CODE
18 more matches not shown…
Cross-File Repetition6 hits · 30 pts
SeverityFileLineSnippetContext
HIGHuvicorn/protocols/websockets/wsproto_impl.py0called by the transport when the write buffer exceeds the high water mark.STRING
HIGHuvicorn/protocols/http/h11_impl.py0called by the transport when the write buffer exceeds the high water mark.STRING
HIGHuvicorn/protocols/http/httptools_impl.py0called by the transport when the write buffer exceeds the high water mark.STRING
HIGHuvicorn/protocols/websockets/wsproto_impl.py0called by the transport when the write buffer drops below the low water mark.STRING
HIGHuvicorn/protocols/http/h11_impl.py0called by the transport when the write buffer drops below the low water mark.STRING
HIGHuvicorn/protocols/http/httptools_impl.py0called by the transport when the write buffer drops below the low water mark.STRING
Deep Nesting25 hits · 23 pts
SeverityFileLineSnippetContext
LOWtests/conftest.py182CODE
LOWtests/test_server.py90CODE
LOWtests/test_server.py95CODE
LOWtests/supervisors/test_reload.py71CODE
LOWtests/protocols/test_websocket.py456CODE
LOWtests/protocols/test_websocket.py492CODE
LOWtests/protocols/test_websocket.py463CODE
LOWtests/protocols/test_websocket.py495CODE
LOWuvicorn/server.py103CODE
LOWuvicorn/config.py146CODE
LOWuvicorn/config.py191CODE
LOWuvicorn/config.py380CODE
LOWuvicorn/middleware/proxy_headers.py28CODE
LOWuvicorn/middleware/proxy_headers.py108CODE
LOWuvicorn/supervisors/watchfilesreload.py37CODE
LOWuvicorn/lifespan/on.py102CODE
LOWuvicorn/protocols/websockets/websockets_sansio_impl.py160CODE
LOWuvicorn/protocols/websockets/websockets_sansio_impl.py372CODE
LOWuvicorn/protocols/websockets/websockets_impl.py267CODE
LOWuvicorn/protocols/websockets/wsproto_impl.py168CODE
LOWuvicorn/protocols/websockets/wsproto_impl.py352CODE
LOWuvicorn/protocols/http/h11_impl.py178CODE
LOWuvicorn/protocols/http/h11_impl.py414CODE
LOWuvicorn/protocols/http/httptools_impl.py420CODE
LOWuvicorn/protocols/http/httptools_impl.py463CODE
Decorative Section Separators7 hits · 21 pts
SeverityFileLineSnippetContext
MEDIUMtests/middleware/test_proxy_headers.py80 ## -----------------------------COMMENT
MEDIUMtests/middleware/test_proxy_headers.py117 ## -----------------------------COMMENT
MEDIUMtests/middleware/test_proxy_headers.py157 ## -----------------------------COMMENT
MEDIUMtests/middleware/test_proxy_headers.py194 ## -----------------------------COMMENT
MEDIUMtests/middleware/test_proxy_headers.py231 ## -----------------------------COMMENT
MEDIUMtests/middleware/test_proxy_headers.py268 ## -----------------------------COMMENT
MEDIUMtests/middleware/test_proxy_headers.py305 ## -----------------------------COMMENT
Modern Structural Boilerplate4 hits · 4 pts
SeverityFileLineSnippetContext
LOWtests/benchmarks/http.py109 def set_protocol(self, protocol: asyncio.Protocol) -> None:CODE
LOWuvicorn/__init__.py5__all__ = ["main", "run", "Config", "Server"]CODE
LOWuvicorn/_compat.py8__all__ = ["asyncio_run", "iscoroutinefunction"]CODE
LOWuvicorn/supervisors/__init__.py16__all__ = ["Multiprocess", "ChangeReload"]CODE
Self-Referential Comments1 hit · 3 pts
SeverityFileLineSnippetContext
MEDIUMuvicorn/server.py155 # Create a socket using UNIX domain socket.COMMENT
Excessive Try-Catch Wrapping3 hits · 2 pts
SeverityFileLineSnippetContext
LOWtests/test_main.py36 except Exception: # pragma: no coverCODE
LOWtests/protocols/test_websocket.py1076 except Exception as exc:CODE
LOWtests/protocols/test_http.py957 except Exception: # pragma: no coverCODE
AI Structural Patterns2 hits · 2 pts
SeverityFileLineSnippetContext
LOWuvicorn/config.py191CODE
LOWuvicorn/main.py494CODE