Build and publish crates with pyo3, cffi and uniffi bindings as well as rust binaries as python packages
This report presents the forensic synthetic code analysis of PyO3/maturin, a Rust project with 5,775 GitHub stars. SynthScan v2.0 examined 78,825 lines of code across 559 source files, recording 190 pattern matches distributed across 14 syntactic categories. The overall adjusted score of 3.8 places this repository in the Likely human-written band.
The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).
This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.
Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.
This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.
The scanner identified 190 distinct pattern matches across 14 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.
Reading the findings table: The Severity column indicates the diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | deny.toml | 1 | # This template contains all of the possible sections and their default values | COMMENT |
| LOW | deny.toml | 21 | # `target_family = "unix"` configuration, that only having windows targets in | COMMENT |
| LOW | deny.toml | 41 | # from the view of cargo-deny. This is an extremely heavy hammer, as if a crate | COMMENT |
| LOW | deny.toml | 61 | # option can be used to specify the depth at which feature edges will be added. | COMMENT |
| LOW | deny.toml | 81 | #"a-crate-that-is-yanked@0.1.1", # you can also ignore yanked crate versions if you wish | COMMENT |
| LOW | deny.toml | 121 | # Each entry is the crate and version constraint, and its specific allow | COMMENT |
| LOW | deny.toml | 141 | # the license expression. If the contents match, the clarification will be used | COMMENT |
| LOW | deny.toml | 161 | # is only published to private registries, and ignore is true, the crate will | COMMENT |
| LOW | deny.toml | 181 | # The default lint level for `default` features for crates that are members of | COMMENT |
| LOW | deny.toml | 201 | ] | COMMENT |
| LOW | deny.toml | 221 | #] | COMMENT |
| LOW | deny.toml | 241 | # More documentation about the 'sources' section can be found here: | COMMENT |
| LOW | guide/src/config.md | 21 | # Features can also be conditional on the target Python version | COMMENT |
| LOW | guide/src/config.md | 61 | # Bindings type | COMMENT |
| LOW | guide/src/config.md | 81 | sdist-generator = "cargo" | COMMENT |
| LOW | guide/src/config.md | 181 | COMMENT | |
| LOW | tests/common/mod.rs | 101 | pub fn case_target_dir(case_id: &str) -> PathBuf { | COMMENT |
| LOW | tests/common/integration.rs | 21 | /// | COMMENT |
| LOW | src/cargo_options.rs | 81 | COMMENT | |
| LOW | src/cross_compile.rs | 101 | /// | COMMENT |
| LOW | src/build_options.rs | 21 | /// Find interpreters from the host machine | COMMENT |
| LOW | src/build_options.rs | 41 | /// The `pypi` option applies on all platforms and ensure that only tags that can be uploaded to | COMMENT |
| LOW | src/build_options.rs | 61 | #[arg(long, conflicts_with = "skip_auditwheel")] | COMMENT |
| LOW | src/build_options.rs | 81 | #[derive(Debug, Default, Serialize, Deserialize, clap::Parser, Clone, Eq, PartialEq)] | COMMENT |
| LOW | src/build_options.rs | 101 | /// High level API for building wheels from a crate, also used for the CLI. | COMMENT |
| LOW | src/metadata.rs | 21 | /// The metadata required to generate the .dist-info directory | COMMENT |
| LOW | src/lib.rs | 1 | //! Builds wheels from a crate that exposes python bindings through pyo3 | COMMENT |
| LOW | src/lib.rs | 21 | //! - auditwheel: Enables dependency auditing and wheel repair for macOS (install-name/rpath | COMMENT |
| LOW | src/upload.rs | 21 | use std::time::Duration; | COMMENT |
| LOW | src/upload.rs | 41 | /// | COMMENT |
| LOW | src/upload.rs | 81 | } | COMMENT |
| LOW | src/project_layout.rs | 21 | /// Contains the canonicalized (i.e. absolute) path to the python part of the project | COMMENT |
| LOW | src/project_layout.rs | 301 | format!( | COMMENT |
| LOW | src/pyproject_toml.rs | 21 | pub maturin: Option<ToolMaturin>, | COMMENT |
| LOW | src/pyproject_toml.rs | 61 | #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] | COMMENT |
| LOW | src/pyproject_toml.rs | 141 | } | COMMENT |
| LOW | src/pyproject_toml.rs | 161 | pub enum CargoCrateType { | COMMENT |
| LOW | src/pyproject_toml.rs | 201 | #[serde(alias = "macosx-deployment-target")] | COMMENT |
| LOW | src/pyproject_toml.rs | 221 | pub struct SbomConfig { | COMMENT |
| LOW | src/pyproject_toml.rs | 241 | /// [tool.maturin] | COMMENT |
| LOW | src/pyproject_toml.rs | 341 | /// | COMMENT |
| LOW | src/pyproject_toml.rs | 361 | /// Include files matching the given glob pattern(s). | COMMENT |
| LOW | src/pyproject_toml.rs | 381 | pub strip: bool, | COMMENT |
| LOW | src/pyproject_toml.rs | 401 | /// List of features to activate. | COMMENT |
| LOW | src/pyproject_toml.rs | 421 | /// Use base Python executable instead of venv Python executable in PEP 517 build. | COMMENT |
| LOW | src/pyproject_toml.rs | 441 | /// The `[tool.maturin.generate-ci]` section | COMMENT |
| LOW | src/pyproject_toml.rs | 481 | COMMENT | |
| LOW | src/pyproject_toml.rs | 521 | #[derive(Serialize, Deserialize, Debug, Clone)] | COMMENT |
| LOW | src/main.rs | 41 | struct Opt { | COMMENT |
| LOW | src/main.rs | 61 | #[command(name = "build", alias = "b")] | COMMENT |
| LOW | src/main.rs | 81 | /// Can also be enabled via the MATURIN_PGO environment variable. | COMMENT |
| LOW | src/main.rs | 101 | /// | COMMENT |
| LOW | src/main.rs | 121 | /// Build only a source distribution (sdist) without compiling. | COMMENT |
| LOW | src/main.rs | 141 | path: Option<String>, | COMMENT |
| LOW | src/main.rs | 161 | #[cfg(feature = "upload")] | COMMENT |
| LOW | src/main.rs | 181 | cargo: CargoOptions, | COMMENT |
| LOW | src/compile.rs | 61 | /// Library search paths for this architecture | COMMENT |
| LOW | src/compile.rs | 81 | #[derive(Debug, Clone)] | COMMENT |
| LOW | src/compile.rs | 101 | /// `copy_back_cargo_outputs` has restored unpatched bytes at the | COMMENT |
| LOW | src/compile.rs | 121 | /// per-arch dependency analysis during macOS wheel repair. | COMMENT |
| 58 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | Cargo.toml | 113 | # project scaffolding, maturin new/init/generate-ci | COMMENT |
| MEDIUM | Cargo.toml | 214 | # project scaffolding | COMMENT |
| MEDIUM | tests/cli.rs | 18 | #[cfg(not(feature = "scaffolding"))] | COMMENT |
| MEDIUM | tests/cli.rs | 25 | #[cfg(not(all(feature = "upload", feature = "zig", feature = "scaffolding")))] | COMMENT |
| MEDIUM | src/lib.rs | 64 | #[cfg(feature = "scaffolding")] | COMMENT |
| MEDIUM | src/lib.rs | 84 | #[cfg(feature = "scaffolding")] | COMMENT |
| MEDIUM | src/lib.rs | 94 | #[cfg(feature = "scaffolding")] | COMMENT |
| MEDIUM | src/main.rs | 18 | #[cfg(feature = "scaffolding")] | COMMENT |
| MEDIUM⚡ | src/main.rs | 137 | #[cfg(feature = "scaffolding")] | COMMENT |
| MEDIUM⚡ | src/main.rs | 146 | #[cfg(feature = "scaffolding")] | COMMENT |
| MEDIUM⚡ | src/main.rs | 154 | #[cfg(feature = "scaffolding")] | COMMENT |
| MEDIUM⚡ | src/main.rs | 266 | #[cfg(feature = "scaffolding")] | COMMENT |
| MEDIUM⚡ | src/main.rs | 268 | #[cfg(feature = "scaffolding")] | COMMENT |
| MEDIUM⚡ | src/main.rs | 270 | #[cfg(feature = "scaffolding")] | COMMENT |
| MEDIUM | src/commands/mod.rs | 9 | #[cfg(feature = "scaffolding")] | COMMENT |
| MEDIUM⚡ | src/commands/mod.rs | 66 | #[cfg(feature = "scaffolding")] | COMMENT |
| MEDIUM⚡ | src/commands/mod.rs | 73 | #[cfg(feature = "scaffolding")] | COMMENT |
| MEDIUM⚡ | src/commands/mod.rs | 80 | #[cfg(feature = "scaffolding")] | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| CRITICAL | src/build_orchestrator.rs | 468 | self.context.project.project_layout.data.as_deref(), | CODE |
| CRITICAL⚡ | src/build_orchestrator.rs | 771 | if !self.context.project.metadata24.scripts.is_empty() { | CODE |
| CRITICAL⚡ | src/build_orchestrator.rs | 777 | if !self.context.project.metadata24.entry_points.is_empty() { | CODE |
| CRITICAL⚡ | src/build_orchestrator.rs | 781 | if self.context.project.project_layout.python_module.is_some() { | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | maturin/bootstrap.py | 12 | CODE | |
| LOW | maturin/bootstrap.py | 19 | CODE | |
| LOW | maturin/__init__.py | 11 | CODE | |
| LOW | maturin/__main__.py | 1 | CODE | |
| LOW | …licit/python/cffi_mixed_implicit/some_rust/__init__.py | 1 | CODE | |
| LOW | …licit/python/cffi_mixed_implicit/some_rust/__init__.py | 1 | CODE | |
| LOW | …ixed-py-subdir/python/cffi_mixed_py_subdir/__init__.py | 1 | CODE | |
| LOW | …ixed-py-subdir/python/cffi_mixed_py_subdir/__init__.py | 1 | CODE | |
| LOW | test-crates/uniffi-mixed/uniffi_mixed/__init__.py | 1 | CODE | |
| LOW | test-crates/cffi-mixed/cffi_mixed/__init__.py | 1 | CODE | |
| LOW | test-crates/cffi-mixed/cffi_mixed/__init__.py | 1 | CODE | |
| LOW | test-crates/cffi-mixed/cffi_mixed/__init__.py | 2 | CODE | |
| LOW | …xed-with-path-dep/cffi_mixed_with_path_dep/__init__.py | 1 | CODE | |
| LOW | …xed-with-path-dep/cffi_mixed_with_path_dep/__init__.py | 1 | CODE | |
| LOW | …t-crates/cffi-mixed-src/src/cffi_mixed_src/__init__.py | 1 | CODE | |
| LOW | …t-crates/cffi-mixed-src/src/cffi_mixed_src/__init__.py | 1 | CODE | |
| LOW | test-crates/pyo3-mixed/pyo3_mixed/__init__.py | 1 | CODE | |
| LOW | …/cffi-mixed-submodule/cffi_mixed_submodule/__init__.py | 1 | CODE | |
| LOW | …submodule/cffi_mixed_submodule/rust_module/__init__.py | 1 | CODE | |
| LOW | …include-exclude/cffi_mixed_include_exclude/__init__.py | 1 | CODE | |
| LOW | …include-exclude/cffi_mixed_include_exclude/__init__.py | 1 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | …licit/python/cffi_mixed_implicit/some_rust/__init__.py | 3 | __all__ = ["ffi", "lib"] | CODE |
| LOW | …ixed-py-subdir/python/cffi_mixed_py_subdir/__init__.py | 3 | __all__ = ["ffi", "lib"] | CODE |
| LOW | test-crates/cffi-mixed/cffi_mixed/__init__.py | 4 | __all__ = ["Line", "ffi", "lib"] | CODE |
| LOW | …xed-with-path-dep/cffi_mixed_with_path_dep/__init__.py | 3 | __all__ = ["ffi", "lib"] | CODE |
| LOW | …t-crates/cffi-mixed-src/src/cffi_mixed_src/__init__.py | 3 | __all__ = ["ffi", "lib"] | CODE |
| LOW | …/cffi-mixed-submodule/cffi_mixed_submodule/__init__.py | 3 | __all__ = ["rust"] | CODE |
| LOW | …submodule/cffi_mixed_submodule/rust_module/__init__.py | 3 | __all__ = ["rust"] | CODE |
| LOW | …include-exclude/cffi_mixed_include_exclude/__init__.py | 3 | __all__ = ["ffi", "lib"] | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | noxfile.py | 93 | def _resolve_pyodide_platform_inputs(info: dict) -> dict: | CODE |
| LOW | maturin/bootstrap.py | 22 | def get_requires_for_build_wheel(config_settings: dict[str, Any] | None = None) -> list[str]: | CODE |
| LOW | maturin/bootstrap.py | 28 | def get_requires_for_build_sdist(config_settings: dict[str, Any] | None = None) -> list[str]: | CODE |
| LOW | maturin/__init__.py | 165 | def get_requires_for_build_wheel(config_settings: Mapping[str, Any] | None = None) -> list[str]: | CODE |
| LOW | maturin/__init__.py | 189 | def get_requires_for_build_sdist(config_settings: Mapping[str, Any] | None = None) -> list[str]: | CODE |
| LOW | maturin/__init__.py | 197 | def prepare_metadata_for_build_wheel(metadata_directory: str, config_settings: Mapping[str, Any] | None = None) -> str: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/common/other.rs | 720 | // Step 1: Build the sdist | COMMENT |
| LOW | tests/common/other.rs | 744 | // Step 2: Unpack sdist and build wheels from it | COMMENT |
| LOW | src/python_interpreter/resolver.rs | 253 | // Step 1: PYO3_CONFIG_FILE is an explicit override that trumps everything | COMMENT |
| LOW | src/python_interpreter/resolver.rs | 268 | // Step 2: Discover candidates (unified for native/cross) | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/common/other.rs | 720 | // Step 1: Build the sdist | COMMENT |
| LOW | tests/common/other.rs | 744 | // Step 2: Unpack sdist and build wheels from it | COMMENT |
| LOW | src/python_interpreter/resolver.rs | 253 | // Step 1: PYO3_CONFIG_FILE is an explicit override that trumps everything | COMMENT |
| LOW | src/python_interpreter/resolver.rs | 268 | // Step 2: Discover candidates (unified for native/cross) | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | test-crates/cffi-mixed/test_cffi_mixed.py | 24 | assert line.length() == 5 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | .github/workflows/test.yml | 94 | # minutes; the test harness falls back to micromamba when conda is absent. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | test-crates/pyo3-pure/tests/test_pyo3_pure.py | 15 | def test_function(): | CODE |
| LOW | test-crates/pyo3-abi3t/tests/test_pyo3_abi3t.py | 15 | def test_function(): | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | src/ci/github/render.rs | 147 | "# This file is autogenerated by maturin v{version} | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | .github/workflows/test.yml | 581 | # Check if all needs were successful or skipped. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | noxfile.py | 39 | CODE |