Repository Analysis

diesel-rs/diesel

A safe, extensible ORM and Query Builder for Rust

7.2 Low AI signal View on GitHub

Analysis Overview

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

7.2
Adjusted Score
7.2
Raw Score
100%
Time Factor
2026-07-10
Last Push
14.1K
Stars
Rust
Language
178.0K
Lines of Code
1.2K
Files
1.6K
Pattern Hits
2026-07-14
Scan Date
0.00
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 0HIGH 0MEDIUM 8LOW 1604

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

Over-Commented Block1589 hits · 1226 pts
SeverityFileLineSnippetContext
LOWdiesel_infer_query/src/query_source.rs1// This Source Code Form is subject to the terms of the Mozilla PublicCOMMENT
LOWdiesel_infer_query/src/query_source.rs21/// This information is relevant toCOMMENT
LOWdiesel_infer_query/src/query_source.rs41 /// source lookup mapCOMMENT
LOWdiesel_infer_query/src/error.rs1// This Source Code Form is subject to the terms of the Mozilla PublicCOMMENT
LOWdiesel_infer_query/src/views.rs21 pub fn field_count(&self) -> usize {COMMENT
LOW.config/nextest.toml21# statements straddling a second boundary;COMMENT
LOWguide_drafts/trait_derives.md221}COMMENT
LOWdiesel_compile_tests/tests/trybuild.rs21 // would leak into the blessed `.stderr` files. Map the actual targetCOMMENT
LOW…ests/tests/fail/array_expressions_must_be_same_type.rs21 //~^ ERROR: cannot select `f64` from `diesel::query_builder::from_clause::NoFromClause`COMMENT
LOW…ests/fail/right_side_of_left_join_requires_nullable.rs41 let join = users::table.left_outer_join(posts::table);COMMENT
LOW…ests/fail/right_side_of_left_join_requires_nullable.rs141 //~^ ERROR: type mismatch resolving `<table as AppearsInFromClause<table>>::Count == Never`COMMENT
LOW…select_for_update_cannot_be_mixed_with_some_clauses.rs21 //~| ERROR: the trait bound `SelectStatement<FromClause<...>>: LockingDsl<...>` is not satisfiedCOMMENT
LOW…select_for_update_cannot_be_mixed_with_some_clauses.rs41 //~| ERROR: the trait bound `SelectStatement<FromClause<...>>: LockingDsl<...>` is not satisfiedCOMMENT
LOW…/cannot_mix_aggregate_and_non_aggregate_in_order_by.rs61 // aggregate ORDER BY without explicit SELECT (default non-aggregate select, no GROUP BY)COMMENT
LOW…indow_functions_expression_requires_window_function.rs21 users::table.select(lower(users::name).over());COMMENT
LOW…indow_functions_expression_requires_window_function.rs41 //~| 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.rs21 let source = users::table.select(sum(posts::id));COMMENT
LOWdiesel_compile_tests/tests/fail/selectable.rs201 .load(&mut conn)COMMENT
LOW…compile_tests/tests/fail/find_requires_correct_type.rs21 //~^ ERROR: the trait bound `str: Expression` is not satisfiedCOMMENT
LOW…s/fail/derive/belongs_to_missing_foreign_key_column.rs21#[derive(Associations)]COMMENT
LOW…sts/tests/fail/derive/identifiable_missing_pk_field.rs21}COMMENT
LOW…esel_compile_tests/tests/fail/derive/bad_belongs_to.rs61#[diesel(belongs_to(Bar = "bar_id"))]COMMENT
LOWdiesel_compile_tests/tests/fail/derive/empty_struct.rs21//~^ ERROR: this derive can only be used on non-unit structsCOMMENT
LOW…l_compile_tests/tests/fail/derive/bad_postgres_type.rs21#[diesel(postgres_type(name))]COMMENT
LOW…l_compile_tests/tests/fail/derive/bad_postgres_type.rs41#[diesel(postgres_type(name = "foo", array_oid = 3))]COMMENT
LOW…l_compile_tests/tests/fail/derive/bad_postgres_type.rs61#[diesel(postgres_type(schema = "foo"))]COMMENT
LOWdiesel_compile_tests/tests/fail/derive/bad_sql_type.rs1extern crate diesel;COMMENT
LOW…esel_compile_tests/tests/fail/derive/bad_mysql_type.rs21#[diesel(mysql_type(name))]COMMENT
LOWdiesel_compile_tests/tests/fail/derive/has_query.rs41 //~| ERROR: the trait bound `std::string::String: FromSqlRow<diesel::sql_types::Integer, Pg>` is not satisfiedCOMMENT
LOW…sel_compile_tests/tests/fail/derive/bad_sqlite_type.rs21#[diesel(sqlite_type(name))]COMMENT
LOW…ts/fail/derive/belongs_to_missing_foreign_key_field.rs1#[macro_use]COMMENT
LOW…sel_compile_tests/tests/fail/derive/bad_column_name.rs21#[derive(Queryable)]COMMENT
LOW…tests/fail/derive_deprecated/deprecated_column_name.rs21#[derive(AsChangeset)]COMMENT
LOW…sts/fail/derive_deprecated/deprecated_postgres_type.rs21#[postgres(type_name)]COMMENT
LOW…sts/fail/derive_deprecated/deprecated_postgres_type.rs41#[postgres(type_name = "foo", array_oid = "3")]COMMENT
LOW…ts/tests/fail/derive_deprecated/deprecated_sql_type.rs1#[macro_use]COMMENT
LOW…/tests/fail/derive_deprecated/deprecated_belongs_to.rs21COMMENT
LOW…/tests/fail/derive_deprecated/deprecated_belongs_to.rs61#[derive(Associations)]COMMENT
LOW…/tests/fail/derive_deprecated/deprecated_belongs_to.rs101#[belongs_to(Bar, what)]COMMENT
LOWdiesel_dynamic_schema/src/dynamic_value.rs1//! This module provides a container that allows to receive a dynamicallyCOMMENT
LOWdiesel_dynamic_schema/src/dynamic_value.rs21//! #COMMENT
LOWdiesel_dynamic_schema/src/dynamic_value.rs41//! # }COMMENT
LOWdiesel_dynamic_schema/src/dynamic_value.rs61//! #COMMENT
LOWdiesel_dynamic_schema/src/dynamic_value.rs81//! #COMMENT
LOWdiesel_dynamic_schema/src/dynamic_value.rs101//! );COMMENT
LOWdiesel_dynamic_schema/src/dynamic_value.rs121//! #[derive(PartialEq, Debug)]COMMENT
LOWdiesel_dynamic_schema/src/dynamic_value.rs141//! }COMMENT
LOWdiesel_dynamic_schema/src/lib.rs1//! # Diesel dynamic schemaCOMMENT
LOWdiesel_dynamic_schema/src/lib.rs21//! for actually exist, or that the types you state are correct.COMMENT
LOWdiesel_dynamic_schema/src/lib.rs41//! #COMMENT
LOWdiesel_dynamic_schema/src/lib.rs61//! #COMMENT
LOWdiesel_dynamic_schema/src/lib.rs101///COMMENT
LOWdiesel_dynamic_schema/src/table.rs61 /// let table_with_schema: Table<&str> = schema.table("posts");COMMENT
LOWdsl_auto_type/src/auto_type/local_variables_map.rs121 LetStatementInferredType {COMMENT
LOWdiesel/src/data_types.rs1//! Structs to represent the primitive equivalent of SQL types whereCOMMENT
LOWdiesel/src/reexport_ambiguities.rs1// This macro exists to workaroundCOMMENT
LOWdiesel/src/backend.rs21/// A database backendCOMMENT
LOWdiesel/src/backend.rs41/// details how the newly implemented backend may communicate with diesel. As of this,COMMENT
LOWdiesel/src/backend.rs61/// + [`Integer`](sql_types::Integer)COMMENT
LOWdiesel/src/backend.rs101 /// should not be used directly.COMMENT
1529 more matches not shown…
Decorative Section Separators5 hits · 20 pts
SeverityFileLineSnippetContext
MEDIUM.github/dependabot.yml3 # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━COMMENT
MEDIUM.github/dependabot.yml5 # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━COMMENT
MEDIUM.github/dependabot.yml28 # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━COMMENT
MEDIUM.github/dependabot.yml30 # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━COMMENT
MEDIUM.github/dependabot.yml38 # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━COMMENT
Fake / Example Data10 hits · 14 pts
SeverityFileLineSnippetContext
LOWdiesel/src/sqlite/connection/mod.rs705 /// sql_query("INSERT INTO users (name, email) VALUES ('John Doe', 'john.doe@example.com'), ('Jane Doe', 'jane.doe@eCOMMENT
LOWdiesel/src/sqlite/connection/mod.rs705 /// sql_query("INSERT INTO users (name, email) VALUES ('John Doe', 'john.doe@example.com'), ('Jane Doe', 'jane.doe@eCOMMENT
LOWdiesel/src/sqlite/connection/mod.rs1655 "John Doe".to_string(),CODE
LOWdiesel/src/sqlite/connection/mod.rs1660 "Jane Doe".to_string(),CODE
LOWdiesel/src/sqlite/connection/mod.rs1669 let _ = crate::sql_query("INSERT INTO users (name, email) VALUES ('John Doe', 'john.doe@example.com'), ('Jane DoCODE
LOWdiesel/src/sqlite/connection/mod.rs1669 let _ = crate::sql_query("INSERT INTO users (name, email) VALUES ('John Doe', 'john.doe@example.com'), ('Jane DoCODE
LOWdiesel/src/sqlite/connection/mod.rs1714 let _ = crate::sql_query("INSERT INTO users (name, email) VALUES ('John Doe', 'john.doe@example.com'), ('Jane DoCODE
LOWdiesel/src/sqlite/connection/mod.rs1714 let _ = crate::sql_query("INSERT INTO users (name, email) VALUES ('John Doe', 'john.doe@example.com'), ('Jane DoCODE
LOWdiesel/src/expression/mod.rs1048/// .select(selection(NameOrConst::Const("Jane Doe".into())))COMMENT
LOWdiesel/src/expression/mod.rs1050/// assert_eq!(String::from("Jane Doe"), with_name);COMMENT
AI Slop Vocabulary2 hits · 6 pts
SeverityFileLineSnippetContext
MEDIUMdiesel/src/connection/statement_cache/mod.rs410/// Essentially a customized version of [`Cow`]COMMENT
MEDIUMdiesel_derives/src/sql_function.rs1507/// Essentially the same as ArgCaptured, but only allowing ident patternsCOMMENT
Example Usage Blocks4 hits · 6 pts
SeverityFileLineSnippetContext
LOWdiesel/src/query_source/aliasing/macros.rs5/// Example usageCOMMENT
LOWdiesel/src/expression/operators.rs210/// ## Example usageCOMMENT
LOWdiesel_derives/src/lib.rs1308/// Example usageCOMMENT
LOWdiesel_derives/src/lib.rs1592/// Example usageCOMMENT
Self-Referential Comments1 hit · 3 pts
SeverityFileLineSnippetContext
MEDIUM.github/workflows/release.yml287 # Create a GitHub Release while uploading all files to itCOMMENT
Hyper-Verbose Identifiers1 hit · 1 pts
SeverityFileLineSnippetContext
LOWexamples/sqlite/wasm/server.py5class RequestHandler(SimpleHTTPRequestHandler):CODE