AI Slop Code RIsk Monitor

patroni/patroni

A template for PostgreSQL High Availability with Etcd, Consul, ZooKeeper, or Kubernetes

25.3 Elevated pattern signal View on GitHub

Maintenance and Governance Review

This report summarizes scanner evidence for patroni/patroni, a Python project with 8,777 GitHub stars. SynthScan examined 56,544 lines of code across 158 source files, recording 1108 pattern matches distributed across 14 syntactic categories. The legacy adjusted pattern signal is 25.3 (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.

25.3
Adjusted Signal
25.3
Raw Pattern Score
100%
Time Factor
2026-10-07
Last Push
8.8K
Stars
Python
Language
56.5K
Lines of Code
158
Files
1.1K
Pattern Hits
2026-10-12
Scan Date
0.57
HC Hit Rate

Risk Review · v3

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

Cognitive Ownership Risk 38.6/100 · MEDIUM

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

Hallucinated Dependency & Supply Chain Risk 20.6/100 · LOW

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

Agent Over-Engineering Ratio 59.3/100 · HIGH

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

PR Review Velocity Impact 77.1/100 · CRITICAL

Which changes need focused human review? 1108 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 14HIGH 76MEDIUM 27LOW 991

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 1108 distinct pattern matches across 14 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 Identifiers474 hits · 398 pts
SeverityFileLineSnippetContext
LOWpatroni/validator.py169def validate_standby_cluster_port(port: Any) -> bool:CODE
LOWpatroni/validator.py210def comma_separated_host_port(string: str) -> bool:CODE
LOWpatroni/validator.py222def validate_host_port_listen(host_port: str) -> bool:CODE
LOWpatroni/validator.py235def validate_host_port_listen_multiple_hosts(host_port: str) -> bool:CODE
LOWpatroni/validator.py1000def validate_synchronous_mode(value: Any) -> None:CODE
LOWpatroni/ha.py318 def quorum_commit_mode_is_active(self) -> bool:CODE
LOWpatroni/ha.py325 def _get_failover_action_name(self) -> str:CODE
LOWpatroni/ha.py601 def _handle_rewind_or_reinitialize(self) -> Optional[str]:CODE
LOWpatroni/ha.py833 def _maybe_enable_synchronous_mode(self) -> Optional[SyncState]:CODE
LOWpatroni/ha.py851 def disable_synchronous_replication(self) -> None:CODE
LOWpatroni/ha.py870 def _handle_synchronous_strict_mode(self, dcs_state: SyncState, replication_state: Any) -> bool:CODE
LOWpatroni/ha.py923 def _process_quorum_replication(self) -> None:CODE
LOWpatroni/ha.py987 def _process_multisync_replication(self) -> None:CODE
LOWpatroni/ha.py1064 def _process_multisync_prepromote(self) -> bool:CODE
LOWpatroni/ha.py1095 def _process_quorum_prepromote(self) -> None:CODE
LOWpatroni/ha.py1115 def process_sync_replication_prepromote(self) -> bool:CODE
LOWpatroni/ha.py1198 def enforce_follow_remote_member(self, message: str) -> str:CODE
LOWpatroni/ha.py1558 def manual_failover_process_no_leader(self) -> Optional[bool]:CODE
LOWpatroni/ha.py1714 def release_leader_key_voluntarily(self, last_lsn: Optional[int] = None) -> None:CODE
LOWpatroni/ha.py1833 def should_run_scheduled_action(self, action_name: str, scheduled_at: Optional[datetime.datetime],CODE
LOWpatroni/ha.py1868 def process_manual_failover_from_leader(self) -> Optional[str]:CODE
LOWpatroni/ha.py1908 def process_unhealthy_cluster(self) -> str:CODE
LOWpatroni/ha.py2022 def evaluate_scheduled_restart(self) -> Optional[str]:CODE
LOWpatroni/ha.py2176 def handle_long_action_in_progress(self) -> str:CODE
LOW⚡patroni/config.py273 def __get_and_maybe_adjust_int_value(self, config: Dict[str, Any], param: str, min_value: int) -> int:CODE
LOWpatroni/config.py293 def _validate_and_adjust_timeouts(self, config: Dict[str, Any]) -> None:CODE
LOWpatroni/config.py334 def set_dynamic_configuration(self, configuration: Union[ClusterConfig, Dict[str, Any]]) -> bool:CODE
LOWpatroni/config.py360 def reload_local_configuration(self) -> Optional[bool]:CODE
LOWpatroni/config.py384 def _process_postgresql_parameters(parameters: Any, is_local: bool = False) -> Dict[str, Any]:CODE
LOWpatroni/config.py435 def _safe_copy_dynamic_configuration(self, dynamic_configuration: Dict[str, Any]) -> Dict[str, Any]:CODE
LOWpatroni/config.py481 def _build_environment_configuration() -> Dict[str, Any]:CODE
LOWpatroni/config.py714 def _build_effective_configuration(self, dynamic_configuration: Dict[str, Any],CODE
LOWpatroni/config.py833 def build_effective_postgresql_configuration(self, role: PostgresqlRole) -> Dict[str, Any]:CODE
LOWpatroni/config.py877 def _validate_contradictory_tags(self) -> None:CODE
LOWpatroni/log.py130 def _try_to_report_lost_records(self) -> None:CODE
LOWpatroni/global_config.py39 def _cluster_has_valid_config(cluster: Optional['Cluster']) -> bool:CODE
LOWpatroni/global_config.py120 def is_synchronous_mode_strict(self) -> bool:CODE
LOWpatroni/global_config.py124 def get_standby_cluster_config(self) -> Any:CODE
LOWpatroni/global_config.py253 def manage_synchronized_standby_slots_enabled(self) -> bool:CODE
LOWpatroni/file_perm.py76 def set_permissions_from_data_directory(self, data_dir: str) -> None:CODE
LOWpatroni/ctl.py586def get_all_members_leader_first(cluster: Cluster) -> Iterator[Member]:CODE
LOWpatroni/ctl.py1255def _do_failover_or_switchover(action: str, cluster_name: str, group: Optional[int], site: Optional[str],CODE
LOWpatroni/ctl.py1854def wait_until_pause_is_applied(dcs: AbstractDCS, paused: bool, old_cluster: Cluster) -> None:CODE
LOWpatroni/ctl.py2040def format_config_for_editing(data: Any, default_flow_style: bool = False) -> str:CODE
LOWpatroni/quorum.py255 def __handle_non_steady_cases(self) -> Iterator[Transition]:CODE
LOWpatroni/quorum.py375 def __handle_replication_factor_change(self) -> Iterator[Transition]:CODE
LOWpatroni/utils.py323def convert_int_from_base_unit(base_value: int, base_unit: Optional[str]) -> Optional[str]:CODE
LOWpatroni/utils.py367def convert_real_from_base_unit(base_value: float, base_unit: Optional[str]) -> Optional[str]:CODE
LOWpatroni/utils.py411def maybe_convert_from_base_unit(base_value: str, vartype: str, base_unit: Optional[str]) -> str:CODE
LOWpatroni/config_generator.py329 def _get_bin_dir_from_running_instance(self) -> str:CODE
LOWpatroni/config_generator.py468 def _enrich_config_from_running_instance(self) -> None:CODE
LOWpatroni/__main__.py117 def apply_dynamic_configuration(self, cluster: 'Cluster') -> None:CODE
LOWpatroni/postgresql/validator.py235def _get_postgres_guc_validators(config: Dict[str, Any], parameter: str) -> Tuple[_Transformable, ...]:CODE
LOWpatroni/postgresql/validator.py261def _read_postgres_gucs_validators_file(file: PathLikeObj) -> Dict[str, Any]:CODE
LOWpatroni/postgresql/validator.py280def _load_postgres_gucs_validators() -> None:CODE
LOWpatroni/postgresql/validator.py413def _transform_parameter_value(validators: MutableMapping[str, Tuple[_Transformable, ...]],CODE
LOWpatroni/postgresql/validator.py446def transform_postgresql_parameter_value(version: int, name: str, value: Any,CODE
LOWpatroni/postgresql/validator.py473def transform_recovery_parameter_value(version: int, name: str, value: Any,CODE
LOWpatroni/postgresql/bootstrap.py33 def keep_existing_recovery_conf(self) -> bool:CODE
LOWpatroni/postgresql/sync.py304 def _handle_synchronous_standby_names_change(self) -> None:CODE
414 more matches not shown…
Excessive Try-Catch Wrapping240 hits · 256 pts
SeverityFileLineSnippetContext
LOWsetup.py145 except Exception:CODE
MEDIUMsetup.py142def run(self):CODE
LOWpatroni/validator.py189 except Exception:CODE
LOWpatroni/validator.py262 except Exception:CODE
LOWpatroni/validator.py279 except Exception:CODE
LOWpatroni/validator.py744 except Exception as e:CODE
MEDIUMpatroni/ha.py357def acquire_lock(self) -> bool:CODE
LOWpatroni/ha.py362 except Exception:CODE
LOWpatroni/ha.py398 except Exception:CODE
LOWpatroni/ha.py404 except Exception:CODE
LOWpatroni/ha.py445 except Exception as e:CODE
LOWpatroni/ha.py510 except Exception:CODE
LOWpatroni/ha.py1271 except Exception as e:CODE
LOWpatroni/ha.py1315 except Exception as e:CODE
LOWpatroni/ha.py1354 except Exception:CODE
LOWpatroni/ha.py1815 except Exception:CODE
LOWpatroni/ha.py2325 except Exception as exc1:CODE
LOWpatroni/ha.py2332 except Exception as exc2:CODE
LOWpatroni/ha.py2551 except Exception:CODE
LOWpatroni/raft_controller.py23 except Exception:CODE
MEDIUMpatroni/raft_controller.py20def _run_cycle(self) -> None:CODE
LOW⚡patroni/config.py260 except Exception:CODE
LOW⚡patroni/config.py265 except Exception:CODE
LOW⚡patroni/config.py270 except Exception:CODE
LOWpatroni/config.py239 except Exception:CODE
LOWpatroni/config.py356 except Exception:CODE
LOWpatroni/config.py380 except Exception:CODE
LOWpatroni/config.py607 except Exception:CODE
LOWpatroni/config.py635 except Exception:CODE
LOWpatroni/log.py143 except Exception:CODE
LOWpatroni/log.py158 except Exception:CODE
LOWpatroni/log.py413 except Exception as e:CODE
LOWpatroni/log.py506 except Exception:CODE
LOWpatroni/file_perm.py55 except Exception as e:CODE
LOWpatroni/file_perm.py87 except Exception as e:CODE
LOWpatroni/ctl.py200 except Exception as e:CODE
LOWpatroni/ctl.py1424 except Exception:CODE
LOWpatroni/ctl.py1845 except Exception as err:CODE
LOWpatroni/ctl.py1906 except Exception as err:CODE
LOWpatroni/ctl.py2301 except Exception as e:CODE
LOWpatroni/ctl.py2396 except Exception as err:CODE
LOWpatroni/psycopg.py179 except Exception:CODE
LOWpatroni/api.py813 except Exception:CODE
LOWpatroni/api.py1045 except Exception:CODE
LOWpatroni/api.py1164 except Exception as e:CODE
LOWpatroni/api.py1558 except Exception as e:CODE
LOWpatroni/api.py1690 except Exception as e:CODE
LOWpatroni/api.py1712 except Exception as e:CODE
LOWpatroni/api.py1827 except Exception:CODE
LOWpatroni/api.py1949 except Exception as e:CODE
LOWpatroni/api.py2011 except Exception as e:CODE
LOWpatroni/api.py2067 except Exception as e:CODE
LOWpatroni/async_executor.py169 except Exception:CODE
LOWpatroni/config_generator.py66 except Exception as err:CODE
LOWpatroni/config_generator.py530 except Exception as e:CODE
LOWpatroni/__main__.py68 except Exception as e:CODE
LOWpatroni/__main__.py156 except Exception:CODE
LOWpatroni/__main__.py196 except Exception:CODE
LOWpatroni/__main__.py268 except Exception:CODE
LOWpatroni/__main__.py272 except Exception:CODE
180 more matches not shown…
Empty Error Handlers41 hits · 205 pts
SeverityFileLineSnippetContext
HIGHpatroni/validator.py189except Exception:CODE
HIGHpatroni/ha.py510except Exception:CODE
HIGHpatroni/log.py143except Exception:CODE
HIGHpatroni/__main__.py432except OSError:CODE
HIGHpatroni/daemon.py54except ImportError: # pragma: no coverCODE
HIGHpatroni/daemon.py243except KeyboardInterrupt:CODE
HIGHpatroni/postgresql/config.py475except AttributeError:CODE
HIGHpatroni/postgresql/__init__.py989except (psycopg.Error, PostgresConnectionException):CODE
HIGHpatroni/postgresql/__init__.py973except TimeoutExpired:CODE
HIGHpatroni/postgresql/postmaster.py330except psutil.NoSuchProcess:CODE
HIGHpatroni/postgresql/postmaster.py212except psutil.Error:CODE
HIGHpatroni/postgresql/postmaster.py284except psutil.NoSuchProcess:CODE
HIGHpatroni/postgresql/cancellable.py108except Exception:CODE
HIGHpatroni/postgresql/cancellable.py56except psutil.Error:CODE
HIGHpatroni/postgresql/cancellable.py62except psutil.NoSuchProcess:CODE
HIGHpatroni/watchdog/linux.py195except WatchdogError:CODE
HIGHpatroni/dcs/zookeeper.py409except NoNodeError:CODE
HIGHpatroni/dcs/zookeeper.py364except NoNodeError:CODE
HIGHpatroni/dcs/etcd.py506except (ReferenceError, TypeError, AttributeError):CODE
HIGHpatroni/dcs/kubernetes.py54except OSError:CODE
HIGHpatroni/dcs/kubernetes.py251except K8sException:CODE
HIGHfeatures/environment.py171except Exception:CODE
HIGHfeatures/environment.py663except Exception:CODE
HIGHfeatures/environment.py696except Exception:CODE
HIGHfeatures/environment.py700except Exception:CODE
HIGHfeatures/steps/slots.py40except Exception:CODE
HIGHfeatures/steps/slots.py76except Exception:CODE
HIGHfeatures/steps/slots.py103except Exception:CODE
HIGHfeatures/steps/slots.py122except Exception:CODE
HIGHfeatures/steps/slots.py165except Exception:CODE
HIGHfeatures/steps/slots.py182except Exception:CODE
HIGHfeatures/steps/slots.py69except Exception:CODE
HIGHfeatures/steps/slots.py31except Exception:CODE
HIGHfeatures/steps/quorum_commit.py21except Exception:CODE
HIGHfeatures/steps/quorum_commit.py56except Exception:CODE
HIGHfeatures/steps/cascading_replication.py34except Exception:CODE
HIGHfeatures/steps/cascading_replication.py49except Exception:CODE
HIGHfeatures/steps/patroni_api.py178except Exception:CODE
HIGHfeatures/steps/citus.py36except Exception:CODE
HIGHfeatures/steps/citus.py62except Exception:CODE
HIGHtests/test_api.py880except Exception:CODE
Cross-Language Confusion21 hits · 142 pts
SeverityFileLineSnippetContext
HIGH⚡features/environment.py637 if subprocess.call([docker, 'info'], stdout=null, stderr=null) != 0:CODE
HIGH⚡features/environment.py642 if subprocess.call([docker, 'info'], stdout=null, stderr=null) != 0:CODE
HIGHfeatures/environment.py1117 '-out', context.certfile], stdout=null, stderr=null)CODE
HIGH⚡features/steps/citus.py70 context.pctl.query(name, 'CREATE TABLE public.d(id int not null)')CODE
HIGHtests/test_consul.py47 'ModifyIndex': 6429, 'Value': b'{"leader": "leader", "sync_standby": null}'},CODE
HIGH⚡tests/test_citus.py254 self.assertTrue(new.equals(expected, True))CODE
HIGH⚡tests/test_citus.py265 self.assertTrue(new.equals(expected, True))CODE
HIGH⚡tests/test_citus.py276 self.assertTrue(new.equals(expected, True))CODE
HIGH⚡tests/test_citus.py286 self.assertTrue(new.equals(expected, True))CODE
HIGH⚡tests/test_citus.py326 self.assertTrue(new.equals(expected, True))CODE
HIGH⚡tests/test_citus.py336 self.assertTrue(new.equals(expected, True))CODE
HIGH⚡tests/test_citus.py346 self.assertTrue(new.equals(expected, True))CODE
HIGH⚡tests/test_citus.py356 self.assertTrue(new.equals(expected, True))CODE
HIGH⚡tests/test_citus.py365 self.assertTrue(new.equals(expected, True))CODE
HIGH⚡tests/test_citus.py374 self.assertTrue(new.equals(expected, True))CODE
HIGH⚡tests/test_citus.py383 self.assertTrue(new.equals(expected, True))CODE
HIGH⚡tests/test_citus.py393 self.assertTrue(new.equals(expected, True))CODE
HIGHtests/test_citus.py229 self.assertTrue(new.equals(expected, True))CODE
HIGHtests/test_citus.py242 self.assertTrue(new.equals(expected, True))CODE
HIGHtests/test_citus.py297 self.assertTrue(new.equals(expected, True))CODE
HIGHtests/test_citus.py312 self.assertTrue(new.equals(expected, True))CODE
Deep Nesting133 hits · 101 pts
SeverityFileLineSnippetContext
LOWsetup.py174CODE
LOWpatroni/validator.py110CODE
LOWpatroni/validator.py169CODE
LOWpatroni/validator.py295CODE
LOWpatroni/validator.py552CODE
LOWpatroni/validator.py708CODE
LOWpatroni/validator.py782CODE
LOWpatroni/validator.py841CODE
LOWpatroni/ha.py449CODE
LOWpatroni/ha.py755CODE
LOWpatroni/ha.py923CODE
LOWpatroni/ha.py1133CODE
LOWpatroni/ha.py1177CODE
LOWpatroni/ha.py1202CODE
LOWpatroni/ha.py1381CODE
LOWpatroni/ha.py1514CODE
LOWpatroni/ha.py1558CODE
LOWpatroni/ha.py1833CODE
LOWpatroni/ha.py1868CODE
LOWpatroni/ha.py1908CODE
LOWpatroni/ha.py1969CODE
LOWpatroni/ha.py2176CODE
LOWpatroni/ha.py2317CODE
LOWpatroni/ha.py2555CODE
LOWpatroni/config.py242CODE
LOWpatroni/config.py384CODE
LOWpatroni/config.py435CODE
LOWpatroni/config.py481CODE
LOWpatroni/config.py714CODE
LOWpatroni/dynamic_loader.py73CODE
LOWpatroni/log.py342CODE
LOWpatroni/log.py441CODE
LOWpatroni/log.py509CODE
LOWpatroni/ctl.py422CODE
LOWpatroni/ctl.py897CODE
LOWpatroni/ctl.py1112CODE
LOWpatroni/ctl.py1586CODE
LOWpatroni/ctl.py1809CODE
LOWpatroni/ctl.py2272CODE
LOWpatroni/api.py247CODE
LOWpatroni/api.py960CODE
LOWpatroni/api.py1134CODE
LOWpatroni/api.py1693CODE
LOWpatroni/api.py1998CODE
LOWpatroni/utils.py122CODE
LOWpatroni/utils.py916CODE
LOWpatroni/utils.py1291CODE
LOWpatroni/config_generator.py184CODE
LOWpatroni/config_generator.py372CODE
LOWpatroni/__main__.py286CODE
LOWpatroni/__main__.py389CODE
LOWpatroni/__main__.py418CODE
LOWpatroni/postgresql/bootstrap.py157CODE
LOWpatroni/postgresql/bootstrap.py263CODE
LOWpatroni/postgresql/bootstrap.py386CODE
LOWpatroni/postgresql/sync.py63CODE
LOWpatroni/postgresql/sync.py336CODE
LOWpatroni/postgresql/sync.py361CODE
LOWpatroni/postgresql/callback_executor.py69CODE
LOWpatroni/postgresql/config.py215CODE
73 more matches not shown…
Modern Structural Boilerplate86 hits · 87 pts
SeverityFileLineSnippetContext
LOWpatroni/ha.py27logger = logging.getLogger(__name__)CODE
LOWpatroni/ha.py120 def update_slots(self, slots: Dict[str, int]) -> None:CODE
LOWpatroni/ha.py207 def set_is_active(self, value: float) -> None:CODE
LOWpatroni/ha.py300 def set_is_leader(self, value: bool) -> None:CODE
LOWpatroni/ha.py1177 def update_cluster_history(self) -> None:CODE
LOWpatroni/ha.py2310 def set_start_timeout(self, value: Optional[int]) -> None:CODE
LOWpatroni/raft_controller.py8logger = logging.getLogger(__name__)CODE
LOWpatroni/config.py25logger = logging.getLogger(__name__)CODE
LOWpatroni/config.py534 def _set_section_values(section: str, params: List[str]) -> None:CODE
LOWpatroni/dynamic_loader.py15logger = logging.getLogger(__name__)CODE
LOWpatroni/log.py37 def set_log_file_mode(self, mode: Optional[int]) -> None:CODE
LOWpatroni/log.py252 def update_loggers(self, config: Dict[str, Any]) -> None:CODE
LOWpatroni/file_perm.py10logger = logging.getLogger(__name__)CODE
LOWpatroni/file_perm.py76 def set_permissions_from_data_directory(self, data_dir: str) -> None:CODE
LOWpatroni/ctl.py165 def _set_hline(self, value: str) -> None:CODE
LOWpatroni/psycopg.py13__all__ = ['connect', 'parse_conninfo', 'quote_ident', 'quote_literal',CODE
LOWpatroni/quorum.py9logger = logging.getLogger(__name__)CODE
LOWpatroni/api.py37logger = logging.getLogger(__name__)CODE
LOWpatroni/api.py1638 def _set_fd_cloexec(fd: socket.socket) -> None:CODE
LOWpatroni/utils.py41logger = logging.getLogger(__name__)CODE
LOWpatroni/utils.py706 def update_delay(self) -> None:CODE
LOWpatroni/async_executor.py11logger = logging.getLogger(__name__)CODE
LOWpatroni/config_generator.py372 def _set_pg_params(self, cur: Union['cursor', 'Cursor[Any]']) -> None:CODE
LOWpatroni/config_generator.py415 def _set_su_params(self) -> None:CODE
LOWpatroni/config_generator.py438 def _set_conf_files(self) -> None:CODE
LOWpatroni/__main__.py26logger = logging.getLogger(__name__)CODE
LOWpatroni/daemon.py45logger = logging.getLogger(__name__)CODE
LOWpatroni/postgresql/validator.py14logger = logging.getLogger(__name__)CODE
LOWpatroni/postgresql/bootstrap.py19logger = logging.getLogger(__name__)CODE
LOWpatroni/postgresql/sync.py17logger = logging.getLogger(__name__)CODE
LOWpatroni/postgresql/sync.py415 def set_synchronous_standby_names(self, sync: Collection[str], num: Optional[int] = None) -> None:CODE
LOWpatroni/postgresql/misc.py10logger = logging.getLogger(__name__)CODE
LOWpatroni/postgresql/callback_executor.py11logger = logging.getLogger(__name__)CODE
LOWpatroni/postgresql/config.py30logger = logging.getLogger(__name__)CODE
LOWpatroni/postgresql/config.py495 def set_file_permissions(self, filename: str) -> None:CODE
LOWpatroni/postgresql/slots.py30logger = logging.getLogger(__name__)CODE
LOW⚡patroni/postgresql/__init__.py474 def set_enforce_hot_standby_feedback(self, value: bool) -> None:CODE
LOW⚡patroni/postgresql/__init__.py723 def set_role(self, value: PostgresqlRole) -> None:CODE
LOW⚡patroni/postgresql/__init__.py732 def set_state(self, value: PostgresqlState) -> None:CODE
LOWpatroni/postgresql/__init__.py43logger = logging.getLogger(__name__)CODE
LOWpatroni/postgresql/__init__.py361 def set_pending_restart_reason(self, diff_dict: CaseInsensitiveDict) -> None:CODE
LOWpatroni/postgresql/rewind.py21logger = logging.getLogger(__name__)CODE
LOWpatroni/postgresql/connection.py14logger = logging.getLogger(__name__)CODE
LOWpatroni/postgresql/postmaster.py26logger = logging.getLogger(__name__)CODE
LOWpatroni/postgresql/cancellable.py15logger = logging.getLogger(__name__)CODE
LOWpatroni/postgresql/available_parameters/__init__.py6logger = logging.getLogger(__name__)CODE
LOWpatroni/postgresql/mpp/citus.py20logger = logging.getLogger(__name__)CODE
LOWpatroni/postgresql/mpp/citus.py523 def update_node(self, groupid: int, node: PgDistNode, cooldown: float = 10000) -> None:CODE
LOWpatroni/postgresql/mpp/citus.py534 def update_group(self, task: PgDistTask, transaction: bool) -> None:CODE
LOWpatroni/watchdog/__init__.py3__all__ = ['WatchdogError', 'Watchdog']CODE
LOWpatroni/watchdog/linux.py212 def set_timeout(self, timeout: int) -> None:CODE
LOWpatroni/watchdog/linux.py237 def set_timeout(self, timeout: int) -> None:CODE
LOWpatroni/watchdog/base.py12__all__ = ['WatchdogError', 'Watchdog']CODE
LOWpatroni/watchdog/base.py14logger = logging.getLogger(__name__)CODE
LOWpatroni/watchdog/base.py291 def set_timeout(self, timeout: int) -> None:CODE
LOWpatroni/scripts/wale_restore.py39logger = logging.getLogger(__name__)CODE
LOWpatroni/scripts/aws.py16logger = logging.getLogger(__name__)CODE
LOWpatroni/scripts/barman/utils.py67def set_up_logging(log_file: Optional[str] = None) -> None:CODE
LOWpatroni/dcs/exhibitor.py14logger = logging.getLogger(__name__)CODE
LOWpatroni/dcs/etcd3.py30logger = logging.getLogger(__name__)CODE
26 more matches not shown…
Hallucination Indicators14 hits · 80 pts
SeverityFileLineSnippetContext
CRITICAL⚡tests/test_ha.py281 self.ha.cluster.config.data.update({'standby_cluster': {'port': 5432}})STRING
CRITICAL⚡tests/test_ha.py1524 self.ha.cluster.config.data.update({'synchronous_mode': True, 'primary_start_timeout': 0})STRING
CRITICAL⚡tests/test_ha.py1533 self.ha.cluster.config.data.update({'primary_stop_timeout': 30})STRING
CRITICAL⚡tests/test_ha.py1871 self.ha.cluster.config.data.clear()STRING
CRITICALtests/test_ha.py340 self.ha.cluster.config.data.update({'maximum_lag_on_failover': 10})STRING
CRITICALtests/test_ha.py373 self.ha.cluster.leader.member.data.update(version='2.0.2', role=PostgresqlRole.PRIMARY)STRING
CRITICALtests/test_ha.py514 self.ha.cluster.config.data.update({'slots': {'l': {'database': 'a', 'plugin': 'b'}}})STRING
CRITICALtests/test_ha.py519 self.ha.cluster.config.data.update({'postgresql': {'use_slots': False}})STRING
CRITICALtests/test_ha.py861 self.ha.cluster.config.data.update({'maximum_lag_on_failover': 5})STRING
CRITICALtests/test_ha.py909 self.ha.cluster.config.data.update({'maximum_lag_on_failover': 5})STRING
CRITICALtests/test_ha.py1054 self.ha.cluster.config.data.update({'maximum_lag_on_failover': 5})STRING
CRITICALtests/test_ha.py1246 self.ha.cluster.config.data.update({'maximum_lag_on_failover': 5})STRING
CRITICALtests/test_ha.py1562 self.ha.cluster.config.data.update({'standby_cluster': {'port': 5432}})STRING
CRITICALtests/test_ha.py1596 self.ha.cluster.config.data.update({'standby_cluster': {'restore_command': 'foo', 'port': None}})STRING
Cross-File Repetition14 hits · 70 pts
SeverityFileLineSnippetContext
HIGHpatroni/dcs/etcd3.py0load and build the :class:`cluster` object from dcs, which represents a single postgresql cluster. :param path: the pathSTRING
HIGHpatroni/dcs/zookeeper.py0load and build the :class:`cluster` object from dcs, which represents a single postgresql cluster. :param path: the pathSTRING
HIGHpatroni/dcs/__init__.py0load and build the :class:`cluster` object from dcs, which represents a single postgresql cluster. :param path: the pathSTRING
HIGHpatroni/dcs/etcd.py0load and build the :class:`cluster` object from dcs, which represents a single postgresql cluster. :param path: the pathSTRING
HIGHpatroni/dcs/consul.py0load and build the :class:`cluster` object from dcs, which represents a single postgresql cluster. :param path: the pathSTRING
HIGHpatroni/dcs/kubernetes.py0load and build the :class:`cluster` object from dcs, which represents a single postgresql cluster. :param path: the pathSTRING
HIGHpatroni/dcs/raft.py0load and build the :class:`cluster` object from dcs, which represents a single postgresql cluster. :param path: the pathSTRING
HIGHpatroni/dcs/etcd3.py0load and build all postgresql clusters from a single mpp cluster. :param path: the path in dcs where to load cluster(s) STRING
HIGHpatroni/dcs/zookeeper.py0load and build all postgresql clusters from a single mpp cluster. :param path: the path in dcs where to load cluster(s) STRING
HIGHpatroni/dcs/__init__.py0load and build all postgresql clusters from a single mpp cluster. :param path: the path in dcs where to load cluster(s) STRING
HIGHpatroni/dcs/etcd.py0load and build all postgresql clusters from a single mpp cluster. :param path: the path in dcs where to load cluster(s) STRING
HIGHpatroni/dcs/consul.py0load and build all postgresql clusters from a single mpp cluster. :param path: the path in dcs where to load cluster(s) STRING
HIGHpatroni/dcs/kubernetes.py0load and build all postgresql clusters from a single mpp cluster. :param path: the path in dcs where to load cluster(s) STRING
HIGHpatroni/dcs/raft.py0load and build all postgresql clusters from a single mpp cluster. :param path: the path in dcs where to load cluster(s) STRING
Unused Imports45 hits · 38 pts
SeverityFileLineSnippetContext
LOWpatroni/dynamic_loader.py13CODE
LOWpatroni/global_config.py17CODE
LOWpatroni/ctl.py51CODE
LOWpatroni/psycopg.py10CODE
LOWpatroni/psycopg.py11CODE
LOWpatroni/psycopg.py11CODE
LOWpatroni/psycopg.py23CODE
LOWpatroni/psycopg.py23CODE
LOWpatroni/psycopg.py23CODE
LOWpatroni/psycopg.py23CODE
LOWpatroni/psycopg.py75CODE
LOWpatroni/psycopg.py75CODE
LOWpatroni/psycopg.py75CODE
LOWpatroni/psycopg.py75CODE
LOWpatroni/utils.py37CODE
LOWpatroni/config_generator.py16CODE
LOWpatroni/__main__.py23CODE
LOWpatroni/__main__.py24CODE
LOWpatroni/postgresql/bootstrap.py17CODE
LOWpatroni/postgresql/sync.py15CODE
LOWpatroni/postgresql/config.py28CODE
LOWpatroni/postgresql/slots.py25CODE
LOWpatroni/postgresql/slots.py26CODE
LOWpatroni/postgresql/slots.py28CODE
LOWpatroni/postgresql/__init__.py40CODE
LOWpatroni/postgresql/__init__.py40CODE
LOWpatroni/postgresql/__init__.py41CODE
LOWpatroni/postgresql/__init__.py41CODE
LOWpatroni/postgresql/connection.py8CODE
LOWpatroni/postgresql/connection.py8CODE
LOWpatroni/postgresql/mpp/__init__.py15CODE
LOWpatroni/postgresql/mpp/__init__.py16CODE
LOWpatroni/postgresql/mpp/citus.py16CODE
LOWpatroni/watchdog/__init__.py1CODE
LOWpatroni/watchdog/__init__.py1CODE
LOWpatroni/scripts/barman/config_switch.py27CODE
LOWpatroni/scripts/barman/recover.py27CODE
LOWpatroni/dcs/zookeeper.py22CODE
LOWpatroni/dcs/__init__.py27CODE
LOWpatroni/dcs/__init__.py28CODE
LOWpatroni/dcs/__init__.py30CODE
LOWpatroni/dcs/etcd.py33CODE
LOWpatroni/dcs/consul.py27CODE
LOWpatroni/dcs/kubernetes.py33CODE
LOWpatroni/dcs/raft.py33CODE
Over-Commented Block22 hits · 22 pts
SeverityFileLineSnippetContext
LOWpostgres1.yml1scope: batmanCOMMENT
LOWpostgres1.yml21#citus:COMMENT
LOWpostgres1.yml61 # For kerberos gss based connectivity (discard @.*$)COMMENT
LOWpostgres0.yml1scope: batmanCOMMENT
LOWpostgres0.yml21#citus:COMMENT
LOWpostgres0.yml41# self_addr: 127.0.0.1:2222COMMENT
LOWpostgres0.yml61 #host: 127.0.0.1COMMENT
LOWpostgres0.yml81# max_replication_slots: 10COMMENT
LOWpostgres0.yml121 parameters:COMMENT
LOWdocker-compose-citus.yml1# docker compose file for running a Citus clusterCOMMENT
LOWpostgres2.yml21#citus:COMMENT
LOWpostgres2.yml61 # For kerberos gss based connectivity (discard @.*$)COMMENT
LOWpatroni/api.py81 # A hacky way to have decorators that work with and without parameters.COMMENT
LOWpatroni/postgresql/config.py341 'old_value': (maybe_convert_from_base_unit(str_value(old_value), vartype, unit)COMMENT
LOWpatroni/postgresql/postmaster.py301 # it is hard to know the current state of postgres startup, so we had to reimplement pg_ctl startCOMMENT
LOWpatroni/scripts/wale_restore.py1#!/usr/bin/env pythonCOMMENT
LOWdocs/conf.py1#!/usr/bin/env python3COMMENT
LOWdocs/conf.py81author = 'Patroni Contributors'COMMENT
LOWdocs/conf.py141COMMENT
LOWdocs/conf.py161COMMENT
LOWkubernetes/citus_k8s.yaml241 - name: pgdataCOMMENT
LOWkubernetes/patroni_k8s.yaml101 - name: pgdataCOMMENT
Redundant / Tautological Comments9 hits · 14 pts
SeverityFileLineSnippetContext
LOWpatroni/validator.py151 # Check if "socket.IF_INET" or "socket.IF_INET6" is being used and instantiate a socket with the identifiedCOMMENT
LOWpatroni/ha.py977 # Check if manage_synchronized_standby_slots feature state changed even when no sync changesCOMMENT
LOWpatroni/ha.py1029 # Check if manage_synchronized_standby_slots feature state changedCOMMENT
LOWpatroni/ha.py2274 # Check if we are in startup, when paused defer to main loop for manual failovers.COMMENT
LOWpatroni/ha.py2373 # Check if we tried to recover from postgres crash and failedCOMMENT
LOWpatroni/postgresql/config.py1277 # Check if any parameter was set back to the current pg_settings valueCOMMENT
LOWpatroni/postgresql/mpp/citus.py657 # Add the task to the list if Worker node state is different from the cached `pg_dist_group`COMMENT
LOWtests/test_patroni.py322 # Set role to REPLICACOMMENT
LOWtests/test_patroni.py344 # Set role to REPLICA and mark it as already processedCOMMENT
Self-Referential Comments4 hits · 10 pts
SeverityFileLineSnippetContext
MEDIUMpatroni/api.py2052 # Define the Server header response using the server_tokens option.COMMENT
MEDIUMpatroni/dcs/zookeeper.py41 """This method is trying to establish connection with one of the zookeeper nodes.STRING
MEDIUMpatroni/dcs/__init__.py1857 # This method is always called with ``optime`` key, rest of the keys are optional.COMMENT
MEDIUMdocs/conf.py7# This file is execfile()d with the current directory set to itsCOMMENT
AI Slop Vocabulary3 hits · 4 pts
SeverityFileLineSnippetContext
LOWpatroni/ha.py1836 # If the scheduled action is in the far future, we shouldn't do anything and just return.COMMENT
LOWpatroni/postgresql/validator.py465 # likely an extension GUC, so just return as it is. Otherwise, if `name` is in `parameters`, it's likely aCOMMENT
LOWpatroni/postgresql/validator.py488 # just pass down the list of settings defined in Patroni validators so :func:`_transform_parameter_value` will notCOMMENT
AI Structural Patterns2 hits · 2 pts
SeverityFileLineSnippetContext
LOWpatroni/utils.py658CODE
LOWtests/test_ha.py112CODE