Rhai - An embedded scripting language for Rust.
This report summarizes scanner evidence for rhaiscript/rhai, a Rust project with 5,771 GitHub stars. SynthScan examined 113,914 lines of code across 357 source files, recording 1041 pattern matches distributed across 4 syntactic categories. The legacy adjusted pattern signal is 8.0 (Moderate pattern signal); it is not an authorship estimate.
Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.
Use each vector to guide manual verification of the underlying findings.
Payload schema: 1.0.0 · Engine: 2.0.0 · Scoring: heuristic-density-v1 · Scan date: 2026-10-31.
Can maintainers explain intent, assumptions, and trade-offs? 1039 finding(s).
Are imports declared and package/API names verified? 2 finding(s).
Are wrappers, guards, and repeated structures necessary? 0 finding(s).
Which changes need focused human review? 1041 finding(s).
This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.
Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.
This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.
The scanner identified 1041 distinct pattern matches across 4 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. 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 configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tools/reserved.txt | 1 | // This file holds a list of reserved symbols for the Rhai language. | COMMENT |
| LOW | tools/keywords.txt | 1 | // This file holds a list of keywords/symbols for the Rhai language, with mapping to | COMMENT |
| LOW | tests/native.rs | 81 | COMMENT | |
| LOW | tests/arrays.rs | 361 | " | COMMENT |
| LOW | tests/mod.rs | 1 | mod grain { | COMMENT |
| LOW | tests/mod.rs | 21 | #[cfg(feature = "debugging")] | COMMENT |
| LOW | tests/grain/format.rs | 1 | //! An artifact must mean what the program it came from meant, and nothing a | COMMENT |
| LOW | tests/grain/format.rs | 121 | // rests on into a panic in Rhai, so the case is not run at all there. | COMMENT |
| LOW | tests/grain/format.rs | 141 | } | COMMENT |
| LOW | tests/grain/format.rs | 161 | let mut scope = Scope::new(); | COMMENT |
| LOW | tests/grain/format.rs | 461 | /// artifact holding jump targets that are not in the code, and so the one the | COMMENT |
| LOW | tests/grain/format.rs | 521 | ("switch-float", "let x = 42; switch x { 1.5 => 1, _ => 0 }", Caps::FLOAT, "floating-point"), | COMMENT |
| LOW | tests/grain/format.rs | 541 | #[cfg(not(feature = "no_float"))] | COMMENT |
| LOW | tests/grain/format.rs | 641 | COMMENT | |
| LOW | tests/grain/format.rs | 681 | let _ = Vm::new(&engine).eval_with_scope(&mut Scope::new(), &program); | COMMENT |
| LOW | tests/grain/format.rs | 761 | /// the sidecar it kept and has a backtrace. | COMMENT |
| LOW | tests/grain/format.rs | 981 | // | COMMENT |
| LOW | tests/grain/call_fn.rs | 1 | //! Calling one compiled function, with the environment and receiver Rhai gives | COMMENT |
| LOW | tests/grain/call_fn.rs | 21 | COMMENT | |
| LOW | tests/grain/custom_syntax.rs | 1 | //! Custom syntax against the walker's own scope and control-flow rules. | COMMENT |
| LOW | tests/grain/custom_syntax.rs | 181 | } | COMMENT |
| LOW | tests/grain/limits.rs | 1 | //! Compiled code must still be stoppable. | COMMENT |
| LOW | tests/grain/callback.rs | 161 | } | COMMENT |
| LOW | tests/grain/scope.rs | 1 | //! Variables the caller already had, which no slot can name. | COMMENT |
| LOW | tests/grain/scope.rs | 481 | agree_with(&engine, r#"fn via_kit() { import "kit" as k; k::double(3) } via_kit()"#, |_| {}, true); | COMMENT |
| LOW | tests/grain/scope.rs | 701 | assert_eq!(fresh.len(), 0, "the body never ran, so it declared nothing"); | COMMENT |
| LOW | tests/grain/differential.rs | 1 | //! The VM must mean exactly what Rhai means. | COMMENT |
| LOW | tests/grain/differential.rs | 181 | COMMENT | |
| LOW | tests/grain/differential.rs | 221 | /// five bytes and a dispatch and can never do anything, and because it is | COMMENT |
| LOW | tests/grain/fuzz.rs | 1 | //! Randomized loading, on the assumption that an artifact is hostile. | COMMENT |
| LOW | tests/grain/fuzz.rs | 221 | /// | COMMENT |
| LOW | tests/grain/projection.rs | 1 | //! What would a lowering of this script actually weigh? | COMMENT |
| LOW | tests/grain/allocation.rs | 1 | //! What the AST costs, and what the VM costs instead. | COMMENT |
| LOW | tests/grain/debugger.rs | 1 | //! A compiled program must be visible to the debugger, and stoppable. | COMMENT |
| LOW | tests/grain/debugger.rs | 381 | /// What a callback declares must not disturb the program it stopped. | COMMENT |
| LOW | tests/grain/corpus/generate.rs | 1 | // Random Rhai scripts, for comparing the VM against the walker on programs | COMMENT |
| LOW | tests/grain/corpus/generate.rs | 21 | // argument order for captures, pinned in `tests/callback.rs`. Closures are | COMMENT |
| LOW | tests/grain/corpus/generate.rs | 101 | COMMENT | |
| LOW | tests/grain/corpus/generate.rs | 121 | /// which is worth generating rather than worth avoiding. | COMMENT |
| LOW | tests/grain/corpus/generate.rs | 141 | pub struct Generator { | COMMENT |
| LOW | tests/grain/corpus/generate.rs | 501 | 9 => self.map(), | COMMENT |
| LOW | tests/grain/corpus/generate.rs | 541 | // form is `fn` in disguise, so `no_function` takes it too. | COMMENT |
| LOW | tests/grain/corpus/mod.rs | 1 | //! Scripts the VM must agree with Rhai on. | COMMENT |
| LOW | tests/grain/corpus/mod.rs | 21 | pub name: &'static str, | COMMENT |
| LOW | tests/grain/corpus/mod.rs | 81 | // a script can be given one: sharing is otherwise something Rhai does to a | COMMENT |
| LOW | tests/grain/corpus/mod.rs | 141 | Case { name, source } | COMMENT |
| LOW | tests/grain/corpus/mod.rs | 461 | // both loop variables have to go with the frame. | COMMENT |
| LOW | tests/grain/corpus/mod.rs | 481 | // A case value that matched but whose guard declined must continue to the | COMMENT |
| LOW | tests/grain/corpus/mod.rs | 501 | // A jump out of an arm and out of the switch, which is where the operand | COMMENT |
| LOW | tests/grain/corpus/mod.rs | 541 | // A script method mutating its receiver: `this` is bound by reference, so | COMMENT |
| LOW | tests/grain/corpus/mod.rs | 561 | case("call_style_pure_native", "let a = [1, 2]; len(a)"), | COMMENT |
| LOW | tests/grain/corpus/mod.rs | 581 | // argument rather than before it. | COMMENT |
| LOW | tests/grain/corpus/mod.rs | 601 | // cannot fold it into a pointer carrying an environment. | COMMENT |
| LOW | tests/grain/corpus/mod.rs | 621 | case("error_fn_ptr_from_an_unusable_name", r#"Fn("not an identifier!")"#), | COMMENT |
| LOW | tests/grain/corpus/mod.rs | 661 | // visible from outside the expression that invented it. | COMMENT |
| LOW | tests/grain/corpus/mod.rs | 701 | // A mutating method on a temporary. The mutation has nowhere to land, and | COMMENT |
| LOW | tests/grain/corpus/mod.rs | 721 | // The op-assign form, which falls back to the plain operator when no | COMMENT |
| LOW | tests/grain/corpus/mod.rs | 741 | case("throw_from_a_catch_drops_the_catch_var", "let a = 1; try { throw 2; } catch (e) { throw e; }"), | COMMENT |
| LOW | tests/grain/corpus/mod.rs | 781 | // has already been left — so the second failure here must not be caught. | COMMENT |
| LOW | codegen/src/lib.rs | 1 | //! This crate contains procedural macros to make creating Rhai plugin modules much easier. | COMMENT |
| 962 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | src/types/dynamic.rs | 1375 | // Coded this way in order to maximally leverage potentials for dead-code removal. | COMMENT |
| MEDIUM | src/types/dynamic.rs | 1501 | // Coded this way in order to maximally leverage potentials for dead-code removal. | COMMENT |
| MEDIUM | src/types/dynamic.rs | 1877 | // Coded this way in order to maximally leverage potentials for dead-code removal. | COMMENT |
| MEDIUM | src/types/dynamic.rs | 1980 | // Coded this way in order to maximally leverage potentials for dead-code removal. | COMMENT |
| MEDIUM | src/module/mod.rs | 1656 | /// Essentially, this method is a shortcut for: | COMMENT |
| MEDIUM | src/api/custom_syntax.rs | 230 | // Coded this way in order to maximally leverage potentials for dead-code removal. | COMMENT |
| MEDIUM | src/api/events.rs | 24 | /// the current [`Scope`][crate::Scope]. Essentially the correct variable is at position | COMMENT |
| MEDIUM | src/func/call.rs | 703 | // convert to method-call style in order to leverage potential &mut first argument | COMMENT |
| MEDIUM | src/func/call.rs | 794 | // If so, convert to method-call style in order to leverage potential | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | src/api/custom_syntax.rs | 562 | /// ## Return value | COMMENT |
| LOW | src/api/custom_syntax.rs | 615 | /// ## Return value | COMMENT |
| LOW | src/api/events.rs | 29 | /// ## Return value | COMMENT |
| LOW | src/api/events.rs | 85 | /// ## Return value | COMMENT |
| LOW | src/api/events.rs | 205 | /// ## Return value | COMMENT |
| LOW | src/api/events.rs | 347 | /// ## Return value | COMMENT |
| LOW | src/api/events.rs | 426 | /// ## Return value | COMMENT |
| LOW | src/api/events.rs | 502 | /// ## Return value | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/parse_json.rs | 32 | assert_eq!(map["name"].clone().into_immutable_string().expect("name should exist"), "John Doe"); | CODE |
| LOW | tests/parse_json.rs | 156 | assert_eq!(map["name"].clone().into_immutable_string().expect("name should exist"), "John Doe"); | CODE |