AI Slop Code RIsk Monitor

simonw/sqlite-utils

Python CLI utility and library for manipulating SQLite databases

18.1 Elevated pattern signal View on GitHub

Maintenance and Governance Review

This report summarizes scanner evidence for simonw/sqlite-utils, a Python project with 2,179 GitHub stars. SynthScan examined 28,993 lines of code across 84 source files, recording 606 pattern matches distributed across 12 syntactic categories. The legacy adjusted pattern signal is 18.1 (Elevated pattern signal); it is not an authorship estimate.

Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.

18.1
Adjusted Signal
18.1
Raw Pattern Score
100%
Time Factor
2026-10-11
Last Push
2.2K
Stars
Python
Language
29.0K
Lines of Code
84
Files
606
Pattern Hits
2026-10-12
Scan Date
0.13
HC Hit Rate

Risk Review · v3

Use each vector to guide manual verification of the underlying findings.

Cognitive Ownership Risk 54.4/100 · HIGH

Can maintainers explain intent, assumptions, and trade-offs? 578 finding(s).

Hallucinated Dependency & Supply Chain Risk 4.0/100 · LOW

Are imports declared and package/API names verified? 14 finding(s).

Agent Over-Engineering Ratio 54.7/100 · HIGH

Are wrappers, guards, and repeated structures necessary? 552 finding(s).

PR Review Velocity Impact 68.8/100 · HIGH

Which changes need focused human review? 606 finding(s).

What These Metrics Mean

Adjusted Signal
Legacy pattern score normalized per 1,000 scanned lines and multiplied by the repository-level time factor. It is not an estimate of AI authorship.
Raw Pattern Score
Sum of severity- and context-weighted pattern findings before applying the time factor.
Time Factor
A coarse multiplier based on repository last-push metadata. It does not identify when individual code was written.
Pattern Hits
Count of configured pattern findings. Review each location and surrounding code before acting.
HC Hit Rate
High- and critical-severity findings per scanned file. Severity is a configured detector weight, not proof of a vulnerability or authorship.
Lines / Files
Scan coverage denominators used by the legacy normalized score.

Pattern-Signal History

This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.

Severity Breakdown

Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.

CRITICAL 0HIGH 11MEDIUM 7LOW 588

Directory Score Breakdown

This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.

Pattern Findings

The scanner identified 606 distinct pattern matches across 12 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. 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 configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.

