SQL databases in Python, designed for simplicity, compatibility, and robustness.
This report presents the forensic synthetic code analysis of fastapi/sqlmodel, a Python project with 18,188 GitHub stars. SynthScan v2.0 examined 37,766 lines of code across 427 source files, recording 224 pattern matches distributed across 8 syntactic categories. The overall adjusted score of 4.2 places this repository in the Likely human-written 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 224 distinct pattern matches across 8 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/test_future_annotations.py | 1 | CODE | |
| LOW | …utorial/code_structure/tutorial002_py310/team_model.py | 6 | CODE | |
| LOW | …utorial/code_structure/tutorial002_py310/hero_model.py | 6 | CODE | |
| LOW | sqlmodel/__init__.py | 4 | CODE | |
| LOW | sqlmodel/__init__.py | 5 | CODE | |
| LOW | sqlmodel/__init__.py | 6 | CODE | |
| LOW | sqlmodel/__init__.py | 7 | CODE | |
| LOW | sqlmodel/__init__.py | 8 | CODE | |
| LOW | sqlmodel/__init__.py | 9 | CODE | |
| LOW | sqlmodel/__init__.py | 10 | CODE | |
| LOW | sqlmodel/__init__.py | 11 | CODE | |
| LOW | sqlmodel/__init__.py | 12 | CODE | |
| LOW | sqlmodel/__init__.py | 13 | CODE | |
| LOW | sqlmodel/__init__.py | 14 | CODE | |
| LOW | sqlmodel/__init__.py | 15 | CODE | |
| LOW | sqlmodel/__init__.py | 16 | CODE | |
| LOW | sqlmodel/__init__.py | 17 | CODE | |
| LOW | sqlmodel/__init__.py | 18 | CODE | |
| LOW | sqlmodel/__init__.py | 19 | CODE | |
| LOW | sqlmodel/__init__.py | 20 | CODE | |
| LOW | sqlmodel/__init__.py | 21 | CODE | |
| LOW | sqlmodel/__init__.py | 22 | CODE | |
| LOW | sqlmodel/__init__.py | 23 | CODE | |
| LOW | sqlmodel/__init__.py | 24 | CODE | |
| LOW | sqlmodel/__init__.py | 25 | CODE | |
| LOW | sqlmodel/__init__.py | 26 | CODE | |
| LOW | sqlmodel/__init__.py | 27 | CODE | |
| LOW | sqlmodel/__init__.py | 28 | CODE | |
| LOW | sqlmodel/__init__.py | 29 | CODE | |
| LOW | sqlmodel/__init__.py | 32 | CODE | |
| LOW | sqlmodel/__init__.py | 33 | CODE | |
| LOW | sqlmodel/__init__.py | 36 | CODE | |
| LOW | sqlmodel/__init__.py | 37 | CODE | |
| LOW | sqlmodel/__init__.py | 38 | CODE | |
| LOW | sqlmodel/__init__.py | 39 | CODE | |
| LOW | sqlmodel/__init__.py | 40 | CODE | |
| LOW | sqlmodel/__init__.py | 41 | CODE | |
| LOW | sqlmodel/__init__.py | 42 | CODE | |
| LOW | sqlmodel/__init__.py | 43 | CODE | |
| LOW | sqlmodel/__init__.py | 44 | CODE | |
| LOW | sqlmodel/__init__.py | 45 | CODE | |
| LOW | sqlmodel/__init__.py | 46 | CODE | |
| LOW | sqlmodel/__init__.py | 47 | CODE | |
| LOW | sqlmodel/__init__.py | 48 | CODE | |
| LOW | sqlmodel/__init__.py | 49 | CODE | |
| LOW | sqlmodel/__init__.py | 50 | CODE | |
| LOW | sqlmodel/__init__.py | 51 | CODE | |
| LOW | sqlmodel/__init__.py | 52 | CODE | |
| LOW | sqlmodel/__init__.py | 53 | CODE | |
| LOW | sqlmodel/__init__.py | 54 | CODE | |
| LOW | sqlmodel/__init__.py | 55 | CODE | |
| LOW | sqlmodel/__init__.py | 56 | CODE | |
| LOW | sqlmodel/__init__.py | 57 | CODE | |
| LOW | sqlmodel/__init__.py | 58 | CODE | |
| LOW | sqlmodel/__init__.py | 59 | CODE | |
| LOW | sqlmodel/__init__.py | 60 | CODE | |
| LOW | sqlmodel/__init__.py | 61 | CODE | |
| LOW | sqlmodel/__init__.py | 62 | CODE | |
| LOW | sqlmodel/__init__.py | 63 | CODE | |
| LOW | sqlmodel/__init__.py | 64 | CODE | |
| 88 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/conftest.py | 54 | def get_testing_print_function( | CODE |
| LOW | tests/test_future_annotations.py | 8 | def test_model_with_future_annotations(clear_sqlmodel): | CODE |
| LOW | tests/test_future_annotations.py | 36 | def test_model_with_string_annotations(clear_sqlmodel): | CODE |
| LOW | tests/test_prepare_release.py | 42 | def test_update_version_file_requires_newer_version() -> None: | CODE |
| LOW | tests/test_prepare_release.py | 49 | def test_update_release_notes() -> None: | CODE |
| LOW | tests/test_prepare_release.py | 90 | def test_update_release_notes_rejects_existing_version() -> None: | STRING |
| LOW | tests/test_prepare_release.py | 104 | def test_get_release_notes_body_with_dated_heading() -> None: | STRING |
| LOW | tests/test_prepare_release.py | 133 | def test_get_release_notes_body_with_plain_heading() -> None: | STRING |
| LOW | tests/test_prepare_release.py | 171 | def test_get_release_notes_body_requires_version_section() -> None: | STRING |
| LOW | tests/test_prepare_release.py | 178 | def test_get_release_notes_body_requires_non_empty_section() -> None: | STRING |
| LOW | tests/test_prepare_release.py | 194 | def test_cli_updates_configured_files(tmp_path: Path) -> None: | STRING |
| LOW | tests/test_prepare_release.py | 230 | def test_cli_accepts_env_vars(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None: | STRING |
| LOW | tests/test_prepare_release.py | 250 | def test_cli_prints_current_version(tmp_path: Path) -> None: | STRING |
| LOW | tests/test_prepare_release.py | 268 | def test_cli_prints_release_notes(tmp_path: Path) -> None: | STRING |
| LOW | tests/test_deprecations.py | 13 | def test_deprecated_from_orm_inheritance(): | CODE |
| LOW | tests/test_deprecations.py | 21 | def test_deprecated_parse_obj(): | CODE |
| LOW | tests/test_nullable.py | 81 | def test_non_nullable_optional_field_with_no_default_set(clear_sqlmodel, caplog): | CODE |
| LOW | tests/test_nullable.py | 108 | def test_nullable_primary_key(clear_sqlmodel, caplog): | CODE |
| LOW | tests/test_ondelete_raises.py | 7 | def test_ondelete_requires_nullable(clear_sqlmodel: Any) -> None: | CODE |
| LOW | tests/test_ondelete_raises.py | 29 | def test_ondelete_requires_foreign_key(clear_sqlmodel: Any) -> None: | CODE |
| LOW | tests/test_aliases.py | 29 | def test_create_with_field_name(model: type[PydanticUser] | type[SQLModelUser]): | CODE |
| LOW | tests/test_aliases.py | 35 | def test_create_with_field_name_with_config( | CODE |
| LOW | tests/test_aliases.py | 57 | def test_create_with_both_prefers_alias( | CODE |
| LOW | tests/test_aliases.py | 65 | def test_dict_default_uses_field_names( | CODE |
| LOW | tests/test_aliases.py | 76 | def test_dict_by_alias_uses_aliases( | CODE |
| LOW | tests/test_aliases.py | 105 | def test_create_with_validation_alias( | CODE |
| LOW | tests/test_aliases.py | 113 | def test_serialize_with_serialization_alias( | CODE |
| LOW | tests/test_field_sa_relationship.py | 6 | def test_sa_relationship_no_args() -> None: | CODE |
| LOW | tests/test_field_sa_relationship.py | 30 | def test_sa_relationship_no_kwargs() -> None: | CODE |
| LOW | tests/test_field_sa_column.py | 8 | def test_sa_column_takes_precedence() -> None: | CODE |
| LOW | tests/test_field_sa_column.py | 20 | def test_sa_column_with_annotated_metadata() -> None: | CODE |
| LOW | tests/test_field_sa_column.py | 31 | def test_sa_column_no_sa_args() -> None: | CODE |
| LOW | tests/test_field_sa_column.py | 42 | def test_sa_column_no_sa_kargs() -> None: | CODE |
| LOW | tests/test_field_sa_column.py | 64 | def test_sa_column_no_primary_key() -> None: | CODE |
| LOW | tests/test_field_sa_column.py | 75 | def test_sa_column_no_nullable() -> None: | CODE |
| LOW | tests/test_field_sa_column.py | 86 | def test_sa_column_no_foreign_key() -> None: | CODE |
| LOW | tests/test_field_sa_column.py | 124 | def test_sa_column_no_ondelete() -> None: | CODE |
| LOW | tests/test_main.py | 9 | def test_should_allow_duplicate_row_if_unique_constraint_is_not_passed(clear_sqlmodel): | CODE |
| LOW | tests/test_main.py | 39 | def test_should_allow_duplicate_row_if_unique_constraint_is_false(clear_sqlmodel): | CODE |
| LOW | tests/test_main.py | 69 | def test_should_raise_exception_when_try_to_duplicate_row_if_unique_constraint_is_true( | CODE |
| LOW | tests/test_main.py | 96 | def test_sa_relationship_property(clear_sqlmodel): | CODE |
| LOW | tests/test_main.py | 130 | def test_composite_primary_key(clear_sqlmodel): | CODE |
| LOW | tests/test_main.py | 156 | def test_composite_primary_key_and_validator(clear_sqlmodel): | CODE |
| LOW | tests/test_main.py | 191 | def test_foreign_key_ondelete_with_annotated(clear_sqlmodel): | CODE |
| LOW | tests/test_annotated_uuid.py | 6 | def test_annotated_optional_types(clear_sqlmodel) -> None: | CODE |
| LOW | tests/test_instance_no_args.py | 6 | def test_allow_instantiation_without_arguments(clear_sqlmodel): | CODE |
| LOW | tests/test_instance_no_args.py | 26 | def test_not_allow_instantiation_without_arguments_if_not_table(): | CODE |
| LOW | tests/test_pydantic/test_model_dump.py | 23 | def test_polymorphic_serialization( | CODE |
| LOW | scripts/docs.py | 150 | def generate_docs_src_versions_for_file(file_path: Path) -> None: | STRING |
| LOW | scripts/docs.py | 211 | def generate_docs_src_versions() -> None: | STRING |
| LOW | …i/app_testing/tutorial001_py310/test_extra_coverage.py | 31 | def test_update_hero_not_found(client: TestClient): | CODE |
| LOW | …i/app_testing/tutorial001_py310/test_extra_coverage.py | 36 | def test_delete_hero_not_found(client: TestClient): | CODE |
| LOW | …ial/fastapi/app_testing/tutorial001_py310/test_main.py | 43 | def test_create_hero_incomplete(client: TestClient): | CODE |
| LOW | sqlmodel/_compat.py | 94 | def init_pydantic_private_attrs(new_object: InstanceOrType["SQLModel"]) -> None: | CODE |
| LOW | sqlmodel/_compat.py | 174 | def get_sa_type_from_type_annotation(annotation: Any) -> Any: | CODE |
| LOW | sqlmodel/main.py | 217 | def _get_sqlmodel_field_metadata(field_info: Any) -> FieldInfoMetadata | None: | CODE |
| LOW | sqlmodel/main.py | 226 | def _get_sqlmodel_field_value( | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/conftest.py | 54 | CODE | |
| LOW | tests/conftest.py | 57 | CODE | |
| LOW | scripts/docs.py | 150 | CODE | |
| LOW | scripts/docs.py | 277 | CODE | |
| LOW | sqlmodel/_compat.py | 122 | CODE | |
| LOW | sqlmodel/_compat.py | 208 | CODE | |
| LOW | sqlmodel/main.py | 627 | CODE | |
| LOW | sqlmodel/main.py | 985 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/conftest.py | 51 | CODE | |
| LOW | sqlmodel/main.py | 237 | CODE | |
| LOW | sqlmodel/main.py | 280 | CODE | |
| LOW | sqlmodel/main.py | 332 | CODE | |
| LOW | sqlmodel/main.py | 365 | CODE | |
| LOW | sqlmodel/main.py | 890 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/test_select_typing.py | 61 | # assert type(hero_5[3]) in [int, type(None)] | COMMENT |
| LOW | sqlmodel/main.py | 821 | # in the Pydantic model so that when SQLAlchemy sets attributes that are | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/test_fields_set.py | 9 | email: str = "test@test.com" | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | scripts/docs.py | 253 | def update_docs_includes_py39_to_py310() -> None: | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | scripts/docs.py | 314 | # Check if the _an counterpart (or non-_an counterpart) is referenced. | STRING |