Python CLI utility and library for manipulating SQLite databases
This report presents the forensic synthetic code analysis of simonw/sqlite-utils, a Python project with 2,161 GitHub stars. SynthScan v2.0 examined 28,919 lines of code across 84 source files, recording 595 pattern matches distributed across 11 syntactic categories. The overall adjusted score of 16.7 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 595 distinct pattern matches across 11 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 | sqlite_utils/db.py | 126 | def _column_definition_with_comments( | STRING |
| LOW | sqlite_utils/db.py | 359 | def _iter_complete_sql_statements(sql: str) -> Generator[str, None, None]: | STRING |
| LOW | sqlite_utils/db.py | 1230 | def _ensure_no_open_transaction(self, operation: str) -> None: | STRING |
| LOW | sqlite_utils/db.py | 1387 | def _resolve_foreign_key_casing( | STRING |
| LOW | sqlite_utils/db.py | 4305 | def build_insert_queries_and_params( | STRING |
| LOW | sqlite_utils/create_table_parser.py | 832 | def check_references_identifier(expression: str, identifier: str) -> bool: | CODE |
| LOW | sqlite_utils/cli.py | 1061 | def insert_upsert_implementation( | STRING |
| LOW | sqlite_utils/cli.py | 2944 | def yield_paths_and_relative_paths(): | STRING |
| LOW | sqlite_utils/cli.py | 3469 | def _compatible_migration_set(obj): | CODE |
| LOW | sqlite_utils/cli.py | 3508 | def _stop_before_for_migration_set(stop_before, migration_set_name): | CODE |
| LOW | sqlite_utils/cli.py | 3779 | def _maybe_register_functions(db, functions_list): | CODE |
| LOW | sqlite_utils/utils.py | 87 | def maximize_csv_field_size_limit() -> None: | CODE |
| LOW | tests/test_conversions.py | 7 | def test_insert_all_conversion(fresh_db): | CODE |
| LOW | tests/test_conversions.py | 23 | def test_upsert_all_conversion(fresh_db): | CODE |
| LOW | tests/test_conversions.py | 38 | def test_table_constructor_conversion(fresh_db): | CODE |
| LOW | tests/test_default_value.py | 41 | def test_insert_empty_record_uses_default_values(fresh_db): | CODE |
| LOW | tests/test_enable_counts.py | 7 | def test_enable_counts_specific_table(fresh_db): | CODE |
| LOW | tests/test_enable_counts.py | 59 | def test_enable_counts_all_tables(fresh_db): | CODE |
| LOW | tests/test_enable_counts.py | 128 | def test_uses_counts_after_enable_counts(counts_db_path): | CODE |
| LOW | tests/test_utils.py | 58 | def test_maximize_csv_field_size_limit(): | CODE |
| LOW | tests/test_transform.py | 124 | def test_transform_sql_table_with_primary_key( | CODE |
| LOW | tests/test_transform.py | 205 | def test_transform_sql_table_with_no_primary_key( | CODE |
| LOW | tests/test_transform.py | 232 | def test_transform_sql_with_no_primary_key_to_primary_key_of_id(fresh_db): | CODE |
| LOW | tests/test_transform.py | 257 | def test_transform_preserves_keyword_literal_defaults(fresh_db): | CODE |
| LOW | tests/test_transform.py | 301 | def test_transform_remove_a_not_null(fresh_db): | CODE |
| LOW | tests/test_transform.py | 312 | def test_transform_add_not_null_with_rename(fresh_db, not_null): | CODE |
| LOW | tests/test_transform.py | 332 | def test_transform_defaults_and_rename_column(fresh_db): | CODE |
| LOW | tests/test_transform.py | 365 | def test_transform_foreign_keys_persist(authors_db): | CODE |
| LOW | tests/test_transform.py | 380 | def test_transform_foreign_keys_survive_renamed_column( | CODE |
| LOW | tests/test_transform.py | 396 | def _add_country_city_continent(db): | CODE |
| LOW | tests/test_transform.py | 412 | def test_transform_drop_foreign_keys(fresh_db, use_pragma_foreign_keys): | CODE |
| LOW | tests/test_transform.py | 445 | def test_transform_verify_foreign_keys(fresh_db): | CODE |
| LOW | tests/test_transform.py | 464 | def test_transform_on_delete_cascade_does_not_delete_records( | CODE |
| LOW | tests/test_transform.py | 503 | def test_transform_in_transaction_refuses_destructive_on_delete(fresh_db, on_delete): | STRING |
| LOW | tests/test_transform.py | 535 | def test_transform_in_transaction_refuses_self_referential_cascade(fresh_db): | STRING |
| LOW | tests/test_transform.py | 558 | def test_transform_in_transaction_allowed_with_no_action_foreign_key(fresh_db): | STRING |
| LOW | tests/test_transform.py | 585 | def test_transform_in_transaction_allowed_for_child_table(fresh_db): | STRING |
| LOW | tests/test_transform.py | 608 | def test_transform_in_transaction_allowed_with_foreign_keys_off(fresh_db): | STRING |
| LOW | tests/test_transform.py | 630 | def test_transform_add_foreign_keys_from_scratch(fresh_db): | STRING |
| LOW | tests/test_transform.py | 676 | def test_transform_add_foreign_keys_from_partial(fresh_db, add_foreign_keys): | STRING |
| LOW | tests/test_transform.py | 716 | def test_transform_replace_foreign_keys(fresh_db, foreign_keys): | STRING |
| LOW | tests/test_transform.py | 737 | def test_transform_preserves_rowids(fresh_db, table_type): | STRING |
| LOW | tests/test_transform.py | 787 | def test_transform_to_strict_with_invalid_data(fresh_db): | STRING |
| LOW | tests/test_transform.py | 802 | def test_transform_strict_updates_default(fresh_db): | STRING |
| LOW | tests/test_transform.py | 816 | def test_transform_to_strict_not_supported(fresh_db, method_name): | STRING |
| LOW | tests/test_transform.py | 827 | def test_transform_preserves_any_column_in_strict_table(fresh_db): | STRING |
| LOW | tests/test_transform.py | 858 | def test_transform_any_column_from_strict_to_non_strict(fresh_db): | STRING |
| LOW | tests/test_transform.py | 918 | def test_transform_retains_indexes_with_foreign_keys(fresh_db): | STRING |
| LOW | tests/test_transform.py | 946 | def test_transform_with_indexes_errors(fresh_db): | STRING |
| LOW | tests/test_transform.py | 967 | def test_transform_rename_column_with_index(fresh_db, table_name, index_name): | STRING |
| LOW | tests/test_transform.py | 988 | def test_transform_recreates_renamed_index_from_metadata(fresh_db): | STRING |
| LOW | tests/test_transform.py | 1018 | def test_transform_rename_complex_index_errors(fresh_db, index_sql): | STRING |
| LOW | tests/test_transform.py | 1030 | def test_transform_with_unique_constraint_implicit_index(fresh_db): | STRING |
| LOW | tests/test_transform.py | 1049 | def test_transform_preserves_composite_unique_constraint(fresh_db): | STRING |
| LOW | tests/test_transform.py | 1076 | def test_transform_preserves_column_unique_collation(fresh_db): | STRING |
| LOW | tests/test_transform.py | 1093 | def test_transform_drops_entire_composite_unique_constraint(fresh_db): | STRING |
| LOW | tests/test_transform.py | 1110 | def test_transform_preserves_autoincrement_and_sequence(fresh_db): | STRING |
| LOW | tests/test_transform.py | 1138 | def test_transform_empty_string_to_null_for_numeric_types( | STRING |
| LOW | tests/test_transform.py | 1158 | def test_transform_preserves_view(fresh_db): | STRING |
| LOW | tests/test_transform.py | 1182 | def test_transform_variants_preserve_view(fresh_db, transform_params): | STRING |
| 461 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | sqlite_utils/db.py | 508 | CODE | |
| LOW | sqlite_utils/db.py | 569 | CODE | |
| LOW | sqlite_utils/db.py | 1290 | CODE | |
| LOW | sqlite_utils/db.py | 1429 | CODE | |
| LOW | sqlite_utils/db.py | 1849 | CODE | |
| LOW | sqlite_utils/db.py | 2643 | CODE | |
| LOW | sqlite_utils/db.py | 2773 | CODE | |
| LOW | sqlite_utils/db.py | 3256 | CODE | |
| LOW | sqlite_utils/db.py | 3389 | CODE | |
| LOW | sqlite_utils/db.py | 4255 | CODE | |
| LOW | sqlite_utils/db.py | 4305 | CODE | |
| LOW | sqlite_utils/db.py | 4520 | CODE | |
| LOW | sqlite_utils/db.py | 4673 | CODE | |
| LOW | sqlite_utils/db.py | 5299 | CODE | |
| LOW | sqlite_utils/db.py | 2933 | CODE | |
| LOW | sqlite_utils/create_table_parser.py | 233 | CODE | |
| LOW | sqlite_utils/create_table_parser.py | 308 | CODE | |
| LOW | sqlite_utils/create_table_parser.py | 322 | CODE | |
| LOW | sqlite_utils/cli.py | 1061 | CODE | |
| LOW | sqlite_utils/cli.py | 2105 | CODE | |
| LOW | sqlite_utils/cli.py | 2263 | CODE | |
| LOW | sqlite_utils/cli.py | 2906 | CODE | |
| LOW | sqlite_utils/cli.py | 3742 | CODE | |
| LOW | sqlite_utils/cli.py | 2944 | CODE | |
| LOW | sqlite_utils/utils.py | 140 | CODE | |
| LOW | sqlite_utils/utils.py | 263 | CODE | |
| LOW | sqlite_utils/utils.py | 288 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | sqlite_utils/db.py | 1082 | # default into a string ('TRUE' instead of 1, 'NULL' instead of null). | STRING |
| HIGH | sqlite_utils/db.py | 5353 | # Optimization - if all rows are null, don't run this query | STRING |
| HIGH | tests/test_extracts.py | 71 | # Null values should stay null, not be extracted into the lookup table | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | sqlite_utils/db.py | 546 | # Create an in-memory database: | COMMENT |
| MEDIUM | sqlite_utils/db.py | 2201 | # This method is defined on Queryable so it serves views too, which | STRING |
| MEDIUM | tests/test_transform.py | 1032 | # Create a table with a UNIQUE constraint on 'name', which creates an implicit index | STRING |
| MEDIUM | tests/test_cli.py | 916 | # Create a temporary file with function definitions | STRING |
| MEDIUM | tests/test_m2m.py | 164 | # Create a candidate | COMMENT |
| MEDIUM | docs/conf.py | 6 | # This file is execfile()d with the current directory set to its | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | sqlite_utils/db.py | 569 | CODE | |
| LOW | sqlite_utils/db.py | 1429 | CODE | |
| LOW | sqlite_utils/db.py | 1700 | CODE | |
| LOW | sqlite_utils/db.py | 2285 | CODE | |
| LOW | sqlite_utils/db.py | 2540 | CODE | |
| LOW | sqlite_utils/db.py | 2643 | CODE | |
| LOW | sqlite_utils/db.py | 2773 | CODE | |
| LOW | sqlite_utils/db.py | 4018 | CODE | |
| LOW | sqlite_utils/db.py | 4604 | CODE | |
| LOW | sqlite_utils/db.py | 4673 | CODE | |
| LOW | sqlite_utils/db.py | 5031 | CODE | |
| LOW | sqlite_utils/db.py | 5069 | CODE | |
| LOW | sqlite_utils/db.py | 5117 | CODE | |
| LOW | sqlite_utils/cli.py | 1061 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | sqlite_utils/__init__.py | 1 | CODE | |
| LOW | sqlite_utils/__init__.py | 2 | CODE | |
| LOW | sqlite_utils/__init__.py | 2 | CODE | |
| LOW | sqlite_utils/__init__.py | 3 | CODE | |
| LOW | sqlite_utils/__init__.py | 4 | CODE | |
| LOW | sqlite_utils/__init__.py | 4 | CODE | |
| LOW | sqlite_utils/recipes.py | 1 | CODE | |
| LOW | sqlite_utils/migrations.py | 7 | CODE | |
| LOW | sqlite_utils/migrations.py | 7 | CODE | |
| LOW | tests/test_register_function.py | 2 | CODE | |
| LOW | tests/test_register_function.py | 3 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | sqlite_utils/db.py | 968 | except Exception: | STRING |
| LOW | sqlite_utils/cli.py | 1148 | except Exception as e: | STRING |
| LOW | sqlite_utils/cli.py | 3320 | except Exception as ex: # noqa: BLE001 | STRING |
| MEDIUM | sqlite_utils/cli.py | 3317 | def wrapped_fn(value): | CODE |
| LOW | sqlite_utils/utils.py | 545 | except Exception: # noqa: BLE001, S110 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | sqlite_utils/db.py | 4784 | # Check if this is list mode or dict mode | STRING |
| LOW | sqlite_utils/cli.py | 3760 | # Check if this is a file path | COMMENT |
| LOW | sqlite_utils/utils.py | 539 | # Check if code is a direct callable reference | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | docs/conf.py | 1 | import inspect | COMMENT |
| LOW | docs/conf.py | 181 | # | COMMENT |
| LOW | .github/workflows/codeql-analysis.yml | 41 | # If you wish to specify custom queries, you can do so here or in a config file. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | sqlite_utils/__init__.py | 6 | __all__ = [ | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | sqlite_utils/db.py | 5369 | # No need to run the query if it will just return the results in reverse order | STRING |