AI Slop Code RIsk Monitor

py-why/dowhy

DoWhy is a Python library for causal inference that supports explicit modeling and testing of causal assumptions. DoWhy is based on a unified language for causal inference, combining causal graphical models and potential outcomes frameworks.

29.2 Elevated pattern signal View on GitHub

Maintenance and Governance Review

This report summarizes scanner evidence for py-why/dowhy, a Python project with 8,345 GitHub stars. SynthScan examined 57,298 lines of code across 301 source files, recording 1287 pattern matches distributed across 20 syntactic categories. The legacy adjusted pattern signal is 29.2 (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.

29.2
Adjusted Signal
29.2
Raw Pattern Score
100%
Time Factor
2026-10-11
Last Push
8.3K
Stars
Python
Language
57.3K
Lines of Code
301
Files
1.3K
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 64.0/100 · HIGH

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

Hallucinated Dependency & Supply Chain Risk 13.4/100 · LOW

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

Agent Over-Engineering Ratio 67.5/100 · HIGH

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

PR Review Velocity Impact 76.3/100 · CRITICAL

Which changes need focused human review? 1287 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 1HIGH 46MEDIUM 61LOW 1179

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 1287 distinct pattern matches across 20 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 Identifiers826 hits · 901 pts
SeverityFileLineSnippetContext
LOWtest_parallel_refuters.py33 "def _simulate_confounders_effect_once(" in aucc_contentCODE
LOWtests/test_datasets.py6def test_when_generating_sales_dataset_then_returns_reasonable_samples():CODE
LOWtests/test_datasets.py19def test_linear_dataset_with_binary_treatment():CODE
LOWtests/test_datasets.py33def test_linear_dataset_with_categorical_treatment():CODE
LOWtests/test_causal_model.py381 def test_cate_estimates_regression(self, beta, num_effect_modifiers, num_samples):STRING
LOWtests/test_causal_model.py406 def test_estimate_conditional_effects_public_api(self):STRING
LOWtests/test_causal_model.py567 def test_unobserved_graph_variables_log_warning(self, caplog):STRING
LOWtests/test_causal_model.py627 def test_compability_with_gcm(self):STRING
LOWtests/test_causal_model.py651 def test_incorrect_graph_format(self):STRING
LOWtests/test_causal_model.py661 def test_learn_graph_initializes_the_graph(self):STRING
LOWtests/test_causal_model.py691 def test_warn_when_treatment_not_in_data(self):CODE
LOWtests/test_causal_model.py702 def test_warn_when_outcome_not_in_data(self):CODE
LOWtests/test_causal_model.py713 def test_no_warn_when_treatment_and_outcome_in_data(self):CODE
LOWtests/test_causal_model.py730 def test_causal_estimator_cache(self):CODE
LOWtests/test_causal_model.py773 def test_refute_estimate_raises_when_method_name_is_none(self):CODE
LOWtests/test_causal_model.py795 def test_do_raises_when_method_name_is_none(self):CODE
LOWtests/test_causal_model.py813 def test_estimate_effect_raises_when_method_name_is_none(self):CODE
LOWtests/test_causal_model.py831 def test_fit_estimator_false_reuses_cached_estimator(self):CODE
LOWtests/test_causal_model.py887 def test_causal_model_do_regression(self):CODE
LOWtests/test_causal_model.py930 def test_repr_matches_str_for_key_result_objects(self):CODE
LOWtests/test_data_transformer.py10def test_dimensionality_reducer_placeholder_methods():CODE
LOWtests/test_causal_estimator.py13def test_causal_estimator_placeholder_methods():CODE
LOWtests/test_causal_estimator.py30 # def test_average_treatment_effect(self):COMMENT
LOWtests/test_causal_estimator.py36 # def test_average_treatment_effect_on_treated(self):COMMENT
LOWtests/test_causal_estimator.py48def test_estimate_effect_warns_on_nan_in_treatment_or_outcome():CODE
LOWtests/test_causal_estimator.py88def test_estimate_effect_no_warning_when_no_nan():CODE
LOWtests/test_causal_estimator.py117def test_estimate_effect_raises_valueerror_for_missing_estimand():CODE
LOWtests/test_confounder_distribution_interpreter.py36def test_confounder_distribution_interpreter_with_categorical_confounder(mock_show):CODE
LOWtests/test_confounder_distribution_interpreter.py49def test_confounder_distribution_interpreter_with_integer_confounder(mock_show):CODE
LOW⚡tests/test_causal_refuter.py14def test_causal_refuter_placeholder_method():CODE
LOW⚡tests/test_causal_refuter.py21def test_causal_refuter_bootstrap_test():CODE
LOW⚡tests/test_causal_refuter.py29def test_normal_distribution_test_zero_std_returns_one():CODE
LOW⚡tests/test_causal_refuter.py47def test_choose_variables_true_returns_all():CODE
LOW⚡tests/test_causal_refuter.py53def test_choose_variables_false_returns_none():CODE
LOW⚡tests/test_causal_refuter.py59def test_choose_variables_int_returns_correct_count():CODE
LOW⚡tests/test_causal_refuter.py66def test_choose_variables_int_zero_returns_empty():CODE
LOW⚡tests/test_causal_refuter.py72def test_choose_variables_int_too_large_raises():CODE
LOW⚡tests/test_causal_refuter.py78def test_choose_variables_list_select_returns_subset():CODE
LOW⚡tests/test_causal_refuter.py84def test_choose_variables_list_deselect_returns_complement():CODE
LOW⚡tests/test_causal_refuter.py90def test_choose_variables_list_deselect_all_returns_empty():CODE
LOW⚡tests/test_causal_refuter.py96def test_choose_variables_list_mixed_select_deselect_raises():CODE
LOW⚡tests/test_causal_refuter.py102def test_choose_variables_list_invalid_variable_raises():CODE
LOW⚡tests/test_causal_refuter.py108def test_choose_variables_empty_pool_true_returns_empty():CODE
LOW⚡tests/test_causal_refuter.py114def test_choose_variables_empty_pool_false_returns_none():CODE
LOWtests/test_causal_graph.py58 def test_check_valid_backdoor_set(self):CODE
LOWtests/test_causal_graph.py120 def test_build_graph_from_str(self):CODE
LOW⚡tests/test_causal_graph.py131def test_identify_mediation_single_mediator():CODE
LOW⚡tests/test_causal_graph.py138def test_identify_mediation_parallel_mediators():CODE
LOW⚡tests/test_causal_graph.py148def test_identify_mediation_no_mediator():CODE
LOW⚡tests/test_causal_graph.py155def test_nie_with_parallel_mediators():CODE
LOWtests/test_propensity_balance_interpreter.py58 def test_interpreter_with_standard_covariate_names(self):CODE
LOWtests/test_propensity_balance_interpreter.py66 def test_interpreter_with_arbitrary_covariate_names(self):CODE
LOW⚡tests/test_propensity_balance_interpreter.py78 def test_interpreter_returns_dataframe(self):CODE
LOW⚡tests/test_propensity_balance_interpreter.py87 def test_interpreter_with_snake_case_method_name(self):CODE
LOW⚡tests/test_propensity_balance_interpreter.py93 def test_interpreter_with_multiple_method_names_returns_list(self):CODE
LOW…/causal_estimators/test_linear_regression_estimator.py151 def test_average_treatment_effect(CODE
LOW…/causal_estimators/test_linear_regression_estimator.py182 def test_general_adjustment_estimation_on_example_graphs(self, example_graph: TestGraphObject):CODE
LOW…/causal_estimators/test_linear_regression_estimator.py195 def test_none_identifier_method_does_not_raise(self):CODE
LOW…/causal_estimators/test_linear_regression_estimator.py217 def test_test_significance_returns_scalar_float_for_single_treatment(self):CODE
LOW…/causal_estimators/test_linear_regression_estimator.py249 def test_test_significance_returns_array_for_multiple_treatments(self):CODE
766 more matches not shown…
Cross-File Repetition38 hits · 190 pts
SeverityFileLineSnippetContext
HIGHdowhy/causal_estimators/econml.py0:param identified_estimand: probability expression representing the target identified estimand to estimate. :param test_STRING
HIGH…sal_estimators/propensity_score_weighting_estimator.py0:param identified_estimand: probability expression representing the target identified estimand to estimate. :param test_STRING
HIGH…hy/causal_estimators/two_stage_regression_estimator.py0:param identified_estimand: probability expression representing the target identified estimand to estimate. :param test_STRING
HIGH…ausal_estimators/regression_discontinuity_estimator.py0:param identified_estimand: probability expression representing the target identified estimand to estimate. :param test_STRING
HIGH…usal_estimators/propensity_score_matching_estimator.py0:param identified_estimand: probability expression representing the target identified estimand to estimate. :param test_STRING
HIGHdowhy/causal_estimators/propensity_score_estimator.py0:param identified_estimand: probability expression representing the target identified estimand to estimate. :param test_STRING
HIGHdowhy/causal_estimators/linear_regression_estimator.py0:param identified_estimand: probability expression representing the target identified estimand to estimate. :param test_STRING
HIGHdowhy/causal_estimators/regression_estimator.py0:param identified_estimand: probability expression representing the target identified estimand to estimate. :param test_STRING
HIGHdowhy/causal_estimators/causalml.py0:param identified_estimand: probability expression representing the target identified estimand to estimate. :param test_STRING
HIGH…y/causal_estimators/instrumental_variable_estimator.py0:param identified_estimand: probability expression representing the target identified estimand to estimate. :param test_STRING
HIGHdowhy/causal_estimators/distance_matching_estimator.py0:param identified_estimand: probability expression representing the target identified estimand to estimate. :param test_STRING
HIGH…stimators/propensity_score_stratification_estimator.py0:param identified_estimand: probability expression representing the target identified estimand to estimate. :param test_STRING
HIGHdowhy/causal_estimators/doubly_robust_estimator.py0:param identified_estimand: probability expression representing the target identified estimand to estimate. :param test_STRING
HIGHdowhy/causal_estimators/econml.py0fits the estimator with data for effect estimation :param data: data frame containing the data :param treatment: name ofSTRING
HIGHdowhy/causal_estimators/tabpfn_estimator.py0fits the estimator with data for effect estimation :param data: data frame containing the data :param treatment: name ofSTRING
HIGH…sal_estimators/propensity_score_weighting_estimator.py0fits the estimator with data for effect estimation :param data: data frame containing the data :param treatment: name ofSTRING
HIGH…ausal_estimators/regression_discontinuity_estimator.py0fits the estimator with data for effect estimation :param data: data frame containing the data :param treatment: name ofSTRING
HIGH…usal_estimators/propensity_score_matching_estimator.py0fits the estimator with data for effect estimation :param data: data frame containing the data :param treatment: name ofSTRING
HIGHdowhy/causal_estimators/linear_regression_estimator.py0fits the estimator with data for effect estimation :param data: data frame containing the data :param treatment: name ofSTRING
HIGHdowhy/causal_estimators/causalml.py0fits the estimator with data for effect estimation :param data: data frame containing the data :param treatment: name ofSTRING
HIGH…y/causal_estimators/instrumental_variable_estimator.py0fits the estimator with data for effect estimation :param data: data frame containing the data :param treatment: name ofSTRING
HIGH…ausal_estimators/generalized_linear_model_estimator.py0fits the estimator with data for effect estimation :param data: data frame containing the data :param treatment: name ofSTRING
HIGH…stimators/propensity_score_stratification_estimator.py0fits the estimator with data for effect estimation :param data: data frame containing the data :param treatment: name ofSTRING
HIGHdowhy/causal_estimators/regression_estimator.py0fits the estimator with data for effect estimation :param data: data frame containing the data :param treatment: name ofSTRING
HIGHdowhy/causal_estimators/econml.py0data: dataframe containing the data on which treatment effect is to be estimated. treatment_value: value of the treatmenSTRING
HIGHdowhy/causal_estimators/causalml.py0data: dataframe containing the data on which treatment effect is to be estimated. treatment_value: value of the treatmenSTRING
HIGH…y/causal_estimators/instrumental_variable_estimator.py0data: dataframe containing the data on which treatment effect is to be estimated. treatment_value: value of the treatmenSTRING
HIGHdowhy/causal_refuters/overrule/ruleset.py0overlapbooleanrule. this module implements the boolean ruleset estimator from overrule [1]. code is adapted (with some sSTRING
HIGHdowhy/causal_refuters/overrule/utils.py0overlapbooleanrule. this module implements the boolean ruleset estimator from overrule [1]. code is adapted (with some sSTRING
HIGH…/causal_refuters/overrule/BCS/load_process_data_BCS.py0overlapbooleanrule. this module implements the boolean ruleset estimator from overrule [1]. code is adapted (with some sSTRING
HIGHdowhy/causal_refuters/overrule/BCS/beam_search.py0overlapbooleanrule. this module implements the boolean ruleset estimator from overrule [1]. code is adapted (with some sSTRING
HIGH…y/causal_refuters/overrule/BCS/overlap_boolean_rule.py0overlapbooleanrule. this module implements the boolean ruleset estimator from overrule [1]. code is adapted (with some sSTRING
HIGHdowhy/graph_learners/ges.py0discover causal graph and return the graph in dot format.STRING
HIGHdowhy/graph_learners/cdt.py0discover causal graph and return the graph in dot format.STRING
HIGHdowhy/graph_learners/lingam.py0discover causal graph and return the graph in dot format.STRING
HIGHdowhy/utils/dgps/quadratic_dgp.py0implements a data generating process that returns data having linear relationship between the treatment, outcome and conSTRING
HIGHdowhy/utils/dgps/cubic_dgp.py0implements a data generating process that returns data having linear relationship between the treatment, outcome and conSTRING
HIGHdowhy/utils/dgps/linear_dgp.py0implements a data generating process that returns data having linear relationship between the treatment, outcome and conSTRING
Unused Imports153 hits · 134 pts
SeverityFileLineSnippetContext
LOWtest_parallel_refuters.py8CODE
LOWtests/test_confounder_distribution_interpreter.py17CODE
LOWtests/test_causal_graph.py4CODE
LOWtests/test_causal_graph.py5CODE
LOWtests/test_causal_graph.py11CODE
LOWtests/causal_estimators/mock_external_estimator.py1CODE
LOWtests/timeseries/test_temporal_shift.py2CODE
LOWtests/timeseries/test_temporal_shift.py2CODE
LOWtests/gcm/test_anomaly.py24CODE
LOWtests/gcm/test_feature_relevance.py8CODE
LOWtests/gcm/test_model_evaluation.py7CODE
LOWtests/gcm/test_intrinsic_influence.py20CODE
LOWtests/utils/test_plotting.py8CODE
LOW…sal_identifiers/test_complete_adjustment_identifier.py3CODE
LOWtests/causal_identifiers/test_backdoor_identifier.py1CODE
LOWtests/causal_identifiers/test_auto_identifier.py31CODE
LOWtests/causal_identifiers/test_frontdoor_identifier.py3CODE
LOWtests/causal_identifiers/test_frontdoor_identifier.py6CODE
LOWtests/causal_identifiers/test_frontdoor_identifier.py6CODE
LOWtests/causal_identifiers/test_frontdoor_identifier.py8CODE
LOW…discovery-book/test_causal_inference_discovery_book.py11CODE
LOW…discovery-book/test_causal_inference_discovery_book.py11CODE
LOWdowhy/__init__.py3CODE
LOWdowhy/__init__.py3CODE
LOWdowhy/__init__.py3CODE
LOWdowhy/__init__.py3CODE
LOWdowhy/__init__.py4CODE
LOWdowhy/causal_identifier/id_identifier.py1CODE
LOWdowhy/causal_identifier/__init__.py1CODE
LOWdowhy/causal_identifier/__init__.py1CODE
LOWdowhy/causal_identifier/__init__.py1CODE
LOWdowhy/causal_identifier/__init__.py1CODE
LOWdowhy/causal_identifier/__init__.py1CODE
LOWdowhy/causal_identifier/__init__.py1CODE
LOWdowhy/causal_identifier/__init__.py1CODE
LOWdowhy/causal_identifier/__init__.py1CODE
LOWdowhy/causal_identifier/__init__.py11CODE
LOWdowhy/causal_identifier/__init__.py11CODE
LOWdowhy/causal_identifier/__init__.py12CODE
LOWdowhy/causal_identifier/__init__.py13CODE
LOWdowhy/causal_identifier/__init__.py13CODE
LOWdowhy/causal_estimators/tabpfn_estimator.py1CODE
LOW…usal_estimators/propensity_score_matching_estimator.py3CODE
LOWdowhy/timeseries/temporal_shift.py3CODE
LOWdowhy/timeseries/temporal_shift.py3CODE
LOWdowhy/timeseries/temporal_shift.py3CODE
LOWdowhy/causal_refuters/data_subset_refuter.py10CODE
LOWdowhy/causal_refuters/placebo_treatment_refuter.py12CODE
LOWdowhy/causal_refuters/evalue_sensitivity_analyzer.py10CODE
LOWdowhy/causal_refuters/bootstrap_refuter.py12CODE
LOWdowhy/causal_refuters/__init__.py5CODE
LOWdowhy/causal_refuters/__init__.py5CODE
LOWdowhy/causal_refuters/__init__.py5CODE
LOWdowhy/causal_refuters/__init__.py10CODE
LOWdowhy/causal_refuters/__init__.py10CODE
LOWdowhy/causal_refuters/__init__.py11CODE
LOWdowhy/causal_refuters/__init__.py11CODE
LOWdowhy/causal_refuters/__init__.py12CODE
LOWdowhy/causal_refuters/__init__.py12CODE
LOWdowhy/causal_refuters/__init__.py13CODE
93 more matches not shown…
Decorative Section Separators24 hits · 92 pts
SeverityFileLineSnippetContext
MEDIUM⚡tests/test_causal_refuter.py40# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/test_causal_refuter.py42# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/utils/test_graph_operations.py26# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/utils/test_graph_operations.py28# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/utils/test_graph_operations.py38# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/utils/test_graph_operations.py40# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/utils/test_graph_operations.py271# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/utils/test_graph_operations.py273# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/utils/test_graph_operations.py291# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/utils/test_graph_operations.py293# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/utils/test_graph_operations.py320# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡tests/utils/test_graph_operations.py322# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/utils/test_graph_operations.py69# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/utils/test_graph_operations.py71# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/utils/test_graph_operations.py130# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/utils/test_graph_operations.py132# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/utils/test_graph_operations.py161# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/utils/test_graph_operations.py163# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/utils/test_graph_operations.py203# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/utils/test_graph_operations.py205# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/utils/test_graph_operations.py224# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/utils/test_graph_operations.py226# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/causal_prediction/test_causal_prediction.py9# ── pure-Python tests (no torch / pytorch-lightning required) ─────────────────COMMENT
MEDIUM⚡tests/causal_prediction/test_causal_prediction.py62# ── torch-dependent tests (skipped when torch / pl are absent) ────────────────COMMENT
Self-Referential Comments33 hits · 78 pts
SeverityFileLineSnippetContext
MEDIUM…usal_estimators/test_two_stage_regression_estimator.py86 # Create the graph describing the causal structureCOMMENT
MEDIUM…usal_estimators/test_two_stage_regression_estimator.py142 # Create a modelSTRING
MEDIUMtests/causal_estimators/test_causalml_estimator.py36 # Create a model that captures the sameCOMMENT
MEDIUMtests/causal_estimators/test_causalml_estimator.py61 # Create a model that captures the sameCOMMENT
MEDIUMtests/causal_estimators/test_causalml_estimator.py86 # Create a model that captures the sameCOMMENT
MEDIUMtests/causal_estimators/test_causalml_estimator.py113 # Create a model that captures the sameCOMMENT
MEDIUMtests/causal_estimators/test_causalml_estimator.py138 # Create a model that captures the sameCOMMENT
MEDIUMtests/causal_estimators/base.py307 # Create a copy of the data and swap the rows.COMMENT
MEDIUM…/causal_estimators/test_distance_matching_estimator.py153 # Create a categorical common causeCOMMENT
MEDIUM…ts/causal_refuters/test_add_unobserved_common_cause.py266 # Creating a model with no unobserved confoundersCOMMENT
MEDIUMtests/gcm/test_anomaly.py334 {"X0": X0[:1], "X1": X1[:1] + np.std(X1.data) * 3, "X2": X2[:1], "X3": X3[:1]} # Creating an anomaly hereCODE
MEDIUMtests/gcm/test_anomaly_attribution.py31 # Defining an anomaly scorer that handles multidimensional inputs.COMMENT
MEDIUMtests/gcm/test_anomaly_attribution.py84 # Defining an anomaly scorer that handles multidimensional inputs.COMMENT
MEDIUM…discovery-book/test_causal_inference_discovery_book.py72 # Define the true effectCOMMENT
MEDIUM…discovery-book/test_causal_inference_discovery_book.py145 # Create the graph describing the causal structureCOMMENT
MEDIUMdocs/generate_docs.sh54# Create the top-level index.htmlCOMMENT
MEDIUMdowhy/datasets.py896 # Creating a NN to simulate the nuisance functionCOMMENT
MEDIUMdowhy/datasets.py973 # The following code for loading the Lalonde dataset was copied fromCOMMENT
MEDIUMdowhy/datasets.py1014 # The following code is a slight modification ofCOMMENT
MEDIUMdowhy/causal_model.py351 # Define the third-party estimation method to be usedCOMMENT
MEDIUMdowhy/gcm/unit_change.py1"""This module provides the APIs for attributing the change in the output value of a deterministic mechanism for a statiSTRING
MEDIUMdowhy/gcm/whatif.py1"""This module provides functionality to answer what-if questions."""STRING
MEDIUMdowhy/gcm/causal_mechanisms.py1"""This module implements different causal mechanisms."""STRING
MEDIUMdowhy/gcm/fitting_sampling.py1"""This module provides functionality for fitting probabilistic causal models and drawing samples from them."""STRING
MEDIUMdowhy/gcm/confidence_intervals.py1"""This module provides functionality to estimate confidence intervals via bootstrapping."""STRING
MEDIUMdowhy/gcm/influence.py1"""This module provides functions to estimate causal influences."""STRING
MEDIUMdowhy/gcm/influence.py81 # Creating a smaller subgraph, which only contains upstream nodes that are connected to the target node.COMMENT
MEDIUMdowhy/gcm/influence.py273 # Creating a smaller subgraph, which only contains upstream nodes that are connected to the target node.COMMENT
MEDIUMdowhy/gcm/confidence_intervals_cms.py1"""This module provides functionality to estimate confidence intervals via bootstrapping the fitting and sampling."""STRING
MEDIUMdowhy/gcm/shapley.py1"""This module provides functionality for shapley value estimation."""STRING
MEDIUMdowhy/gcm/falsify.py1"""This module provides functionality to falsify a user-given DAG given observed data."""STRING
MEDIUMdowhy/utils/timeseries.py208 # Create a new edge with a tuple containing the time lagCOMMENT
MEDIUMdowhy/utils/timeseries.py217 # Create a new edge with a tuple containing the time lagCOMMENT
Deep Nesting72 hits · 72 pts
SeverityFileLineSnippetContext
LOWtests/causal_refuters/base.py34CODE
LOWtests/gcm/ml/test_classification.py31CODE
LOWtests/gcm/ml/test_classification.py32CODE
LOW…usal_identifiers/test_efficient_backdoor_identifier.py11CODE
LOWdowhy/causal_refuter.py80CODE
LOWdowhy/causal_graph.py28CODE
LOWdowhy/causal_graph.py90CODE
LOWdowhy/graph.py366CODE
LOWdowhy/graph.py435CODE
LOWdowhy/datasets.py632CODE
LOWdowhy/datasets.py647CODE
LOWdowhy/datasets.py687CODE
LOWdowhy/causal_model.py21CODE
LOWdowhy/causal_model.py271CODE
LOWdowhy/causal_model.py550CODE
LOWdowhy/causal_identifier/backdoor.py137CODE
LOWdowhy/causal_identifier/backdoor.py249CODE
LOWdowhy/causal_identifier/efficient_backdoor.py202CODE
LOWdowhy/causal_identifier/efficient_backdoor.py256CODE
LOWdowhy/causal_identifier/auto_identifier.py154CODE
LOW…hy/causal_estimators/two_stage_regression_estimator.py165CODE
LOWdowhy/causal_estimators/distance_matching_estimator.py172CODE
LOWdowhy/timeseries/temporal_shift.py9CODE
LOWdowhy/timeseries/temporal_shift.py79CODE
LOWdowhy/causal_refuters/placebo_treatment_refuter.py97CODE
LOWdowhy/causal_refuters/evalue_sensitivity_analyzer.py96CODE
LOWdowhy/causal_refuters/bootstrap_refuter.py95CODE
LOWdowhy/causal_refuters/linear_sensitivity_analyzer.py224CODE
LOWdowhy/causal_refuters/dummy_outcome_refuter.py258CODE
LOWdowhy/causal_refuters/dummy_outcome_refuter.py728CODE
LOWdowhy/causal_refuters/dummy_outcome_refuter.py872CODE
LOWdowhy/causal_refuters/dummy_outcome_refuter.py895CODE
LOWdowhy/causal_refuters/add_unobserved_common_cause.py847CODE
LOWdowhy/causal_refuters/add_unobserved_common_cause.py137CODE
LOWdowhy/causal_refuters/graph_refuter.py69CODE
LOWdowhy/causal_refuters/overrule/utils.py42CODE
LOW…/causal_refuters/overrule/BCS/load_process_data_BCS.py67CODE
LOW…/causal_refuters/overrule/BCS/load_process_data_BCS.py132CODE
LOWdowhy/causal_refuters/overrule/BCS/beam_search.py56CODE
LOW…y/causal_refuters/overrule/BCS/overlap_boolean_rule.py291CODE
LOWdowhy/gcm/model_evaluation.py416CODE
LOWdowhy/gcm/model_evaluation.py634CODE
LOWdowhy/gcm/model_evaluation.py764CODE
LOWdowhy/gcm/model_evaluation.py785CODE
LOWdowhy/gcm/model_evaluation.py182CODE
LOWdowhy/gcm/model_evaluation.py427CODE
LOWdowhy/gcm/equation_parser.py44CODE
LOWdowhy/gcm/distribution_change_robust.py204CODE
LOWdowhy/gcm/distribution_change_robust.py295CODE
LOWdowhy/gcm/influence.py160CODE
LOWdowhy/gcm/shapley.py76CODE
LOWdowhy/gcm/shapley.py312CODE
LOWdowhy/gcm/data_generator.py233CODE
LOWdowhy/gcm/falsify.py304CODE
LOWdowhy/gcm/falsify.py745CODE
LOWdowhy/gcm/falsify.py964CODE
LOWdowhy/gcm/auto.py184CODE
LOWdowhy/gcm/auto.py489CODE
LOWdowhy/gcm/auto.py524CODE
LOWdowhy/gcm/independence_test/__init__.py6CODE
12 more matches not shown…
AI Structural Patterns53 hits · 53 pts
SeverityFileLineSnippetContext
LOWtests/causal_estimators/test_causalml_estimator.py23CODE
LOWtests/causal_estimators/base.py22CODE
LOWtests/causal_estimators/base.py117CODE
LOWtests/causal_refuters/base.py34CODE
LOWdowhy/datasets.py71CODE
LOWdowhy/datasets.py853CODE
LOWdowhy/datasets.py1044CODE
LOWdowhy/causal_estimator.py73CODE
LOWdowhy/causal_model.py21CODE
LOWdowhy/causal_model.py271CODE
LOWdowhy/causal_model.py500CODE
LOWdowhy/causal_identifier/identified_estimand.py12CODE
LOWdowhy/causal_estimators/econml.py47CODE
LOWdowhy/causal_estimators/tabpfn_estimator.py279CODE
LOW…sal_estimators/propensity_score_weighting_estimator.py27CODE
LOW…hy/causal_estimators/two_stage_regression_estimator.py34CODE
LOW…ausal_estimators/regression_discontinuity_estimator.py21CODE
LOW…usal_estimators/propensity_score_matching_estimator.py28CODE
LOWdowhy/causal_estimators/linear_regression_estimator.py27CODE
LOWdowhy/causal_estimators/causalml.py30CODE
LOW…y/causal_estimators/instrumental_variable_estimator.py31CODE
LOWdowhy/causal_estimators/distance_matching_estimator.py22CODE
LOWdowhy/causal_estimators/propensity_score_estimator.py21CODE
LOW…ausal_estimators/generalized_linear_model_estimator.py26CODE
LOW…stimators/propensity_score_stratification_estimator.py27CODE
LOWdowhy/causal_estimators/doubly_robust_estimator.py27CODE
LOWdowhy/causal_estimators/regression_estimator.py21CODE
LOW…causal_refuters/partial_linear_sensitivity_analyzer.py46CODE
LOW…causal_refuters/partial_linear_sensitivity_analyzer.py522CODE
LOWdowhy/causal_refuters/bootstrap_refuter.py147CODE
LOWdowhy/causal_refuters/assess_overlap_overrule.py109CODE
LOWdowhy/causal_refuters/linear_sensitivity_analyzer.py31CODE
LOWdowhy/causal_refuters/linear_sensitivity_analyzer.py368CODE
LOWdowhy/causal_refuters/dummy_outcome_refuter.py258CODE
LOWdowhy/causal_refuters/dummy_outcome_refuter.py408CODE
LOWdowhy/causal_refuters/add_unobserved_common_cause.py703CODE
LOWdowhy/causal_refuters/add_unobserved_common_cause.py847CODE
LOWdowhy/causal_refuters/reisz.py149CODE
LOWdowhy/causal_refuters/overrule/ruleset.py27CODE
LOW…y/causal_refuters/overrule/BCS/overlap_boolean_rule.py25CODE
LOWdowhy/gcm/model_evaluation.py53CODE
LOWdowhy/gcm/distribution_change_robust.py613CODE
LOWdowhy/gcm/distribution_change_robust.py295CODE
LOWdowhy/gcm/distribution_change_robust.py515CODE
LOWdowhy/gcm/influence.py216CODE
LOWdowhy/gcm/distribution_change.py87CODE
LOWdowhy/gcm/distribution_change.py350CODE
LOWdowhy/gcm/falsify.py518CODE
LOWdowhy/gcm/independence_test/kernel.py113CODE
LOWdowhy/gcm/util/plotting.py53CODE
LOWdowhy/utils/plotting.py113CODE
LOWdowhy/api/causal_data_frame.py35CODE
LOWdowhy/causal_prediction/algorithms/cacm.py9CODE
Redundant / Tautological Comments27 hits · 41 pts
SeverityFileLineSnippetContext
LOW⚡tests/utils/test_plotting.py21 # Check if calling the method causes some import or runtime errorsCOMMENT
LOWtests/causal_identifiers/test_optimize_backdoor.py28 # Check if backdoor sets are valid i.e. if they block all paths between the treatment and the outcomeCOMMENT
LOWtests/causal_identifiers/test_optimize_backdoor.py77 # Check if backdoor sets are valid i.e. if they block all paths between the treatment and the outcomeCOMMENT
LOWtests/causal_identifiers/test_optimize_backdoor.py105 # Check if backdoor sets are valid i.e. if they block all paths between the treatment and the outcomeCOMMENT
LOWtests/causal_identifiers/test_optimize_backdoor.py133 # Check if backdoor sets are valid i.e. if they block all paths between the treatment and the outcomeCOMMENT
LOWtests/causal_identifiers/test_optimize_backdoor.py161 # Check if backdoor sets are valid i.e. if they block all paths between the treatment and the outcomeCOMMENT
LOWdowhy/causal_refuter.py119 # Check if all are select or deselect variablesCOMMENT
LOWdowhy/causal_refuter.py131 # Check if all the required_variables belong to confounders, instrumental variables or effectCOMMENT
LOWdowhy/datasets.py738 ): # Check if current "node" has not been processed yet and if all the parent nodes have been processedCODE
LOWdowhy/causal_estimator.py133 # Check if some parameters were set, otherwise set to default valuesCOMMENT
LOWdowhy/causal_estimator.py574 # Check if any parameter is changed from the previous std error estimateCOMMENT
LOWdowhy/causal_estimator.py910 # Check if estimator's target estimand is identifiedCOMMENT
LOWdowhy/causal_model.py432 # Check if estimator's target estimand is identifiedCOMMENT
LOWdowhy/causal_identifier/backdoor.py166 # Check if path is backdoor and does not have nodes1\node1 or nodes2\node2 as intermediate nodesCOMMENT
LOW…hy/causal_estimators/two_stage_regression_estimator.py92 # Check if the treatment is one-dimensionalCOMMENT
LOWdowhy/causal_estimators/distance_matching_estimator.py136 # Check if the treatment is one-dimensionalCOMMENT
LOWdowhy/causal_estimators/propensity_score_estimator.py128 # Check if the treatment is one-dimensionalCOMMENT
LOWdowhy/timeseries/temporal_shift.py60 # Add the parent to the queue for further explorationCOMMENT
LOWdowhy/causal_refuters/assess_overlap_overrule.py210 # Check if all supported units are considered to be in the overlap setCOMMENT
LOWdowhy/causal_refuters/dummy_outcome_refuter.py608 # Check if we are using an estimator in the transformation listCOMMENT
LOWdowhy/causal_refuters/overrule/BCS/beam_search.py159 # Check if duplicateCOMMENT
LOWdowhy/gcm/whatif.py175 # Check if we need to apply an intervention on the given node.COMMENT
LOWdowhy/gcm/whatif.py180 # Check if the intervention function changes the shape of the data.COMMENT
LOWdowhy/gcm/shapley.py470 # Check if change in percentage is below thresholdCOMMENT
LOWdowhy/utils/timeseries.py45 # Check if the edge already existsCOMMENT
LOWdowhy/utils/timeseries.py104 # Check if the edge already existsCOMMENT
LOWdowhy/causal_prediction/algorithms/base_algorithm.py28 # Check if the optimizer is currently supportedCOMMENT
Modern Structural Boilerplate20 hits · 20 pts
SeverityFileLineSnippetContext
LOWdowhy/causal_refuter.py19logger = logging.getLogger(__name__)CODE
LOWdowhy/__init__.py39__all__ = [CODE
LOW⚡dowhy/causal_estimator.py17logger = logging.getLogger(__name__)CODE
LOWdowhy/causal_identifier/__init__.py15__all__ = [CODE
LOWdowhy/causal_identifier/auto_identifier.py30logger = logging.getLogger(__name__)CODE
LOWdowhy/causal_estimators/tabpfn_estimator.py23logger = logging.getLogger(__name__)CODE
LOWdowhy/causal_estimators/causalml.py19logger = logging.getLogger(__name__)CODE
LOWdowhy/causal_refuters/data_subset_refuter.py14logger = logging.getLogger(__name__)CODE
LOWdowhy/causal_refuters/placebo_treatment_refuter.py18logger = logging.getLogger(__name__)CODE
LOWdowhy/causal_refuters/bootstrap_refuter.py16logger = logging.getLogger(__name__)CODE
LOWdowhy/causal_refuters/__init__.py34__all__ = [CODE
LOWdowhy/causal_refuters/assess_overlap.py8logger = logging.getLogger(__name__)CODE
LOWdowhy/causal_refuters/dummy_outcome_refuter.py21logger = logging.getLogger(__name__)CODE
LOWdowhy/causal_refuters/add_unobserved_common_cause.py25logger = logging.getLogger(__name__)CODE
LOWdowhy/causal_refuters/random_common_cause.py15logger = logging.getLogger(__name__)CODE
LOWdowhy/gcm/config.py15def set_default_n_jobs(n_jobs: int) -> None:CODE
LOWdowhy/gcm/causal_models.py66 def set_causal_mechanism(self, node: Any, mechanism: Union[StochasticModel, ConditionalStochasticModel]) -> None:CODE
LOWdowhy/gcm/causal_models.py101 def set_causal_mechanism(self, node: Any, mechanism: Union[StochasticModel, FunctionalCausalModel]) -> None:CODE
LOWdowhy/gcm/equation_parser.py41logger = logging.getLogger(__name__)CODE
LOWdowhy/gcm/util/general.py41def set_random_seed(random_seed: int) -> None:CODE
Empty Error Handlers4 hits · 20 pts
SeverityFileLineSnippetContext
HIGHtests/test_causal_estimator.py84except Exception:CODE
HIGHtests/causal_estimators/base.py395except NotImplementedError:CODE
HIGHtests/gcm/test_equation_parser.py66except KeyError as ke:CODE
HIGHdowhy/utils/graph_operations.py244except nx.NetworkXNoPath:CODE
Cross-Language Confusion3 hits · 18 pts
SeverityFileLineSnippetContext
HIGHdowhy/causal_refuter.py167 "The normal-distribution p-value is undefined; returning p_value=1."CODE
HIGHdowhy/causal_refuters/evalue_sensitivity_analyzer.py425 # if CI crosses null, set its E-value to 1COMMENT
HIGHdowhy/gcm/divergence.py110 D_f(P || Q) = \int f(p(x)/q(x)) q(x) dx ~= -1/N \sum_x log(p(Y = 1 | x) / (1 - p(Y = 1 | x)))CODE
Excessive Try-Catch Wrapping12 hits · 14 pts
SeverityFileLineSnippetContext
LOWtest_parallel_refuters.py45 except Exception as e:CODE
LOWtest_parallel_refuters.py69 except Exception as e:CODE
LOWtests/test_causal_estimator.py84 except Exception:CODE
MEDIUMtests/causal_estimators/test_causalml_estimator.py159 print("Error with respect to the number of samples")CODE
MEDIUMtests/causal_estimators/base.py17 print("Error tolerance is", error_tolerance)CODE
LOWdowhy/graph.py465 except Exception as e:CODE
LOWdowhy/graph.py471 except Exception as e:CODE
LOWdowhy/graph.py482 except Exception as e:CODE
LOWdowhy/graph.py489 except Exception as e:CODE
LOWdowhy/causal_estimators/tabpfn_estimator.py64 except Exception as e:CODE
LOWdowhy/utils/encoding.py54 except Exception as e:CODE
LOWdowhy/utils/plotting.py61 except Exception as error:CODE
Over-Commented Block12 hits · 12 pts
SeverityFileLineSnippetContext
LOWtests/test_causal_estimator.py21class TestCausalEstimator(unittest.TestCase):COMMENT
LOWdocs/source/conf.py1# -*- coding: utf-8 -*-COMMENT
LOWdocs/source/conf.py81# The suffix(es) of source filenames.COMMENT
LOWdocs/source/conf.py121#COMMENT
LOWdocs/source/conf.py141COMMENT
LOW.github/workflows/repo-assist.lock.yml1# gh-aw-metadata: {"schema_version":"v3","frontmatter_hash":"6538abb568ad674ed3bfd5cd20c199190f28c126725f245a8bf6cbc92f9COMMENT
LOW.github/workflows/repo-assist.lock.yml21# Not all edits will cause changes to this file.COMMENT
LOW.github/workflows/repo-assist.lock.yml41# - COPILOT_GITHUB_TOKENCOMMENT
LOWdowhy/datasets.py981 # 1. Redistributions of source code must retain the above copyright notice, this list of conditions and theCOMMENT
LOWdowhy/datasets.py1021 #COMMENT
LOWdowhy/causal_estimator.py41COMMENT
LOWdowhy/gcm/confidence_intervals_cms.py21#COMMENT
Hallucination Indicators1 hit · 10 pts
SeverityFileLineSnippetContext
CRITICALdowhy/causal_prediction/models/networks.py90 tmp = self.network.conv1.weight.data.clone()CODE
AI Response Leakage1 hit · 8 pts
SeverityFileLineSnippetContext
HIGHdowhy/gcm/confidence_intervals_cms.py26# In this example, gcm.confidence_intervals is expecting a callable with non-deterministic outputs for building theCOMMENT
AI Slop Vocabulary2 hits · 4 pts
SeverityFileLineSnippetContext
LOWdowhy/graph.py248 # First we can just call get_proper_causal_path_nodes, thenCOMMENT
MEDIUMdowhy/causal_estimators/doubly_robust_estimator.py214 # Doubly robust formulaCOMMENT
Fake / Example Data3 hits · 3 pts
SeverityFileLineSnippetContext
LOWtests/causal_refuters/test_assess_overlap.py10def dummy_data():CODE
LOWtests/causal_refuters/test_assess_overlap.py34def refute(dummy_data):CODE
LOWtests/causal_refuters/test_assess_overlap.py35 model = CausalModel(data=dummy_data, treatment="T", outcome="Y", common_causes=["X1", "X2"])CODE
Modern AI Meta-Vocabulary1 hit · 2 pts
SeverityFileLineSnippetContext
MEDIUMAGENTS.md23 causal_model.py # CausalModel: orchestrates the 4-step workflowCODE
Overly Generic Function Names1 hit · 1 pts
SeverityFileLineSnippetContext
LOWdowhy/causal_refuters/dummy_outcome_refuter.py728def process_data(CODE
Verbosity Indicators1 hit · 0 pts
SeverityFileLineSnippetContext
LOWdowhy/causal_refuters/dummy_outcome_refuter.py754 :param outcome_validation: This variable stores the dummy_outcome generated by the transformationsSTRING