Repository Analysis

PyO3/maturin

Build and publish crates with pyo3, cffi and uniffi bindings as well as rust binaries as python packages

3.8 Likely human-written View on GitHub

Analysis Overview

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).

3.8
Adjusted Score
3.8
Raw Score
100%
Time Factor
2026-08-24
Last Push
5.8K
Stars
Rust
Language
78.8K
Lines of Code
559
Files
190
Pattern Hits
2026-08-29
Scan Date
0.01
HC Hit Rate

What These Metrics Mean

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

Score History

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.

Severity Breakdown

Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.

CRITICAL 4HIGH 1MEDIUM 20LOW 165

Directory Score Breakdown

This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.

Pattern Findings

The scanner identified 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.

Over-Commented Block118 hits · 118 pts
SeverityFileLineSnippetContext
LOWdeny.toml1# This template contains all of the possible sections and their default valuesCOMMENT
LOWdeny.toml21# `target_family = "unix"` configuration, that only having windows targets inCOMMENT
LOWdeny.toml41# from the view of cargo-deny. This is an extremely heavy hammer, as if a crateCOMMENT
LOWdeny.toml61# option can be used to specify the depth at which feature edges will be added.COMMENT
LOWdeny.toml81 #"a-crate-that-is-yanked@0.1.1", # you can also ignore yanked crate versions if you wishCOMMENT
LOWdeny.toml121 # Each entry is the crate and version constraint, and its specific allowCOMMENT
LOWdeny.toml141# the license expression. If the contents match, the clarification will be usedCOMMENT
LOWdeny.toml161# is only published to private registries, and ignore is true, the crate willCOMMENT
LOWdeny.toml181# The default lint level for `default` features for crates that are members ofCOMMENT
LOWdeny.toml201]COMMENT
LOWdeny.toml221#]COMMENT
LOWdeny.toml241# More documentation about the 'sources' section can be found here:COMMENT
LOWguide/src/config.md21# Features can also be conditional on the target Python versionCOMMENT
LOWguide/src/config.md61# Bindings typeCOMMENT
LOWguide/src/config.md81sdist-generator = "cargo"COMMENT
LOWguide/src/config.md181COMMENT
LOWtests/common/mod.rs101pub fn case_target_dir(case_id: &str) -> PathBuf {COMMENT
LOWtests/common/integration.rs21///COMMENT
LOWsrc/cargo_options.rs81COMMENT
LOWsrc/cross_compile.rs101///COMMENT
LOWsrc/build_options.rs21 /// Find interpreters from the host machineCOMMENT
LOWsrc/build_options.rs41 /// The `pypi` option applies on all platforms and ensure that only tags that can be uploaded toCOMMENT
LOWsrc/build_options.rs61 #[arg(long, conflicts_with = "skip_auditwheel")]COMMENT
LOWsrc/build_options.rs81#[derive(Debug, Default, Serialize, Deserialize, clap::Parser, Clone, Eq, PartialEq)]COMMENT
LOWsrc/build_options.rs101/// High level API for building wheels from a crate, also used for the CLI.COMMENT
LOWsrc/metadata.rs21/// The metadata required to generate the .dist-info directoryCOMMENT
LOWsrc/lib.rs1//! Builds wheels from a crate that exposes python bindings through pyo3COMMENT
LOWsrc/lib.rs21//! - auditwheel: Enables dependency auditing and wheel repair for macOS (install-name/rpathCOMMENT
LOWsrc/upload.rs21use std::time::Duration;COMMENT
LOWsrc/upload.rs41 ///COMMENT
LOWsrc/upload.rs81 }COMMENT
LOWsrc/project_layout.rs21 /// Contains the canonicalized (i.e. absolute) path to the python part of the projectCOMMENT
LOWsrc/project_layout.rs301 format!(COMMENT
LOWsrc/pyproject_toml.rs21 pub maturin: Option<ToolMaturin>,COMMENT
LOWsrc/pyproject_toml.rs61#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]COMMENT
LOWsrc/pyproject_toml.rs141 }COMMENT
LOWsrc/pyproject_toml.rs161pub enum CargoCrateType {COMMENT
LOWsrc/pyproject_toml.rs201 #[serde(alias = "macosx-deployment-target")]COMMENT
LOWsrc/pyproject_toml.rs221pub struct SbomConfig {COMMENT
LOWsrc/pyproject_toml.rs241/// [tool.maturin]COMMENT
LOWsrc/pyproject_toml.rs341///COMMENT
LOWsrc/pyproject_toml.rs361 /// Include files matching the given glob pattern(s).COMMENT
LOWsrc/pyproject_toml.rs381 pub strip: bool,COMMENT
LOWsrc/pyproject_toml.rs401 /// List of features to activate.COMMENT
LOWsrc/pyproject_toml.rs421 /// Use base Python executable instead of venv Python executable in PEP 517 build.COMMENT
LOWsrc/pyproject_toml.rs441/// The `[tool.maturin.generate-ci]` sectionCOMMENT
LOWsrc/pyproject_toml.rs481COMMENT
LOWsrc/pyproject_toml.rs521#[derive(Serialize, Deserialize, Debug, Clone)]COMMENT
LOWsrc/main.rs41struct Opt {COMMENT
LOWsrc/main.rs61 #[command(name = "build", alias = "b")]COMMENT
LOWsrc/main.rs81 /// Can also be enabled via the MATURIN_PGO environment variable.COMMENT
LOWsrc/main.rs101 ///COMMENT
LOWsrc/main.rs121 /// Build only a source distribution (sdist) without compiling.COMMENT
LOWsrc/main.rs141 path: Option<String>,COMMENT
LOWsrc/main.rs161 #[cfg(feature = "upload")]COMMENT
LOWsrc/main.rs181 cargo: CargoOptions,COMMENT
LOWsrc/compile.rs61 /// Library search paths for this architectureCOMMENT
LOWsrc/compile.rs81#[derive(Debug, Clone)]COMMENT
LOWsrc/compile.rs101 /// `copy_back_cargo_outputs` has restored unpatched bytes at theCOMMENT
LOWsrc/compile.rs121 /// per-arch dependency analysis during macOS wheel repair.COMMENT
58 more matches not shown…
Modern AI Meta-Vocabulary18 hits · 68 pts
SeverityFileLineSnippetContext
MEDIUMCargo.toml113# project scaffolding, maturin new/init/generate-ciCOMMENT
MEDIUMCargo.toml214# project scaffoldingCOMMENT
MEDIUMtests/cli.rs18 #[cfg(not(feature = "scaffolding"))]COMMENT
MEDIUMtests/cli.rs25 #[cfg(not(all(feature = "upload", feature = "zig", feature = "scaffolding")))]COMMENT
MEDIUMsrc/lib.rs64#[cfg(feature = "scaffolding")]COMMENT
MEDIUMsrc/lib.rs84#[cfg(feature = "scaffolding")]COMMENT
MEDIUMsrc/lib.rs94#[cfg(feature = "scaffolding")]COMMENT
MEDIUMsrc/main.rs18#[cfg(feature = "scaffolding")]COMMENT
MEDIUMsrc/main.rs137 #[cfg(feature = "scaffolding")]COMMENT
MEDIUMsrc/main.rs146 #[cfg(feature = "scaffolding")]COMMENT
MEDIUMsrc/main.rs154 #[cfg(feature = "scaffolding")]COMMENT
MEDIUMsrc/main.rs266 #[cfg(feature = "scaffolding")]COMMENT
MEDIUMsrc/main.rs268 #[cfg(feature = "scaffolding")]COMMENT
MEDIUMsrc/main.rs270 #[cfg(feature = "scaffolding")]COMMENT
MEDIUMsrc/commands/mod.rs9#[cfg(feature = "scaffolding")]COMMENT
MEDIUMsrc/commands/mod.rs66#[cfg(feature = "scaffolding")]COMMENT
MEDIUMsrc/commands/mod.rs73#[cfg(feature = "scaffolding")]COMMENT
MEDIUMsrc/commands/mod.rs80#[cfg(feature = "scaffolding")]COMMENT
Hallucination Indicators4 hits · 55 pts
SeverityFileLineSnippetContext
CRITICALsrc/build_orchestrator.rs468 self.context.project.project_layout.data.as_deref(),CODE
CRITICALsrc/build_orchestrator.rs771 if !self.context.project.metadata24.scripts.is_empty() {CODE
CRITICALsrc/build_orchestrator.rs777 if !self.context.project.metadata24.entry_points.is_empty() {CODE
CRITICALsrc/build_orchestrator.rs781 if self.context.project.project_layout.python_module.is_some() {CODE
Unused Imports21 hits · 21 pts
SeverityFileLineSnippetContext
LOWmaturin/bootstrap.py12CODE
LOWmaturin/bootstrap.py19CODE
LOWmaturin/__init__.py11CODE
LOWmaturin/__main__.py1CODE
LOW…licit/python/cffi_mixed_implicit/some_rust/__init__.py1CODE
LOW…licit/python/cffi_mixed_implicit/some_rust/__init__.py1CODE
LOW…ixed-py-subdir/python/cffi_mixed_py_subdir/__init__.py1CODE
LOW…ixed-py-subdir/python/cffi_mixed_py_subdir/__init__.py1CODE
LOWtest-crates/uniffi-mixed/uniffi_mixed/__init__.py1CODE
LOWtest-crates/cffi-mixed/cffi_mixed/__init__.py1CODE
LOWtest-crates/cffi-mixed/cffi_mixed/__init__.py1CODE
LOWtest-crates/cffi-mixed/cffi_mixed/__init__.py2CODE
LOW…xed-with-path-dep/cffi_mixed_with_path_dep/__init__.py1CODE
LOW…xed-with-path-dep/cffi_mixed_with_path_dep/__init__.py1CODE
LOW…t-crates/cffi-mixed-src/src/cffi_mixed_src/__init__.py1CODE
LOW…t-crates/cffi-mixed-src/src/cffi_mixed_src/__init__.py1CODE
LOWtest-crates/pyo3-mixed/pyo3_mixed/__init__.py1CODE
LOW…/cffi-mixed-submodule/cffi_mixed_submodule/__init__.py1CODE
LOW…submodule/cffi_mixed_submodule/rust_module/__init__.py1CODE
LOW…include-exclude/cffi_mixed_include_exclude/__init__.py1CODE
LOW…include-exclude/cffi_mixed_include_exclude/__init__.py1CODE
Modern Structural Boilerplate8 hits · 8 pts
SeverityFileLineSnippetContext
LOW…licit/python/cffi_mixed_implicit/some_rust/__init__.py3__all__ = ["ffi", "lib"]CODE
LOW…ixed-py-subdir/python/cffi_mixed_py_subdir/__init__.py3__all__ = ["ffi", "lib"]CODE
LOWtest-crates/cffi-mixed/cffi_mixed/__init__.py4__all__ = ["Line", "ffi", "lib"]CODE
LOW…xed-with-path-dep/cffi_mixed_with_path_dep/__init__.py3__all__ = ["ffi", "lib"]CODE
LOW…t-crates/cffi-mixed-src/src/cffi_mixed_src/__init__.py3__all__ = ["ffi", "lib"]CODE
LOW…/cffi-mixed-submodule/cffi_mixed_submodule/__init__.py3__all__ = ["rust"]CODE
LOW…submodule/cffi_mixed_submodule/rust_module/__init__.py3__all__ = ["rust"]CODE
LOW…include-exclude/cffi_mixed_include_exclude/__init__.py3__all__ = ["ffi", "lib"]CODE
Hyper-Verbose Identifiers6 hits · 6 pts
SeverityFileLineSnippetContext
LOWnoxfile.py93def _resolve_pyodide_platform_inputs(info: dict) -> dict:CODE
LOWmaturin/bootstrap.py22def get_requires_for_build_wheel(config_settings: dict[str, Any] | None = None) -> list[str]:CODE
LOWmaturin/bootstrap.py28def get_requires_for_build_sdist(config_settings: dict[str, Any] | None = None) -> list[str]:CODE
LOWmaturin/__init__.py165def get_requires_for_build_wheel(config_settings: Mapping[str, Any] | None = None) -> list[str]:CODE
LOWmaturin/__init__.py189def get_requires_for_build_sdist(config_settings: Mapping[str, Any] | None = None) -> list[str]:CODE
LOWmaturin/__init__.py197def prepare_metadata_for_build_wheel(metadata_directory: str, config_settings: Mapping[str, Any] | None = None) -> str:CODE
Verbosity Indicators4 hits · 6 pts
SeverityFileLineSnippetContext
LOWtests/common/other.rs720 // Step 1: Build the sdistCOMMENT
LOWtests/common/other.rs744 // Step 2: Unpack sdist and build wheels from itCOMMENT
LOWsrc/python_interpreter/resolver.rs253 // Step 1: PYO3_CONFIG_FILE is an explicit override that trumps everythingCOMMENT
LOWsrc/python_interpreter/resolver.rs268 // Step 2: Discover candidates (unified for native/cross)COMMENT
Structural Annotation Overuse4 hits · 6 pts
SeverityFileLineSnippetContext
LOWtests/common/other.rs720 // Step 1: Build the sdistCOMMENT
LOWtests/common/other.rs744 // Step 2: Unpack sdist and build wheels from itCOMMENT
LOWsrc/python_interpreter/resolver.rs253 // Step 1: PYO3_CONFIG_FILE is an explicit override that trumps everythingCOMMENT
LOWsrc/python_interpreter/resolver.rs268 // Step 2: Discover candidates (unified for native/cross)COMMENT
Cross-Language Confusion1 hit · 5 pts
SeverityFileLineSnippetContext
HIGHtest-crates/cffi-mixed/test_cffi_mixed.py24 assert line.length() == 5CODE
AI Slop Vocabulary1 hit · 3 pts
SeverityFileLineSnippetContext
MEDIUM.github/workflows/test.yml94 # minutes; the test harness falls back to micromamba when conda is absent.COMMENT
Overly Generic Function Names2 hits · 2 pts
SeverityFileLineSnippetContext
LOWtest-crates/pyo3-pure/tests/test_pyo3_pure.py15def test_function():CODE
LOWtest-crates/pyo3-abi3t/tests/test_pyo3_abi3t.py15def test_function():CODE
Self-Referential Comments1 hit · 2 pts
SeverityFileLineSnippetContext
MEDIUMsrc/ci/github/render.rs147 "# This file is autogenerated by maturin v{version}CODE
Redundant / Tautological Comments1 hit · 2 pts
SeverityFileLineSnippetContext
LOW.github/workflows/test.yml581 # Check if all needs were successful or skipped.COMMENT
Deep Nesting1 hit · 1 pts
SeverityFileLineSnippetContext
LOWnoxfile.py39CODE