Facilitating high-level interactions between Wasm modules and JavaScript
This report presents the forensic synthetic code analysis of wasm-bindgen/wasm-bindgen, a Rust project with 9,090 GitHub stars. SynthScan v2.0 examined 406,327 lines of code across 3081 source files, recording 9086 pattern matches distributed across 8 syntactic categories. The overall adjusted score of 19.9 places this repository in the Moderate 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 9086 distinct pattern matches across 8 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 | publish.rs | 1 | //! Helper script to publish the wasm-bindgen suite of crates | COMMENT |
| LOW | crates/futures/src/lib.rs | 1 | //! Bridging the gap between Rust Futures and JavaScript Promises. | COMMENT |
| LOW | crates/test/src/lib.rs | 1 | //! Runtime support for the `#[wasm_bindgen_test]` attribute | COMMENT |
| LOW | crates/test/src/lib.rs | 41 | /// This macro is invoked as: | COMMENT |
| LOW | crates/test/src/lib.rs | 121 | COMMENT | |
| LOW | crates/test/src/rt/mod.rs | 1 | //! Internal-only runtime module used for the `wasm_bindgen_test` crate. | COMMENT |
| LOW | crates/test/src/rt/mod.rs | 21 | // runs. | COMMENT |
| LOW | crates/test/src/rt/mod.rs | 41 | // * The `wasm-bindgen-test-runner` binary takes over. It runs `wasm-bindgen` | COMMENT |
| LOW | crates/test/src/rt/mod.rs | 61 | // This is used for test filters today. | COMMENT |
| LOW | crates/test/src/rt/mod.rs | 121 | COMMENT | |
| LOW | crates/test/src/rt/mod.rs | 461 | /// If a test is currently running it takes the `args` array and stringifies | COMMENT |
| LOW | crates/test/src/rt/mod.rs | 801 | /// we've got Rust code running we'll be able to capture output. | COMMENT |
| LOW | crates/test/src/rt/criterion/measurement.rs | 1 | //! This module defines a set of traits that can be used to plug different measurements (eg. | COMMENT |
| LOW | crates/test/src/rt/criterion/measurement.rs | 41 | /// The given typical value should be used to choose the unit. This function may be called | COMMENT |
| LOW | crates/test/src/rt/criterion/measurement.rs | 61 | /// Scale the values and return a unit string designed for machines. | COMMENT |
| LOW | crates/test/src/rt/criterion/bencher.rs | 1 | use super::measurement::Measurement; | COMMENT |
| LOW | crates/test/src/rt/criterion/bencher.rs | 21 | /// or [`iter_batched_ref`]. See [`BatchSize`] for a discussion of batch sizes. | COMMENT |
| LOW | crates/test/src/rt/criterion/bencher.rs | 41 | /// Times a `routine` by executing it many times and timing the total elapsed time. | COMMENT |
| LOW | crates/test/src/rt/criterion/bencher.rs | 61 | for _ in 0..self.iters { | COMMENT |
| LOW | crates/test/src/rt/criterion/bencher.rs | 81 | /// | COMMENT |
| LOW | crates/test/src/rt/criterion/bencher.rs | 101 | self.iterated = true; | COMMENT |
| LOW | crates/test/src/rt/criterion/bencher.rs | 141 | /// # Example | COMMENT |
| LOW | crates/test/src/rt/criterion/mod.rs | 1 | //! A statistics-driven micro-benchmarking library written in Rust. | COMMENT |
| LOW | crates/test/src/rt/criterion/mod.rs | 61 | /// | COMMENT |
| LOW | crates/test/src/rt/criterion/mod.rs | 141 | /// measurement time. | COMMENT |
| LOW | crates/test/src/rt/criterion/mod.rs | 161 | #[must_use] | COMMENT |
| LOW | crates/test/src/rt/criterion/mod.rs | 181 | assert!(dur.as_nanos() > 0); | COMMENT |
| LOW | crates/test/src/rt/criterion/mod.rs | 201 | if n <= 1000 { | COMMENT |
| LOW | crates/test/src/rt/criterion/mod.rs | 241 | console_error!( | COMMENT |
| LOW | crates/test/src/rt/criterion/mod.rs | 281 | M: Measurement + 'static, | COMMENT |
| LOW | crates/test/src/rt/criterion/mod.rs | 341 | /// Benchmarks a future. | COMMENT |
| LOW | crates/test/src/rt/criterion/mod.rs | 381 | /// an input string or `&[u8]`. | COMMENT |
| LOW | crates/test/src/rt/criterion/mod.rs | 401 | /// This enum allows the user to control how Criterion.rs chooses the iteration count when sampling. | COMMENT |
| LOW | …st/src/rt/criterion/stats/univariate/outliers/tukey.rs | 1 | //! Tukey's method | COMMENT |
| LOW | …st/src/rt/criterion/stats/univariate/outliers/tukey.rs | 21 | //! | COMMENT |
| LOW | …test/src/rt/criterion/stats/univariate/outliers/mod.rs | 1 | //! Classification of outliers | COMMENT |
| LOW | crates/test/src/rt/web_time/instant.rs | 101 | } | COMMENT |
| LOW | crates/cli-support/src/externref.rs | 201 | COMMENT | |
| LOW | crates/cli-support/src/intrinsic.rs | 1 | //! Definition of all wasm-bindgen intrinsics. | COMMENT |
| LOW | crates/cli-support/src/lib.rs | 421 | // sure that this binary was produced by a compatible version of the | COMMENT |
| LOW | crates/cli-support/src/suggest.rs | 1 | //! Suggestion helpers for "did you mean ...?" diagnostics. | COMMENT |
| LOW | crates/cli-support/src/wasm_conventions.rs | 101 | match candidates.len() { | COMMENT |
| LOW | crates/cli-support/src/wasm2es6js.rs | 201 | } | COMMENT |
| LOW | crates/cli-support/src/descriptors.rs | 1 | //! Management of wasm-bindgen descriptor functions. | COMMENT |
| LOW | crates/cli-support/src/interpreter/mod.rs | 1 | //! A tiny and incomplete Wasm interpreter | COMMENT |
| LOW | crates/cli-support/src/interpreter/mod.rs | 41 | // during descriptor execution. | COMMENT |
| LOW | crates/cli-support/src/interpreter/mod.rs | 61 | // The descriptor which we're assembling, a list of `u32` entries. This is | COMMENT |
| LOW | crates/cli-support/src/interpreter/mod.rs | 101 | .iter() | COMMENT |
| LOW | crates/cli-support/src/interpreter/mod.rs | 241 | COMMENT | |
| LOW | crates/cli-support/src/interpreter/mod.rs | 541 | // ... otherwise this is a normal call so we recurse. | COMMENT |
| LOW | crates/cli-support/src/js/mod.rs | 41 | } | COMMENT |
| LOW | crates/cli-support/src/js/mod.rs | 161 | COMMENT | |
| LOW | crates/cli-support/src/js/mod.rs | 181 | /// emcc needs to keep alive). | COMMENT |
| LOW | crates/cli-support/src/js/mod.rs | 281 | /// attribute on an exported Rust struct. The parent class is expected | COMMENT |
| LOW | crates/cli-support/src/js/mod.rs | 421 | COMMENT | |
| LOW | crates/cli-support/src/js/mod.rs | 561 | } | COMMENT |
| LOW | crates/cli-support/src/js/mod.rs | 1981 | // The key is the qualified JS identity; use it directly to | COMMENT |
| LOW | crates/cli-support/src/js/mod.rs | 2121 | let ancestors: Vec<(String, String)> = class.ancestors.clone(); | COMMENT |
| LOW | crates/cli-support/src/js/mod.rs | 2461 | let ts_definition = if class.generate_typescript { | COMMENT |
| LOW | crates/cli-support/src/js/mod.rs | 2621 | write_setter(ts_dst, setter); | COMMENT |
| 9002 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | guide/src/wasm-bindgen-test/benchmark.md | 20 | ### Step 1 - Add Dependency to Cargo.toml ### | COMMENT |
| LOW | guide/src/wasm-bindgen-test/benchmark.md | 29 | ### Step 2 - Add Benchmark ### | COMMENT |
| LOW | guide/src/wasm-bindgen-test/benchmark.md | 44 | ### Step 3 - Run Benchmark ### | COMMENT |
| LOW | guide/src/wasm-bindgen-test/benchmark.md | 64 | ### Step 4 - Optimize ### | COMMENT |
| LOW | guide/src/wasm-bindgen-test/benchmark.md | 105 | ### Step 5 - Asynchronous function ### | COMMENT |
| LOW | guide/src/wasm-bindgen-test/benchmark.md | 125 | ### Step 6 - Run benchmark in browser ### | COMMENT |
| LOW | guide/src/wasm-bindgen-test/benchmark.md | 129 | ### Step 7 - Configuration ### | COMMENT |
| LOW | src/rt/mod.rs | 986 | // NOTE: This method is used to encode u32 into a variable-length-integer during the compile-time . | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | crates/webidl/src/constants.rs | 1068 | "placeholder", | CODE |
| LOW | crates/webidl/src/constants.rs | 1264 | "placeholder", | CODE |
| LOW | crates/web-sys/src/features/gen_HtmlTextAreaElement.rs | 179 | js_name = "placeholder" | CODE |
| LOW | crates/web-sys/src/features/gen_HtmlTextAreaElement.rs | 191 | js_name = "placeholder" | CODE |
| LOW | crates/web-sys/src/features/gen_HtmlInputElement.rs | 408 | #[wasm_bindgen(method, getter, js_class = "HTMLInputElement", js_name = "placeholder")] | COMMENT |
| LOW | crates/web-sys/src/features/gen_HtmlInputElement.rs | 415 | #[wasm_bindgen(method, setter, js_class = "HTMLInputElement", js_name = "placeholder")] | COMMENT |
| LOW | examples/weather_report/src/lib.rs | 238 | .set_attribute("placeholder", "Type city name here") | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | crates/js-sys/src/lib.rs | 5952 | /// It is a more robust version of the original, global isNaN(). | COMMENT |
| MEDIUM | src/cast.rs | 31 | /// In general this is intended to be a more robust version of | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | crates/cli-support/src/js/mod.rs | 4104 | function GetOwnOrInheritedPropertyDescriptor(obj, id) { | CODE |
| LOW | crates/js-sys/tests/wait_async_mock.js | 6 | export function installNotifyOnlyWaitAsyncMock() { | CODE |
| LOW | crates/js-sys/tests/wasm/Promise.js | 86 | export async function testRustDoubleNumberPromise(rustModule) { | CODE |
| LOW | examples/raytrace-parallel/server.py | 5 | class RequestHandler(SimpleHTTPRequestHandler): | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | crates/cli-support/src/interpreter/mod.rs | 258 | /// # Return value | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | crates/js-sys/tests/wasm/JsString.rs | 649 | // TODO: Add test once we have optional parameters | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | crates/cli-support/src/wit/mod.rs | 1997 | don't forget to recompile your Wasm file! Alternatively, you can update the | CODE |