Audio waveform player
This report summarizes scanner evidence for katspaugh/wavesurfer.js, a TypeScript project with 10,460 GitHub stars. SynthScan examined 39,060 lines of code across 168 source files, recording 67 pattern matches distributed across 4 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? 67 finding(s).
Are imports declared and package/API names verified? 0 finding(s).
Are wrappers, guards, and repeated structures necessary? 18 finding(s).
Which changes need focused human review? 67 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 67 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 | jest.config.js | 1 | import { createDefaultEsmPreset } from 'ts-jest' | COMMENT |
| LOW | jest.config.js | 21 | // belt-and-suspenders with the in-test `beforeAll` guard in gc-leaks.test.ts: that guard is what | COMMENT |
| LOW | eslint.config.js | 81 | { | COMMENT |
| LOW | eslint.config.js | 121 | // Primitive files: raw acquisition here IS the primitive that | COMMENT |
| LOW | eslint.config.js | 141 | // callers (renderer.ts, envelope.ts) register that cleanup on their | COMMENT |
| LOW | cypress/support/commands.ts | 1 | /// <reference types="cypress" /> | COMMENT |
| LOW | cypress/support/commands.ts | 21 | // -- This is a dual command -- | COMMENT |
| LOW | cypress/support/e2e.ts | 1 | // *********************************************************** | COMMENT |
| LOW | examples/spectrogram.js | 41 | COMMENT | |
| LOW | examples/spectrogram.js | 61 | // | COMMENT |
| LOW | src/wavesurfer.ts | 661 | // Re-entrancy guard: a fresh child scope for this load call. | COMMENT |
| LOW | src/wavesurfer.ts | 681 | // The pipeline below -- starting with the 'load' emit -- can throw or | COMMENT |
| LOW | src/wavesurfer.ts | 761 | // destroyed before 'loadedmetadata' ever fires (e.g. never emitted | COMMENT |
| LOW | src/wavesurfer.ts | 821 | } | COMMENT |
| LOW | src/wavesurfer.ts | 1121 | // this.scope.dispose() cascades to loadScope (a child), which aborts any | COMMENT |
| LOW | src/define-plugin.ts | 21 | ctx: PluginContext<Events>, | COMMENT |
| LOW | src/define-plugin.ts | 41 | create(...args: PluginCtorArgs<Options>): BasePlugin<Events, Options> & Api | COMMENT |
| LOW | src/define-plugin.ts | 121 | public static create(...args: PluginCtorArgs<Options>) { | COMMENT |
| LOW | src/define-plugin.ts | 161 | // `subscriptions`, then unAll()s listeners registered on this plugin. | COMMENT |
| LOW | src/spectrogram-frequencies.ts | 181 | COMMENT | |
| LOW | src/spectrogram-setup.ts | 661 | COMMENT | |
| LOW | src/spectrogram-setup.ts | 941 | // The worker still re-subarrays internally using options.startTime/endTime (same protocol | COMMENT |
| LOW | src/spectrogram-setup.ts | 1201 | // is not cached so the next render retries. Guard immediately post-await (mirroring | COMMENT |
| LOW | src/spectrogram-setup.ts | 1461 | // A redraw arriving mid-render (e.g. a new file decoded while the | COMMENT |
| LOW | src/renderer.ts | 41 | private lastContainerWidth = 0 | COMMENT |
| LOW | src/plugins/record.ts | 81 | // Early-removal handles for the per-track 'ended' listeners registered in | COMMENT |
| LOW | src/plugins/record.ts | 261 | if (err instanceof DOMException && err.name === 'AbortError') return | COMMENT |
| LOW | src/plugins/record.ts | 581 | } | COMMENT |
| LOW | src/plugins/regions.ts | 21 | // does not fit definePlugin's PluginCtorArgs contract on its own | COMMENT |
| LOW | src/state/wavesurfer-state.ts | 181 | COMMENT | |
| LOW | src/__tests__/memory-leaks.test.ts | 381 | // destroyed the instance -- see issue #3637 -- so this must be a rejection, | COMMENT |
| LOW | src/__tests__/spectrogram-worker-errors.test.ts | 161 | // The worker still re-subarrays internally using options.startTime/endTime (same protocol | COMMENT |
| LOW | src/__tests__/spectrogram-worker-errors.test.ts | 581 | // so exercising it directly here covers both instead of fighting jsdom's lack of a real 2D | COMMENT |
| LOW | src/__tests__/spectrogram-windowed-destroy.test.ts | 1 | import WindowedSpectrogramPlugin from '../plugins/spectrogram-windowed.js' | COMMENT |
| LOW | src/__tests__/gc-leaks.test.ts | 61 | import { definePlugin } from '../define-plugin.js' | COMMENT |
| LOW | src/__tests__/gc-leaks.test.ts | 281 | expectCollected( | COMMENT |
| LOW | src/__tests__/gc-leaks.test.ts | 341 | // become unreachable once `plugin` itself is collected regardless of whether destroy()'s | COMMENT |
| LOW | src/__tests__/gc-leaks.test.ts | 361 | await plugin.getFrequenciesData() | COMMENT |
| LOW | src/__tests__/gc-leaks.test.ts | 421 | // A synthetic plugin, local to this test: its setup() closes over a sizable typed array | COMMENT |
| LOW | src/__tests__/gc-leaks.test.ts | 461 | 'the GcPayloadTestPlugin instance / its closure-only payload (check definePlugin teardown and ' + | COMMENT |
| LOW | src/__tests__/envelope-leaks.test.ts | 141 | // MERGED + ADAPTED (was two tests: "nulls the polyline on destroy..." and | COMMENT |
| LOW | src/__tests__/envelope-leaks.test.ts | 161 | // destroyed-but-not-nulled `polyline` reference is already functionally | COMMENT |
| LOW | src/__tests__/spectrogram-destroy.test.ts | 81 | COMMENT | |
| LOW | src/__tests__/timeline.test.ts | 101 | COMMENT | |
| LOW | src/__tests__/timeline.test.ts | 121 | // `updateVisibleNotches` and asserted its exact call args, including a | COMMENT |
| LOW | src/__tests__/timeline.test.ts | 161 | wavesurfer.getRenderer().getVisibleRange().set({ startTime: 0.1, endTime: 0.9 }) | COMMENT |
| LOW | src/__tests__/wavesurfer.test.ts | 681 | await expect(loadPromise).rejects.toMatchObject({ name: 'AbortError' }) | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | src/renderer-utils.ts | 203 | export function getRelativePointerPosition(rect: DOMRect, clientX: number, clientY: number): [number, number] { | CODE |
| LOW | src/renderer-utils.ts | 311 | export function calculateSingleCanvasWidth({ | CODE |
| LOW | src/spectrogram-windowing.ts | 587 | export function computeWindowedPixelsPerSecond( | CODE |
| LOW | src/spectrogram-render-utils.ts | 166 | export function createSparseFilterBankForScale( | CODE |
| LOW | src/spectrogram-render-utils.ts | 326 | export function dbToCompressedColorIndices( | CODE |
| LOW | src/spectrogram-render-utils.ts | 755 | export function createWrapperClickHandler(wrapper: HTMLElement, emit: (event: string, ...args: any[]) => void) { | CODE |
| LOW | src/spectrogram-frequencies.ts | 75 | function getOrCreateFFT( | CODE |
| LOW | src/spectrogram-setup.ts | 807 | async function calculateFrequenciesWithWorker(audioBuffer: AudioBuffer): Promise<Uint8Array[][]> { | CODE |
| LOW | src/spectrogram-setup.ts | 914 | function getWindowedPixelsPerSecond(): number { | CODE |
| LOW | src/spectrogram-setup.ts | 918 | async function calculateFrequenciesWithWorkerRange(startTime: number, endTime: number): Promise<Uint8Array[][]> { | CODE |
| LOW | src/spectrogram-setup.ts | 979 | async function calculateFrequenciesMainThreadRange(startTime: number, endTime: number): Promise<Uint8Array[][]> { | CODE |
| LOW | src/spectrogram-setup.ts | 1015 | async function calculateFrequenciesForRange(startTime: number, endTime: number): Promise<Uint8Array[][]> { | CODE |
| LOW | src/webaudio.ts | 19 | function setWebAudioSessionPlayback() { | CODE |
| LOW | src/plugins/timeline.ts | 172 | function defaultPrimaryLabelInterval(pxPerSec: number): number { | CODE |
| LOW | src/plugins/timeline.ts | 184 | function defaultSecondaryLabelInterval(pxPerSec: number): number { | CODE |
| LOW | src/reactive/scroll-stream.ts | 37 | export function calculateScrollPercentages(scrollData: ScrollData): ScrollPercentages { | CODE |
| LOW | src/__tests__/spectrogram-frequencies.test.ts | 44 | function oracleCalculateFrequencies(audioChannels: Float32Array[], options: OracleOptions): Uint8Array[][] { | CODE |
| LOW | src/__tests__/helpers/audio-buffer.ts | 26 | export function ensureGlobalAudioBufferStub(): void { | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | .github/workflows/unit-tests.yml | 12 | # The GC-leak harness (gc-leaks.test.ts) asserts real garbage collection | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | .github/workflows/release.yml | 26 | # Check if this exact version (stable or prerelease) is already on npm, | COMMENT |