A framework for finding JavaScript memory leaks and analyzing heap snapshots
This report summarizes scanner evidence for facebook/memlab, a TypeScript project with 5,079 GitHub stars. SynthScan examined 166,781 lines of code across 750 source files, recording 288 pattern matches distributed across 6 syntactic categories. The legacy adjusted pattern signal is 1.8 (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? 287 finding(s).
Are imports declared and package/API names verified? 1 finding(s).
Are wrappers, guards, and repeated structures necessary? 123 finding(s).
Which changes need focused human review? 288 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 288 distinct pattern matches across 6 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 | website/src/components/TerminalReplay/lib/Term.js | 561 | // var term = Terminal.focus; | COMMENT |
| LOW | website/src/components/TerminalReplay/lib/Term.js | 2001 | break; | COMMENT |
| LOW | website/src/components/TerminalReplay/lib/Term.js | 2041 | // CSI Pm i Media Copy (MC). | COMMENT |
| LOW | website/src/components/TerminalReplay/lib/Term.js | 2061 | // this.disableModifiers(this.params); | COMMENT |
| LOW | website/src/components/TerminalReplay/lib/Term.js | 2081 | break; | COMMENT |
| LOW | website/src/components/TerminalReplay/lib/Term.js | 2101 | // if (this.postfix === ' ') { | COMMENT |
| LOW | website/src/components/TerminalReplay/lib/Term.js | 2121 | // this.setAttrInRectangle(this.params); | COMMENT |
| LOW | website/src/components/TerminalReplay/lib/Term.js | 2141 | // case 't': | COMMENT |
| LOW | website/src/components/TerminalReplay/lib/Term.js | 2161 | // this.restoreCursor(this.params); | COMMENT |
| LOW | website/src/components/TerminalReplay/lib/Term.js | 2181 | // CSI Pc; Pt; Pl; Pb; Pr$ x | COMMENT |
| LOW | website/src/components/TerminalReplay/lib/Term.js | 2201 | // CSI Pm ' { | COMMENT |
| LOW | website/src/components/TerminalReplay/lib/Term.js | 2221 | // if (this.postfix === ' ') { | COMMENT |
| LOW | website/src/components/TerminalReplay/lib/Term.js | 3041 | // Ps = 2 2 -> Normal (neither bold nor faint). | COMMENT |
| LOW | website/src/components/TerminalReplay/lib/Term.js | 3061 | // Ps = 4 6 -> Set background color to Cyan. | COMMENT |
| LOW | website/src/components/TerminalReplay/lib/Term.js | 3081 | // Ps = 1 0 4 -> Set background color to Blue. | COMMENT |
| LOW | website/src/components/TerminalReplay/lib/Term.js | 3221 | // Ps = 6 -> Report Cursor Position (CPR) [row;column] as CSI | COMMENT |
| LOW | website/src/components/TerminalReplay/lib/Term.js | 3441 | // CSI Ps c Send Device Attributes (Primary DA). | COMMENT |
| LOW | website/src/components/TerminalReplay/lib/Term.js | 3461 | // Ps = 0 or omitted -> request the terminal's identification | COMMENT |
| LOW | website/src/components/TerminalReplay/lib/Term.js | 3541 | this.x = this.cols - 1; | COMMENT |
| LOW | website/src/components/TerminalReplay/lib/Term.js | 3561 | // Ps = 9 -> Send Mouse X & Y on button press. See the sec- | COMMENT |
| LOW | website/src/components/TerminalReplay/lib/Term.js | 3581 | // Ps = 6 6 -> Application keypad (DECNKM). | COMMENT |
| LOW | website/src/components/TerminalReplay/lib/Term.js | 3601 | // enables the altSendsEscape resource). | COMMENT |
| LOW | website/src/components/TerminalReplay/lib/Term.js | 3761 | // Ps = 4 -> Jump (Fast) Scroll (DECSCLM). | COMMENT |
| LOW | website/src/components/TerminalReplay/lib/Term.js | 3781 | // compile-time option). | COMMENT |
| LOW | website/src/components/TerminalReplay/lib/Term.js | 3801 | // Ps = 1 0 3 7 -> Send VT220 Remove from the editing-keypad | COMMENT |
| LOW | website/src/components/TerminalReplay/lib/Term.js | 4041 | this.tabs = {}; | COMMENT |
| LOW | website/src/components/TerminalReplay/lib/Term.js | 4061 | // Set or reset resource-values used by xterm to decide whether | COMMENT |
| LOW | website/src/components/TerminalReplay/lib/Term.js | 4081 | // Ps = 1 -> modifyCursorKeys. | COMMENT |
| LOW | website/src/components/TerminalReplay/lib/Term.js | 4121 | }; | COMMENT |
| LOW | website/src/components/TerminalReplay/lib/Term.js | 4141 | // as in the ANSI DECRQM. | COMMENT |
| LOW | website/src/components/TerminalReplay/lib/Term.js | 4161 | // Ps = 0 -> Clear all LEDS (default). | COMMENT |
| LOW | website/src/components/TerminalReplay/lib/Term.js | 4221 | COMMENT | |
| LOW | website/src/components/TerminalReplay/lib/Term.js | 4241 | // Ps = 3 ; x ; y -> Move window to [x, y]. | COMMENT |
| LOW | website/src/components/TerminalReplay/lib/Term.js | 4261 | // Ps = 1 4 -> Report xterm window in pixels. Result is CSI | COMMENT |
| LOW | website/src/components/TerminalReplay/lib/Term.js | 4281 | ; | COMMENT |
| LOW | website/src/components/TerminalReplay/lib/Term.js | 4301 | // cussion of "Title Modes") | COMMENT |
| LOW | website/src/components/TerminalReplay/lib/Term.js | 4321 | ; | COMMENT |
| LOW | website/src/components/TerminalReplay/lib/Term.js | 4341 | // rectangle is disabled. Filter rectangles are always treated | COMMENT |
| LOW | website/src/components/TerminalReplay/lib/Term.js | 4401 | // Enable Locator Reporting (DECELR). | COMMENT |
| LOW | website/src/components/TerminalReplay/lib/Term.js | 4441 | // this.maxRange(); | COMMENT |
| LOW | website/src/components/TerminalReplay/lib/Term.js | 4461 | // CSI Pt; Pl; Pb; Pr$ { | COMMENT |
| LOW | website/src/components/TerminalReplay/lib/Term.js | 4481 | // -> CSI Pe ; Pb ; Pr ; Pc ; Pp & w | COMMENT |
| LOW | website/src/lib/ContainerAnimation.js | 1 | // | COMMENT |
| LOW | packages/core/src/paths/TraceFinder.ts | 161 | // | COMMENT |
| LOW | packages/core/src/lib/Config.ts | 361 | this.interceptScript = false; | COMMENT |
| LOW | packages/core/src/lib/Config.ts | 381 | // TF/IDF maximum document frequency | COMMENT |
| LOW | packages/core/src/lib/Config.ts | 401 | // Information saved in this map will be | COMMENT |
| LOW | packages/mcp-server/scripts/build-dist.sh | 1 | #!/bin/bash | COMMENT |
| LOW | packages/mcp-server/src/run-manifest.ts | 201 | if (cyclesPerRung != null && cyclesPerRung.length !== paths.length) { | COMMENT |
| LOW | packages/mcp-server/src/utils.ts | 101 | COMMENT | |
| LOW | packages/mcp-server/src/snapshot-index.ts | 201 | if (parsed.sourceMtimeMs !== Math.round(stat.mtimeMs)) return null; | COMMENT |
| LOW | packages/mcp-server/src/tools/round-audit.ts | 341 | status: 'info', | COMMENT |
| LOW | packages/mcp-server/src/tools/snapshot-summary.ts | 81 | edgeCount++; | COMMENT |
| LOW | packages/mcp-server/src/tools/sequence-analysis.ts | 321 | // Reuse a snapshot that is already resident rather than re-parsing it. | COMMENT |
| LOW | packages/mcp-server/src/tools/sequence-analysis.ts | 661 | // the browser MCP's capture_numeric_value): that mode emits one graph | COMMENT |
| LOW | packages/mcp-server/src/tools/sequence-analysis.ts | 761 | // separates them is a rung captured after the app settles, and it is | COMMENT |
| LOW | packages/mcp-server/src/tools/rate-model.ts | 241 | ], | COMMENT |
| LOW | packages/mcp-server/src/tools/island-doors.ts | 341 | COMMENT | |
| LOW | packages/mcp-server/src/tools/prune-run.ts | 81 | return gzipAvailable; | COMMENT |
| LOW | packages/mcp-server/src/tools/eval.ts | 261 | truncated: true, | COMMENT |
| 80 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | …/core/src/trace-cluster/MultiIterationSeqClustering.ts | 142 | function positiveIntOrDefaultValue(v: AnyValue, d: number): number { | CODE |
| LOW | packages/core/src/trace-cluster/ClusterUtilsHelper.ts | 464 | function getSimilarityByTraceElementList( | CODE |
| LOW | packages/core/src/lib/Serializer.ts | 121 | function JSONifyDetachedHTMLElement( | CODE |
| LOW | packages/core/src/lib/Serializer.ts | 232 | function JSONifyFiberNodeReturnTrace( | CODE |
| LOW | packages/core/src/lib/Serializer.ts | 774 | function summarizeUnboundedObjects( | CODE |
| LOW | packages/core/src/lib/Serializer.ts | 795 | function summarizeUnboundedObjectsToCSV( | CODE |
| LOW | packages/core/src/lib/HeapParser.ts | 51 | async function loadSnapshotMetaDataFromFile( | CODE |
| LOW | packages/core/src/lib/Utils.ts | 447 | function iterateDescendantFiberNodes( | CODE |
| LOW | packages/core/src/lib/Utils.ts | 487 | function getConditionalDominatorIds( | CODE |
| LOW | packages/core/src/lib/Utils.ts | 768 | async function getSnapshotNodeIdsFromFile( | CODE |
| LOW | packages/core/src/lib/Utils.ts | 1277 | function extractHTMLElementNodeInfo(node: IHeapNode): string { | CODE |
| LOW | packages/core/src/lib/Utils.ts | 1297 | function getSnapshotSequenceFilePath(): string { | CODE |
| LOW | packages/core/src/lib/Utils.ts | 1389 | function pathHasNodeOrEdgeWithName( | CODE |
| LOW | packages/core/src/lib/Utils.ts | 1572 | function camelCaseToReadableString( | CODE |
| LOW | packages/core/src/lib/Utils.ts | 1641 | function getSnapshotFilesFromTabsOrder(options: AnyOptions = {}): string[] { | CODE |
| LOW | packages/core/src/lib/Utils.ts | 1737 | function getSnapshotDirForAnalysis(): string { | CODE |
| LOW | packages/core/src/lib/Utils.ts | 1745 | function getSingleSnapshotFileForAnalysis(): string { | CODE |
| LOW | packages/core/src/lib/Utils.ts | 1811 | function getSnapshotFilePathWithTabType( | CODE |
| LOW | packages/core/src/lib/Utils.ts | 2219 | function isNodeDominatedByDeletionsArray(node: IHeapNode): boolean { | CODE |
| LOW | packages/core/src/lib/Utils.ts | 2295 | function aggregateDominatorMetrics( | CODE |
| LOW | packages/core/src/lib/Utils.ts | 2366 | function tryToMutePuppeteerWarning() { | CODE |
| LOW | packages/core/src/lib/Utils.ts | 2408 | function convertCLIArgsToReadableCommand(args: string[]): string { | CODE |
| LOW | packages/core/src/lib/HeapAnonymizer.ts | 477 | function collectUnclassifiedLabelFamilies( | CODE |
| LOW | packages/core/src/lib/HeapAnonymizer.ts | 916 | export async function anonymizeHeapSnapshotFile( | CODE |
| LOW | …ib/trace-filters/rules/FilterInternalNodeTrace.rule.ts | 39 | function internalNodeRetainsDetachedElement(path: LeakTracePathItem): boolean { | CODE |
| LOW | …filters/rules/FilterCppRootsToDetachedDOMTrace.rule.ts | 37 | function hasCppRootsToDetachedDOMNode(path: LeakTracePathItem): boolean { | CODE |
| LOW | …ters/rules/FilterAttachedDOMToDetachedDOMTrace.rule.ts | 39 | function isAttachedDOMToDetachedDOMChain(path: LeakTracePathItem): boolean { | CODE |
| LOW | …lib/trace-filters/rules/FilterStyleEngineTrace.rule.ts | 38 | function styleEngineRetainsDetachedElement(path: LeakTracePathItem): boolean { | CODE |
| LOW | …/lib/trace-filters/rules/FilterShadowRootTrace.rule.ts | 38 | function shadowRootRetainsDetachedElement(path: LeakTracePathItem): boolean { | CODE |
| LOW | …ace-filters/rules/FilterPendingActivitiesTrace.rule.ts | 40 | function pendingActivitiesRetainsDetachedElementChain( | CODE |
| LOW | …b/leak-filters/rules/FilterOverSizedNodeAsLeak.rule.ts | 36 | function isHeapNodeUsefulForLeakTraceDiffing( | CODE |
| LOW | …ib/leak-filters/rules/FilterDetachedDOMElement.rule.ts | 48 | function isDetachedDOMNodeDominatedByDehydratedMemoizedState( | CODE |
| LOW | packages/mcp-server/src/native-context.ts | 189 | export function resolveNativeContextFilter( | CODE |
| LOW | packages/mcp-server/src/run-manifest.ts | 157 | function cyclesFromPrecedingDrivenRung( | CODE |
| LOW | packages/mcp-server/src/guardrail.ts | 118 | function installUnknownParamRejection(server: McpServer): void { | CODE |
| LOW | packages/mcp-server/src/context-analysis.ts | 306 | function attributeScriptScopeInfos( | CODE |
| LOW | packages/mcp-server/src/artifact-classes.ts | 224 | export function classifyNonProductionString( | CODE |
| LOW | packages/mcp-server/src/artifact-classes.ts | 272 | export function isReactRefreshSignatureShape( | CODE |
| LOW | packages/mcp-server/src/artifact-classes.ts | 292 | export function isHarnessToolManifestShape( | CODE |
| LOW | packages/mcp-server/src/utils.ts | 433 | export function hasFreshnessTimestampSibling(node: IHeapNode): boolean { | CODE |
| LOW | packages/mcp-server/src/utils.ts | 609 | export function filterLargestObjectsCounted( | CODE |
| LOW | packages/mcp-server/src/utils.ts | 830 | export function boundedDominatorRetainedSize( | CODE |
| LOW | packages/mcp-server/src/utils.ts | 1235 | export function instrumentationRetainerNote( | CODE |
| LOW | packages/mcp-server/src/dev-edges.ts | 306 | export function shortestPathAvoidingDevEdges( | CODE |
| LOW | packages/mcp-server/src/tools/population-vs-owners.ts | 45 | export function registerPopulationVsOwners(server: McpServer): void { | CODE |
| LOW | packages/mcp-server/src/tools/property-distribution.ts | 46 | export function registerPropertyDistribution(server: McpServer): void { | CODE |
| LOW | packages/mcp-server/src/tools/object-cost-breakdown.ts | 136 | export function registerObjectCostBreakdown(server: McpServer): void { | CODE |
| LOW | packages/mcp-server/src/tools/string-prefix-census.ts | 98 | export function registerStringPrefixCensus(server: McpServer): void { | CODE |
| LOW | packages/mcp-server/src/tools/field-release-impact.ts | 71 | export function registerFieldReleaseImpact(server: McpServer): void { | CODE |
| LOW | packages/mcp-server/src/tools/dev-subtracted-delta.ts | 78 | export function registerDevSubtractedDelta(server: McpServer): void { | CODE |
| LOW | …ckages/mcp-server/src/tools/snapshot-budget-planner.ts | 37 | export function registerSnapshotBudgetPlanner(server: McpServer): void { | CODE |
| LOW | packages/mcp-server/src/tools/closure-inspection.ts | 142 | export function registerClosureInspection(server: McpServer): void { | CODE |
| LOW | packages/mcp-server/src/tools/module-attribution.ts | 272 | export function registerModuleAttribution(server: McpServer): void { | CODE |
| LOW | packages/mcp-server/src/tools/react-update-queues.ts | 523 | export function registerReactUpdateQueues(server: McpServer): void { | CODE |
| LOW | packages/mcp-server/src/tools/anonymize-snapshot.ts | 107 | export function registerAnonymizeSnapshot(server: McpServer): void { | CODE |
| LOW | packages/mcp-server/src/tools/auto-investigate.ts | 346 | function scanDistributedAccumulation( | CODE |
| LOW | packages/mcp-server/src/tools/auto-investigate.ts | 434 | function scanSubscriptionAccumulation( | CODE |
| LOW | packages/mcp-server/src/tools/cache-inventory.ts | 102 | function functionPropertyCollections( | CODE |
| LOW | packages/mcp-server/src/tools/dead-context-variables.ts | 108 | export function registerDeadContextVariables(server: McpServer): void { | CODE |
| LOW | packages/mcp-server/src/tools/blink-native-census.ts | 205 | export function registerBlinkNativeCensus(server: McpServer): void { | CODE |
| 63 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | packages/core/src/paths/TraceFinder.ts | 304 | // Step 1: DFS from the root. | COMMENT |
| LOW⚡ | packages/core/src/paths/TraceFinder.ts | 307 | // Step 2: nodes may remain unreachable from the root. First bring in | COMMENT |
| LOW | packages/core/src/paths/TraceFinder.ts | 321 | // Step 3: whatever is still unreachable is a clique of nodes retained only | COMMENT |
| LOW | packages/core/src/paths/TraceFinder.ts | 334 | // Step 4: main loop, processing vertices in decreasing DFS number. | COMMENT |
| LOW | packages/core/src/paths/TraceFinder.ts | 374 | // Step 5: fill in the immediate dominators not computed explicitly above. | COMMENT |
| LOW | packages/mcp-server/MCP_SKILL.md | 17 | ## Step 0: Obtain the Snapshot | COMMENT |
| LOW | packages/mcp-server/MCP_SKILL.md | 41 | ## Step 1: Load and Triage | COMMENT |
| LOW | packages/mcp-server/MCP_SKILL.md | 73 | ## Step 2: Choose an Investigation Path | COMMENT |
| LOW | packages/mcp-server/MCP_SKILL.md | 365 | ## Step 3: Deep Dive | COMMENT |
| LOW | packages/mcp-server/MCP_SKILL.md | 395 | ## Step 4: Report Findings | COMMENT |
| LOW | packages/mcp-server/src/tools/intern-opportunities.ts | 296 | // Step 1: per-value string duplication index. | COMMENT |
| LOW | packages/mcp-server/src/tools/intern-opportunities.ts | 329 | // Step 2: For duplicated strings, sample referrers to get property × shape | COMMENT |
| LOW | packages/mcp-server/src/tools/intern-opportunities.ts | 576 | // Step 3: Compute savings and filter | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | packages/core/src/paths/TraceFinder.ts | 304 | // Step 1: DFS from the root. | COMMENT |
| LOW⚡ | packages/core/src/paths/TraceFinder.ts | 307 | // Step 2: nodes may remain unreachable from the root. First bring in | COMMENT |
| LOW | packages/core/src/paths/TraceFinder.ts | 321 | // Step 3: whatever is still unreachable is a clique of nodes retained only | COMMENT |
| LOW | packages/core/src/paths/TraceFinder.ts | 334 | // Step 4: main loop, processing vertices in decreasing DFS number. | COMMENT |
| LOW | packages/core/src/paths/TraceFinder.ts | 374 | // Step 5: fill in the immediate dominators not computed explicitly above. | COMMENT |
| LOW | packages/mcp-server/src/tools/intern-opportunities.ts | 296 | // Step 1: per-value string duplication index. | COMMENT |
| LOW | packages/mcp-server/src/tools/intern-opportunities.ts | 329 | // Step 2: For duplicated strings, sample referrers to get property × shape | COMMENT |
| LOW | packages/mcp-server/src/tools/intern-opportunities.ts | 576 | // Step 3: Compute savings and filter | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | packages/mcp-server/src/tools/find-nodes-by-class.ts | 181 | // largest first, then scan order), so paging is seamless between them. | COMMENT |
| MEDIUM | packages/e2e/static/links/min.js | 4 | !function(){"use strict";var e={725:function(e){var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=O | CODE |
| MEDIUM | packages/e2e/static/links/min.js | 4 | !function(){"use strict";var e={725:function(e){var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=O | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | AI.md | 128 | await page.locator('input[name="email"]').fill('user@example.com'); | CODE |