Repository Analysis

patroni/patroni

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

21.8 Moderate AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of patroni/patroni, a Python project with 8,642 GitHub stars. SynthScan v2.0 examined 55,226 lines of code across 158 source files, recording 1037 pattern matches distributed across 13 syntactic categories. The overall adjusted score of 21.8 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).

21.8
Adjusted Score
21.8
Raw Score
100%
Time Factor
2026-08-06
Last Push
8.6K
Stars
Python
Language
55.2K
Lines of Code
158
Files
1.0K
Pattern Hits
2026-08-09
Scan Date
0.31
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

Longitudinal tracking requires multiple scan runs. Once this repository is re-scanned after new commits land, this chart will visualise how the synthetic code signal evolves over time — enabling you to detect whether AI authorship is growing, stabilising, or being actively corrected by human engineers.

No multi-scan history yet — run the scanner again to build trend data.

Severity Breakdown

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.

CRITICAL 14HIGH 35MEDIUM 27LOW 961

Directory Score Breakdown

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.

Pattern Findings

The scanner identified 1037 distinct pattern matches across 13 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.

Hyper-Verbose Identifiers452 hits · 381 pts
SeverityFileLineSnippetContext
LOWpatroni/validator.py185def comma_separated_host_port(string: str) -> bool:CODE
LOWpatroni/validator.py197def validate_host_port_listen(host_port: str) -> bool:CODE
LOWpatroni/validator.py210def validate_host_port_listen_multiple_hosts(host_port: str) -> bool:CODE
LOWpatroni/validator.py975def validate_synchronous_mode(value: Any) -> None:CODE
LOWpatroni/ha.py317 def quorum_commit_mode_is_active(self) -> bool:CODE
LOWpatroni/ha.py324 def _get_failover_action_name(self) -> str:CODE
LOWpatroni/ha.py600 def _handle_rewind_or_reinitialize(self) -> Optional[str]:CODE
LOWpatroni/ha.py832 def _maybe_enable_synchronous_mode(self) -> Optional[SyncState]:CODE
LOWpatroni/ha.py850 def disable_synchronous_replication(self) -> None:CODE
LOWpatroni/ha.py865 def _handle_synchronous_strict_mode(self, dcs_state: SyncState, replication_state: Any) -> bool:CODE
LOWpatroni/ha.py915 def _process_quorum_replication(self) -> None:CODE
LOWpatroni/ha.py976 def _process_multisync_replication(self) -> None:CODE
LOWpatroni/ha.py1050 def _process_multisync_prepromote(self) -> bool:CODE
LOWpatroni/ha.py1081 def _process_quorum_prepromote(self) -> None:CODE
LOWpatroni/ha.py1101 def process_sync_replication_prepromote(self) -> bool:CODE
LOWpatroni/ha.py1184 def enforce_follow_remote_member(self, message: str) -> str:CODE
LOWpatroni/ha.py1507 def manual_failover_process_no_leader(self) -> Optional[bool]:CODE
LOWpatroni/ha.py1657 def release_leader_key_voluntarily(self, last_lsn: Optional[int] = None) -> None:CODE
LOWpatroni/ha.py1776 def should_run_scheduled_action(self, action_name: str, scheduled_at: Optional[datetime.datetime],CODE
LOWpatroni/ha.py1811 def process_manual_failover_from_leader(self) -> Optional[str]:CODE
LOWpatroni/ha.py1851 def process_unhealthy_cluster(self) -> str:CODE
LOWpatroni/ha.py1964 def evaluate_scheduled_restart(self) -> Optional[str]:CODE
LOWpatroni/ha.py2118 def handle_long_action_in_progress(self) -> str:CODE
LOWpatroni/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.py712 def _build_effective_configuration(self, dynamic_configuration: Dict[str, Any],CODE
LOWpatroni/config.py831 def build_effective_postgresql_configuration(self, role: PostgresqlRole) -> Dict[str, Any]:CODE
LOWpatroni/config.py878 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/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], candidate: Optional[str],CODE
LOWpatroni/ctl.py1833def wait_until_pause_is_applied(dcs: AbstractDCS, paused: bool, old_cluster: Cluster) -> None:CODE
LOWpatroni/ctl.py2019def 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/api.py1904 def get_certificate_serial_number(self) -> Optional[str]: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.py327 def _get_bin_dir_from_running_instance(self) -> str:CODE
LOWpatroni/config_generator.py465 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
LOWpatroni/postgresql/sync.py336 def _process_replica_readiness(self, cluster: Cluster, replica_list: _ReplicaList) -> None:CODE
392 more matches not shown…
Excessive Try-Catch Wrapping235 hits · 254 pts
SeverityFileLineSnippetContext
LOWsetup.py145 except Exception:CODE
MEDIUMsetup.py142def run(self):CODE
LOWpatroni/validator.py237 except Exception:CODE
LOWpatroni/validator.py254 except Exception:CODE
LOWpatroni/validator.py719 except Exception as e:CODE
MEDIUMpatroni/ha.py356def acquire_lock(self) -> bool:CODE
LOWpatroni/ha.py361 except Exception:CODE
LOWpatroni/ha.py397 except Exception:CODE
LOWpatroni/ha.py403 except Exception:CODE
LOWpatroni/ha.py444 except Exception as e:CODE
LOWpatroni/ha.py509 except Exception:CODE
LOWpatroni/ha.py1257 except Exception as e:CODE
LOWpatroni/ha.py1301 except Exception as e:CODE
LOWpatroni/ha.py1340 except Exception:CODE
LOWpatroni/ha.py1758 except Exception:CODE
LOWpatroni/ha.py2267 except Exception as exc1:CODE
LOWpatroni/ha.py2274 except Exception as exc2:CODE
LOWpatroni/ha.py2493 except Exception:CODE
LOWpatroni/raft_controller.py23 except Exception:CODE
MEDIUMpatroni/raft_controller.py20def _run_cycle(self) -> None:CODE
LOWpatroni/config.py260 except Exception:CODE
LOWpatroni/config.py265 except Exception:CODE
LOWpatroni/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.py605 except Exception:CODE
LOWpatroni/config.py633 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.py1406 except Exception:CODE
LOWpatroni/ctl.py1824 except Exception as err:CODE
LOWpatroni/ctl.py1885 except Exception as err:CODE
LOWpatroni/ctl.py2280 except Exception as e:CODE
LOWpatroni/ctl.py2375 except Exception as err:CODE
LOWpatroni/psycopg.py179 except Exception:CODE
LOWpatroni/api.py803 except Exception:CODE
LOWpatroni/api.py1035 except Exception:CODE
LOWpatroni/api.py1154 except Exception as e:CODE
LOWpatroni/api.py1526 except Exception as e:CODE
LOWpatroni/api.py1648 except Exception as e:CODE
LOWpatroni/api.py1670 except Exception as e:CODE
LOWpatroni/api.py1785 except Exception:CODE
LOWpatroni/api.py1900 except Exception as e:CODE
LOWpatroni/api.py1944 except Exception as e:CODE
LOWpatroni/async_executor.py169 except Exception:CODE
LOWpatroni/config_generator.py66 except Exception as err:CODE
LOWpatroni/config_generator.py526 except Exception as e:CODE
LOWpatroni/__main__.py68 except Exception as e:CODE
LOWpatroni/__main__.py156 except Exception:CODE
LOWpatroni/__main__.py195 except Exception:CODE
LOWpatroni/__main__.py267 except Exception:CODE
LOWpatroni/__main__.py271 except Exception:CODE
LOWpatroni/daemon.py237 except Exception as e:CODE
LOWpatroni/postgresql/validator.py230 except Exception as exc:CODE
175 more matches not shown…
Cross-Language Confusion21 hits · 142 pts
SeverityFileLineSnippetContext
HIGHfeatures/environment.py635 if subprocess.call([docker, 'info'], stdout=null, stderr=null) != 0:CODE
HIGHfeatures/environment.py640 if subprocess.call([docker, 'info'], stdout=null, stderr=null) != 0:CODE
HIGHfeatures/environment.py1109 '-out', context.certfile], stdout=null, stderr=null)CODE
HIGHfeatures/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
HIGHtests/test_citus.py254 self.assertTrue(new.equals(expected, True))CODE
HIGHtests/test_citus.py265 self.assertTrue(new.equals(expected, True))CODE
HIGHtests/test_citus.py276 self.assertTrue(new.equals(expected, True))CODE
HIGHtests/test_citus.py286 self.assertTrue(new.equals(expected, True))CODE
HIGHtests/test_citus.py326 self.assertTrue(new.equals(expected, True))CODE
HIGHtests/test_citus.py336 self.assertTrue(new.equals(expected, True))CODE
HIGHtests/test_citus.py346 self.assertTrue(new.equals(expected, True))CODE
HIGHtests/test_citus.py356 self.assertTrue(new.equals(expected, True))CODE
HIGHtests/test_citus.py365 self.assertTrue(new.equals(expected, True))CODE
HIGHtests/test_citus.py374 self.assertTrue(new.equals(expected, True))CODE
HIGHtests/test_citus.py383 self.assertTrue(new.equals(expected, True))CODE
HIGHtests/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 Nesting131 hits · 100 pts
SeverityFileLineSnippetContext
LOWsetup.py174CODE
LOWpatroni/validator.py110CODE
LOWpatroni/validator.py270CODE
LOWpatroni/validator.py527CODE
LOWpatroni/validator.py683CODE
LOWpatroni/validator.py757CODE
LOWpatroni/validator.py816CODE
LOWpatroni/ha.py448CODE
LOWpatroni/ha.py754CODE
LOWpatroni/ha.py915CODE
LOWpatroni/ha.py1119CODE
LOWpatroni/ha.py1163CODE
LOWpatroni/ha.py1188CODE
LOWpatroni/ha.py1367CODE
LOWpatroni/ha.py1465CODE
LOWpatroni/ha.py1507CODE
LOWpatroni/ha.py1776CODE
LOWpatroni/ha.py1811CODE
LOWpatroni/ha.py1851CODE
LOWpatroni/ha.py1911CODE
LOWpatroni/ha.py2118CODE
LOWpatroni/ha.py2259CODE
LOWpatroni/ha.py2497CODE
LOWpatroni/config.py242CODE
LOWpatroni/config.py384CODE
LOWpatroni/config.py435CODE
LOWpatroni/config.py481CODE
LOWpatroni/config.py712CODE
LOWpatroni/dynamic_loader.py73CODE
LOWpatroni/log.py342CODE
LOWpatroni/log.py441CODE
LOWpatroni/log.py509CODE
LOWpatroni/ctl.py422CODE
LOWpatroni/ctl.py897CODE
LOWpatroni/ctl.py1112CODE
LOWpatroni/ctl.py1565CODE
LOWpatroni/ctl.py1788CODE
LOWpatroni/ctl.py2251CODE
LOWpatroni/api.py247CODE
LOWpatroni/api.py950CODE
LOWpatroni/api.py1124CODE
LOWpatroni/api.py1651CODE
LOWpatroni/api.py1931CODE
LOWpatroni/utils.py122CODE
LOWpatroni/utils.py913CODE
LOWpatroni/utils.py1286CODE
LOWpatroni/config_generator.py184CODE
LOWpatroni/config_generator.py370CODE
LOWpatroni/__main__.py285CODE
LOWpatroni/__main__.py388CODE
LOWpatroni/__main__.py417CODE
LOWpatroni/postgresql/bootstrap.py157CODE
LOWpatroni/postgresql/bootstrap.py253CODE
LOWpatroni/postgresql/bootstrap.py372CODE
LOWpatroni/postgresql/sync.py63CODE
LOWpatroni/postgresql/sync.py336CODE
LOWpatroni/postgresql/sync.py361CODE
LOWpatroni/postgresql/callback_executor.py69CODE
LOWpatroni/postgresql/config.py215CODE
LOWpatroni/postgresql/config.py519CODE
71 more matches not shown…
Modern Structural Boilerplate86 hits · 88 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.py299 def set_is_leader(self, value: bool) -> None:CODE
LOWpatroni/ha.py1163 def update_cluster_history(self) -> None:CODE
LOWpatroni/ha.py2252 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.py1596 def _set_fd_cloexec(fd: socket.socket) -> None:CODE
LOWpatroni/utils.py41logger = logging.getLogger(__name__)CODE
LOWpatroni/utils.py703 def update_delay(self) -> None:CODE
LOWpatroni/async_executor.py11logger = logging.getLogger(__name__)CODE
LOWpatroni/config_generator.py370 def _set_pg_params(self, cur: Union['cursor', 'Cursor[Any]']) -> None:CODE
LOWpatroni/config_generator.py413 def _set_su_params(self) -> None:CODE
LOWpatroni/config_generator.py436 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.py492 def set_file_permissions(self, filename: str) -> None:CODE
LOWpatroni/postgresql/slots.py29logger = logging.getLogger(__name__)CODE
LOWpatroni/postgresql/__init__.py468 def set_enforce_hot_standby_feedback(self, value: bool) -> None:CODE
LOWpatroni/postgresql/__init__.py717 def set_role(self, value: PostgresqlRole) -> None:CODE
LOWpatroni/postgresql/__init__.py726 def set_state(self, value: PostgresqlState) -> None:CODE
LOWpatroni/postgresql/__init__.py43logger = logging.getLogger(__name__)CODE
LOWpatroni/postgresql/__init__.py355 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.py14logger = 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
CRITICALtests/test_ha.py280 self.ha.cluster.config.data.update({'standby_cluster': {'port': 5432}})STRING
CRITICALtests/test_ha.py1422 self.ha.cluster.config.data.update({'synchronous_mode': True, 'primary_start_timeout': 0})STRING
CRITICALtests/test_ha.py1431 self.ha.cluster.config.data.update({'primary_stop_timeout': 30})STRING
CRITICALtests/test_ha.py1769 self.ha.cluster.config.data.clear()STRING
CRITICALtests/test_ha.py339 self.ha.cluster.config.data.update({'maximum_lag_on_failover': 10})STRING
CRITICALtests/test_ha.py372 self.ha.cluster.leader.member.data.update(version='2.0.2', role=PostgresqlRole.PRIMARY)STRING
CRITICALtests/test_ha.py512 self.ha.cluster.config.data.update({'slots': {'l': {'database': 'a', 'plugin': 'b'}}})STRING
CRITICALtests/test_ha.py517 self.ha.cluster.config.data.update({'postgresql': {'use_slots': False}})STRING
CRITICALtests/test_ha.py854 self.ha.cluster.config.data.update({'maximum_lag_on_failover': 5})STRING
CRITICALtests/test_ha.py897 self.ha.cluster.config.data.update({'maximum_lag_on_failover': 5})STRING
CRITICALtests/test_ha.py1041 self.ha.cluster.config.data.update({'maximum_lag_on_failover': 5})STRING
CRITICALtests/test_ha.py1190 self.ha.cluster.config.data.update({'maximum_lag_on_failover': 5})STRING
CRITICALtests/test_ha.py1460 self.ha.cluster.config.data.update({'standby_cluster': {'port': 5432}})STRING
CRITICALtests/test_ha.py1494 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 · 40 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.py24CODE
LOWpatroni/postgresql/slots.py25CODE
LOWpatroni/postgresql/slots.py27CODE
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 # in python. It will start postgres, wait for port to be open and wait until postgres will 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 Comments7 hits · 10 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.py2216 # Check if we are in startup, when paused defer to main loop for manual failovers.COMMENT
LOWpatroni/ha.py2315 # Check if we tried to recover from postgres crash and failedCOMMENT
LOWpatroni/postgresql/config.py1250 # 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.py316 # Set role to REPLICACOMMENT
LOWtests/test_patroni.py338 # Set role to REPLICA and mark it as already processedCOMMENT
Self-Referential Comments4 hits · 10 pts
SeverityFileLineSnippetContext
MEDIUMpatroni/api.py1983 # 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__.py1853 # 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 Vocabulary4 hits · 6 pts
SeverityFileLineSnippetContext
LOWpatroni/ha.py1779 # 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
LOWpatroni/postgresql/config.py547 # Previously we didn't backup pg_ident.conf, if file is missing just create emptyCOMMENT
AI Structural Patterns2 hits · 2 pts
SeverityFileLineSnippetContext
LOWpatroni/utils.py655CODE
LOWtests/test_ha.py112CODE