Hyper-Verbose Identifiers524 hits · 403 pts
SeverityFileLineSnippetContext
LOWsqlite_utils/db.py126def _column_definition_with_comments(STRING
LOWsqlite_utils/db.py359def _iter_complete_sql_statements(sql: str) -> Generator[str, None, None]:STRING
LOWsqlite_utils/db.py1230 def _ensure_no_open_transaction(self, operation: str) -> None:STRING
LOWsqlite_utils/db.py1387 def _resolve_foreign_key_casing(STRING
LOWsqlite_utils/db.py4305 def build_insert_queries_and_params(STRING
LOWsqlite_utils/create_table_parser.py832def check_references_identifier(expression: str, identifier: str) -> bool:CODE
LOWsqlite_utils/cli.py1061def insert_upsert_implementation(STRING
LOWsqlite_utils/cli.py2944 def yield_paths_and_relative_paths():STRING
LOWsqlite_utils/cli.py3469def _compatible_migration_set(obj):CODE
LOWsqlite_utils/cli.py3508def _stop_before_for_migration_set(stop_before, migration_set_name):CODE
LOWsqlite_utils/cli.py3779def _maybe_register_functions(db, functions_list):CODE
LOWsqlite_utils/utils.py87def maximize_csv_field_size_limit() -> None:CODE
LOWtests/test_conversions.py7def test_insert_all_conversion(fresh_db):CODE
LOWtests/test_conversions.py23def test_upsert_all_conversion(fresh_db):CODE
LOWtests/test_conversions.py38def test_table_constructor_conversion(fresh_db):CODE
LOWtests/test_default_value.py41def test_insert_empty_record_uses_default_values(fresh_db):CODE
LOWtests/test_enable_counts.py7def test_enable_counts_specific_table(fresh_db):CODE
LOWtests/test_enable_counts.py59def test_enable_counts_all_tables(fresh_db):CODE
LOWtests/test_enable_counts.py128def test_uses_counts_after_enable_counts(counts_db_path):CODE
LOWtests/test_utils.py58def test_maximize_csv_field_size_limit():CODE
LOWtests/test_transform.py124def test_transform_sql_table_with_primary_key(CODE
LOWtests/test_transform.py205def test_transform_sql_table_with_no_primary_key(CODE
LOWtests/test_transform.py232def test_transform_sql_with_no_primary_key_to_primary_key_of_id(fresh_db):CODE
LOWtests/test_transform.py257def test_transform_preserves_keyword_literal_defaults(fresh_db):CODE
LOWtests/test_transform.py301def test_transform_remove_a_not_null(fresh_db):CODE
LOWtests/test_transform.py312def test_transform_add_not_null_with_rename(fresh_db, not_null):CODE
LOWtests/test_transform.py332def test_transform_defaults_and_rename_column(fresh_db):CODE
LOWtests/test_transform.py365def test_transform_foreign_keys_persist(authors_db):CODE
LOWtests/test_transform.py380def test_transform_foreign_keys_survive_renamed_column(CODE
LOWtests/test_transform.py396def _add_country_city_continent(db):CODE
LOWtests/test_transform.py412def test_transform_drop_foreign_keys(fresh_db, use_pragma_foreign_keys):CODE
LOWtests/test_transform.py445def test_transform_verify_foreign_keys(fresh_db):CODE
LOWtests/test_transform.py464def test_transform_on_delete_cascade_does_not_delete_records(CODE
LOWtests/test_transform.py503def test_transform_in_transaction_refuses_destructive_on_delete(fresh_db, on_delete):STRING
LOWtests/test_transform.py535def test_transform_in_transaction_refuses_self_referential_cascade(fresh_db):STRING
LOWtests/test_transform.py558def test_transform_in_transaction_allowed_with_no_action_foreign_key(fresh_db):STRING
LOWtests/test_transform.py585def test_transform_in_transaction_allowed_for_child_table(fresh_db):STRING
LOWtests/test_transform.py608def test_transform_in_transaction_allowed_with_foreign_keys_off(fresh_db):STRING
LOWtests/test_transform.py630def test_transform_add_foreign_keys_from_scratch(fresh_db):STRING
LOWtests/test_transform.py676def test_transform_add_foreign_keys_from_partial(fresh_db, add_foreign_keys):STRING
LOWtests/test_transform.py716def test_transform_replace_foreign_keys(fresh_db, foreign_keys):STRING
LOWtests/test_transform.py737def test_transform_preserves_rowids(fresh_db, table_type):STRING
LOWtests/test_transform.py787def test_transform_to_strict_with_invalid_data(fresh_db):STRING
LOWtests/test_transform.py802def test_transform_strict_updates_default(fresh_db):STRING
LOWtests/test_transform.py816def test_transform_to_strict_not_supported(fresh_db, method_name):STRING
LOWtests/test_transform.py827def test_transform_preserves_any_column_in_strict_table(fresh_db):STRING
LOWtests/test_transform.py858def test_transform_any_column_from_strict_to_non_strict(fresh_db):STRING
LOWtests/test_transform.py918def test_transform_retains_indexes_with_foreign_keys(fresh_db):STRING
LOWtests/test_transform.py946def test_transform_with_indexes_errors(fresh_db):STRING
LOWtests/test_transform.py967def test_transform_rename_column_with_index(fresh_db, table_name, index_name):STRING
LOWtests/test_transform.py988def test_transform_recreates_renamed_index_from_metadata(fresh_db):STRING
LOWtests/test_transform.py1018def test_transform_rename_complex_index_errors(fresh_db, index_sql):STRING
LOWtests/test_transform.py1030def test_transform_with_unique_constraint_implicit_index(fresh_db):STRING
LOWtests/test_transform.py1049def test_transform_preserves_composite_unique_constraint(fresh_db):STRING
LOWtests/test_transform.py1076def test_transform_preserves_column_unique_collation(fresh_db):STRING
LOWtests/test_transform.py1093def test_transform_drops_entire_composite_unique_constraint(fresh_db):STRING
LOWtests/test_transform.py1110def test_transform_preserves_autoincrement_and_sequence(fresh_db):STRING
LOWtests/test_transform.py1138def test_transform_empty_string_to_null_for_numeric_types(STRING
LOWtests/test_transform.py1158def test_transform_preserves_view(fresh_db):STRING
LOWtests/test_transform.py1182def test_transform_variants_preserve_view(fresh_db, transform_params):STRING
464 more matches not shown…
Empty Error Handlers8 hits · 40 pts
SeverityFileLineSnippetContext
HIGHsqlite_utils/db.py426except AttributeError:CODE
HIGHsqlite_utils/db.py5545except ValueError:CODE
HIGHsqlite_utils/db.py836except sqlite3.NotSupportedError:CODE
HIGHsqlite_utils/cli.py75except sqlite3.Error:CODE
HIGHsqlite_utils/utils.py540except (AttributeError, SyntaxError, NameError, KeyError, TypeError):CODE
HIGHsqlite_utils/utils.py549except Exception: # noqa: BLE001, S110CODE
HIGHtests/conftest.py59except sqlite3.Error:CODE
HIGHtests/test_rows.py137except sqlite3.OperationalError:CODE
Deep Nesting27 hits · 23 pts
SeverityFileLineSnippetContext
LOWsqlite_utils/db.py508CODE
LOWsqlite_utils/db.py569CODE
LOWsqlite_utils/db.py1290CODE
LOWsqlite_utils/db.py1429CODE
LOWsqlite_utils/db.py1849CODE
LOWsqlite_utils/db.py2643CODE
LOWsqlite_utils/db.py2773CODE
LOWsqlite_utils/db.py3256CODE
LOWsqlite_utils/db.py3389CODE
LOWsqlite_utils/db.py4255CODE
LOWsqlite_utils/db.py4305CODE
LOWsqlite_utils/db.py4520CODE
LOWsqlite_utils/db.py4673CODE
LOWsqlite_utils/db.py5299CODE
LOWsqlite_utils/db.py2933CODE
LOWsqlite_utils/create_table_parser.py233CODE
LOWsqlite_utils/create_table_parser.py308CODE
LOWsqlite_utils/create_table_parser.py322CODE
LOWsqlite_utils/cli.py1061CODE
LOWsqlite_utils/cli.py2105CODE
LOWsqlite_utils/cli.py2263CODE
LOWsqlite_utils/cli.py2906CODE
LOWsqlite_utils/cli.py3742CODE
LOWsqlite_utils/cli.py2944CODE
LOWsqlite_utils/utils.py140CODE
LOWsqlite_utils/utils.py263CODE
LOWsqlite_utils/utils.py288CODE
Cross-Language Confusion3 hits · 12 pts
SeverityFileLineSnippetContext
HIGHsqlite_utils/db.py1082 # default into a string ('TRUE' instead of 1, 'NULL' instead of null).STRING
HIGHsqlite_utils/db.py5353 # Optimization - if all rows are null, don't run this querySTRING
HIGHtests/test_extracts.py71 # Null values should stay null, not be extracted into the lookup tableCOMMENT
Self-Referential Comments6 hits · 12 pts
SeverityFileLineSnippetContext
MEDIUMsqlite_utils/db.py546 # Create an in-memory database:COMMENT
MEDIUMsqlite_utils/db.py2201 # This method is defined on Queryable so it serves views too, whichSTRING
MEDIUMtests/test_transform.py1032 # Create a table with a UNIQUE constraint on 'name', which creates an implicit indexSTRING
MEDIUMtests/test_cli.py916 # Create a temporary file with function definitionsSTRING
MEDIUMtests/test_m2m.py164 # Create a candidateCOMMENT
MEDIUMdocs/conf.py6# This file is execfile()d with the current directory set to itsCOMMENT
Unused Imports11 hits · 11 pts
SeverityFileLineSnippetContext
LOWsqlite_utils/__init__.py1CODE
LOWsqlite_utils/__init__.py2CODE
LOWsqlite_utils/__init__.py2CODE
LOWsqlite_utils/__init__.py3CODE
LOWsqlite_utils/__init__.py4CODE
LOWsqlite_utils/__init__.py4CODE
LOWsqlite_utils/recipes.py1CODE
LOWsqlite_utils/migrations.py7CODE
LOWsqlite_utils/migrations.py7CODE
LOWtests/test_register_function.py2CODE
LOWtests/test_register_function.py3CODE
AI Structural Patterns14 hits · 10 pts
SeverityFileLineSnippetContext
LOWsqlite_utils/db.py569CODE
LOWsqlite_utils/db.py1429CODE
LOWsqlite_utils/db.py1700CODE
LOWsqlite_utils/db.py2285CODE
LOWsqlite_utils/db.py2540CODE
LOWsqlite_utils/db.py2643CODE
LOWsqlite_utils/db.py2773CODE
LOWsqlite_utils/db.py4018CODE
LOWsqlite_utils/db.py4604CODE
LOWsqlite_utils/db.py4673CODE
LOWsqlite_utils/db.py5031CODE
LOWsqlite_utils/db.py5069CODE
LOWsqlite_utils/db.py5117CODE
LOWsqlite_utils/cli.py1061CODE
Excessive Try-Catch Wrapping5 hits · 4 pts
SeverityFileLineSnippetContext
LOWsqlite_utils/db.py968 except Exception:STRING
LOWsqlite_utils/cli.py1148 except Exception as e:STRING
LOWsqlite_utils/cli.py3320 except Exception as ex: # noqa: BLE001STRING
MEDIUMsqlite_utils/cli.py3317def wrapped_fn(value):CODE
LOWsqlite_utils/utils.py549 except Exception: # noqa: BLE001, S110CODE
Redundant / Tautological Comments3 hits · 3 pts
SeverityFileLineSnippetContext
LOWsqlite_utils/db.py4784 # Check if this is list mode or dict modeSTRING
LOWsqlite_utils/cli.py3760 # Check if this is a file pathCOMMENT
LOWsqlite_utils/utils.py543 # Check if code is a direct callable referenceCOMMENT
Over-Commented Block3 hits · 3 pts
SeverityFileLineSnippetContext
LOWdocs/conf.py1import inspectCOMMENT
LOWdocs/conf.py181 #COMMENT
LOW.github/workflows/codeql-analysis.yml41 # If you wish to specify custom queries, you can do so here or in a config file.COMMENT
Modern Structural Boilerplate1 hit · 1 pts
SeverityFileLineSnippetContext
LOWsqlite_utils/__init__.py6__all__ = [CODE
AI Slop Vocabulary1 hit · 0 pts
SeverityFileLineSnippetContext
LOWsqlite_utils/db.py5369 # No need to run the query if it will just return the results in reverse orderSTRING