AI Slop Code RIsk Monitor

PyO3/pyo3

Rust bindings for the Python interpreter

4.6 Low pattern signal View on GitHub

Maintenance and Governance Review

This report summarizes scanner evidence for PyO3/pyo3, a Rust project with 16,220 GitHub stars. SynthScan examined 166,760 lines of code across 726 source files, recording 742 pattern matches distributed across 17 syntactic categories. The legacy adjusted pattern signal is 4.6 (Low 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.

4.6
Adjusted Signal
4.6
Raw Pattern Score
100%
Time Factor
2026-10-09
Last Push
16.2K
Stars
Rust
Language
166.8K
Lines of Code
726
Files
742
Pattern Hits
2026-10-12
Scan Date
0.01
HC Hit Rate

Risk Review · v3

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

Cognitive Ownership Risk 18.5/100 · LOW

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

Hallucinated Dependency & Supply Chain Risk 1.3/100 · LOW

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

Agent Over-Engineering Ratio 2.7/100 · LOW

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

PR Review Velocity Impact 21.1/100 · LOW

Which changes need focused human review? 742 finding(s).

What These Metrics Mean

Adjusted Signal
Legacy pattern score normalized per 1,000 scanned lines and multiplied by the repository-level time factor. It is not an estimate of AI authorship.
Raw Pattern Score
Sum of severity- and context-weighted pattern findings before applying the time factor.
Time Factor
A coarse multiplier based on repository last-push metadata. It does not identify when individual code was written.
Pattern Hits
Count of configured pattern findings. Review each location and surrounding code before acting.
HC Hit Rate
High- and critical-severity findings per scanned file. Severity is a configured detector weight, not proof of a vulnerability or authorship.
Lines / Files
Scan coverage denominators used by the legacy normalized score.

Pattern-Signal History

This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.

Severity Breakdown

Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.

CRITICAL 0HIGH 7MEDIUM 6LOW 729

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 742 distinct pattern matches across 17 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.

Over-Commented Block638 hits · 603 pts
SeverityFileLineSnippetContext
LOWtypos.toml1[files]COMMENT
LOWtypos.toml21# | ^^^COMMENT
LOWtypos.toml41# error: `placehold` should be `placeholder`COMMENT
LOWtypos.toml61# |COMMENT
LOWguide/src/class.md241 ) -> PyResult<()> {COMMENT
LOWguide/src/class.md261# });COMMENT
LOWguide/src/class.md501 if val % 2 == 0 {COMMENT
LOWguide/src/class.md841- For details on `parameter-list`, see the documentation of `Method arguments` section.COMMENT
LOWguide/src/class.md1081 #[classmethod]COMMENT
LOWguide/src/class.md1101# let doc: String = class.getattr("__doc__")?.extract()?;COMMENT
LOWguide/src/class.md1121# let sig: String = inspectCOMMENT
LOWguide/src/class.md1141# let method = class.getattr("my_static_method")?;COMMENT
LOWguide/src/parallelism.md41```COMMENT
LOWguide/src/parallelism.md61```COMMENT
LOWguide/src/function.md141 # let warnings = py.import("warnings")?;COMMENT
LOWguide/src/function.md161 # for (warning, (category, message)) in list.iter().zip(expected_warnings) {COMMENT
LOWguide/src/migration.md501# use pyo3::sync::GILOnceCell;COMMENT
LOWguide/src/migration.md1861```rustCOMMENT
LOWguide/src/advanced.md21For example, [`append_to_inittab!`]({{#PYO3_DOCS_URL}}/pyo3/macro.append_to_inittab.html) must be called before Python iCOMMENT
LOWguide/src/trait-bounds.md181# }COMMENT
LOWguide/src/trait-bounds.md201# self.modelCOMMENT
LOWguide/src/trait-bounds.md341Let's modify the code performing the type conversion to give a helpful error message to the Python user:COMMENT
LOWguide/src/trait-bounds.md381#COMMENT
LOWguide/src/conversions/traits.md1# Conversion traitsCOMMENT
LOWguide/src/conversions/traits.md41COMMENT
LOWguide/src/conversions/traits.md81# let dict = PyDict::new(py);COMMENT
LOWguide/src/conversions/traits.md101 string_attr: String,COMMENT
LOWguide/src/conversions/traits.md141 bar: String,COMMENT
LOWguide/src/conversions/traits.md161Tuple structs are also supported but do not allow customizing the extraction.COMMENT
LOWguide/src/conversions/traits.md221 inner: String,COMMENT
LOWguide/src/conversions/traits.md281# let rust_thing: RustyEnum<'_> = thing.extract()?;COMMENT
LOWguide/src/conversions/traits.md301# );COMMENT
LOWguide/src/conversions/traits.md321# match rust_thing {COMMENT
LOWguide/src/conversions/traits.md341# let rust_thing: RustyEnum<'_> = instance.extract()?;COMMENT
LOWguide/src/conversions/traits.md361# )?;COMMENT
LOWguide/src/conversions/traits.md381# b"text",COMMENT
LOWguide/src/conversions/traits.md401enum RustyEnum {COMMENT
LOWguide/src/conversions/traits.md421# }COMMENT
LOWguide/src/conversions/traits.md501# // Filled caseCOMMENT
LOWguide/src/function/signature.md141The example below creates a function `add` which accepts two positional-only arguments `a` and `b`, where `b` has a defaCOMMENT
LOWguide/src/function/signature.md201# Python::attach(|py| {COMMENT
LOWguide/src/function/signature.md241 a + bCOMMENT
LOWguide/src/function/error-handling.md161}COMMENT
LOWguide/src/class/numeric.md341# n = Number(0)COMMENT
LOWguide/src/class/numeric.md361#COMMENT
LOWguide/src/class/numeric.md381# import inspectCOMMENT
LOWguide/src/class/object.md41COMMENT
LOWguide/src/class/object.md281 self.0 == other.0COMMENT
LOWpyo3-ffi/src/moduleobject.rs41 pub fn PyModule_GetDict(arg1: *mut PyObject) -> *mut PyObject;COMMENT
LOWpyo3-ffi/src/methodobject.rs141/// Function types used to implement Python callables.COMMENT
LOWpyo3-ffi/src/lib.rs1#![no_std]COMMENT
LOWpyo3-ffi/src/lib.rs21//! - The vast majority can only be used safely while the thread is attached to the Python interpreter.COMMENT
LOWpyo3-ffi/src/lib.rs41//! PyO3 uses `rustc`'s `--cfg` flags to enable or disable code used for different Python versions.COMMENT
LOWpyo3-ffi/src/lib.rs61//! To use these attributes, add [`pyo3-build-config`] as a build dependency inCOMMENT
LOWpyo3-ffi/src/lib.rs81//! - CPython 3.9 or greaterCOMMENT
LOWpyo3-ffi/src/lib.rs101//! # Downstream Rust code (including code in `bin/`, `examples/`, and `tests/`) will not be ableCOMMENT
LOWpyo3-ffi/src/lib.rs121//! **`build.rs`**COMMENT
LOWpyo3-ffi/src/lib.rs141//! m_base: PyModuleDef_HEAD_INIT,COMMENT
LOWpyo3-ffi/src/lib.rs161//! // A zeroed PyMethodDef to mark the end of the array.COMMENT
LOWpyo3-ffi/src/lib.rs181//! slot: 0,COMMENT
578 more matches not shown…
Hyper-Verbose Identifiers56 hits · 56 pts
SeverityFileLineSnippetContext
LOWnoxfile.py60def _parse_supported_interpreter_version(CODE
LOWnoxfile.py74def _supported_interpreter_versions(CODE
LOW⚡noxfile.py325def _clippy_additional_workspaces(session: nox.Session) -> bool:CODE
LOWnoxfile.py644def test_cross_compilation_windows(session: nox.Session):CODE
LOWnoxfile.py1312def set_msrv_package_versions(session: nox.Session):STRING
LOWnoxfile.py1585def _iter_extern_libpython_blocks(source: str) -> Iterator[str]:CODE
LOWnoxfile.py1610def _cfg_attr_is_non_cpython_only(attr: str) -> bool:CODE
LOW⚡examples/word-count/tests/test_word_count.py35def test_word_count_rust_parallel(benchmark, contents):STRING
LOW⚡examples/word-count/tests/test_word_count.py40def test_word_count_rust_sequential(benchmark, contents):STRING
LOW⚡examples/word-count/tests/test_word_count.py45def test_word_count_python_sequential(benchmark, contents):STRING
LOW⚡examples/word-count/tests/test_word_count.py50def run_rust_sequential_twice(STRING
LOW⚡examples/word-count/tests/test_word_count.py60def test_word_count_rust_sequential_twice_with_threads(benchmark, contents):STRING
LOWpytests/tests/test_sequence.py9def test_vec_from_list_pystring():CODE
LOWpytests/tests/test_sequence.py29def test_rust_array_from_array():CODE
LOWpytests/tests/test_misc.py23def test_multiple_imports_same_interpreter_ok():CODE
LOWpytests/tests/test_misc.py41def test_import_in_subinterpreter_forbidden():CODE
LOWpytests/tests/test_misc.py67def test_type_fully_qualified_name_includes_module():CODE
LOWpytests/tests/test_datetime_hypothesis.py110def test_datetime_from_timestamp(dt):CODE
LOWpytests/tests/test_finalization.py27def test_hammer_attaching_in_thread():CODE
LOWpytests/tests/test_finalization.py35def test_detach_during_finalization():CODE
LOWpytests/tests/test_enums.py5def test_complex_enum_variant_constructors():CODE
LOWpytests/tests/test_enums.py39def test_complex_enum_variant_subclasses(variant: enums.ComplexEnum):CODE
LOWpytests/tests/test_enums.py43def test_complex_enum_field_getters():CODE
LOWpytests/tests/test_enums.py74def test_complex_enum_desugared_match(variant: enums.ComplexEnum):CODE
LOWpytests/tests/test_enums.py105def test_complex_enum_pyfunction_in_out_desugared_match(variant: enums.ComplexEnum):CODE
LOWpytests/tests/test_enums.py126def test_tuple_enum_variant_constructors():CODE
LOWpytests/tests/test_enums.py142def test_tuple_enum_variant_subclasses(variant: enums.TupleEnum):CODE
LOW⚡pytests/tests/test_enums.py153def test_tuple_enum_field_getters():CODE
LOW⚡pytests/tests/test_enums.py160def test_tuple_enum_index_getter():CODE
LOW⚡pytests/tests/test_enums.py170def test_mixed_complex_enum_pyfunction_instance_nothing(CODE
LOWpytests/tests/test_enums.py183def test_mixed_complex_enum_pyfunction_instance_empty(variant: enums.MixedComplexEnum):CODE
LOWpytests/tests/test_datetime.py76def test_invalid_time_fails_overflow(args):CODE
LOWpytests/tests/test_datetime.py126def test_invalid_datetime_fails():CODE
LOWpytests/tests/test_datetime.py136def test_datetime_from_timestamp_tzinfo():CODE
LOWpytests/tests/test_datetime.py194def test_tz_class_introspection():CODE
LOWpytests/tests/test_enums_match.py16def test_complex_enum_match_statement(variant: enums.ComplexEnum):CODE
LOWpytests/tests/test_enums_match.py44def test_complex_enum_pyfunction_in_out(variant: enums.ComplexEnum):CODE
LOWpytests/tests/test_enums_match.py68def test_complex_enum_partial_match(variant: enums.ComplexEnum):CODE
LOWpytests/tests/test_enums_match.py83def test_tuple_enum_match_statement(variant: enums.TupleEnum):CODE
LOWpytests/tests/test_enums_match.py103def test_simple_tuple_enum_match_statement(variant: enums.SimpleTupleEnum):CODE
LOWpytests/tests/test_enums_match.py119def test_tuple_enum_match_match_args(variant: enums.TupleEnum):CODE
LOWpytests/tests/test_enums_match.py136def test_tuple_enum_partial_match(variant: enums.TupleEnum):CODE
LOWpytests/tests/test_enums_match.py151def test_mixed_complex_enum_match_statement(variant: enums.MixedComplexEnum):CODE
LOWpytests/tests/test_pyclasses.py85def test_option_iter_type_hints() -> None:CODE
LOWpytests/tests/test_pyclasses.py170def test_no_constructor_defined_propagates_cause(cls: type, exc_message: str):CODE
LOWpytests/tests/test_pyfunctions.py66def test_simple_args_kwargs_py(benchmark):CODE
LOWpytests/tests/test_pyfunctions.py70def test_simple_args_kwargs_rs(benchmark):CODE
LOWpytests/tests/test_pyfunctions.py104def test_positional_only_batched_py(benchmark):CODE
LOWpytests/tests/test_pyfunctions.py118def test_positional_only_batched_rs(benchmark):CODE
LOWpytests/tests/test_pyfunctions.py146def many_keyword_arguments_py(CODE
LOWpytests/tests/test_pyfunctions.py167def call_with_many_keyword_arguments(f) -> Any:CODE
LOWpytests/tests/test_pyfunctions.py186def test_many_keyword_arguments_py(benchmark):CODE
LOWpytests/tests/test_pyfunctions.py190def test_many_keyword_arguments_rs(benchmark):CODE
LOWpytests/tests/test_exception.py4def test_pypy_exception_dealloc():CODE
LOWpytests/tests/test_objstore.py7def test_objstore_doesnot_leak_memory():CODE
LOWpytests/tests/test_path.py29def test_take_invalid_pathlike():CODE
Cross-Language Confusion5 hits · 32 pts
SeverityFileLineSnippetContext
HIGH⚡examples/plugin/python_plugin/gadget_init_plugin.py8 g.push(1)CODE
HIGH⚡examples/plugin/python_plugin/gadget_init_plugin.py9 g.push(2)CODE
HIGH⚡examples/plugin/python_plugin/gadget_init_plugin.py10 g.push(3)CODE
HIGHexamples/plugin/plugin_api/tests/test_Gadget.py22 gadget.push(42)CODE
HIGHpytests/tests/test_objstore.py23 store.push(message)CODE
Excessive Try-Catch Wrapping10 hits · 14 pts
SeverityFileLineSnippetContext
LOW⚡noxfile.py332 except Exception:CODE
LOW⚡noxfile.py341 except Exception:CODE
LOWnoxfile.py403 except Exception:CODE
LOWnoxfile.py1108 except Exception:CODE
LOWguide/src/migration.md1717 except Exception as e:CODE
LOW⚡guide/src/debugging.md318 except Exception:CODE
LOW⚡guide/src/debugging.md325 except Exception as e:CODE
MEDIUM⚡guide/src/debugging.md326 print(f"Error updating launch.json: {e}")CODE
LOWtests/test_inheritance.rs229except Exception as e:CODE
LOWsrc/types/traceback.rs158except Exception as e:CODE
Decorative Section Separators4 hits · 12 pts
SeverityFileLineSnippetContext
MEDIUMguide/glossary_linker.py66# ---------------------------------------------------------------------------COMMENT
MEDIUMguide/glossary_linker.py68# ---------------------------------------------------------------------------COMMENT
MEDIUMguide/glossary_linker.py183# ---------------------------------------------------------------------------COMMENT
MEDIUMguide/glossary_linker.py185# ---------------------------------------------------------------------------COMMENT
Unused Imports9 hits · 9 pts
SeverityFileLineSnippetContext
LOWnoxfile.py1CODE
LOWexamples/plugin/plugin_api/tests/test_import.py2CODE
LOWexamples/maturin-starter/maturin_starter/__init__.py2CODE
LOWexamples/maturin-starter/maturin_starter/__init__.py5CODE
LOWexamples/word-count/word_count/__init__.py1CODE
LOWexamples/word-count/word_count/__init__.py1CODE
LOWexamples/word-count/word_count/__init__.py1CODE
LOW…tools-rust-starter/setuptools_rust_starter/__init__.py2CODE
LOW…tools-rust-starter/setuptools_rust_starter/__init__.py5CODE
Deep Nesting7 hits · 7 pts
SeverityFileLineSnippetContext
LOWnoxfile.py812CODE
LOWnoxfile.py987CODE
LOWnoxfile.py1556CODE
LOWnoxfile.py1585CODE
LOWguide/glossary_linker.py84CODE
LOWpytests/tests/test_enums.py74CODE
LOWpytests/tests/test_enums.py105CODE
Synthetic Comment Markers1 hit · 5 pts
SeverityFileLineSnippetContext
HIGHContributing.md38We prefer that authors disclose if a contribution is generated by AI so we can take that into account without guesswork.CODE
Empty Error Handlers1 hit · 5 pts
SeverityFileLineSnippetContext
HIGHpytests/noxfile.py27except CommandFailed:CODE
TODO Padding3 hits · 4 pts
SeverityFileLineSnippetContext
LOWpyo3-macros-backend/src/py_expr.rs186 _ => PyConstant::Ellipsis, // TODO: implement ByteStr and CStrCODE
LOWpyo3-macros-backend/src/frompyobject.rs475 // TODO: implement using a Protocol?COMMENT
LOWpyo3-macros-backend/src/intopyobject.rs381 // TODO: implement using a Protocol?COMMENT
Self-Referential Comments1 hit · 3 pts
SeverityFileLineSnippetContext
MEDIUMpytests/tests/test_enums_match.py1# This file is only collected when Python >= 3.10, because it tests match syntax.COMMENT
Modern Structural Boilerplate2 hits · 2 pts
SeverityFileLineSnippetContext
LOWnoxfile.py224def set_coverage_env(session: nox.Session) -> None:CODE
LOWexamples/word-count/word_count/__init__.py3__all__ = [CODE
Redundant / Tautological Comments1 hit · 2 pts
SeverityFileLineSnippetContext
LOW.github/workflows/ci.yml878 # Check if all needs were successful or skipped.COMMENT
Example Usage Blocks1 hit · 2 pts
SeverityFileLineSnippetContext
LOWsrc/pyclass.rs66 /// Usage example:COMMENT
AI Slop Vocabulary1 hit · 2 pts
SeverityFileLineSnippetContext
LOWsrc/pycell/impl_.rs309 // For `#[pyclass]` types which inherit from PyAny, we can just call tp_freeCOMMENT
Fake / Example Data1 hit · 1 pts
SeverityFileLineSnippetContext
LOWguide/src/python-from-rust/calling-existing-code.md348 let house = house_class.call1(("123 Main Street",)).unwrap();CODE
AI Structural Patterns1 hit · 1 pts
SeverityFileLineSnippetContext
LOWpytests/tests/test_pyfunctions.py146CODE