Rhai - An embedded scripting language for Rust.
This report summarizes scanner evidence for rhaiscript/rhai, a Rust project with 5,725 GitHub stars. SynthScan examined 111,731 lines of code across 355 source files, recording 1041 pattern matches distributed across 4 syntactic categories. The legacy adjusted pattern signal is 8.2 (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.
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/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 | 641 | /// Flipping each bit of each byte is exhaustive over single-bit corruption, | COMMENT |
| LOW | tests/grain/format.rs | 681 | // case worth having run above. | COMMENT |
| LOW | tests/grain/format.rs | 741 | let long = Compiler::new().compile(&engine.compile("let a = 1; while a < 9 { a += 1 } a").unwrap()); | COMMENT |
| LOW | tests/grain/format.rs | 761 | /// nothing to resolve. | 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 | 441 | 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 | 441 | // The loop variable is pushed once and mutated in place rather than | COMMENT |
| LOW | tests/grain/corpus/mod.rs | 461 | case("switch_float_literal", " let x = 2; switch x { 1.5 => 1, _=> 0 }"), | COMMENT |
| LOW | tests/grain/corpus/mod.rs | 481 | case("switch_non-hashable_subject", "let w = widget(3); switch w { 1 => \"int\", _ => \"other\" }"), | COMMENT |
| LOW | tests/grain/corpus/mod.rs | 521 | case("fn_call", "fn add(a, b) { a + b } add(2, 3)"), | COMMENT |
| LOW | tests/grain/corpus/mod.rs | 541 | // `this` is what leaves the body non-lowerable, and calling it by name | COMMENT |
| LOW | tests/grain/corpus/mod.rs | 561 | case("call_style_receiver_twice_over", "let a = [1]; insert(a, 0, a); a"), | COMMENT |
| LOW | tests/grain/corpus/mod.rs | 581 | // Function pointers are invoked via `.call()`; `f(5)` would look for a | COMMENT |
| LOW | tests/grain/corpus/mod.rs | 601 | // was measured to move the divergence onto the common path instead of | COMMENT |
| LOW | tests/grain/corpus/mod.rs | 621 | // an error (`eval/chaining.rs:461`). | COMMENT |
| LOW | tests/grain/corpus/mod.rs | 641 | // The other half of it: only a write creates a key. Reading one that is | COMMENT |
| LOW | tests/grain/corpus/mod.rs | 701 | // a different dispatch path and positions itself differently. | COMMENT |
| LOW | tests/grain/corpus/mod.rs | 721 | // --- what an escaping error leaves in the scope ------------------------- | COMMENT |
| LOW | tests/grain/corpus/mod.rs | 761 | case("try_catch_rethrow", "try { try { throw 1; } catch { throw; } } catch (e) { e }"), | COMMENT |
| LOW | tests/grain/corpus/mod.rs | 801 | // The mirror of it: an *index* step handing back the temporary, with the | COMMENT |
| LOW | codegen/src/lib.rs | 1 | //! This crate contains procedural macros to make creating Rhai plugin modules much easier. | COMMENT |
| LOW | codegen/src/lib.rs | 21 | //! let m = exported_module!(advanced_math); | COMMENT |
| LOW | codegen/src/lib.rs | 41 | mod function; | COMMENT |
| LOW | codegen/src/lib.rs | 61 | /// } | 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 | 1870 | // Coded this way in order to maximally leverage potentials for dead-code removal. | COMMENT |
| MEDIUM | src/types/dynamic.rs | 1973 | // Coded this way in order to maximally leverage potentials for dead-code removal. | COMMENT |
| MEDIUM | src/module/mod.rs | 1612 | /// 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 | 692 | // convert to method-call style in order to leverage potential &mut first argument | COMMENT |
| MEDIUM | src/func/call.rs | 783 | // 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 |