AI Slop Code RIsk Monitor

dbcli/pgcli

Postgres CLI with autocompletion and syntax highlighting

30.2 High pattern signal View on GitHub

Maintenance and Governance Review

This report summarizes scanner evidence for dbcli/pgcli, a Python project with 13,414 GitHub stars. SynthScan examined 16,884 lines of code across 93 source files, recording 446 pattern matches distributed across 11 syntactic categories. The legacy adjusted pattern signal is 30.2 (High 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.

30.2
Adjusted Signal
30.2
Raw Pattern Score
100%
Time Factor
2026-09-20
Last Push
13.4K
Stars
Python
Language
16.9K
Lines of Code
93
Files
446
Pattern Hits
2026-10-12
Scan Date
0.16
HC Hit Rate

Risk Review · v3

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

Cognitive Ownership Risk 70.7/100 · HIGH

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

Hallucinated Dependency & Supply Chain Risk 0.0/100 · LOW

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

Agent Over-Engineering Ratio 75.5/100 · CRITICAL

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

PR Review Velocity Impact 79.5/100 · CRITICAL

Which changes need focused human review? 446 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 15MEDIUM 7LOW 424

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 446 distinct pattern matches across 11 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 Identifiers383 hits · 378 pts
SeverityFileLineSnippetContext
LOWrelease.py56def get_merged_prs_since_last_tag():CODE
LOWrelease.py99def create_distribution_files():CODE
LOWrelease.py104def upload_distribution_files():CODE
LOWpgcli/pgcompleter.py612 def get_join_condition_matches(self, suggestion, word_before_cursor):CODE
LOWpgcli/pgcompleter.py709 def get_from_clause_item_matches(self, suggestion, word_before_cursor):CODE
LOWpgcli/pyev.py94 def calculate_planner_estimate(self, plan):CODE
LOWpgcli/pgtoolbar.py19def create_toolbar_tokens_func(pgcli):CODE
LOWpgcli/pgexecute.py27def remove_beginning_comments(command):CODE
LOWpgcli/main.py408 def register_special_commands(self):CODE
LOWpgcli/main.py1416 def _handle_server_closed_connection(self, text):CODE
LOWpgcli/main.py1450 def _on_completions_refreshed(self, new_completer, persist_priorities):CODE
LOWpgcli/main.py1999def obfuscate_process_password():CODE
LOWpgcli/main.py403 def _is_named_query_execution(self, text):STRING
LOWpgcli/main.py1027 def _check_ongoing_transaction_and_allow_quitting(self):STRING
LOWpgcli/packages/sqlcompletion.py185def _split_multiple_statements(full_text, text_before_cursor, parsed):CODE
LOWpgcli/packages/sqlcompletion.py304def suggest_based_on_last_token(token, stmt):CODE
LOWpgcli/packages/prompt_utils.py6def confirm_destructive_query(queries, keywords, alias, force=False):CODE
LOWpgcli/packages/parseutils/__init__.py23def query_is_unconditional_update(query):CODE
LOWpgcli/packages/parseutils/__init__.py56def parse_destructive_warning(warning_level):CODE
LOWpgcli/packages/parseutils/tables.py75def extract_table_identifiers(token_stream, allow_functions=True):CODE
LOW⚡tests/test_pgexecute.py509def test_multiple_queries_same_line(executor):CODE
LOW⚡tests/test_pgexecute.py517def test_multiple_queries_with_special_command_same_line(executor, pgspecial):CODE
LOW⚡tests/test_pgexecute.py526def test_multiple_queries_same_line_syntaxerror(executor, exception_formatter):CODE
LOW⚡tests/test_pgexecute.py542def test_special_command_help(executor, pgspecial):CODE
LOW⚡tests/test_pgexecute.py549def test_bytea_field_support_in_output(executor):CODE
LOW⚡tests/test_pgexecute.py557def test_unicode_support_in_unknown_type(executor):CODE
LOW⚡tests/test_pgexecute.py562def test_unicode_support_in_enum_type(executor):CODE
LOW⚡tests/test_pgexecute.py570def test_json_renders_without_u_prefix(executor, expanded):CODE
LOW⚡tests/test_pgexecute.py579def test_jsonb_renders_without_u_prefix(executor, expanded):CODE
LOWtests/test_pgexecute.py74def test_bools_are_treated_as_strings(executor):CODE
LOWtests/test_pgexecute.py98def test_schemata_table_views_and_columns_query(executor):CODE
LOWtests/test_pgexecute.py227def test_invalid_syntax_verbose(executor):CODE
LOWtests/test_pgexecute.py277def test_execute_from_file_no_arg(executor, pgspecial):CODE
LOWtests/test_pgexecute.py288def test_execute_from_file_io_error(os, executor, pgspecial):CODE
LOWtests/test_pgexecute.py302def test_execute_from_commented_file_that_executes_another_file(executor, pgspecial, tmpdir):CODE
LOWtests/test_pgexecute.py320def test_execute_commented_first_line_and_special(executor, pgspecial, tmpdir):CODE
LOWtests/test_pgexecute.py418def test_execute_commented_first_line_and_normal(executor, pgspecial, tmpdir):CODE
LOWtests/test_pgexecute.py609def test_large_numbers_render_directly(executor, value):CODE
LOWtests/test_pgexecute.py628def test_raises_with_no_formatter(executor, sql):CODE
LOWtests/test_pgexecute.py655def test_nonexistent_function_definition(executor):CODE
LOWtests/test_pgexecute.py677def test_function_notice_order(executor):CODE
LOWtests/test_pgexecute.py722def test_nonexistent_view_definition(executor):CODE
LOWtests/test_pgexecute.py759def test_explain_mode_does_not_wrap_special_command(executor):CODE
LOWtests/test_pgexecute.py784def test_explain_mode_runs_describe_as_special(executor, pgspecial):CODE
LOWtests/test_pgexecute.py794def test_explain_mode_wraps_normal_sql(executor, pgspecial):CODE
LOWtests/test_pgexecute.py815def test_exit_without_active_connection(executor):CODE
LOWtests/test_pgexecute.py258def test_unicode_support_in_output(executor, expanded):STRING
LOWtests/test_ssh_tunnel.py14def mock_ssh_tunnel_forwarder() -> MagicMock:CODE
LOWtests/test_ssh_tunnel.py110def test_ssh_tunnel_preserves_original_host_for_pgpass(mock_ssh_tunnel_forwarder: MagicMock, mock_pgexecute: MagicMock) CODE
LOWtests/test_ssh_tunnel.py123def test_ssh_tunnel_with_dsn_preserves_host(mock_ssh_tunnel_forwarder: MagicMock, mock_pgexecute: MagicMock) -> None:CODE
LOWtests/test_ssh_tunnel.py137def test_no_ssh_tunnel_does_not_set_hostaddr(mock_pgexecute: MagicMock) -> None:CODE
LOWtests/test_rowlimit.py95def test_row_limit_on_non_select(over_limit):CODE
LOWtests/metadata.py112 def columns_functions_and_keywords(self, tbl, parent="public", typ="tables", pos=0):CODE
LOWtests/metadata.py118 def schemas_and_from_clause_items(self, parent="public", pos=0):CODE
LOW⚡tests/test_tuples_only.py8def test_tuples_only_flag_passed_to_pgcli():CODE
LOW⚡tests/test_tuples_only.py17def test_tuples_only_long_form():CODE
LOW⚡tests/test_tuples_only.py26def test_tuples_only_not_set_by_default():CODE
LOW⚡tests/test_tuples_only.py35def test_tuples_only_leaves_the_configured_table_format_alone():CODE
LOW⚡tests/test_tuples_only.py40def test_tuples_only_turns_off_timing():CODE
LOW⚡tests/test_tuples_only.py45def test_tuples_only_prints_rows_only():CODE
323 more matches not shown…
Empty Error Handlers8 hits · 40 pts
SeverityFileLineSnippetContext
HIGHpgcli/magic.py54except SystemExit:CODE
HIGHpgcli/pgexecute.py281except ValueError:CODE
HIGHpgcli/pgexecute.py413except special.CommandNotFound:CODE
HIGHpgcli/main.py994except KeyboardInterrupt:CODE
HIGHpgcli/main.py1853except Exception:CODE
HIGHpgcli/packages/sqlcompletion.py458except ValueError:CODE
HIGHtests/utils.py51except Exception:CODE
HIGHtests/features/steps/basic_commands.py237except pexpect.TIMEOUT:CODE
Cross-File Repetition7 hits · 35 pts
SeverityFileLineSnippetContext
HIGHtests/features/steps/crud_database.py0steps for behavioral style tests are defined in this module. each step is defined by the string decorating it. this striSTRING
HIGHtests/features/steps/named_queries.py0steps for behavioral style tests are defined in this module. each step is defined by the string decorating it. this striSTRING
HIGHtests/features/steps/crud_table.py0steps for behavioral style tests are defined in this module. each step is defined by the string decorating it. this striSTRING
HIGHtests/features/steps/basic_commands.py0steps for behavioral style tests are defined in this module. each step is defined by the string decorating it. this striSTRING
HIGHtests/features/steps/pgbouncer.py0steps for behavioral style tests are defined in this module. each step is defined by the string decorating it. this striSTRING
HIGHtests/features/steps/specials.py0steps for behavioral style tests are defined in this module. each step is defined by the string decorating it. this striSTRING
HIGHtests/features/steps/expanded.py0steps for behavioral style tests are defined in this module. each step is defined by the string decorating it. this striSTRING
Excessive Try-Catch Wrapping19 hits · 19 pts
SeverityFileLineSnippetContext
LOWpgcli/auth.py39 except Exception as e:CODE
LOWpgcli/auth.py51 except Exception as e:CODE
MEDIUMpgcli/auth.py48def keyring_set_password(key, passwd):CODE
MEDIUMpgcli/main.py526def change_table_format(self, pattern, **_):CODE
LOWpgcli/main.py808 except Exception as e:CODE
LOWpgcli/main.py865 except Exception as e: # Connecting to a database could fail.CODE
LOWpgcli/main.py1786 except Exception:CODE
LOWpgcli/main.py1853 except Exception:CODE
LOWpgcli/main.py1869 except Exception:CODE
LOWpgcli/main.py1974 except Exception:CODE
LOWpgcli/main.py2016 except Exception:CODE
LOWpgcli/main.py2028 except Exception:CODE
LOWpgcli/main.py952 except Exception as e:STRING
LOWpgcli/main.py1073 except Exception as e:STRING
LOWpgcli/main.py1102 except Exception as e:STRING
LOWtests/utils.py30except Exception:CODE
LOWtests/utils.py51 except Exception:CODE
LOWtests/features/environment.py198 except Exception as x:CODE
LOWtests/features/db_utils.py48 except Exception:CODE
Self-Referential Comments5 hits · 15 pts
SeverityFileLineSnippetContext
MEDIUMpgcli/completion_refresher.py55 # Create a new pgexecute method to populate the completions.COMMENT
MEDIUMtests/test_main.py868 # Create a new named query (editor returns SQL, no error).COMMENT
MEDIUMtests/test_init_commands_simple.py54 # Create a temporary config file with init-commandsCOMMENT
MEDIUMtests/test_init_commands_simple.py72 # Create a temporary config file with init-commandsCOMMENT
MEDIUMtests/features/steps/file_option.py14 # Create a temporary file that will be cleaned up automaticallyCOMMENT
Deep Nesting15 hits · 13 pts
SeverityFileLineSnippetContext
LOWpgcli/pgcompleter.py892CODE
LOWpgcli/pyev.py159CODE
LOWpgcli/pgexecute.py320CODE
LOWpgcli/main.py1723CODE
LOWpgcli/main.py2123CODE
LOWpgcli/main.py873CODE
LOWpgcli/main.py911CODE
LOWpgcli/main.py1057CODE
LOWpgcli/main.py1458CODE
LOWpgcli/packages/sqlcompletion.py229CODE
LOWpgcli/packages/sqlcompletion.py304CODE
LOWpgcli/packages/formatter/sqlformatter.py26CODE
LOWpgcli/packages/parseutils/tables.py36CODE
LOWpgcli/packages/parseutils/tables.py75CODE
LOWpgcli/packages/parseutils/meta.py24CODE
Redundant / Tautological Comments3 hits · 3 pts
SeverityFileLineSnippetContext
LOWpgcli/main.py734 # Check if DSN contains a password - if so, don't use PGPASSWORDCOMMENT
LOWpgcli/main.py1012 # Check if we need to update completions, in order of mostSTRING
LOWtests/test_completion_refresher.py91 # Set refreshers to 0: we're not testing refresh logic hereCOMMENT
Over-Commented Block2 hits · 2 pts
SeverityFileLineSnippetContext
LOWpgcli/packages/sqlcompletion.py341 return (Keyword(), Special())COMMENT
LOWpgcli/packages/parseutils/tables.py141 # abc is the table name, but if we don't stop at the first lparen, thenCOMMENT
Slop Phrases1 hit · 2 pts
SeverityFileLineSnippetContext
LOWpgcli/main.py249 # make sure to use self.config_writer, not self.configCOMMENT
AI Structural Patterns2 hits · 2 pts
SeverityFileLineSnippetContext
LOWpgcli/main.py216CODE
LOWtests/test_pgexecute.py14CODE
Modern Structural Boilerplate1 hit · 1 pts
SeverityFileLineSnippetContext
LOWpgcli/pgstyle.py10logger = logging.getLogger(__name__)CODE