AI Slop Code RIsk Monitor

shap/shap

A game theoretic approach to explain the output of any machine learning model.

7.7 Moderate pattern signal View on GitHub

Maintenance and Governance Review

This report summarizes scanner evidence for shap/shap, a Jupyter Notebook project with 25,803 GitHub stars. SynthScan examined 154,207 lines of code across 268 source files, recording 890 pattern matches distributed across 18 syntactic categories. The legacy adjusted pattern signal is 7.7 (Moderate 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.

7.7
Adjusted Signal
7.7
Raw Pattern Score
100%
Time Factor
2026-10-09
Last Push
25.8K
Stars
Jupyter Notebook
Language
154.2K
Lines of Code
268
Files
890
Pattern Hits
2026-10-12
Scan Date
0.19
HC Hit Rate

Risk Review · v3

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

Cognitive Ownership Risk 20.0/100 · LOW

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

Hallucinated Dependency & Supply Chain Risk 9.4/100 · LOW

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

Agent Over-Engineering Ratio 18.0/100 · LOW

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

PR Review Velocity Impact 32.5/100 · MEDIUM

Which changes need focused human review? 890 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 3HIGH 48MEDIUM 28LOW 811

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 890 distinct pattern matches across 18 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 Identifiers409 hits · 398 pts
SeverityFileLineSnippetContext
LOWshap/_explanation.py730 def _use_data_as_feature_names(self) -> dict[Any, list[Any]]:CODE
LOWshap/benchmark/metrics.py143def keep_absolute_mask__roc_auc(X, y, model_generator, method_name, num_fcounts=11):CODE
LOWshap/benchmark/metrics.py187def remove_absolute_mask__roc_auc(X, y, model_generator, method_name, num_fcounts=11):CODE
LOWshap/benchmark/metrics.py231def keep_absolute_resample__roc_auc(X, y, model_generator, method_name, num_fcounts=11):CODE
LOWshap/benchmark/metrics.py275def remove_absolute_resample__roc_auc(X, y, model_generator, method_name, num_fcounts=11):CODE
LOWshap/benchmark/metrics.py319def keep_absolute_impute__roc_auc(X, y, model_generator, method_name, num_fcounts=11):CODE
LOWshap/benchmark/metrics.py363def remove_absolute_impute__roc_auc(X, y, model_generator, method_name, num_fcounts=11):CODE
LOWshap/benchmark/metrics.py455def batch_remove_absolute_retrain__roc_auc(X, y, model_generator, method_name, num_fcounts=11):CODE
LOWshap/benchmark/metrics.py467def batch_keep_absolute_retrain__roc_auc(X, y, model_generator, method_name, num_fcounts=11):CODE
LOWshap/benchmark/methods.py56def tree_shap_tree_path_dependent(model, data):CODE
LOWshap/maskers/_text.py380def post_process_sentencepiece_tokenizer_output(s):CODE
LOWshap/maskers/_image.py171def _jit_build_partition_tree(xmin, xmax, ymin, ymax, zmin, zmax, total_ywidth, total_zwidth, M, clustering, q):CODE
LOWshap/utils/transformers.py28def parse_prefix_suffix_for_tokenizer(tokenizer):CODE
LOWshap/utils/_masked_model.py176 # def _build_varying_delta_mask_rows(self, masks):COMMENT
LOWshap/utils/_masked_model.py286def _assert_output_input_match(inputs, outputs):CODE
LOWshap/utils/_masked_model.py292def _convert_delta_mask_to_full(masks, full_masks):CODE
LOWshap/utils/_masked_model.py313def _validate_build_fixed_inputs(CODE
LOWshap/utils/_legacy.py82def convert_to_instance_with_index(val, column_name, index_value, index_name):CODE
LOWshap/models/_topk_lm.py113 def get_output_names_and_update_topk_token_ids(self, X):CODE
LOWshap/models/_text_generation.py206 def parse_prefix_suffix_for_model_generate_output(self, output):CODE
LOWshap/models/_teacher_forcing.py349 def get_teacher_forced_logits(self, X, Y):CODE
LOWshap/explainers/_coalition.py349def create_partition_hierarchy(CODE
LOWshap/explainers/_coalition.py443def _generate_paths_and_combinations(node: Node) -> list[tuple[str, tuple[Any, ...], float]]:CODE
LOWshap/explainers/_coalition.py512def _map_combinations_to_unique_masks(CODE
LOWshap/explainers/_explainer.py516 def supports_model_with_masker(model: Any, masker: Any) -> bool:CODE
LOWshap/explainers/_linear.py355 def supports_model_with_masker(model: Any, masker: Any) -> bool:CODE
LOWshap/explainers/_additive.py110 def supports_model_with_masker(model: Any, masker: Any) -> bool:CODE
LOWshap/explainers/_tree.py59def _safe_check_tree_instance_experimental(tree_instance: Any) -> None:CODE
LOWshap/explainers/_tree.py539 def _short_circuit_tree_path_dependent_to_external_shap_calculation(CODE
LOWshap/explainers/_tree.py920 def _get_shap_interactions_output(self, phi: npt.NDArray[Any], flat_output: bool) -> npt.NDArray[Any]:CODE
LOWshap/explainers/_tree.py966 def supports_model_with_masker(model: Any, masker: Any) -> bool:CODE
LOWshap/explainers/_tree.py1634 def _set_xgboost_model_attributes(CODE
LOWshap/explainers/_tree.py2234def get_xgboost_dmatrix_properties(model: Any) -> dict[str, Any]:CODE
LOWshap/explainers/other/_ubjson.py167def _decode_simple_key_value_pair(fp, key_type):CODE
LOWshap/explainers/_deep/deep_tf.py389 def execute_with_overridden_gradients(self, f):CODE
LOWshap/explainers/_deep/deep_tf.py688def linearity_with_excluded_handler(input_inds, explainer, op, *grads):CODE
LOWshap/plots/_decision.py35def __decision_plot_matplotlib(CODE
LOWshap/plots/_text.py1070 def process_text_to_text_shap_values(shap_values):STRING
LOWshap/plots/_text.py1459def unpack_shap_explanation_contents(shap_values):STRING
LOWshap/plots/_force_matplotlib.py303def draw_higher_lower_element(out_value, offset_text):CODE
LOWtests/conftest.py87def compare_numpy_outputs_against_baseline(*, func_file, baseline_dir=None, rtol=1e-4, atol=1e-6):CODE
LOWtests/test_explanation.py67def test_explanation_hstack_errors(random_seed):CODE
LOWtests/test_explanation.py99def test_feature_names_slicing_for_square_arrays(random_seed, N):CODE
LOWtests/test_explanation.py130def test_populating_op_history():CODE
LOWtests/test_explanation.py164def test_cohorts_invalid_input(inp):CODE
LOWtests/test_explanation.py173def test_cohorts_magic_methods(random_seed):CODE
LOWtests/test_explanation.py211def test_cohorts_magic_methods_errors():CODE
LOWtests/test_explanation.py239def test_cohorts_generation_with_one_feature():CODE
LOWtests/test_install.py7def test_importing_from_installed_package_not_local_files():CODE
LOWtests/maskers/test_composite.py9def test_composite_masker_init():CODE
LOWtests/maskers/test_composite.py25def test_composite_masker_with_fixed_maskers():CODE
LOWtests/maskers/test_composite.py40def test_composite_masker_shape_method():CODE
LOWtests/maskers/test_composite.py54def test_composite_masker_mask_shapes():CODE
LOWtests/maskers/test_composite.py69def test_composite_masker_data_transform():CODE
LOWtests/maskers/test_composite.py85def test_composite_masker_arg_count_mismatch():CODE
LOWtests/maskers/test_composite.py101def test_composite_masker_call_arg_count_mismatch():CODE
LOWtests/maskers/test_composite.py114def test_composite_masker_clustering():CODE
LOWtests/maskers/test_composite.py125def test_composite_masker_single_masker():CODE
LOWtests/maskers/test_composite.py138def test_composite_masker_three_maskers():CODE
LOWtests/maskers/test_composite.py153def test_composite_with_output_composite():CODE
349 more matches not shown…
Cross-Language Confusion22 hits · 135 pts
SeverityFileLineSnippetContext
HIGH⚡shap/plots/_text.py178 document._zoom_{uuid} = undefined;CODE
HIGH⚡shap/plots/_text.py180 var next_id = undefined;CODE
HIGH⚡shap/plots/_text.py182 if (document._zoom_{uuid} !== undefined) {{CODE
HIGHshap/plots/_text.py202 if (document._zoom_{uuid} !== undefined) {{ return; }}CODE
HIGHshap/plots/_text.py203 if (document._hover_{uuid} !== undefined) {{CODE
HIGHshap/plots/_text.py1317 var {uuid}_heatmap_flat_state = null;CODE
HIGHshap/plots/_text.py1320 if ({uuid}_heatmap_flat_state === null) {{CODE
HIGHshap/plots/_text.py1338 if ({uuid}_heatmap_flat_state === null) {{CODE
HIGHshap/plots/_text.py1362 {uuid}_heatmap_flat_state = null;CODE
HIGHshap/plots/_text.py1365 if ({uuid}_heatmap_flat_state === null) {{CODE
HIGHshap/plots/_text.py1448 if (id === null) {{CODE
HIGH⚡shap/plots/_image.py331 var {uuid}_heatmap_flat_state = null;CODE
HIGH⚡shap/plots/_image.py335 if ({uuid}_heatmap_flat_state === null) {{CODE
HIGH⚡shap/plots/_image.py342 if ({uuid}_heatmap_flat_state === null) {{CODE
HIGH⚡shap/plots/_image.py344 {uuid}_update_image_and_overlay(null);CODE
HIGH⚡shap/plots/_image.py349 if ({uuid}_heatmap_flat_state === null) {{CODE
HIGH⚡shap/plots/_image.py359 {uuid}_update_image_and_overlay(null);CODE
HIGH⚡shap/plots/_image.py360 {uuid}_heatmap_flat_state = null;CODE
HIGHshap/plots/_image.py389 if (selected_id == null) {{CODE
HIGHshap/plots/_image.py402 if ({uuid}_heatmap_flat_state !== null ) {{CODE
HIGHshap/plots/_image.py453 dragStart = null;CODE
HIGHshap/plots/_image.py495 savedTransforms.push(xform.translate(0, 0));CODE
Unused Imports135 hits · 132 pts
SeverityFileLineSnippetContext
LOWshap/datasets.py1CODE
LOWshap/__init__.py3CODE
LOWshap/__init__.py3CODE
LOWshap/__init__.py6CODE
LOWshap/__init__.py7CODE
LOWshap/__init__.py8CODE
LOWshap/__init__.py9CODE
LOWshap/__init__.py10CODE
LOWshap/__init__.py11CODE
LOWshap/__init__.py12CODE
LOWshap/__init__.py13CODE
LOWshap/__init__.py14CODE
LOWshap/__init__.py15CODE
LOWshap/__init__.py16CODE
LOWshap/__init__.py17CODE
LOWshap/__init__.py18CODE
LOWshap/__init__.py19CODE
LOWshap/__init__.py95CODE
LOWshap/__init__.py95CODE
LOWshap/__init__.py95CODE
LOWshap/__init__.py95CODE
LOWshap/__init__.py96CODE
LOWshap/__init__.py97CODE
LOWshap/__init__.py97CODE
LOWshap/__init__.py100CODE
LOWshap/__init__.py46CODE
LOWshap/links.py1CODE
LOWshap/_explanation.py1CODE
LOWshap/benchmark/__init__.py1CODE
LOWshap/benchmark/__init__.py2CODE
LOWshap/benchmark/__init__.py3CODE
LOWshap/benchmark/__init__.py4CODE
LOWshap/maskers/_fixed.py1CODE
LOWshap/maskers/_masker.py1CODE
LOWshap/maskers/__init__.py1CODE
LOWshap/maskers/__init__.py2CODE
LOWshap/maskers/__init__.py3CODE
LOWshap/maskers/__init__.py4CODE
LOWshap/maskers/__init__.py5CODE
LOWshap/maskers/__init__.py6CODE
LOWshap/maskers/__init__.py7CODE
LOWshap/maskers/__init__.py7CODE
LOWshap/maskers/__init__.py7CODE
LOWshap/maskers/__init__.py8CODE
LOWshap/maskers/_composite.py1CODE
LOWshap/utils/_types.py1CODE
LOWshap/utils/_clustering.py1CODE
LOWshap/utils/_clustering.py17CODE
LOWshap/utils/__init__.py1CODE
LOWshap/utils/__init__.py1CODE
LOWshap/utils/__init__.py1CODE
LOWshap/utils/__init__.py1CODE
LOWshap/utils/__init__.py1CODE
LOWshap/utils/__init__.py8CODE
LOWshap/utils/__init__.py8CODE
LOWshap/utils/__init__.py8CODE
LOWshap/utils/__init__.py8CODE
LOWshap/utils/__init__.py8CODE
LOWshap/utils/__init__.py8CODE
LOWshap/utils/__init__.py8CODE
75 more matches not shown…
Over-Commented Block95 hits · 94 pts
SeverityFileLineSnippetContext
LOWpyproject.toml141COMMENT
LOWshap/benchmark/plots.py21COMMENT
LOWshap/benchmark/plots.py41 # "keep_negative_mask": {COMMENT
LOWshap/benchmark/plots.py61 # "xlabel": "Max fraction of features removed",COMMENT
LOWshap/benchmark/plots.py81 # "sort_order": 9COMMENT
LOWshap/benchmark/plots.py101 # "keep_absolute_resample__roc_auc": {COMMENT
LOWshap/benchmark/plots.py121 # "xlabel": "Max fraction of features removed",COMMENT
LOWshap/benchmark/plots.py141 # "sort_order": 12COMMENT
LOWshap/benchmark/plots.py161 # "batch_keep_absolute__r2": {COMMENT
LOWshap/benchmark/plots.py181 # },COMMENT
LOWshap/benchmark/plots.py201 # "title": "Saabas"COMMENT
LOWshap/benchmark/plots.py541 "<div style='float: left; font-weight: regular; font-size: 24px; color: #000;'>SHAP Benchmark <span style='font-COMMENT
LOWshap/benchmark/_sequential.py21COMMENT
LOWshap/benchmark/_sequential.py121 # if not hasattr(attributions[0], "__len__"):COMMENT
LOWshap/maskers/_text.py261 # assert len(clustering)+1 == MCOMMENT
LOWshap/cutils/tabular_utils.h1#ifndef TABULAR_UTILS_HCOMMENT
LOWshap/cutils/grey_code_utils.h1#ifndef GREY_CODE_UTILS_HCOMMENT
LOWshap/utils/_masked_model.py181 # self._varying_delta_mask_rows = []COMMENT
LOWshap/cext/gpu_treeshap.h21#include <thrust/iterator/discard_iterator.h>COMMENT
LOWshap/cext/tree_shap.h1/**COMMENT
LOWshap/explainers/_partition.py301 base_value = f00COMMENT
LOWshap/explainers/_partition.py601 # #r = self.maskerCOMMENT
LOWshap/explainers/_partition.py621 # # output_indexes = np.argsort(np.abs(f11))[:out_len]COMMENT
LOWshap/explainers/_partition.py641 # owen(fc=0)COMMENT
LOWshap/explainers/_partition.py661 # while not q.empty() and len(batch_masks) < batch_size and eval_count < max_evals:COMMENT
LOWshap/explainers/_partition.py681 # self.dvalues[ind] += (f11 - f00) * weightCOMMENT
LOWshap/explainers/_partition.py701COMMENT
LOWshap/explainers/_partition.py721 # new_weight /= 2COMMENT
LOWshap/explainers/_gradient.py401 # regression model with priors of the coefficients equal to the estimated variances for eachCOMMENT
LOWshap/explainers/_kernel.py761 eyAdj2 = eyAdj - self.maskMatrix[:, nonzero_inds[-1]] * (COMMENT
LOWshap/explainers/_additive.py161# data : numpy.array, pandas.DataFrameCOMMENT
LOWshap/explainers/_additive.py181# self.data = dataCOMMENT
LOWshap/explainers/_additive.py201# X : numpy.array, pandas.DataFrame or scipy.csr_matrixCOMMENT
LOWshap/explainers/_additive.py221# X = X.valuesCOMMENT
LOWshap/explainers/pytree.py21# self.model_type = "xgboost"COMMENT
LOWshap/explainers/pytree.py41COMMENT
LOWshap/explainers/pytree.py61# return phi[:, 0]COMMENT
LOWshap/explainers/pytree.py81# if self.model_type == "xgboost":COMMENT
LOWshap/explainers/pytree.py101# def __init__(self, children_left, children_right, children_default, feature, threshold, value, node_sample_weight)COMMENT
LOWshap/explainers/pytree.py121# if hasattr(tree, "missing_go_to_left"):COMMENT
LOWshap/explainers/pytree.py321COMMENT
LOWshap/explainers/other/_ubjson.py81# [d][67.0]COMMENT
LOWshap/plots/_beeswarm.py141 # out_names = shap_exp.output_namesCOMMENT
LOWshap/plots/_beeswarm.py221 raise ValueError(emsg)COMMENT
LOWshap/plots/_beeswarm.py241 # return beeswarm(COMMENT
LOWshap/plots/_beeswarm.py261 # slow = -vCOMMENT
LOWshap/plots/_beeswarm.py281 # plt.subplot(1, max_display, i + 1)COMMENT
LOWshap/plots/colors/_colors.py121# default_colors = ["#1E88E5", "#ff0d57", "#13B755", "#7C52FF", "#FFC000", "#00AEEF"]COMMENT
LOWshap/plots/colors/_colorconv.py1### ------------ vendored from skimage.color.colorconv -------------COMMENT
LOWshap/plots/colors/_colorconv.py21# may be used to endorse or promote products derived from this softwareCOMMENT
LOWtests/explainers/test_tree.py1501 )COMMENT
LOWtests/explainers/test_tree.py1761 #COMMENT
LOWtests/plots/test_decision.py121# import lightgbm as lgbCOMMENT
LOWtests/plots/test_decision.py141# "max_bin": 512,COMMENT
LOWtests/plots/test_decision.py161# shap_interaction_values = explainer.shap_interaction_values(features)COMMENT
LOWtests/plots/test_decision.py181# shap.decision_plot(base_value, shap_values[0, :])COMMENT
LOWtests/plots/test_decision.py201# # Now with feature names in the features argument as numpy.COMMENT
LOWtests/plots/test_decision.py221# highlight = y_label != (expit(predictions) > 0.5)COMMENT
LOWtests/plots/test_decision.py241# shap.decision_plot(alpha=0.2, **args1)COMMENT
LOWtests/plots/test_decision.py261# shap.decision_plot(**args2) # to compare with previous plotCOMMENT
35 more matches not shown…
Deep Nesting88 hits · 87 pts
SeverityFileLineSnippetContext
LOWshap/_explanation.py966CODE
LOWshap/_explanation.py108CODE
LOWshap/_explanation.py317CODE
LOWshap/_serializable.py70CODE
LOWshap/benchmark/_explanation_error.py92CODE
LOWshap/benchmark/plots.py386CODE
LOWshap/benchmark/plots.py446CODE
LOWshap/benchmark/experiments.py266CODE
LOWshap/benchmark/_sequential.py88CODE
LOWshap/benchmark/_sequential.py216CODE
LOWshap/maskers/_text.py111CODE
LOWshap/maskers/_text.py177CODE
LOWshap/maskers/_tabular.py22CODE
LOWshap/maskers/_image.py171CODE
LOWshap/maskers/_image.py72CODE
LOWshap/utils/transformers.py28CODE
LOWshap/utils/_clustering.py154CODE
LOWshap/utils/_masked_model.py74CODE
LOWshap/utils/_general.py45CODE
LOWshap/utils/_general.py73CODE
LOWshap/utils/_general.py121CODE
LOWshap/models/_topk_lm.py203CODE
LOWshap/models/_text_generation.py123CODE
LOWshap/models/_teacher_forcing.py266CODE
LOWshap/models/_teacher_forcing.py349CODE
LOWshap/actions/_optimizer.py12CODE
LOWshap/actions/_optimizer.py31CODE
LOWshap/explainers/_coalition.py332CODE
LOWshap/explainers/_coalition.py481CODE
LOWshap/explainers/_coalition.py207CODE
LOWshap/explainers/_explainer.py37CODE
LOWshap/explainers/_partition.py755CODE
LOWshap/explainers/_partition.py283CODE
LOWshap/explainers/_gradient.py268CODE
LOWshap/explainers/_gradient.py311CODE
LOWshap/explainers/_gradient.py576CODE
LOWshap/explainers/_sampling.py79CODE
LOWshap/explainers/_linear.py495CODE
LOWshap/explainers/_linear.py105CODE
LOWshap/explainers/_linear.py330CODE
LOWshap/explainers/_linear.py428CODE
LOWshap/explainers/_permutation.py132CODE
LOWshap/explainers/_kernel.py234CODE
LOWshap/explainers/_kernel.py371CODE
LOWshap/explainers/_kernel.py580CODE
LOWshap/explainers/_kernel.py659CODE
LOWshap/explainers/_kernel.py713CODE
LOWshap/explainers/_exact.py344CODE
LOWshap/explainers/_exact.py365CODE
LOWshap/explainers/_exact.py120CODE
LOWshap/explainers/_tree.py163CODE
LOWshap/explainers/_tree.py539CODE
LOWshap/explainers/_tree.py1015CODE
LOWshap/explainers/_tree.py1676CODE
LOWshap/explainers/_tree.py1858CODE
LOWshap/explainers/_tree.py2533CODE
LOWshap/explainers/pytree.py143CODE
LOWshap/explainers/pytree.py168CODE
LOWshap/explainers/other/_maple.py154CODE
LOWshap/explainers/other/_treegain.py12CODE
28 more matches not shown…
Empty Error Handlers15 hits · 75 pts
SeverityFileLineSnippetContext
HIGHshap/benchmark/metrics.py13except Exception:CODE
HIGHshap/benchmark/plots.py18except ImportError:CODE
HIGHshap/explainers/_explainer.py344except Exception:CODE
HIGHshap/explainers/_gradient.py568except AttributeError:CODE
HIGHshap/explainers/_gradient.py217except Exception:CODE
HIGHshap/explainers/other/_lime.py9except ImportError:CODE
HIGHshap/explainers/_deep/deep_pytorch.py267except AttributeError:CODE
HIGHshap/explainers/_deep/deep_pytorch.py271except AttributeError:CODE
HIGHshap/explainers/_deep/deep_pytorch.py304except AttributeError:CODE
HIGHshap/explainers/_deep/deep_pytorch.py90except AttributeError:CODE
HIGHshap/explainers/_deep/deep_pytorch.py94except AttributeError:CODE
HIGHshap/plots/_bar.py322except Exception:CODE
HIGHshap/plots/_bar.py444except TypeError:CODE
HIGHtests/conftest.py17except ImportError:CODE
HIGHtests/explainers/test_deep.py311except ImportError:CODE
Cross-File Repetition11 hits · 55 pts
SeverityFileLineSnippetContext
HIGHshap/explainers/_explainer.py0determines if this explainer can handle the given model. this is an abstract static method meant to be implemented by eaSTRING
HIGHshap/explainers/_additive.py0determines if this explainer can handle the given model. this is an abstract static method meant to be implemented by eaSTRING
HIGHshap/explainers/_tree.py0determines if this explainer can handle the given model. this is an abstract static method meant to be implemented by eaSTRING
HIGHshap/explainers/_partition.py0explains a single row and returns the tuple (row_values, row_expected_values, row_mask_shapes).STRING
HIGHshap/explainers/_linear.py0explains a single row and returns the tuple (row_values, row_expected_values, row_mask_shapes).STRING
HIGHshap/explainers/_permutation.py0explains a single row and returns the tuple (row_values, row_expected_values, row_mask_shapes).STRING
HIGHshap/explainers/_additive.py0explains a single row and returns the tuple (row_values, row_expected_values, row_mask_shapes).STRING
HIGHshap/explainers/_exact.py0explains a single row and returns the tuple (row_values, row_expected_values, row_mask_shapes).STRING
HIGHtests/plots/test_beeswarm.py0checks that valueerror is raised if the features data matrix has an incompatible shape with the shap_values matrix.STRING
HIGHtests/plots/test_violin.py0checks that valueerror is raised if the features data matrix has an incompatible shape with the shap_values matrix.STRING
HIGHtests/plots/test_summary.py0checks that valueerror is raised if the features data matrix has an incompatible shape with the shap_values matrix.STRING
Self-Referential Comments11 hits · 37 pts
SeverityFileLineSnippetContext
MEDIUMshap/explainers/_coalition.py331# This function is to encode the dictionary to our specific structureCOMMENT
MEDIUMshap/explainers/pytree.py1"""This module is a pure python implementation of Tree SHAP.STRING
MEDIUMtests/maskers/test_output_composite.py128 # Create a custom masker that takes 2 argumentsCOMMENT
MEDIUMtests/maskers/test_output_composite.py159 # Create a minimal masker without all optional attributesCOMMENT
MEDIUMtests/explainers/test_tree.py884 # Define an objective function for skopt to optimise.COMMENT
MEDIUMtests/explainers/test_tree.py2027 # Create a SHAP TreeExplainerCOMMENT
MEDIUM⚡tests/plots/test_force_js.py48 # Create a simple modelCOMMENT
MEDIUM⚡tests/plots/test_force_js.py53 # Create the explainerCOMMENT
MEDIUM⚡tests/plots/test_force_js.py63 # Create a simple modelCOMMENT
MEDIUM⚡tests/plots/test_force_js.py68 # Create the explainerCOMMENT
MEDIUMdocs/conf.py6# This file is execfile()d with the current directory set to itsCOMMENT
AI Slop Vocabulary15 hits · 34 pts
SeverityFileLineSnippetContext
LOWshap/explainers/_linear.py247 # if we still have some multi-collinearity present then we just add regularization...COMMENT
LOWshap/explainers/_exact.py144 # if nothing varies then we can just return the expected value as the output and be done with itCOMMENT
LOWshap/plots/_violin.py326 # to ignore it, just set it to the previous y-values (so the area between them will be zero). Not ysCOMMENT
LOWshap/plots/_beeswarm.py1038 # to ignore it, just set it to the previous y-values (so the area between them will be zero). Not ysCOMMENT
MEDIUM⚡shap/plots/resources/bundle.js2(()=>{var e={543(e,t,n){var r;e=n.nmd(e),function(){var a,i="Expected a function",o="__lodash_hash_undefined__",l="__lodCODE
MEDIUM⚡shap/plots/resources/bundle.js2(()=>{var e={543(e,t,n){var r;e=n.nmd(e),function(){var a,i="Expected a function",o="__lodash_hash_undefined__",l="__lodCODE
MEDIUM⚡docs/artwork/california_dataset.html3(()=>{var e={486:function(e,t,n){var r;e=n.nmd(e),function(){var a,i="Expected a function",o="__lodash_hash_undefined__"CODE
MEDIUM⚡docs/artwork/california_dataset.html3(()=>{var e={486:function(e,t,n){var r;e=n.nmd(e),function(){var a,i="Expected a function",o="__lodash_hash_undefined__"CODE
MEDIUM⚡docs/artwork/california_instance.html3(()=>{var e={486:function(e,t,n){var r;e=n.nmd(e),function(){var a,i="Expected a function",o="__lodash_hash_undefined__"CODE
MEDIUM⚡docs/artwork/california_instance.html3(()=>{var e={486:function(e,t,n){var r;e=n.nmd(e),function(){var a,i="Expected a function",o="__lodash_hash_undefined__"CODE
MEDIUM⚡…iner/Keras LSTM for IMDB Sentiment Classification.html12004function r(t,e){if(!o.canUseDOM||e&&!("addEventListener"in document))return!1;var n="on"+t,r=n in document;if(!r){var a=CODE
LOW⚡…iner/Keras LSTM for IMDB Sentiment Classification.html12004function r(t,e){if(!o.canUseDOM||e&&!("addEventListener"in document))return!1;var n="on"+t,r=n in document;if(!r){var a=CODE
MEDIUM⚡…iner/Keras LSTM for IMDB Sentiment Classification.html12004function r(t,e){if(!o.canUseDOM||e&&!("addEventListener"in document))return!1;var n="on"+t,r=n in document;if(!r){var a=CODE
LOW…Intermediate Layer of VGG16 on ImageNet (PyTorch).html11886<h2 id="Explain-with-local-smoothing">Explain with local smoothing<a class="anchor-link" href="#Explain-with-local-smootCODE
MEDIUMjavascript/package-lock.json9024 "resolved": "https://registry.npmjs.org/robust-predicates/-/robust-predicates-3.0.2.tgz",CODE
Excessive Try-Catch Wrapping31 hits · 32 pts
SeverityFileLineSnippetContext
LOWshap/_explanation.py524 except Exception:CODE
LOWshap/benchmark/metrics.py13except Exception:CODE
LOWshap/benchmark/metrics.py18except Exception:CODE
LOWshap/maskers/_text.py53 except Exception:CODE
LOWshap/utils/_legacy.py143 except Exception:CODE
LOWshap/explainers/_explainer.py344 except Exception:CODE
LOWshap/explainers/_gradient.py80 except Exception:CODE
LOWshap/explainers/_gradient.py86 except Exception:CODE
LOWshap/explainers/_gradient.py217 except Exception:CODE
LOWshap/explainers/_linear.py362 except Exception:CODE
LOWshap/explainers/tf_utils.py32 except Exception:CODE
LOWshap/explainers/_tree.py976 except Exception:CODE
LOWshap/explainers/_tree.py1431 except Exception:CODE
LOWshap/explainers/_tree.py1444 except Exception:CODE
LOWshap/explainers/_tree.py1457 except Exception:CODE
LOWshap/explainers/_tree.py1471 except Exception:CODE
LOWshap/explainers/_tree.py1484 except Exception:CODE
LOWshap/explainers/_tree.py1499 except Exception:CODE
LOWshap/explainers/_tree.py1509 except Exception:CODE
LOWshap/explainers/_deep/__init__.py77 except Exception:CODE
LOWshap/explainers/_deep/__init__.py83 except Exception:CODE
LOWshap/plots/_beeswarm.py393 except Exception:CODE
LOWshap/plots/_beeswarm.py805 except Exception:CODE
LOWshap/plots/_bar.py322 except Exception:CODE
LOWtests/datasets_to_cache.py66 except Exception as e:CODE
LOWtests/datasets_to_cache.py77 except Exception as e:CODE
LOWtests/explainers/test_tree.py233 except Exception:CODE
LOWtests/explainers/test_tree.py289 except Exception:CODE
LOWtests/explainers/test_deep.py215 except Exception:CODE
LOW⚡tests/plots/test_force_js.py35 except Exception:CODE
LOW⚡tests/plots/test_force_js.py38 except Exception:CODE
Hallucination Indicators3 hits · 30 pts
SeverityFileLineSnippetContext
CRITICALshap/explainers/tf_utils.py31 session = tf.compat.v1.keras.backend.get_session()CODE
CRITICALtests/explainers/test_deep.py235 sess = tf.compat.v1.keras.backend.get_session()CODE
CRITICAL…/user_studies/sickness_scores/static/lib/jquery-min.js5}({});var B=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;function R(e,n,r,i){if(x.acceptData(e)){var o,a,s=x.expando,l=e.CODE
Decorative Section Separators8 hits · 24 pts
SeverityFileLineSnippetContext
MEDIUMCMakeLists.txt33# ==============================================================================COMMENT
MEDIUMCMakeLists.txt35# ==============================================================================COMMENT
MEDIUMCMakeLists.txt81# ==============================================================================COMMENT
MEDIUMCMakeLists.txt83# ==============================================================================COMMENT
MEDIUMCMakeLists.txt113# ==============================================================================COMMENT
MEDIUMCMakeLists.txt116# ==============================================================================COMMENT
MEDIUMshap/explainers/_additive.py157# ----------COMMENT
MEDIUMshap/explainers/_additive.py200# ----------COMMENT
AI Structural Patterns15 hits · 15 pts
SeverityFileLineSnippetContext
LOWshap/_explanation.py108CODE
LOWshap/models/_model.py29CODE
LOWshap/explainers/_deep/deep_tf.py387CODE
LOWshap/plots/_heatmap.py11CODE
LOWshap/plots/_partial_dependence.py31CODE
LOWshap/plots/_violin.py25CODE
LOWshap/plots/_decision.py212CODE
LOWshap/plots/_force.py30CODE
LOWshap/plots/_force.py384CODE
LOWshap/plots/_group_difference.py7CODE
LOWshap/plots/_beeswarm.py40CODE
LOWshap/plots/_beeswarm.py521CODE
LOWshap/plots/_image.py27CODE
LOWshap/plots/_scatter.py23CODE
LOWshap/plots/_scatter.py517CODE
Modern Structural Boilerplate12 hits · 12 pts
SeverityFileLineSnippetContext
LOWshap/__init__.py103__all__ = [CODE
LOWshap/benchmark/__init__.py9__all__ = ["ComputeTime", "ExplanationError", "BenchmarkResult", "SequentialMasker"]CODE
LOWshap/maskers/__init__.py10__all__ = [CODE
LOWshap/utils/__init__.py25__all__ = [CODE
LOWshap/models/__init__.py7__all__ = [CODE
LOWshap/actions/__init__.py3__all__ = ["Action"]CODE
LOWshap/explainers/__init__.py28__all__ = [CODE
LOWshap/explainers/other/__init__.py7__all__ = [CODE
LOWshap/plots/_style.py96def set_style(_style: StyleConfig | None = None, /, **options: Unpack[StyleOptions]) -> None:CODE
LOWshap/plots/__init__.py24__all__ = [CODE
LOWshap/plots/colors/__init__.py17__all__ = [CODE
LOWtests/plots/test_image.py8def set_reproducible_mpl_rcparams() -> None:CODE
Verbosity Indicators5 hits · 9 pts
SeverityFileLineSnippetContext
LOWshap/explainers/_coalition.py242 # Step 1: build the hierarchyCOMMENT
LOWshap/explainers/_coalition.py259 # Step 2: Compute model results for all unique masksCOMMENT
LOW⚡shap/explainers/_coalition.py270 # Step 3: Compute marginals for permutationsCOMMENT
LOW⚡shap/explainers/_coalition.py277 # Step 4: Implement Owen values weightingCOMMENT
LOWshap/explainers/_coalition.py298 # Step 5: Return resultsCOMMENT
Structural Annotation Overuse5 hits · 9 pts
SeverityFileLineSnippetContext
LOWshap/explainers/_coalition.py242 # Step 1: build the hierarchyCOMMENT
LOWshap/explainers/_coalition.py259 # Step 2: Compute model results for all unique masksCOMMENT
LOW⚡shap/explainers/_coalition.py270 # Step 3: Compute marginals for permutationsCOMMENT
LOW⚡shap/explainers/_coalition.py277 # Step 4: Implement Owen values weightingCOMMENT
LOWshap/explainers/_coalition.py298 # Step 5: Return resultsCOMMENT
Fake / Example Data6 hits · 8 pts
SeverityFileLineSnippetContext
LOW⚡shap/plots/resources/bundle.js2(()=>{var e={543(e,t,n){var r;e=n.nmd(e),function(){var a,i="Expected a function",o="__lodash_hash_undefined__",l="__lodCODE
LOW⚡docs/artwork/california_dataset.html3(()=>{var e={486:function(e,t,n){var r;e=n.nmd(e),function(){var a,i="Expected a function",o="__lodash_hash_undefined__"CODE
LOW⚡docs/artwork/california_instance.html3(()=>{var e={486:function(e,t,n){var r;e=n.nmd(e),function(){var a,i="Expected a function",o="__lodash_hash_undefined__"CODE
LOW…notebooks/Census income classification with Keras.html11831"ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"TCODE
LOW…s/notebooks/Iris classification with scikit-learn.html11837"ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"TCODE
LOW…iner/Keras LSTM for IMDB Sentiment Classification.html11990var i=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;t.exports=fCODE
Redundant / Tautological Comments4 hits · 6 pts
SeverityFileLineSnippetContext
LOWshap/utils/image.py39 # Check if empty or notCOMMENT
LOW.github/workflows/run_tests.yml125 # Set DYLD_LIBRARY_PATH to avoid OpenMP conflicts, see https://github.com/unit8co/darts/pull/3050COMMENT
LOW.github/workflows/build_wheels.yml122 # Set DYLD_LIBRARY_PATH to avoid OpenMP conflicts, see https://github.com/unit8co/darts/pull/3050COMMENT
LOW.github/workflows/test_js.yml32 # Check if the built bundle matches the committed bundle (ignoring whitespace)COMMENT