Create the next immutable state by mutating the current one
This report summarizes scanner evidence for immerjs/immer, a JavaScript project with 28,999 GitHub stars. SynthScan examined 46,637 lines of code across 107 source files, recording 37 pattern matches distributed across 8 syntactic categories. The legacy adjusted pattern signal is 1.4 (Low 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? 27 finding(s).
Are imports declared and package/API names verified? 10 finding(s).
Are wrappers, guards, and repeated structures necessary? 6 finding(s).
Which changes need focused human review? 37 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 37 distinct pattern matches across 8 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⚡ | src/plugins/patches.ts | 51 | // Step 1: Check if state has a stored key | COMMENT |
| LOW⚡ | src/plugins/patches.ts | 53 | // Step 2: Validate the key is still valid in parent | COMMENT |
| LOW | src/plugins/patches.ts | 73 | // Step 3: Handle Set case specially | COMMENT |
| LOW | src/plugins/patches.ts | 85 | // Step 4: Validate key still exists in parent | COMMENT |
| LOW⚡ | src/plugins/patches.ts | 102 | // Step 5: Add key to path | COMMENT |
| LOW⚡ | src/plugins/patches.ts | 106 | // Step 6: Recurse to parent if exists | COMMENT |
| LOW⚡ | src/plugins/patches.ts | 111 | // Step 7: At root - reverse path and validate | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | src/plugins/patches.ts | 51 | // Step 1: Check if state has a stored key | COMMENT |
| LOW⚡ | src/plugins/patches.ts | 53 | // Step 2: Validate the key is still valid in parent | COMMENT |
| LOW | src/plugins/patches.ts | 73 | // Step 3: Handle Set case specially | COMMENT |
| LOW | src/plugins/patches.ts | 85 | // Step 4: Validate key still exists in parent | COMMENT |
| LOW⚡ | src/plugins/patches.ts | 102 | // Step 5: Add key to path | COMMENT |
| LOW⚡ | src/plugins/patches.ts | 106 | // Step 6: Recurse to parent if exists | COMMENT |
| LOW⚡ | src/plugins/patches.ts | 111 | // Step 7: At root - reverse path and validate | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| CRITICAL | __tests__/patch.js | 1593 | draft.queries.queryKey.data.items.push({name: "item2"}) | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | __performance_tests__/data.json | 5777 | "about": "Laboris aliqua labore esse officia Lorem. Ad occaecat ullamco est quis cillum Lorem ipsum eu laboris velit | CODE |
| LOW | __performance_tests__/data.json | 7577 | "about": "Ut labore consequat occaecat deserunt qui in. Lorem ipsum commodo culpa minim proident amet voluptate eius | CODE |
| LOW | __performance_tests__/data.json | 8657 | "about": "Eu est esse Lorem ipsum aute non labore qui id ad exercitation deserunt. Velit nulla nostrud laboris velit | CODE |
| LOW | __performance_tests__/data.json | 11537 | "about": "Enim Lorem ipsum Lorem culpa officia ad et esse ullamco fugiat. Eiusmod non tempor quis ad eu elit magna a | CODE |
| LOW | __performance_tests__/data.json | 12977 | "about": "Commodo consectetur occaecat non nostrud est sunt sunt incididunt mollit qui eiusmod laboris do esse. Et e | CODE |
| LOW | __performance_tests__/data.json | 16442 | "about": "Commodo elit eu irure ex eu eiusmod ipsum et laboris enim dolore nulla fugiat enim. Excepteur non dolor an | CODE |
| LOW | __performance_tests__/data.json | 17342 | "about": "Est veniam irure dolore aliquip ex. Dolore minim sunt eu voluptate aliqua. Enim elit cupidatat cupidatat l | CODE |
| LOW | __performance_tests__/data.json | 21707 | "about": "Et ea veniam amet nisi labore enim elit. Mollit eu laborum nulla fugiat qui mollit dolor. Reprehenderit no | CODE |
| LOW | __performance_tests__/data.json | 23057 | "about": "Fugiat ad eu eu dolor nisi occaecat velit proident velit nostrud enim. Adipisicing aute dolore aute exerci | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | src/core/finalize.ts | 169 | export function registerChildFinalizationCallback( | CODE |
| LOW | src/core/finalize.ts | 194 | function generatePatchesAndFinalize(state: ImmerState, rootScope: ImmerScope) { | CODE |
| LOW | src/plugins/patches.ts | 247 | function generatePatchesFromAssigned( | CODE |
| LOW | src/plugins/arrayMethods.ts | 299 | function handleReorderingOperation( | CODE |
| LOW | src/plugins/arrayMethods.ts | 440 | function handleNonMutatingOperation( | CODE |
| LOW | src/utils/common.ts | 291 | function dontMutateFrozenCollections() { | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | perf-testing/read-cpuprofile.js | 441 | // .map(([category, funcMap]) => { | COMMENT |
| LOW | perf-testing/read-cpuprofile.js | 461 | // .sort((a, b) => b[1] - a[1]) | COMMENT |
| LOW | perf-testing/read-cpuprofile.js | 481 | // if (funcKey.includes("[unknown]")) { | COMMENT |
| LOW | perf-testing/read-cpuprofile.js | 501 | // uncategorizedStats.forEach(([func, samples]) => { | COMMENT |
| LOW | perf-testing/read-cpuprofile.js | 521 | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | __tests__/regressions.js | 167 | // That's roughly what seamless-immutable does | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | _site/readme/index.html | 241 | Here is a simple example of the difference that Immer could make in practice. | CODE |