AI Slop Code Risk Monitor

huggingface/transformers.js

SlopCodeMonitor badge for huggingface/transformers.js Adjusted legacy signal; badge bands: 25 / 50 / 75 (different from dashboard bands).

State-of-the-art Machine Learning for the web. Run 🤗 Transformers directly in your browser, with no need for a server!

2.1 Low pattern signal View on GitHub

Open-Source Code Quality, Security and Technical Debt Review

This report summarizes scanner evidence for huggingface/transformers.js, a JavaScript project with 16,390 GitHub stars. SynthScan examined 77,416 lines of code across 710 source files, recording 93 pattern matches distributed across 9 syntactic categories. The legacy adjusted pattern signal is 2.1 (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.

2.1
Adjusted Signal
2.1
Raw Pattern Score
100%
Time Factor
2026-10-30
Last Push
16.4K
Stars
JavaScript
Language
77.4K
Lines of Code
710
Files
93
Pattern Hits
2026-10-31
Scan Date
0.00
HC Hit Rate

Risk Review · Payload v1

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.

Cognitive Ownership Risk 9.6/100 · LOW

Can maintainers explain intent, assumptions, and trade-offs? 90 finding(s).

Hallucinated Dependency & Supply Chain Risk 0.0/100 · LOW

Are imports declared and package/API names verified? 0 finding(s).

Agent Over-Engineering Ratio 1.1/100 · LOW

Are wrappers, guards, and repeated structures necessary? 11 finding(s).

PR Review Velocity Impact 8.3/100 · LOW

Which changes need focused human review? 93 finding(s).

What These Metrics Mean

Adjusted Signal
Legacy pattern score normalized per 1,000 scanned lines and multiplied by the repository-level time factor. It is not an estimate of AI authorship.
Raw Pattern Score
Sum of severity- and context-weighted pattern findings before applying the time factor.
Time Factor
A coarse multiplier based on repository last-push metadata. It does not identify when individual code was written.
Pattern Hits
Count of configured pattern findings. Review each location and surrounding code before acting.
HC Hit Rate
High- and critical-severity findings per scanned file. Severity is a configured detector weight, not proof of a vulnerability or authorship.
Lines / Files
Scan coverage denominators used by the legacy normalized score.

Pattern-Signal History

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.

Severity Breakdown

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.

CRITICAL 0HIGH 0MEDIUM 21LOW 72

Directory Score Breakdown

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.

Pattern Findings

The scanner identified 93 distinct pattern matches across 9 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.

Structural Annotation Overuse34 hits · 56 pts
SeverityFileLineSnippetContext
LOW⚡packages/transformers/tests/utils/cache.test.js411 // Step 1: Pre-cache config.json by downloading itCOMMENT
LOW⚡packages/transformers/tests/utils/cache.test.js414 // Step 2: Clear the cacheCOMMENT
LOW⚡packages/transformers/tests/utils/cache.test.js417 // Step 3: Verify response shapeCOMMENT
LOWpackages/transformers/tests/utils/cache.test.js433 // Step 4: config.json should have been cached and deletedCOMMENT
LOW⚡packages/transformers/tests/utils/cache.test.js452 // Step 1: Pre-cache config.json by downloading itCOMMENT
LOW⚡packages/transformers/tests/utils/cache.test.js455 // Step 2: Clear the pipeline cacheCOMMENT
LOW⚡packages/transformers/tests/utils/cache.test.js458 // Step 3: Verify response shapeCOMMENT
LOWpackages/transformers/tests/utils/cache.test.js471 // Step 4: Should include expected pipeline filesCOMMENT
LOWpackages/transformers/docs/source/guides/private.md9## Step 1: Generating a User Access TokenCOMMENT
LOWpackages/transformers/docs/source/guides/private.md22## Step 2: Using the access token in Transformers.jsCOMMENT
LOW…ages/transformers/docs/source/tutorials/next-ai-sdk.md17## Step 1: Create the projectCOMMENT
LOW…ages/transformers/docs/source/tutorials/next-ai-sdk.md32## Step 2: Configure Next.js for browser inferenceCOMMENT
LOW…ages/transformers/docs/source/tutorials/next-ai-sdk.md55## Step 3: Create the Web WorkerCOMMENT
LOW…ages/transformers/docs/source/tutorials/next-ai-sdk.md72## Step 4: Define the model configurationCOMMENT
LOW…ages/transformers/docs/source/tutorials/next-ai-sdk.md109## Step 5: Define toolsCOMMENT
LOW…ages/transformers/docs/source/tutorials/next-ai-sdk.md166## Step 6: Create the chat transportCOMMENT
LOW…ages/transformers/docs/source/tutorials/next-ai-sdk.md288## Step 7: Build the chat UICOMMENT
LOW…ages/transformers/docs/source/tutorials/next-ai-sdk.md420## Step 8: Run the applicationCOMMENT
LOWpackages/transformers/docs/source/tutorials/next.md21### Step 1: Initialise the projectCOMMENT
LOWpackages/transformers/docs/source/tutorials/next.md40### Step 2: Install and configure Transformers.jsCOMMENT
LOWpackages/transformers/docs/source/tutorials/next.md115### Step 3: Design the user interfaceCOMMENT
LOWpackages/transformers/docs/source/tutorials/next.md239### Step 1: Initialise the projectCOMMENT
LOWpackages/transformers/docs/source/tutorials/next.md258### Step 2: Install and configure Transformers.jsCOMMENT
LOWpackages/transformers/docs/source/tutorials/next.md351### Step 3: Design the user interfaceCOMMENT
LOWpackages/transformers/docs/source/tutorials/react.md17## Step 1: Initialize the projectCOMMENT
LOWpackages/transformers/docs/source/tutorials/react.md43## Step 2: Install and configure Transformers.jsCOMMENT
LOWpackages/transformers/docs/source/tutorials/react.md114## Step 3: Design the user interfaceCOMMENT
LOWpackages/transformers/docs/source/tutorials/react.md405## Step 4: Connecting everything togetherCOMMENT
LOW…kages/transformers/docs/source/tutorials/vanilla-js.md14## Step 1: HTML and CSS setupCOMMENT
LOW…kages/transformers/docs/source/tutorials/vanilla-js.md92## Step 2: JavaScript setupCOMMENT
LOW…kages/transformers/docs/source/tutorials/vanilla-js.md129## Step 3: Create an object detection pipelineCOMMENT
LOW…kages/transformers/docs/source/tutorials/vanilla-js.md163## Step 4: Create the image uploaderCOMMENT
LOW…kages/transformers/docs/source/tutorials/vanilla-js.md194## Step 5: Run the modelCOMMENT
LOW…kages/transformers/docs/source/tutorials/vanilla-js.md230## Step 6: Render the boxesCOMMENT
Modern AI Meta-Vocabulary16 hits · 47 pts
SeverityFileLineSnippetContext
MEDIUMREADME.md184| [Zero-Shot Classification](https://huggingface.co/tasks/zero-shot-classification) | `zero-shot-classification` | ClasCODE
MEDIUM⚡README.md228| [Zero-Shot Audio Classification](https://huggingface.co/learn/audio-course/chapter4/classification_models#zero-shot-auCODE
MEDIUM⚡README.md229| [Zero-Shot Image Classification](https://huggingface.co/tasks/zero-shot-image-classification) | `zero-shot-image-classCODE
MEDIUM⚡README.md230| [Zero-Shot Object Detection](https://huggingface.co/tasks/zero-shot-object-detection) | `zero-shot-object-detection` CODE
MEDIUMpackages/transformers/src/tokenization_utils.js227 * See the [RAG section](https://huggingface.co/docs/transformers/main/en/chat_templating#arguments-for-RAG) of the chatCOMMENT
MEDIUM⚡.ai/skills/transformers-js/SKILL.md46- [`zero-shot-classification`](references/TASKS.md#zero-shot-classification) — default model: `Xenova/distilbert-base-unCODE
MEDIUM⚡.ai/skills/transformers-js/SKILL.md48- [`zero-shot-audio-classification`](references/TASKS.md#zero-shot-audio-classification) — default model: `Xenova/clap-hCODE
MEDIUM⚡.ai/skills/transformers-js/SKILL.md55- [`zero-shot-image-classification`](references/TASKS.md#zero-shot-image-classification) — default model: `Xenova/clip-vCODE
MEDIUM⚡.ai/skills/transformers-js/SKILL.md57- [`zero-shot-object-detection`](references/TASKS.md#zero-shot-object-detection) — default model: `Xenova/owlvit-base-paCODE
MEDIUM⚡.ai/skills/transformers-js/references/TASKS.md10**Audio** — [`audio-classification`](#audio-classification) · [`zero-shot-audio-classification`](#zero-shot-audio-classiCODE
MEDIUM⚡.ai/skills/transformers-js/references/TASKS.md12**Vision** — [`image-to-text`](#image-to-text) · [`image-classification`](#image-classification) · [`image-segmentation`CODE
MEDIUM⚡.ai/skills/transformers-js/references/TASKS.md14**Text** — [`text-classification`](#text-classification) · [`token-classification`](#token-classification) · [`question-CODE
MEDIUM.ai/skills/transformers-js/references/TASKS.md55### `zero-shot-audio-classification`COMMENT
MEDIUM.ai/skills/transformers-js/references/TASKS.md313### `zero-shot-image-classification`COMMENT
MEDIUM.ai/skills/transformers-js/references/TASKS.md361### `zero-shot-object-detection`COMMENT
MEDIUM.ai/skills/transformers-js/references/TASKS.md843### `zero-shot-classification`COMMENT
Over-Commented Block19 hits · 19 pts
SeverityFileLineSnippetContext
LOW…ers/tests/pipelines/test_pipelines_object_detection.js101 { score: 0.020360343158245087, label: "LABEL_31", box: { xmin: 56, ymin: 55, xmax: 169, ymax: 167 } },COMMENT
LOW…mers/tests/pipelines/test_pipelines_text_generation.js121 },COMMENT
LOW…ncoder_decoder/test_modeling_vision_encoder_decoder.js21 });COMMENT
LOW…ers/tests/models/florence2/test_processor_florence2.js161 },COMMENT
LOW…ers/tests/models/florence2/test_processor_florence2.js181 // target: {COMMENT
LOWpackages/transformers/src/utils/audio.js41 let audio;COMMENT
LOWpackages/transformers/src/utils/cache/FileCache.js121 }COMMENT
LOWpackages/transformers/src/models/modeling_utils.js421 // if (generation_config.encoder_repetition_penalty !== null && generation_config.encoder_repetition_penalty !==COMMENT
LOWpackages/transformers/src/models/modeling_utils.js901COMMENT
LOWpackages/transformers/src/models/modeling_utils.js1621 const { input_ids, attention_mask } = model_inputs;COMMENT
LOW…ransformers/src/models/whisper/tokenization_whisper.js361 for (let i = 1; i < sequences.length; ++i) {COMMENT
LOWpackages/transformers/src/generation/logits_process.js101}COMMENT
LOWpackages/transformers/src/generation/logits_process.js121// *COMMENT
LOW.ai/skills/transformers-js/references/TASKS.md101// {COMMENT
LOW.ai/skills/transformers-js/references/TASKS.md341**Example:** Run object-detection with `Xenova/detr-resnet-50`.COMMENT
LOW.ai/skills/transformers-js/references/TASKS.md381// },COMMENT
LOW.ai/skills/transformers-js/references/TASKS.md401```javascriptCOMMENT
LOW.ai/skills/transformers-js/references/TASKS.md481COMMENT
LOW.ai/skills/transformers-js/references/TASKS.md601const output = await classifier('My name is Sarah and I live in London');COMMENT
Verbosity Indicators8 hits · 16 pts
SeverityFileLineSnippetContext
LOW⚡packages/transformers/tests/utils/cache.test.js411 // Step 1: Pre-cache config.json by downloading itCOMMENT
LOW⚡packages/transformers/tests/utils/cache.test.js414 // Step 2: Clear the cacheCOMMENT
LOW⚡packages/transformers/tests/utils/cache.test.js417 // Step 3: Verify response shapeCOMMENT
LOWpackages/transformers/tests/utils/cache.test.js433 // Step 4: config.json should have been cached and deletedCOMMENT
LOW⚡packages/transformers/tests/utils/cache.test.js452 // Step 1: Pre-cache config.json by downloading itCOMMENT
LOW⚡packages/transformers/tests/utils/cache.test.js455 // Step 2: Clear the pipeline cacheCOMMENT
LOW⚡packages/transformers/tests/utils/cache.test.js458 // Step 3: Verify response shapeCOMMENT
LOWpackages/transformers/tests/utils/cache.test.js471 // Step 4: Should include expected pipeline filesCOMMENT
Decorative Section Separators3 hits · 9 pts
SeverityFileLineSnippetContext
MEDIUM…/transformers/src/models/pyannote/modeling_pyannote.js51 * // ┌─────────┬────────────────────┬────────────────────┬────┬─────────────────────┐COMMENT
MEDIUM…/transformers/src/models/pyannote/modeling_pyannote.js53 * // ├─────────┼────────────────────┼────────────────────┼────┼─────────────────────┤COMMENT
MEDIUM…/transformers/src/models/pyannote/modeling_pyannote.js65 * // └─────────┴────────────────────┴────────────────────┴────┴─────────────────────┘COMMENT
Hyper-Verbose Identifiers8 hits · 8 pts
SeverityFileLineSnippetContext
LOW…ers-structured-output/src/StructuredOutputProcessor.ts87function discourageRepeatedWhitespace(logits: Tensor, tokenIds: readonly number[], count: number): void {CODE
LOW…ages/transformers-structured-output/src/engine/json.ts523function computeIntegerRestriction(schema: Record<string, unknown>): { lo: number; hi: number } | null {CODE
LOW…ages/transformers-structured-output/src/engine/json.ts747function selectedConditionalBranch(CODE
LOWpackages/transformers/tests/progress_callbacks.test.js64function expectValidEventLifecycle(events, model_id, expectedFiles) {CODE
LOWpackages/transformers/tests/utils/audio.test.js40function generateDeterministicWaveform(length) {CODE
LOWpackages/transformers/src/backends/onnx.js165export function deviceToExecutionProviders(device = null) {CODE
LOWpackages/transformers/src/utils/model-loader.js11export function resolveExternalDataFormat(config, fullName, fileName) {CODE
LOWpackages/transformers/src/utils/model-loader.js27export function getExternalDataChunkNames(fullName, numChunks) {CODE
TODO Padding3 hits · 4 pts
SeverityFileLineSnippetContext
LOWpackages/transformers/tests/tokenizers.test.js694 // TODO: Add test for token_ids once bug in transformers is fixed.COMMENT
LOWpackages/transformers/src/utils/tensor.js517 // TODO: implement transpose. For now (backwards compatibility), it's just an alias for permute()COMMENT
LOW…ransformers/src/models/whisper/tokenization_whisper.js523 // TODO: implement offsetsCOMMENT
Slop Phrases1 hit · 3 pts
SeverityFileLineSnippetContext
MEDIUMpackages/transformers/src/utils/audio.js56 // to create a single mono channel. It's worth noting that this scaling factor isCOMMENT
AI Slop Vocabulary1 hit · 2 pts
SeverityFileLineSnippetContext
MEDIUMpackages/transformers/tests/tokenizers.test.js641 expect(prompt).toEqual('<BOS_TOKEN><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># Safety Preamble\nThe instructions in tCODE