A safe, extensible ORM and Query Builder for Rust
This report presents the forensic synthetic code analysis of diesel-rs/diesel, a Rust project with 14,116 GitHub stars. SynthScan v2.0 examined 177,979 lines of code across 1171 source files, recording 1612 pattern matches distributed across 7 syntactic categories. The overall adjusted score of 7.2 places this repository in the Low AI signal 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 1612 distinct pattern matches across 7 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 | diesel_infer_query/src/query_source.rs | 1 | // This Source Code Form is subject to the terms of the Mozilla Public | COMMENT |
| LOW | diesel_infer_query/src/query_source.rs | 21 | /// This information is relevant to | COMMENT |
| LOW | diesel_infer_query/src/query_source.rs | 41 | /// source lookup map | COMMENT |
| LOW | diesel_infer_query/src/error.rs | 1 | // This Source Code Form is subject to the terms of the Mozilla Public | COMMENT |
| LOW | diesel_infer_query/src/views.rs | 21 | pub fn field_count(&self) -> usize { | COMMENT |
| LOW | .config/nextest.toml | 21 | # statements straddling a second boundary; | COMMENT |
| LOW | guide_drafts/trait_derives.md | 221 | } | COMMENT |
| LOW | diesel_compile_tests/tests/trybuild.rs | 21 | // would leak into the blessed `.stderr` files. Map the actual target | COMMENT |
| LOW | …ests/tests/fail/array_expressions_must_be_same_type.rs | 21 | //~^ ERROR: cannot select `f64` from `diesel::query_builder::from_clause::NoFromClause` | COMMENT |
| LOW | …ests/fail/right_side_of_left_join_requires_nullable.rs | 41 | let join = users::table.left_outer_join(posts::table); | COMMENT |
| LOW | …ests/fail/right_side_of_left_join_requires_nullable.rs | 141 | //~^ ERROR: type mismatch resolving `<table as AppearsInFromClause<table>>::Count == Never` | COMMENT |
| LOW | …select_for_update_cannot_be_mixed_with_some_clauses.rs | 21 | //~| ERROR: the trait bound `SelectStatement<FromClause<...>>: LockingDsl<...>` is not satisfied | COMMENT |
| LOW | …select_for_update_cannot_be_mixed_with_some_clauses.rs | 41 | //~| ERROR: the trait bound `SelectStatement<FromClause<...>>: LockingDsl<...>` is not satisfied | COMMENT |
| LOW | …/cannot_mix_aggregate_and_non_aggregate_in_order_by.rs | 61 | // aggregate ORDER BY without explicit SELECT (default non-aggregate select, no GROUP BY) | COMMENT |
| LOW | …indow_functions_expression_requires_window_function.rs | 21 | users::table.select(lower(users::name).over()); | COMMENT |
| LOW | …indow_functions_expression_requires_window_function.rs | 41 | //~| ERROR: `diesel::sql_types::Text` is neither `diesel::sql_types::Range<_>` nor `diesel::sql_types::Multirange<_> | COMMENT |
| LOW | …ggregate_expression_requires_column_from_same_table.rs | 21 | let source = users::table.select(sum(posts::id)); | COMMENT |
| LOW | diesel_compile_tests/tests/fail/selectable.rs | 201 | .load(&mut conn) | COMMENT |
| LOW | …compile_tests/tests/fail/find_requires_correct_type.rs | 21 | //~^ ERROR: the trait bound `str: Expression` is not satisfied | COMMENT |
| LOW | …s/fail/derive/belongs_to_missing_foreign_key_column.rs | 21 | #[derive(Associations)] | COMMENT |
| LOW | …sts/tests/fail/derive/identifiable_missing_pk_field.rs | 21 | } | COMMENT |
| LOW | …esel_compile_tests/tests/fail/derive/bad_belongs_to.rs | 61 | #[diesel(belongs_to(Bar = "bar_id"))] | COMMENT |
| LOW | diesel_compile_tests/tests/fail/derive/empty_struct.rs | 21 | //~^ ERROR: this derive can only be used on non-unit structs | COMMENT |
| LOW | …l_compile_tests/tests/fail/derive/bad_postgres_type.rs | 21 | #[diesel(postgres_type(name))] | COMMENT |
| LOW | …l_compile_tests/tests/fail/derive/bad_postgres_type.rs | 41 | #[diesel(postgres_type(name = "foo", array_oid = 3))] | COMMENT |
| LOW | …l_compile_tests/tests/fail/derive/bad_postgres_type.rs | 61 | #[diesel(postgres_type(schema = "foo"))] | COMMENT |
| LOW | diesel_compile_tests/tests/fail/derive/bad_sql_type.rs | 1 | extern crate diesel; | COMMENT |
| LOW | …esel_compile_tests/tests/fail/derive/bad_mysql_type.rs | 21 | #[diesel(mysql_type(name))] | COMMENT |
| LOW | diesel_compile_tests/tests/fail/derive/has_query.rs | 41 | //~| ERROR: the trait bound `std::string::String: FromSqlRow<diesel::sql_types::Integer, Pg>` is not satisfied | COMMENT |
| LOW | …sel_compile_tests/tests/fail/derive/bad_sqlite_type.rs | 21 | #[diesel(sqlite_type(name))] | COMMENT |
| LOW | …ts/fail/derive/belongs_to_missing_foreign_key_field.rs | 1 | #[macro_use] | COMMENT |
| LOW | …sel_compile_tests/tests/fail/derive/bad_column_name.rs | 21 | #[derive(Queryable)] | COMMENT |
| LOW | …tests/fail/derive_deprecated/deprecated_column_name.rs | 21 | #[derive(AsChangeset)] | COMMENT |
| LOW | …sts/fail/derive_deprecated/deprecated_postgres_type.rs | 21 | #[postgres(type_name)] | COMMENT |
| LOW | …sts/fail/derive_deprecated/deprecated_postgres_type.rs | 41 | #[postgres(type_name = "foo", array_oid = "3")] | COMMENT |
| LOW | …ts/tests/fail/derive_deprecated/deprecated_sql_type.rs | 1 | #[macro_use] | COMMENT |
| LOW | …/tests/fail/derive_deprecated/deprecated_belongs_to.rs | 21 | COMMENT | |
| LOW | …/tests/fail/derive_deprecated/deprecated_belongs_to.rs | 61 | #[derive(Associations)] | COMMENT |
| LOW | …/tests/fail/derive_deprecated/deprecated_belongs_to.rs | 101 | #[belongs_to(Bar, what)] | COMMENT |
| LOW | diesel_dynamic_schema/src/dynamic_value.rs | 1 | //! This module provides a container that allows to receive a dynamically | COMMENT |
| LOW | diesel_dynamic_schema/src/dynamic_value.rs | 21 | //! # | COMMENT |
| LOW | diesel_dynamic_schema/src/dynamic_value.rs | 41 | //! # } | COMMENT |
| LOW | diesel_dynamic_schema/src/dynamic_value.rs | 61 | //! # | COMMENT |
| LOW | diesel_dynamic_schema/src/dynamic_value.rs | 81 | //! # | COMMENT |
| LOW | diesel_dynamic_schema/src/dynamic_value.rs | 101 | //! ); | COMMENT |
| LOW | diesel_dynamic_schema/src/dynamic_value.rs | 121 | //! #[derive(PartialEq, Debug)] | COMMENT |
| LOW | diesel_dynamic_schema/src/dynamic_value.rs | 141 | //! } | COMMENT |
| LOW | diesel_dynamic_schema/src/lib.rs | 1 | //! # Diesel dynamic schema | COMMENT |
| LOW | diesel_dynamic_schema/src/lib.rs | 21 | //! for actually exist, or that the types you state are correct. | COMMENT |
| LOW | diesel_dynamic_schema/src/lib.rs | 41 | //! # | COMMENT |
| LOW | diesel_dynamic_schema/src/lib.rs | 61 | //! # | COMMENT |
| LOW | diesel_dynamic_schema/src/lib.rs | 101 | /// | COMMENT |
| LOW | diesel_dynamic_schema/src/table.rs | 61 | /// let table_with_schema: Table<&str> = schema.table("posts"); | COMMENT |
| LOW | dsl_auto_type/src/auto_type/local_variables_map.rs | 121 | LetStatementInferredType { | COMMENT |
| LOW | diesel/src/data_types.rs | 1 | //! Structs to represent the primitive equivalent of SQL types where | COMMENT |
| LOW | diesel/src/reexport_ambiguities.rs | 1 | // This macro exists to workaround | COMMENT |
| LOW | diesel/src/backend.rs | 21 | /// A database backend | COMMENT |
| LOW | diesel/src/backend.rs | 41 | /// details how the newly implemented backend may communicate with diesel. As of this, | COMMENT |
| LOW | diesel/src/backend.rs | 61 | /// + [`Integer`](sql_types::Integer) | COMMENT |
| LOW | diesel/src/backend.rs | 101 | /// should not be used directly. | COMMENT |
| 1529 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | .github/dependabot.yml | 3 | # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | COMMENT |
| MEDIUM | .github/dependabot.yml | 5 | # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | COMMENT |
| MEDIUM⚡ | .github/dependabot.yml | 28 | # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | COMMENT |
| MEDIUM⚡ | .github/dependabot.yml | 30 | # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | COMMENT |
| MEDIUM⚡ | .github/dependabot.yml | 38 | # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | diesel/src/sqlite/connection/mod.rs | 705 | /// sql_query("INSERT INTO users (name, email) VALUES ('John Doe', 'john.doe@example.com'), ('Jane Doe', 'jane.doe@e | COMMENT |
| LOW | diesel/src/sqlite/connection/mod.rs | 705 | /// sql_query("INSERT INTO users (name, email) VALUES ('John Doe', 'john.doe@example.com'), ('Jane Doe', 'jane.doe@e | COMMENT |
| LOW⚡ | diesel/src/sqlite/connection/mod.rs | 1655 | "John Doe".to_string(), | CODE |
| LOW⚡ | diesel/src/sqlite/connection/mod.rs | 1660 | "Jane Doe".to_string(), | CODE |
| LOW⚡ | diesel/src/sqlite/connection/mod.rs | 1669 | let _ = crate::sql_query("INSERT INTO users (name, email) VALUES ('John Doe', 'john.doe@example.com'), ('Jane Do | CODE |
| LOW⚡ | diesel/src/sqlite/connection/mod.rs | 1669 | let _ = crate::sql_query("INSERT INTO users (name, email) VALUES ('John Doe', 'john.doe@example.com'), ('Jane Do | CODE |
| LOW | diesel/src/sqlite/connection/mod.rs | 1714 | let _ = crate::sql_query("INSERT INTO users (name, email) VALUES ('John Doe', 'john.doe@example.com'), ('Jane Do | CODE |
| LOW | diesel/src/sqlite/connection/mod.rs | 1714 | let _ = crate::sql_query("INSERT INTO users (name, email) VALUES ('John Doe', 'john.doe@example.com'), ('Jane Do | CODE |
| LOW | diesel/src/expression/mod.rs | 1048 | /// .select(selection(NameOrConst::Const("Jane Doe".into()))) | COMMENT |
| LOW | diesel/src/expression/mod.rs | 1050 | /// assert_eq!(String::from("Jane Doe"), with_name); | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | diesel/src/connection/statement_cache/mod.rs | 410 | /// Essentially a customized version of [`Cow`] | COMMENT |
| MEDIUM | diesel_derives/src/sql_function.rs | 1507 | /// Essentially the same as ArgCaptured, but only allowing ident patterns | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | diesel/src/query_source/aliasing/macros.rs | 5 | /// Example usage | COMMENT |
| LOW | diesel/src/expression/operators.rs | 210 | /// ## Example usage | COMMENT |
| LOW | diesel_derives/src/lib.rs | 1308 | /// Example usage | COMMENT |
| LOW | diesel_derives/src/lib.rs | 1592 | /// Example usage | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | .github/workflows/release.yml | 287 | # Create a GitHub Release while uploading all files to it | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | examples/sqlite/wasm/server.py | 5 | class RequestHandler(SimpleHTTPRequestHandler): | CODE |