Public report — transformers.js, published 1 Oct 2026. Concrete security findings (which rule fired, in which file, on which line; CVE IDs, secret matches, dependency versions) are REDACTED in this version; ask the repo owner for the full report.
Public
Codebase survey Measured under the Code Assurance Index · rubric rubric-2026.09.18 (frozen) · verify this survey Filed cd_19d8e9f8d1f04a09acf46cdc480ad1e8 Filed 1 October 2026, 21:47 UTC Public

Huggingface/transformers.Js

Measured 1 October 2026, 21:26 UTC

58% Adequate
CriticalWeakAdequateStrongExemplary

Medium · 37,485 LoC · 3 projects · rebuild ~0.4 person-years · weakest lens: Readiness (53%)

Findings by grade

17 critical 235 serious 12 minor 33 could not be resolved — could be critical — see Limitations

This survey was produced by

Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
1 October 2026, 21:26 UTC

A measurement, not a certificate. The Code Assurance Index does not certify, approve or guarantee this codebase; it records a reproducible number and the evidence it was computed from. The standard is authored by Canine Development, who also build Watchdog — its only implementation today. That is said here so the number is checked rather than believed.

Grounded in facts. Every number here is computed, not narrated — reproducible, tool-backed, and traceable to a line of code. How to trust this ▸

44/48dimensions tool-verifieddeterministic · confidence 1.0 · 4 LLM-assisted, advisory
250findings with an exact file:lineof 264 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
48/132dimensions across the health lenses37485 LoC · 3 projects — wide & deep
Chapters

Executive summary

The system holds an adequate standing with a health score of 58%, indicating a workable asset that carries real operational risk. While the codebase is medium-sized and relatively inexpensive to rebuild, its current state imposes a hidden tax on every change, slowing delivery and increasing defect risk. The primary concern is not the code’s complexity alone, but the lack of operational safeguards that leave the business exposed to preventable outages and security regressions.

The most significant risk lies in production readiness, which scores poorly at 53%. This lens measures whether the system is safe to operate, tested, and observable. A low score here means that changes are more likely to cause outages or go undetected until they impact users. For a system of this size, the cost of fixing readiness issues is low, but the cost of ignoring them is high in terms of incident response and lost trust. The weakest point is the lack of automated, repeatable release processes, which makes deployments fragile and error-prone.

A second theme is the velocity tax imposed by code quality. While the architecture is decent, the code’s complexity and duplication create a drag on development speed. Every modification in these weaker areas costs roughly 5–11% more effort than it should, compounding over time. This is not just a technical debt issue; it is a direct hit to team productivity and time-to-market. The cost of this drag is paid annually in engineer hours, making it a recurring expense that reduces the team’s capacity for new features.

On the positive side, the system is not fragile. The rebuild effort is modest, estimated at less than half a person-year, suggesting the core logic is sound and not entangled in unmanageable complexity. The codebase is also free of boilerplate, indicating that the existing code is purposeful and likely well-understood by the current team. This provides a stable foundation for improvement without requiring a costly rewrite.

The first action must be to add static security analysis to the continuous integration pipeline. This single step pays for itself quickly by preventing security regressions from reaching production. It is a low-effort, high-impact change that addresses the most critical gap in readiness. Following this, the team should automate the release process to ensure deployments are repeatable and reversible. These steps will immediately reduce operational risk and improve delivery confidence, allowing the team to focus on reducing the velocity tax in subsequent phases.

How the score is built — each lens's share of the headline Width is the lens's weight in the worst-heaviest fold (the weakest area pulls hardest); colour is that lens's own band. A lens fixes the score in proportion to its width.
Readiness 53% · 46% weightPerformance 60% · 25% weightSecurity 64% · 14% weightMaturity 64% · 8% weightCode Health 66% · 4% weightArchitecture 73% · 2% weight

Raise Readiness 53 → 70 (the Healthy floor) ⇒ headline 58 → ~63.

Code composition — where the lines go
Tests 100%
New since the last scan (5+)

5 finding(s) are new versus the previous scan (2026-09-16) — surfaced by this scheduled scan itself, no pull request required.

  • D36 · REDACTED
  • D36 · REDACTED
  • D36 · REDACTED
  • PF3 · Sync-over-async blocking packages/transformers/tests/test_utils.js
  • PF3 · Sync-over-async blocking packages/transformers/tests/test_utils.js

A full-fidelity diff against the previous run's complete recorded findings — line-move tolerant: a finding that only shifted line counts as unchanged, only genuinely new titles/files surface here.

Rebuild cost & value ~ Modeled — €21,000–€110,000
Cost to rebuild€21,000–€110,000 (0.2–0.7 person-years (356–1,130 h), ~1 engineer)
Domain complexityStandard — harder problems cost more per line
Quality factor0.8× (at 58% quality) — the last 20% of quality is most of the work
Size & shapeMedium · effort split not classified (source measured from disk; the effort-tier breakdown is a C#-only syntax walk)

This codebase represents roughly ~0.4 person-years of build effort (about ~€64,000 to rebuild). Its weakest lens is Readiness at 53% — the part of that asset most exposed by the findings below.

How we model this: boilerplate at a scaffolding rate + logic × domain Standard (×1.0) — standard service × a 0.8× quality factor, at €60–95/h; indicative, ±~30% · size measured directly from source · effort from total production LoC as straight-line logic (the tier split is a C#-only syntax walk), a conservative lower bound. Indicative only — most sensitive to the hourly rate and the domain tier (both tunable in config).

Top priorities

The highest-leverage moves; the full ranked list is in the Roadmap below.

1
Add a SAST step to CI running what this repository's stack ships: CodeQL's javascript-typescript pack, `semgrep --config=p/typescript`, or eslint-plugin-security — so a security regression fails the build instead of landing.
+5.1 pts · Medium effort · Security & performance tooling
2
Automate the release in CI — a deploy stage for a service (Helm/Kubernetes manifests or an equivalent rollout), or a tag-triggered publish job for an artifact — so releases are repeatable and reversible.
+5.1 pts · Medium effort · Deployment & Rollback
3
Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
+5.1 pts · Medium effort · Release Hygiene

Diagnosis — what's actually going on

The top fix pays for itself · High · Economics
The top-ranked fix costs roughly 3–10 engineer-days once. Not doing it costs about 5.4–32.3 engineer-days every year, paid as drag on the ~42,393 lines this team changes annually — a bill that arrives whether or not anyone books it. On those figures the fix breaks even in roughly 1–22 months and is free after that. Method, stated so this is not read as a quotation: debt from the ranked task's effort band; interest = annual changed lines (measured, annualised from the 90-day window) ÷ an ASSUMED 150–400 lines per engineer-day × the 5–11% drag implied by the code-quality signals; breaking point = debt ÷ annual interest. A modelled planning range built from measured inputs and one named assumption — not a quotation, a valuation, or a certified figure.
Evidence: D15 churn: 10,453 line(s) changed over a 90-day window ⇒ ~42,393/year · D1/D2/D6 code quality: averaging 6.0/10 ⇒ a 5–11% drag on each change · top-ranked remediation: Medium effort ⇒ about 3–10 engineer-day(s)
→ Do the top-ranked fix now if this code will still be yours in 22 months.
Value concentrated against a weak lens · Medium · Value at risk
This is a Medium asset (~0.4 person-years to rebuild), and its weakest lens is Readiness at 53%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
Evidence: valuation: Medium, ~0.4 person-years rebuild (37,485 LoC) · weakest lens: Readiness 53%
→ Direct remediation budget at Readiness first — highest risk-reduction per euro on an asset this size.
Highest-leverage move · Medium · Leverage
Of everything flagged, the best return on effort is: Add a SAST step to CI running what this repository's stack ships: CodeQL's javascript-typescript pack, `semgrep --config=p/typescript`, or eslint-plugin-security — so a security regression fails the build instead of landing. The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Add a SAST step to CI running what this repository's stack ships: CodeQL's javascript-typescript pack, `semgrep --config=p/typescript`, or eslint-plugin-security — so a security regression fails the build instead of landing.
A velocity tax on every change · Medium · Economics
The code-quality signals (complexity, duplication, cohesion) average 6.0/10, which acts as a tax on every change in the weaker areas: modifications there plausibly cost on the order of 5–11% more than in clean code, and the tax compounds as the codebase grows. (A modelled estimate, not a measured fact.)
Evidence: D1/D2/D6 code quality: averaging 6.0/10 across the code-quality signals actually measured
→ Pay it down where churn is highest — the hotspots — not everywhere; that's where the tax is actually paid.

Architecture — module dependency graph

Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways — a layering smell or cycle. A clean layered graph has none.

arch @huggingface/transformers transformers @huggingface/transformers-structured-output transformers-structured-output @huggingface/transformers-structured-output->@huggingface/transformers

Architecture — module dependency matrix

Rows and columns are the same modules, ordered so that a module only depends on ones above it. A cell means the row depends on the column, and its number is how many type pairs create that dependency. Read one thing: is anything above the diagonal? A mark there is a dependency cycle. (A cycle is all this shows — an unusual but cycle-free dependency sits below the diagonal like any other.)

529 modules, 371 dependencies. Every dependency points down the layering — no cycles.

Showing the 40 most-connected modules; 489 more are not drawn.

Module dependency matrix. The row depends on the column; the number is how many type pairs create the dependency. A cell above the diagonal is part of a dependency cycle.
depends on →1 transformers-structured-output.src.engine.constraint2 transformers-structured-output.src.engine.types3 transformers.src.feature_extraction_utils4 transformers.src.image_processors_utils5 transformers.src.models.modeling_outputs6 transformers.src.models.modeling_utils7 transformers.src.processing_utils8 transformers.src.tokenization_utils9 transformers.src.utils.tensor10 transformers-structured-output.src.StructuredOutputProcessor11 transformers-structured-output.src.engine12 transformers.src.models.clip.modeling_clip13 transformers.src.models.dac.modeling_dac14 transformers.src.models.detr.modeling_detr15 transformers.src.models.donut.image_processing_donut16 transformers.src.models.encodec.feature_extraction_encodec17 transformers.src.models.gemma3n.feature_extraction_gemma3n18 transformers.src.models.gemma3n.modeling_gemma3n19 transformers.src.models.hubert.modeling_hubert20 transformers.src.models.llava.modeling_llava21 transformers.src.models.maskformer.image_processing_maskformer22 transformers.src.models.mbart.tokenization_mbart23 transformers.src.models.mgp_str.modeling_mgp_str24 transformers.src.models.mimi.modeling_mimi25 transformers.src.models.owlvit.image_processing_owlvit26 transformers.src.models.parakeet.feature_extraction_parakeet27 transformers.src.models.qwen2_vl.image_processing_qwen2_vl28 transformers.src.models.qwen2_vl.modeling_qwen2_vl29 transformers.src.models.qwen2_vl.processing_qwen2_vl30 transformers.src.models.rt_detr.modeling_rt_detr31 transformers.src.models.ultravox.modeling_ultravox32 transformers.src.models.dac.feature_extraction_dac33 transformers.src.models.gemma3.modeling_gemma334 transformers.src.models.idefics3.modeling_idefics335 transformers.src.models.qwen2_5_vl.modeling_qwen2_5_vl36 transformers.src.models.qwen2_5_vl.processing_qwen2_5_vl37 transformers.src.models.rf_detr.modeling_rf_detr38 transformers.src.models.rt_detr_v2.modeling_rt_detr_v239 transformers.src.models.qwen3_vl.modeling_qwen3_vl40 transformers.src.models.qwen3_5.modeling_qwen3_5
1 transformers-structured-output.src.engine.constraint
2 transformers-structured-output.src.engine.types
3 transformers.src.feature_extraction_utils
4 transformers.src.image_processors_utils
5 transformers.src.models.modeling_outputs
6 transformers.src.models.modeling_utils
7 transformers.src.processing_utils
8 transformers.src.tokenization_utils
9 transformers.src.utils.tensor
10 transformers-structured-output.src.StructuredOutputProcessor111
11 transformers-structured-output.src.engine16
12 transformers.src.models.clip.modeling_clip1
13 transformers.src.models.dac.modeling_dac21
14 transformers.src.models.detr.modeling_detr21
15 transformers.src.models.donut.image_processing_donut1
16 transformers.src.models.encodec.feature_extraction_encodec1
17 transformers.src.models.gemma3n.feature_extraction_gemma3n1
18 transformers.src.models.gemma3n.modeling_gemma3n1
19 transformers.src.models.hubert.modeling_hubert1
20 transformers.src.models.llava.modeling_llava1
21 transformers.src.models.maskformer.image_processing_maskformer1
22 transformers.src.models.mbart.tokenization_mbart1
23 transformers.src.models.mgp_str.modeling_mgp_str11
24 transformers.src.models.mimi.modeling_mimi21
25 transformers.src.models.owlvit.image_processing_owlvit1
26 transformers.src.models.parakeet.feature_extraction_parakeet1
27 transformers.src.models.qwen2_vl.image_processing_qwen2_vl1
28 transformers.src.models.qwen2_vl.modeling_qwen2_vl1
29 transformers.src.models.qwen2_vl.processing_qwen2_vl1
30 transformers.src.models.rt_detr.modeling_rt_detr11
31 transformers.src.models.ultravox.modeling_ultravox1
32 transformers.src.models.dac.feature_extraction_dac1
33 transformers.src.models.gemma3.modeling_gemma311
34 transformers.src.models.idefics3.modeling_idefics31
35 transformers.src.models.qwen2_5_vl.modeling_qwen2_5_vl2
36 transformers.src.models.qwen2_5_vl.processing_qwen2_5_vl1
37 transformers.src.models.rf_detr.modeling_rf_detr11
38 transformers.src.models.rt_detr_v2.modeling_rt_detr_v211
39 transformers.src.models.qwen3_vl.modeling_qwen3_vl2
40 transformers.src.models.qwen3_5.modeling_qwen3_51
Dependency, pointing down the layeringAbove the diagonal — part of a cycleThe module itself
…src.engine.constraint…tput.src.engine.types…ture_extraction_utils…mage_processors_utils…dels.modeling_outputs…models.modeling_utils….src.processing_utils…rc.tokenization_utils…mers.src.utils.tensor…cturedOutputProcessor…red-output.src.engine…ls.clip.modeling_clip…dels.dac.modeling_dac…ls.detr.modeling_detr…mage_processing_donut…re_extraction_encodec…re_extraction_gemma3n…ma3n.modeling_gemma3n…ubert.modeling_hubert….llava.modeling_llava…processing_maskformer…rt.tokenization_mbart…_str.modeling_mgp_str…ls.mimi.modeling_mimi…age_processing_owlvit…e_extraction_parakeet…e_processing_qwen2_vl…_vl.modeling_qwen2_vl…l.processing_qwen2_vl…detr.modeling_rt_detr…vox.modeling_ultravox…eature_extraction_dac…emma3.modeling_gemma3…cs3.modeling_idefics3…l.modeling_qwen2_5_vl…processing_qwen2_5_vl…detr.modeling_rf_detr…2.modeling_rt_detr_v2…_vl.modeling_qwen3_vl…n3_5.modeling_qwen3_5…src.engine.constraint1…tput.src.engine.types2…ture_extraction_utils3…mage_processors_utils4…dels.modeling_outputs5…models.modeling_utils6….src.processing_utils7…rc.tokenization_utils8…mers.src.utils.tensor9…cturedOutputProcessor10…red-output.src.engine11…ls.clip.modeling_clip12…dels.dac.modeling_dac13…ls.detr.modeling_detr14…mage_processing_donut15…re_extraction_encodec16…re_extraction_gemma3n17…ma3n.modeling_gemma3n18…ubert.modeling_hubert19….llava.modeling_llava20…processing_maskformer21…rt.tokenization_mbart22…_str.modeling_mgp_str23…ls.mimi.modeling_mimi24…age_processing_owlvit25…e_extraction_parakeet26…e_processing_qwen2_vl27…_vl.modeling_qwen2_vl28…l.processing_qwen2_vl29…detr.modeling_rt_detr30…vox.modeling_ultravox31…eature_extraction_dac32…emma3.modeling_gemma333…cs3.modeling_idefics334…l.modeling_qwen2_5_vl35…processing_qwen2_5_vl36…detr.modeling_rf_detr37…2.modeling_rt_detr_v238…_vl.modeling_qwen3_vl39…n3_5.modeling_qwen3_540111161212111111111112111111111111121111121+489 more modules (most-connected shown)

At a glance — Code Health · 66% · Adequate · gated by D2, D3 ·

At a glance — Architecture · 73% · Adequate · gated by D26, R9 ·

At a glance — Maturity · 64% · Adequate · gated by M2 ·

At a glance — Readiness · 53% · Adequate · gated by P3, P4 ·

At a glance — Security · 64% · Adequate · gated by D36 ·

At a glance — Performance · 60% · Adequate ·

Security & Compliance — OWASP Top-10 mapping

Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).

OWASP categoryFindingsSeverity
A06:2021 — Vulnerable & Outdated Components10High / Critical
A03:2021 — Injection8High / Critical

Roadmap

First, integrate static security analysis into the CI pipeline to block security regressions before they land. Second, automate the release and deployment process to ensure all updates are repeatable and easily reversible. Third, maintain a clear changelog to track what ships in each release. Finally, remove unused dependencies and replace synchronous API calls with asynchronous equivalents to improve system performance and reliability.

Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.

Do thisHelpsEffortDimension
Add a SAST step to CI running what this repository's stack ships: CodeQL's javascript-typescript pack, `semgrep --config=p/typescript`, or eslint-plugin-security — so a security regression fails the build instead of landing.+5.1 ptsMediumSecurity & performance tooling
Automate the release in CI — a deploy stage for a service (Helm/Kubernetes manifests or an equivalent rollout), or a tag-triggered publish job for an artifact — so releases are repeatable and reversible.+5.1 ptsMediumDeployment & Rollback
Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.+5.1 ptsMediumRelease Hygiene
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.+5.0 ptsMediumDependency Hygiene
TypeScript/JavaScript: use the promise APIs (fs/promises, a promisified child_process.execFile, the async zlib/crypto functions) and await them instead of the *Sync variants.+2.1 ptsMediumAsync & latency hygiene
Record significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree, with each file named `NNNN-title` in whatever markup those docs already use, is the most discoverable form).+1.1 ptsMediumArchitecture documentation
Resolve the 8 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (8).+0.5 ptsLowDependency Vulnerabilities
Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.+0.9 ptsMediumCyclomatic Complexity

File quality

Per-file score 0–10 — a quality signature. Of 54 files carrying findings, judged against the Production bar: 2% slop · 59% mixed · 39% near-clean.

FileScoreBandWorst signal
REDACTED1.6SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
packages/transformers-structured-output/src/engine/json.ts7.0MixedCyclomatic Complexity: json.checkSchema (cyclomatic 64)
packages/transformers/src/image_processors_utils.js7.0MixedCyclomatic Complexity: preprocess (cyclomatic 26)
packages/transformers/docs/scripts/lib/render-api.mjs7.0MixedCyclomatic Complexity: render-api.renderType (cyclomatic 19)
packages/transformers/src/models/modeling_utils.js7.1MixedCyclomatic Complexity: PreTrainedModel._get_logits_processor (cyclomatic 26)
packages/transformers/src/utils/tensor.js7.1MixedCyclomatic Complexity: Tensor.slice (cyclomatic 19)
packages/transformers/src/models/whisper/tokenization_whisper.js7.2MixedCyclomatic Complexity: WhisperTokenizer._decode_asr (cyclomatic 52)
packages/transformers-structured-output/src/engine/tokenizer.ts7.2MixedCyclomatic Complexity: tokenizer.extractTokenizer (cyclomatic 26)
packages/transformers/docs/scripts/lib/validate.mjs7.2MixedCyclomatic Complexity: validate.collectDocWarnings (cyclomatic 19)
packages/transformers/src/models/lfm2_vl/image_processing_lfm2_vl.js7.2MixedCyclomatic Complexity: _call (cyclomatic 16)
packages/transformers/src/utils/maths.js7.2MixedCognitive Complexity: P2FFT._realTransform4 (cognitive 21)
packages/transformers/src/configs.js7.4MixedCyclomatic Complexity: getCacheNames (cyclomatic 37)
packages/transformers-structured-output/src/engine/constraint.ts7.4MixedCyclomatic Complexity: constraint.createTokenConstraint (cyclomatic 28)
packages/transformers/src/models/whisper/modeling_whisper.js7.4MixedCyclomatic Complexity: WhisperForConditionalGeneration._generate_with_seek (cyclomatic 24)
packages/transformers/docs/scripts/lib/scan.mjs7.4MixedCyclomatic Complexity: scan.splitConditional (cyclomatic 18)
packages/transformers/src/utils/audio.js7.8MixedCyclomatic Complexity: spectrogram (cyclomatic 48)
packages/transformers/src/utils/hub.js7.8MixedCyclomatic Complexity: hub.loadResourceFile (cyclomatic 43)
packages/transformers/src/utils/model_registry/get_file_metadata.js7.8MixedCyclomatic Complexity: get_file_metadata._get_file_metadata (cyclomatic 29)

How the grades work

Every finding carries one of four grades. Three say how serious it is. The fourth says this survey could not settle it — and it is a grade, not a gap.

Critical — 17

A definite problem that already costs you something and drags the score down: a missing authorisation check, a dependency with a known exploit, a build that does not reproduce. Failure here tends to cause failures elsewhere.

Serious — 235

Likely wrong, but not failing yet. It degrades the codebase over a longer horizon and can cause failures elsewhere — not urgent this week, not something to carry for two years either.

Minor — 12

Recorded, with no effect on how the codebase functions. Present so the survey is complete, not because it needs doing.

Could not be resolved — 33

Something this survey could not settle from the outside, and which could be critical or serious. Either a control was required and no positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean result. These are excluded from the score rather than awarded a pass, so the number on the cover neither rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each one is named under Limitations.

Methodology & how to trust this report

Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 44 of 48 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 4 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.

Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.

What we checked — 48 dimensions across the health lenses
D1D2D3D5D6D9D10D12D13D14D15D17D19D21D26D28D29D30D34D35D36D43AX10AX3AX4M1M2M3M4P1P10P3P4P6PF3R1R10R11R2R3R4R6R7R8R9X24X25X29

Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.

How to trust any code-health report — three questions
  1. Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 250 of 264 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
  2. Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
  3. Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.

This report answers yes to all three. That's the bar to hold any assessment to.

Tools & methods

The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.

MethodBacksVersionEvaluator
Roslyn static analysisComplexity, cohesion, coupling, dead code, API surface, layering5.3.0✓ deterministic
Native secret scannerHardcoded secrets / credentials1.0.0✓ deterministic
Watchdog duplication detector (in-process)Code duplication1.0.0✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.400✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.400✓ deterministic
git / LibGit2SharpChurn hotspots, knowledge concentration, history2.43.0 · 0.31.0✓ deterministic
gitleaks · semgrep · trivySecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3✓ deterministic
LLM (sampled · advisory)Documentation quality, ADR conformance, naming — sampled over a bounded sample; advisory, never a deterministic measurementLocal LLM◐ LLM · sampled · advisory

Every finding is locatable in findings.md. Run 01a0f95c-807b-7e51-a4c8-fd01f235f500.

The exact command behind every deep-scan dimension — tool, version, invocation and retained raw output — is in Appendix B — Reproduction & audit trail.

Run transparency — what happened this run

What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.

  • D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability not scored — the JavaScript/TypeScript suite (jest via `pnpm install --frozen-lockfile --ignore-scripts` in packages/transformers/ (0 tests); jest via `pnpm install --frozen-lockfile --ignore-scripts` in packages/transformers-structured-output/ (0 tests)) ran but surfaced no test cases to the runner, so flakiness couldn't be exercised.
  • D16 Bus Factor — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. Single-maintainer repository — bus factor is not applicable (77 contributor(s) across 2016 commit(s) sampled, automation and bot accounts excluded). One of them holds 91% of the history; the other 76 hold 0.1% each on average, below the 5% at which there is somebody to hand the work to. That is a single maintainer with drive-by contributors, not a team whose knowledge has concentrated — so the bus factor is not applicable and there is nothing here for the owner to act on.
  • D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is a COLLECTOR gap, not an environment fault: it declares a published package (packages/transformers-structured-output/package.json), but no published-package marker D22 reads admitted any project here, so this ecosystem's public API has no collector, and the remedy is to write one — no change to the scan image can close it.
  • D44 Platform End-of-Life — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This dimension reads a project's own statement about the platform it runs on: a TargetFramework in a .NET project file, a .nvmrc or .python-version, a capped requires-python, a Rust toolchain file or Cargo.toml rust-version, a .go-version, .java-version, .ruby-version, .tool-versions or .sdkmanrc, a go.mod go directive, a Maven or Gradle Java level or toolchain, a Gemfile's ruby directive, a mix.exs elixir requirement, a rebar.config minimum_otp_vsn, a pubspec.yaml SDK constraint, a build.sbt scalaVersion, or a framework major pinned by a dependency constraint. This repository carries none of them, so nothing about its platform was established. That is a gap in this analyzer's coverage, NOT a finding that the platform is supported — a language whose runtime is declared elsewhere (Package.swift, a Dockerfile) is simply not read here yet.
  • AX6 Interface segregation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • C2 Access Controls — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
  • C3 Audit Trail — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
  • C4 Data Retention — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These retention controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks retention controls.
  • C5 Data-Subject Rights — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These data-subject rights controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks data-subject rights controls.
  • ED5 Idempotency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check finds retry-prone mutations by walking the repository's declared types, and NONE was loaded on this run, so it had nothing to look at. That is a limit of the analyzer's reach — it reads .NET projects — not a finding that this repository has no command handlers or message consumers.
  • GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
  • R10 Code Duplication — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 30 further occurrence(s) are not listed individually; the score already reflects all 70.
  • S1 Web-Security Posture — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
  • X1 Async correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X12 Unreachable branch — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X13 Undrained process stream — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X14 Bypassable address classification — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X15 Unvalidated length from an untrusted reader — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X16 Unfloored truncation loop — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X17 Uncapped recursion over a caller-supplied document — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X18 Disposal-pattern correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X19 Unrestored process-global state — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X2 Cancellation propagation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X20 Mistyped argument guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X21 Side-effecting pattern guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X22 Contradicted release guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X23 Unguarded diagnostic materialisation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X27 Collection changed while being enumerated — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and Java and Rust source only, and no C# was loaded and no Java or Rust was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X28 Index access outside its own emptiness guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and Scala source only, and no C# was loaded and no Scala was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X3 Exception handling — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X30 Support guard that admits what it rejects — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and Scala source only, and no C# was loaded and no Scala was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X4 Structured logging — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X5 Nullable reference types — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.

Repo exclusion declarations: 15 pattern(s) declared (.gitattributes linguist-generated/vendored, .editorconfig generated_code) excluded 0 source file(s) from code-quality scoring. Declarations are the repo's own visible statement that a tree is machine-written or vendored — auditable in any diff, honored by GitHub the same way.

Limitations & what we did not check

Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.

Per-dimension blind spots

For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
  • D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

The LLM boundary

LLM-set scores this run (4): D19, D21, D26, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score; each names its own sample and method on its card. They are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.

Dimensions

D1 · Cyclomatic Complexity5.9 / 10Adequate✓ Tool-verified

What it measures: How tangled the control flow is — methods with many branches are hard to test and change.

Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.

Maturity: Documented → Verified → Prevented · effective 5.9 / 10 · rule-coverage 100% · ceiling Prevented

71 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was json.checkSchema at 64. A further 4 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being configs.getNormalizedConfig at 120 — they are counted neither in the figure above nor in this dimension's score. 2 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: packages/transformers/docs/scripts/lib/parse.mjs (parse.parseTag at 21), packages/transformers/src/backends/onnx.js (onnx.ensureWasmLoaded at 16). They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.

json.checkSchema (cyclomatic 64)packages/transformers-structured-output/src/engine/json.ts:1568
WhisperTokenizer._decode_asr (cyclomatic 52)packages/transformers/src/models/whisper/tokenization_whisper.js:29
spectrogram (cyclomatic 48)packages/transformers/src/utils/audio.js:484
json.validateObjectNode (cyclomatic 43)packages/transformers-structured-output/src/engine/json.ts:1083
hub.loadResourceFile (cyclomatic 43)packages/transformers/src/utils/hub.js:265

+ 46 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 1 json.checkSchema (cyclomatic 64) finding(s) in Cyclomatic Complexity — start with json.ts. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 WhisperTokenizer._decode_asr (cyclomatic 52) finding(s) in Cyclomatic Complexity — start with tokenization_whisper.js. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 spectrogram (cyclomatic 48) finding(s) in Cyclomatic Complexity — start with audio.js. — One of this dimension's main actionable groups (1 warning-level).
  4. Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.

D2 · Cognitive Complexity2.0 / 10Critical✓ Tool-verified

What it measures: How hard the code is for a person to follow, beyond raw branching.

Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.

Maturity: Documented → Verified → Prevented · effective 2.0 / 10 · rule-coverage 100% · ceiling Prevented

134 method(s) exceeded the cognitive complexity threshold of 15; the worst was WhisperTokenizer._decode_asr at 151.

WhisperTokenizer._decode_asr (cognitive 151)packages/transformers/src/models/whisper/tokenization_whisper.js:29
spectrogram (cognitive 75)packages/transformers/src/utils/audio.js:484
loadResourceFile (cognitive 75)packages/transformers/src/utils/hub.js:265
_call (cognitive 73)REDACTED:376
json.checkSchema (cognitive 72)packages/transformers-structured-output/src/engine/json.ts:1568

+ 81 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 1 WhisperTokenizer._decode_asr (cognitive 151) finding(s) in Cognitive Complexity — start with tokenization_whisper.js. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 spectrogram (cognitive 75) finding(s) in Cognitive Complexity — start with audio.js. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 loadResourceFile (cognitive 75) finding(s) in Cognitive Complexity — start with hub.js. — One of this dimension's main actionable groups (1 warning-level).
  4. Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.

D3 · God Classes3.7 / 10Weak✓ Tool-verified

What it measures: Over-large classes that try to do too much ("god classes").

Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.

Maturity: Documented → Verified → Prevented · effective 3.7 / 10 · rule-coverage 100% · ceiling Prevented

6 god class(es) detected.

FileTooLong: engine/json.ts · ×4packages/transformers-structured-output/src/engine/json.ts
FunctionTooLong: configs.getNormalizedConfigpackages/transformers/src/configs.js:59
TooManyMethods: Tensorpackages/transformers/src/utils/tensor.js:36

What to do

  1. Resolve the 4 FileTooLong finding(s) in God Classes — start with json.ts, modeling_utils.js, tensor.js. — One of this dimension's main actionable groups (4 warning-level).
  2. Resolve the 1 FunctionTooLong finding(s) in God Classes — start with configs.js. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 TooManyMethods finding(s) in God Classes — start with tensor.js. — One of this dimension's main actionable groups (1 warning-level).
  4. Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.

D5 · Coupling10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.

Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.

Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

2 production modules (npm), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 0 module(s) off the main sequence, with abstractness counted on 1 of the 2 (the rest declare no modelled class or interface, export only macros, or have no source directory of their own).

✓ On the Gold path — maintain.

Detailed fixes: d5_recommendation.md.

D6 · Cohesion (LCOM4)10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether a class's methods are focused on a single responsibility.

Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.

Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Verified

0 of 38 classes have LCOM4 above 3.

✓ On the Gold path — maintain.

Detailed fixes: d6_recommendation.md.

D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.

Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

363 test methods: 363 unit, 0 integration, 0 BDD, 0 e2e. The JavaScript/TypeScript suite contributes 363 `it`/`test` case(s) across 24 test file(s) declaring at least one; its tier split is read from package names and paths only.

✓ On the Gold path — maintain.

Detailed fixes: d9_recommendation.md.

D10 · Test Quality9.9 / 10Stronggated by 2 serious findings✓ Tool-verified

What it measures: Whether the tests truly assert behaviour rather than just running the code.

Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.

Maturity: Documented → Verified → Prevented · effective 9.9 / 10 · rule-coverage 100% · ceiling Prevented

0 skipped, 2 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 363 tests.

No assertions: compiles ${file} without errors · ×2packages/transformers/tests/types.test.js:65

What to do

  1. Resolve the 2 No assertions finding(s) in Test Quality — start with types.test.js, progress_callbacks.test.js. — One of this dimension's main actionable groups (2 warning-level).
  2. Enforce Test Quality in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.md.

D12 · Dependency Hygiene9.9 / 10Exemplary✓ Tool-verified

What it measures: Whether dependencies are current, secure, and not bloated.

Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (saturating for vulnerabilities, capped-linear for deprecation/outdated) per KLoC. Exhaustive, deterministic.

Maturity: Documented → Verified → Prevented · effective 9.9 / 10 · rule-coverage 100% · ceiling Verified

1 outdated direct production npm dependency(ies) of 5 graded, 0 pinning defect(s), across 3 package.json (3 of them the product) and 1 committed lockfile(s). Development dependencies are deliberately not graded: this dimension grades what SHIPS. Whether any of these packages is DEPRECATED or UNMAINTAINED is not graded — registry.npmjs.org's latest-version answer carries neither, and release age does not stand in for a maintenance status. Whether any is UNUSED is not graded either: that is a source question, and the frontend dependency lens (R8) answers it in this same run. Known CVEs in this dependency graph are D30's question, read from the manifest there.

Outdated (npm): sharp

✓ On the Gold path — maintain.

Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.

D13 · Secret Scanning10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.

Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

D14 · License Compliance10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether the licenses of third-party packages are compatible with your policy.

Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Verified

0 of 5 shipped npm package(s) use a banned license. Licences were resolved from registry.npmjs.org over the 5 production dependency(ies) this repository's committed lockfile resolves, across 3 product package.json manifest(s). Its 15 `devDependencies` declaration(s) are excluded: a consumer installs none of them. ★ DEPTH: this is the DIRECT production set the lockfile resolves, NOT the transitive closure — only one of the four lock dialects this pass reads states a full graph, so a banned licence pulled in only by a dependency's OWN dependencies is outside this verdict, exactly as the JVM arm's declaration-site verdict is. ★ Each licence is the one the registry publishes for the package's CURRENT release rather than for the pinned version, which is the same caveat the Hex and RubyGems arms carry. This repository publishes itself under Apache-2.0, which is its own choice and is not judged here.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots9.9 / 10Stronggated by 1 serious finding✓ Tool-verified

What it measures: Files that change often and are also complex — the riskiest hotspots.

Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.

Maturity: Documented → Verified → Prevented · effective 9.9 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: packages/transformers/src/utils/hub.js (3×43=129)

Hotspot: packages/transformers/src/utils/hub.jspackages/transformers/src/utils/hub.js:265

What to do

  1. Resolve the 1 Hotspot finding(s) in Churn × Complexity Hotspots — start with hub.js. — One of this dimension's main actionable groups (1 warning-level).

Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.

D17 · Explicit Debt10.0 / 10Exemplary○ Nothing flagged

What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.

Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

0 deducted task-comment markers across 2755 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.

✓ On the Gold path — maintain.

Detailed fixes: d17_recommendation.md.

D19 · Documentation QualityStrong◐ Sampled · advisory

What it measures: Whether the project's documentation is clear, complete, and useful.

Method: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.

Maturity: Documented → Verified → Prevented · effective Strong / 10 · rule-coverage 100% · ceiling Documented

The repository's root README and a focused transformers-structured-output README are the only visible documents; both describe their respective packages clearly. The main documentation is an extensive architecture/Docs directory containing 16 markdown files (including one titled 'Guides') that cover installation, usage examples, supported tasks/models, custom models, quantized dtypes, server-side audio processing in Node.js, WebGPU acceleration, and the Vercel AI SDK integration — all of which are well-organized with a navigation table and an overview section. The root README is the single document that needs to be judged for its scope (overview/installation/usage/contributing/license), but it is not shown here. The project's READMEs are excellent tutorials for building Next.js applications using Transformers.js and the Vercel AI SDK v6. Each document is a self-contained tutorial with an overview (what it builds and what links), prerequisites, step-by-step code blocks showing installation, configuration, model loading, inference, and UI rendering, plus useful links to source code and demos. The architecture/Docs markdown files are also present but not shown in the summary.

What to do

  1. Improve Documentation Quality — currently 8.7/10. — The repository's root README and a focused transformers-structured-output README are the only visible documents; both describe their respective packages clearly. The main documentation is an extensive architecture/Docs directory containing 16 markdown files (including one titled 'Guides') that cover installation, usage examples, supported tasks/models, custom models, quantized dtypes, server-side audio processing in Node.js, WebGPU acceleration, and the Vercel AI SDK integration — all of which are well-organized with a navigation table and an overview section. The root README is the single document that needs to be judged for its scope (overview/installation/usage/contributing/license), but it is not shown here. The project's READMEs are excellent tutorials for building Next.js applications using Transformers.js and the Vercel AI SDK v6. Each document is a self-contained tutorial with an overview (what it builds and what links), prerequisites, step-by-step code blocks showing installation, configuration, model loading, inference, and UI rendering, plus useful links to source code and demos. The architecture/Docs markdown files are also present but not shown in the summary.

Detailed fixes: d19_recommendation.md.

D21 · Naming ConsistencyExemplary◐ Sampled · advisory

What it measures: Whether names — types, methods, variables — are clear and consistent.

Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.

Maturity: Documented → Verified → Prevented · effective Exemplary / 10 · rule-coverage 100% · ceiling Verified

0 naming inconsistencies across 0 sampled symbols.

✓ On the Gold path — maintain.

Detailed fixes: d21_recommendation.md.

D26 · Project Cohesion3.3 / 10Weak✓ Tool-verified

What it measures: Whether each project is a focused, coherent unit rather than an oversized grab-bag.

Method: Project size overshoot penalties (LoC / public-type count / namespace count, 2-of-3 flag) weighted by log magnitude. Exhaustive across projects, deterministic, LLM-independent.

Maturity: Documented → Verified → Prevented · effective 3.3 / 10 · rule-coverage 100% · ceiling Documented

1 of 3 build units (npm) flagged as possibly oversized/incoherent.

Split packages/transformers

What to do

  1. Resolve the 1 Split packages/transformers finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.

D28 · Secrets (history)10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.

Method: Secret scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

gitleaks scanned the full history AND the current working tree and found no secrets.

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

D29 · Static Analysis (SAST)4.6 / 10Weak✓ Tool-verified

What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.

Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.

Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).

Maturity: Documented → Verified → Prevented · effective 4.6 / 10 · rule-coverage 100% · ceiling Documented

8 finding(s): 0 critical, 3 high, 5 medium, 0 low.

REDACTED
REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  2. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  3. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).

Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.

D30 · Dependency Vulnerabilities4.8 / 10Weak✓ Tool-verified

What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.

Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05.

Maturity: Documented → Verified → Prevented · effective 4.8 / 10 · rule-coverage 100% · ceiling Documented

10 finding(s): 0 critical, 8 high, 1 medium, 1 low.

REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 8 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (8). — One of this dimension's main actionable groups (8 issue-level).
  2. Resolve the 1 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 Low CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.

D34 · Knowledge Freshness10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.

Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

Every significant source file has living knowledge — recently and meaningfully worked. Counted over 150 of the 457 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

✓ On the Gold path — maintain.

Detailed fixes: d34_recommendation.md.

D35 · Change Coupling10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.

Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.

Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No strong hidden change-coupling between production files.

✓ On the Gold path — maintain.

Detailed fixes: d35_recommendation.md.

D36 · Supply-chain Provenance & Signing2.5 / 10Weak✓ Tool-verified

What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.

Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.

Maturity: Documented → Verified → Prevented · effective 2.5 / 10 · rule-coverage 100% · ceiling Documented

1/4 supply-chain integrity signals present (provenance, signing, SBOM, pinned actions).

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

+ 1 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).

Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.

D43 · Malicious Dependencies10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Scored apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.

Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. SCORED, not informational.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No dependency in any ecosystem this repository declares is published as malicious.

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

Frontend & cross-cutting dimensions

R = React/JS · M = Maturity · P = Readiness.

AX10 · Code composition10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.

Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.

Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.

What to do

  • The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).

Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.

AX4 · Dependency direction10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.

Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.

M1 · Documentation (README)7.7 / 10Strong✓ Tool-verified

Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.

Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.

What to do

  • Add a 'Testing' section to the root README — how to run the test suite.
  • Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
  • Add a README to the 1 of 2 project(s) that lack one — worth up to 1 pts.
M2 · Architecture documentation2.0 / 10Critical✓ Tool-verified

Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.

Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.

  • No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.

What to do

  • Record significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree, with each file named `NNNN-title` in whatever markup those docs already use, is the most discoverable form).
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the repo is organised deliberately — src/test separation and consistent project naming.

Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.

M4 · Documentation accuracy8.0 / 10Strong◐ Sampled · advisory

Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).

Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.

  • README advertises Salesforce integration, but no Salesforce code/dependency exists — searched for: `salesforce`, `sfdx`, `apex`. Each was matched case- and separator-insensitively against file and directory NAMES anywhere in the tree, and against the CONTENTS of manifest files (package.json, *.csproj, *.props, *.slnx, *.yml, Dockerfile); the README's own prose never counts, so a claim is never refuted by merely being made. Nothing outside that search was read — a footprint living only in a submodule, in a file type not listed here, or under a name none of those terms matches is not seen, and this row is then wrong.

What to do

  • Reconcile the README with reality: README advertises Salesforce integration, but no Salesforce code/dependency exists.
P1 · CI/CD gates10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — Whether an automated pipeline builds and tests every change.

Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.

P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.

Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.

P3 · Security & performance tooling3.0 / 10Weak✓ Tool-verified

Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).

Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.

  • No static application security testing detected. For this repository's stack, add CodeQL's javascript-typescript pack, `semgrep --config=p/typescript`, or eslint-plugin-security as a CI step. What was searched, so you can tell an absence from a miss: the 4989 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.

What to do

  • Add a SAST step to CI running what this repository's stack ships: CodeQL's javascript-typescript pack, `semgrep --config=p/typescript`, or eslint-plugin-security — so a security regression fails the build instead of landing.
  • Dependabot is configured but does not watch `npm` — add that `package-ecosystem` entry to .github/dependabot.yml so those dependencies get the same automatic update and advisory pressure as the ones it already covers.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback2.0 / 10Critical✓ Tool-verified

Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.

Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.

  • No release automation was found in CI — neither a deploy stage (Helm/Kubernetes/compose manifests, an orchestrated rollout) nor a publish job that ships the built artifact. Releases appear to be run by hand, which is slower, less repeatable and harder to reverse.

What to do

  • Automate the release in CI — a deploy stage for a service (Helm/Kubernetes manifests or an equivalent rollout), or a tag-triggered publish job for an artifact — so releases are repeatable and reversible.
P6 · Release Hygiene5.0 / 10Adequate✓ Tool-verified

Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.

Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.

  • No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)

What to do

  • Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
PF3 · Async & latency hygiene6.0 / 10Adequate✓ Tool-verified

Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.

Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from the language model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin) or inside a Java method returning a Reactor Mono/Flux — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.

  • `collect_tests` is async and calls readdirSync, existsSync, statSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/transformers/tests/test_utils.js:16
  • `collect_and_execute_pipeline_tests` is async and calls readdirSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/transformers/tests/test_utils.js:55

What to do

  • TypeScript/JavaScript: use the promise APIs (fs/promises, a promisified child_process.execFile, the async zlib/crypto functions) and await them instead of the *Sync variants.
R1 · Type Safety7.0 / 10Strong✓ Tool-verified

React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.

Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.

What to do

  • Migrate the remaining .js/.jsx files to TypeScript.
R10 · Code Duplication9.1 / 10Exemplary✓ Tool-verified

React / JS · Code Health — Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm over JS/TS tokens, D-386): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.

Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Deterministic.

  • 63 duplicated blocks under packages/transformers/src/models/ have copies in at least two of the sibling directories albert, audio_spectrogram_transformer, bart, bert, camembert, chatterbox (+60 more sibling(s) not listed) — 26 of them are reported below, and 37 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 63 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 63 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 63 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — packages/transformers/src/models/dac/modeling_dac.js:6
  • packages/transformers/src/models/dac/modeling_dac.js:6 · packages/transformers/src/models/mimi/modeling_mimi.js:6 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — packages/transformers/src/models/dac/modeling_dac.js:6
  • packages/transformers/src/models/auto/modeling_auto.js:75 · packages/transformers/src/models/modeling_utils.js:256 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/transformers/src/models/auto/modeling_auto.js:75
  • packages/transformers/src/utils/model_registry/clear_cache.js:48 · packages/transformers/src/utils/model_registry/is_cached.js:32 — the two spans are one implementation copied and then locally edited — 170 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/transformers/src/utils/model_registry/clear_cache.js:48
  • packages/transformers/src/utils/maths.js:460 · packages/transformers/src/utils/maths.js:634 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — packages/transformers/src/utils/maths.js:460
  • packages/transformers/src/models/idefics3/image_processing_idefics3.js:178 · packages/transformers/src/models/phi3_v/image_processing_phi3_v.js:109 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/transformers/src/models/idefics3/image_processing_idefics3.js:178
  • packages/transformers/src/pipelines/audio-classification.js:71 · packages/transformers/src/pipelines/image-classification.js:84 — the two spans are one implementation copied and then locally edited — 161 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/transformers/src/pipelines/audio-classification.js:71
  • packages/transformers/src/generation/logits_process.js:516 · packages/transformers/src/generation/logits_process.js:555 — the two spans are one implementation copied and then locally edited — 108 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/transformers/src/generation/logits_process.js:516
  • packages/transformers/src/models/audio_spectrogram_transformer/feature_extraction_audio_spectrogram_transformer.js:5 · packages/transformers/src/models/seamless_m4t/feature_extraction_seamless_m4t.js:5 · packages/transformers/src/models/wespeaker/feature_extraction_wespeaker.js:5 — the 3 copies are spread across 3 files, and each CITED SPAN is a SPECIALISATION DECLARATION — a type whose `extends` clause names a base and whose body hands that base its own values through `super(…)`. The shared module this dimension usually asks you to extract already exists: it is that base, every one of these sites already reaches it, and the `super(…)` call this row matched on is where each site passes its differences in. So do not read this as an extract-a-helper row — there is no missing helper, and what is left at each site is the declaration of one distinct specialisation, which cannot be deleted without deleting the thing it declares. Read what actually differs between the spans, because two different answers follow. Where the sites differ only in the values they hand the base — a type argument, a service, an alias, a cache — the repetition is a TEMPLATE, and the only moves that collapse it are to generate these declarations from the set they enumerate or to replace the repeated construction with one factory each site calls with its own values; where that set is the point, each site pinning one distinct thing, the repetition IS the enumeration and there is nothing to remove. Where instead a span carries logic OUTSIDE the delegation that is the same at every site, that logic is the part to move, and its home is the base type rather than a new module. Reported because the copies still drift apart the first time only one of them is edited. — packages/transformers/src/models/audio_spectrogram_transformer/feature_extraction_audio_spectrogram_transformer.js:5
  • packages/transformers/src/utils/image.js:248 · packages/transformers/src/utils/image.js:280 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/transformers/src/utils/image.js:248
  • packages/transformers/src/models/seamless_m4t/feature_extraction_seamless_m4t.js:33 · packages/transformers/src/models/wespeaker/feature_extraction_wespeaker.js:33 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/transformers/src/models/seamless_m4t/feature_extraction_seamless_m4t.js:33
  • packages/transformers/src/models/clap/modeling_clap.js:5 · packages/transformers/src/models/clip/modeling_clip.js:48 · packages/transformers/src/models/clip/modeling_clip.js:99 · packages/transformers/src/models/dac/modeling_dac.js:55 · +4 more site(s) not listed — the 8 copies are spread across 7 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/transformers/src/models/clap/modeling_clap.js:5
  • packages/transformers/src/models/gemma3/processing_gemma3.js:15 · packages/transformers/src/models/gemma3n/processing_gemma3n.js:32 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/transformers/src/models/gemma3/processing_gemma3.js:15
  • packages/transformers/src/models/gemma3n/modeling_gemma3n.js:19 · packages/transformers/src/models/phi3_v/modeling_phi3_v.js:12 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/transformers/src/models/gemma3n/modeling_gemma3n.js:19
  • packages/transformers/src/models/granite_speech/processing_granite_speech.js:45 · packages/transformers/src/models/ultravox/processing_ultravox.js:37 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — packages/transformers/src/models/granite_speech/processing_granite_speech.js:45
  • packages/transformers/src/image_processors_utils.js:1051 · packages/transformers/src/models/vitmatte/image_processing_vitmatte.js:13 — the two spans are one implementation copied and then locally edited — 99 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/transformers/src/image_processors_utils.js:1051
  • packages/transformers/src/models/voxtral_realtime/feature_extraction_voxtral_realtime.js:4 · packages/transformers/src/models/whisper/feature_extraction_whisper.js:6 — the 2 copies are spread across 2 files, and each CITED SPAN is a SPECIALISATION DECLARATION — a type whose `extends` clause names a base and whose body hands that base its own values through `super(…)`. The shared module this dimension usually asks you to extract already exists: it is that base, every one of these sites already reaches it, and the `super(…)` call this row matched on is where each site passes its differences in. So do not read this as an extract-a-helper row — there is no missing helper, and what is left at each site is the declaration of one distinct specialisation, which cannot be deleted without deleting the thing it declares. Read what actually differs between the spans, because two different answers follow. Where the sites differ only in the values they hand the base — a type argument, a service, an alias, a cache — the repetition is a TEMPLATE, and the only moves that collapse it are to generate these declarations from the set they enumerate or to replace the repeated construction with one factory each site calls with its own values; where that set is the point, each site pinning one distinct thing, the repetition IS the enumeration and there is nothing to remove. Where instead a span carries logic OUTSIDE the delegation that is the same at every site, that logic is the part to move, and its home is the base type rather than a new module. Reported because the copies still drift apart the first time only one of them is edited. — packages/transformers/src/models/voxtral_realtime/feature_extraction_voxtral_realtime.js:4
  • packages/transformers/src/utils/tensor.js:846 · packages/transformers/src/utils/tensor.js:868 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — packages/transformers/src/utils/tensor.js:846
  • packages/transformers/src/generation/logits_process.js:201 · packages/transformers/src/generation/logits_process.js:441 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/transformers/src/generation/logits_process.js:201
  • packages/transformers/src/models/dac/modeling_dac.js:6 · packages/transformers/src/models/mimi/modeling_mimi.js:6 · packages/transformers/src/models/modeling_outputs.js:49 — the 3 copies are spread across 3 files, and each CITED SPAN is a SPECIALISATION DECLARATION — a type whose `extends` clause names a base and whose body hands that base its own values through `super(…)`. The shared module this dimension usually asks you to extract already exists: it is that base, every one of these sites already reaches it, and the `super(…)` call this row matched on is where each site passes its differences in. So do not read this as an extract-a-helper row — there is no missing helper, and what is left at each site is the declaration of one distinct specialisation, which cannot be deleted without deleting the thing it declares. Read what actually differs between the spans, because two different answers follow. Where the sites differ only in the values they hand the base — a type argument, a service, an alias, a cache — the repetition is a TEMPLATE, and the only moves that collapse it are to generate these declarations from the set they enumerate or to replace the repeated construction with one factory each site calls with its own values; where that set is the point, each site pinning one distinct thing, the repetition IS the enumeration and there is nothing to remove. Where instead a span carries logic OUTSIDE the delegation that is the same at every site, that logic is the part to move, and its home is the base type rather than a new module. Reported because the copies still drift apart the first time only one of them is edited. — packages/transformers/src/models/dac/modeling_dac.js:6
  • packages/transformers/src/models/encodec/feature_extraction_encodec.js:10 · packages/transformers/src/models/wav2vec2/feature_extraction_wav2vec2.js:22 — the two spans are one implementation copied and then locally edited — 56 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/transformers/src/models/encodec/feature_extraction_encodec.js:10
  • packages/transformers/src/utils/maths.js:399 · packages/transformers/src/utils/maths.js:572 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/transformers/src/utils/maths.js:399
  • packages/transformers/src/configs.js:520 · REDACTED:310 — the two spans are one implementation copied and then locally edited — 52 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/transformers/src/configs.js:520
  • packages/transformers/src/generation/logits_process.js:166 · packages/transformers/src/generation/logits_process.js:486 · packages/transformers/src/generation/logits_process.js:561 — all 3 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/transformers/src/generation/logits_process.js:166
  • packages/transformers/src/ops/registry.js:49 · packages/transformers/src/ops/registry.js:66 · packages/transformers/src/ops/registry.js:84 · packages/transformers/src/ops/registry.js:99 · +2 more site(s) not listed — all 6 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/transformers/src/ops/registry.js:49
  • packages/transformers/src/generation/logits_sampler.js:120 · packages/transformers/src/generation/logits_sampler.js:151 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/transformers/src/generation/logits_sampler.js:120
  • packages/transformers/src/models/chatterbox/feature_extraction_chatterbox.js:10 · packages/transformers/src/models/moonshine/feature_extraction_moonshine.js:10 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — packages/transformers/src/models/chatterbox/feature_extraction_chatterbox.js:10
  • packages/transformers/src/models/detr/modeling_detr.js:1 · packages/transformers/src/models/hubert/modeling_hubert.js:2 · packages/transformers/src/models/rt_detr/modeling_rt_detr.js:1 · packages/transformers/src/models/yolos/modeling_yolos.js:1 — the 4 copies are spread across 4 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — packages/transformers/src/models/detr/modeling_detr.js:1
  • packages/transformers/src/models/modeling_utils.js:335 · packages/transformers/src/pipelines.js:147 — the two spans are one implementation copied and then locally edited — 75 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/transformers/src/models/modeling_utils.js:335
  • packages/transformers/src/models/unispeech/modeling_unispeech.js:2 · packages/transformers/src/models/unispeech_sat/modeling_unispeech_sat.js:2 · packages/transformers/src/models/wav2vec2/modeling_wav2vec2.js:2 · packages/transformers/src/models/wav2vec2_bert/modeling_wav2vec2_bert.js:2 — the 4 copies are spread across 4 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — packages/transformers/src/models/unispeech/modeling_unispeech.js:2
  • packages/transformers/src/models/encodec/feature_extraction_encodec.js:4 · packages/transformers/src/models/pyannote/feature_extraction_pyannote.js:5 — the two spans are one implementation copied and then locally edited — 56 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/transformers/src/models/encodec/feature_extraction_encodec.js:4
  • packages/transformers/src/models/m2m_100/tokenization_m2m_100.js:13 · packages/transformers/src/models/mbart/tokenization_mbart.js:3 — the two spans are one implementation copied and then locally edited — 88 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/transformers/src/models/m2m_100/tokenization_m2m_100.js:13
  • packages/transformers/src/models/m2m_100/tokenization_m2m_100.js:13 · packages/transformers/src/models/nllb/tokenization_nllb.js:16 — the two spans are one implementation copied and then locally edited — 79 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/transformers/src/models/m2m_100/tokenization_m2m_100.js:13
  • packages/transformers/src/models/mbart/tokenization_mbart.js:3 · packages/transformers/src/models/nllb/tokenization_nllb.js:16 — the two spans are one implementation copied and then locally edited — 80 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/transformers/src/models/mbart/tokenization_mbart.js:3
  • packages/transformers/src/models/sam/modeling_sam.js:4 · packages/transformers/src/models/vits/modeling_vits.js:1 · packages/transformers/src/models/wavlm/modeling_wavlm.js:2 — the 3 copies are spread across 3 files, and each CITED SPAN is a SPECIALISATION DECLARATION — a type whose `extends` clause names a base and whose body hands that base its own values through `super(…)`. The shared module this dimension usually asks you to extract already exists: it is that base, every one of these sites already reaches it, and the `super(…)` call this row matched on is where each site passes its differences in. So do not read this as an extract-a-helper row — there is no missing helper, and what is left at each site is the declaration of one distinct specialisation, which cannot be deleted without deleting the thing it declares. Read what actually differs between the spans, because two different answers follow. Where the sites differ only in the values they hand the base — a type argument, a service, an alias, a cache — the repetition is a TEMPLATE, and the only moves that collapse it are to generate these declarations from the set they enumerate or to replace the repeated construction with one factory each site calls with its own values; where that set is the point, each site pinning one distinct thing, the repetition IS the enumeration and there is nothing to remove. Where instead a span carries logic OUTSIDE the delegation that is the same at every site, that logic is the part to move, and its home is the base type rather than a new module. Reported because the copies still drift apart the first time only one of them is edited. — packages/transformers/src/models/sam/modeling_sam.js:4
  • packages/transformers/src/models/albert/modeling_albert.js:2 · packages/transformers/src/models/bert/modeling_bert.js:7 · packages/transformers/src/models/camembert/modeling_camembert.js:7 · packages/transformers/src/models/convbert/modeling_convbert.js:7 · +23 more site(s) not listed — the 27 copies are spread across 27 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/transformers/src/models/albert/modeling_albert.js:2
  • packages/transformers/src/models/ultravox/processing_ultravox.js:8 · packages/transformers/src/models/voxtral/processing_voxtral.js:27 — the two spans are one implementation copied and then locally edited — 60 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/transformers/src/models/ultravox/processing_ultravox.js:8
  • packages/transformers/src/models/whisper/tokenization_whisper.js:193 · packages/transformers/src/models/whisper/tokenization_whisper.js:291 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/transformers/src/models/whisper/tokenization_whisper.js:193
  • packages/transformers/src/utils/tensor.js:223 · packages/transformers/src/utils/tensor.js:247 · packages/transformers/src/utils/tensor.js:269 · packages/transformers/src/utils/tensor.js:291 · +1 more site(s) not listed — all 5 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/transformers/src/utils/tensor.js:223
  • packages/transformers-structured-output/scripts/dev.mjs:9 · scripts/rebuildPlugin.mjs:14 — the two spans are one implementation copied and then locally edited — 60 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/transformers-structured-output/scripts/dev.mjs:9

What to do

  • Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
R11 · Import Boundaries9.3 / 10Exemplary✓ Tool-verified

React / JS · Architecture — Conformance to the detected frontend architecture layout (feature-sliced / layered src) plus cross-package deep-import rules (D-386).

Method: Conformance to the detected frontend layout (feature-sliced / layered src) plus cross-package deep-import rules, over the module graph. Deterministic.

  • packages/transformers/scripts/build.mjs:2 reaches into another package with a relative path (../../../scripts/prepareOutDir.mjs) — import the package by name instead. — packages/transformers/scripts/build.mjs:2
  • packages/transformers/scripts/build.mjs:3 reaches into another package with a relative path (../../../scripts/logger.mjs) — import the package by name instead. — packages/transformers/scripts/build.mjs:3
  • packages/transformers/scripts/dev.mjs:6 reaches into another package with a relative path (../../../scripts/prepareOutDir.mjs) — import the package by name instead. — packages/transformers/scripts/dev.mjs:6
  • packages/transformers/scripts/dev.mjs:7 reaches into another package with a relative path (../../../scripts/logger.mjs) — import the package by name instead. — packages/transformers/scripts/dev.mjs:7

What to do

  • Fix the listed violations: import through public entries (package exports / slice index), never reach into another layer or package's internals.
R2 · Cyclomatic Complexity6.0 / 10Adequate✓ Tool-verified

React / JS · Code Health — Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) — real branching, not a regex heuristic.

Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.

  • getNormalizedConfig has cyclomatic complexity 120 and cognitive complexity 7; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/transformers/src/configs.js:59
  • checkSchema has cyclomatic complexity 64 and cognitive complexity 71; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/transformers-structured-output/src/engine/json.ts:1568
  • _decode_asr has cyclomatic complexity 52 and cognitive complexity 151; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/transformers/src/models/whisper/tokenization_whisper.js:29
  • spectrogram has cyclomatic complexity 48 and cognitive complexity 75; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/transformers/src/utils/audio.js:484
  • loadResourceFile has cyclomatic complexity 43 and cognitive complexity 75; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/transformers/src/utils/hub.js:265
  • validateObjectNode has cyclomatic complexity 40 and cognitive complexity 59; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/transformers-structured-output/src/engine/json.ts:1083
  • getCacheNames has cyclomatic complexity 37 and cognitive complexity 61; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/transformers/src/configs.js:344
  • validateNode has cyclomatic complexity 36 and cognitive complexity 42; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/transformers-structured-output/src/engine/json.ts:984
  • _call has cyclomatic complexity 32 and cognitive complexity 59; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:376
  • _get_file_metadata has cyclomatic complexity 29 and cognitive complexity 53; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/transformers/src/utils/model_registry/get_file_metadata.js:59
  • transition has cyclomatic complexity 29 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/transformers-structured-output/src/engine/json.ts:259
  • extractTokenizer has cyclomatic complexity 26 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/transformers-structured-output/src/engine/tokenizer.ts:14
  • preprocess has cyclomatic complexity 26 and cognitive complexity 36; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/transformers/src/image_processors_utils.js:921
  • _get_logits_processor has cyclomatic complexity 26 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/transformers/src/models/modeling_utils.js:404
  • formatMatches has cyclomatic complexity 25 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/transformers-structured-output/src/engine/json.ts:1392
  • _generate_with_seek has cyclomatic complexity 24 and cognitive complexity 48; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/transformers/src/models/whisper/modeling_whisper.js:195
  • _call has cyclomatic complexity 24 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/transformers/src/pipelines/image-segmentation.js:68
  • generate has cyclomatic complexity 23 and cognitive complexity 39; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/transformers/src/models/modeling_utils.js:845
  • validateArrayNode has cyclomatic complexity 23 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/transformers-structured-output/src/engine/json.ts:1052
  • getSession has cyclomatic complexity 23 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/transformers/src/models/session.js:26

What to do

  • Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
R3 · Large Files8.7 / 10Strong✓ Tool-verified

React / JS · Code Health — How many source files exceed the large-file threshold.

Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.

What to do

  • Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
R4 · Test Coverage9.8 / 10Exemplary✓ Tool-verified

React / JS · Readiness — Static test reachability (D-386): the share of production files reachable from any test via the import graph — measured without running anything.

Method: Static test reachability: the share of production files reachable from any test via the import graph — measured without running anything. Deterministic.

  • No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×10) — packages/transformers/scripts/dev.mjs, scripts/dev.mjs, packages/transformers-structured-output/scripts/dev.mjs, …

What to do

  • Add tests that import the unreached modules (directly or through their public entry).
R6 · Tooling10.0 / 10Exemplary✓ Tool-verified

React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each package.json script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.

Method: package.json scanned for test/lint/typecheck script wiring. Deterministic presence check.

R7 · Dead Code10.0 / 10Exemplary✓ Tool-verified

React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).

Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.

  • Unreachable from the 51 application, 4 tooling and 188 test entry point(s) detected in this repo. Gate removals on `pnpm run build` — an undetected custom entry would make these reachable.
  • no import path from any entry point (51 application, 4 tooling, 188 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make (×2) — scripts/rebuildPlugin.mjs, scripts/reportSize.mjs
R8 · Dependency Hygiene6.0 / 10Adequate✓ Tool-verified

React / JS · Readiness — npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.

Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps — from the manifest + import graph. Deterministic.

  • Imported but not declared in any reachable package.json — installs work only by hoisting accident. (×2) — packages/transformers/tests/models/chatterbox/test_modeling_chatterbox.js:1, packages/transformers/src/backends/onnx.js:23

What to do

  • Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
R9 · Circular Imports3.1 / 10Weak✓ Tool-verified

React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.

Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.

  • packages/transformers/src/models/auto/tokenization_auto.js → packages/transformers/src/models/tokenizers.js → packages/transformers/src/models/auto/tokenization_auto.js — packages/transformers/src/models/auto/tokenization_auto.js
  • packages/transformers/src/models/modeling_utils.js → packages/transformers/src/utils/model_registry/get_model_files.js → packages/transformers/src/utils/model_registry/resolve_model_type.js → packages/transformers/src/models/modeling_utils.js — packages/transformers/src/models/modeling_utils.js
  • packages/transformers/src/ops/registry.js → packages/transformers/src/utils/tensor.js → packages/transformers/src/ops/registry.js — packages/transformers/src/ops/registry.js
  • packages/transformers/src/utils/hub.js → packages/transformers/src/utils/model_registry/get_file_metadata.js → packages/transformers/src/utils/hub.js — packages/transformers/src/utils/hub.js

What to do

  • Break each cycle by extracting the shared piece into a module both sides can import.
X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.

Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.

X25 · Inert configuration knob10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere. Either way, every caller who supplies a value silently gets something else.

Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.

X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.

Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.

Reference — by lens

The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.

LensScoreRatingImpact
Code Health66%Adequate — gated by D2, D3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture73%Adequate — gated by D26, R9Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity64%Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness53%Adequate — gated by P3, P4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security64%Adequate — gated by D36Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance60%AdequateStrongest area.
Unscored — 2 check(s) recorded observations but carry no score

These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.

  • X10 Duplicated predicate — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X6 Hand-rolled structured-format parsing — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 4 control(s) we could not find positive evidence for

These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.

  • C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C4 Data Retention — Not assessed: these retention controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks retention controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C5 Data-Subject Rights — Not assessed: these data-subject rights controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks data-subject rights controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 78 check(s) not relevant to this codebase

These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.

  • AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
  • AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
  • AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
  • AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
  • AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
  • AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
  • AC7 A11y enforcement — No web markup found — accessibility is not applicable to this repository.
  • AX1 Captive dependencies — Not applicable: this repository's JavaScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's TypeScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
  • AX2 Stateful singletons — Not applicable: TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX6 Interface segregation — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — no test/production split to check
  • AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility — the dev server did not expose a crawlable HTTP endpoint in time — no runtime evidence This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
  • C1 Data Protection — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entity, a Mongoose schema, a Sequelize or Drizzle table, a Knex migration or a Prisma model — and no database or data-store client in the source either, so this repository keeps no data at rest for these controls to protect. If it does persist personal data (through a hosted backend configured outside this repository, for instance), the controls belong to wherever that data is stored.
  • C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • D11 Test Reliability — No tests discovered
  • D16 Bus Factor — single-maintainer repository — bus factor is not applicable
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D20 ADR Quality — N/A — ADRs are expected on deployable products with a user-facing host, not consumed libraries; no ADR log is required here.
  • D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout nor 2+ sibling source directories each declaring an aggregate root. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — No inline comments to assess — comment value is not applicable here.
  • D25 ADR Conformance — no ADRs to check
  • D27 Navigability — symbol resolution incomplete — navigability not assessed
  • D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
  • D32 Data Compliance (PII/GDPR) — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
  • D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
  • D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
  • D4 Code Duplication — This repository's production source (.js, .mjs, .ts) is not read by D4's token comparison, which compares .NET source: duplication in it is measured by R10 Code Duplication, the frontend lens's card running the same clone algorithm over the JS/TS token stream. Not scored here — read the R10 card for this repository's duplication.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D44 Platform End-of-Life — Platform end-of-life not assessed — this repository declares no platform this pass reads
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • D8 Code Coverage — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — the jest suite in packages/transformers/ ran and not one test passed (FAIL tests/utils/maths.test.js), so the coverage would describe the failed run, not the code. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan. Alternatively, commit the lcov/Cobertura report your CI produces and it is read without a re-run.
  • DM1 Domain Modelling — not scored — this repository shows none of the 3 signals this lens looks for
  • ED1 Event-Driven — not scored — this repository shows none of the 3 signals this lens looks for
  • ED5 Idempotency — This check finds retry-prone mutations (command handlers and message/event consumers) by walking the repository's declared types, and none was loaded here, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • GD1 Unfinished & placeholder code — no source files were read — this check reads C# syntax, and none was loaded for this repository. That is a limit of the analyzer, not a finding about your code.
  • IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P2 Observability — This repository's JavaScript/TypeScript source (2 module(s), 488 file(s) read) declares no entry point and bootstraps no server, and nothing here deploys a service — it is a library, run inside whatever hosts it, so production observability (structured logging, tracing/metrics, health checks) is N/A. If it grows a binary or a service, the dimension reactivates.
  • P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the JavaScript/TypeScript source, so there is no service whose uptime a failing dependency could take down
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (lcov — `vitest --coverage`, `jest --coverage`, `bun test --coverage --coverage-reporter=lcov`, or `nyc`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
  • PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for tinybench, mitata, benchmark.js, benny or vitest `bench(...)` calls in files that import them (or `*.bench.*` files), or one of those in a package.json, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
  • PF2 Allocation hygiene — Not applicable: TypeScript/JavaScript runs on a garbage-collected runtime that gives a program no allocation-control idiom to choose on a hot path — no pools, stack allocation or value types — so allocation awareness is not something this code can be rated on.
  • R5 Dependency Freshness — uses a pnpm lockfile — dependency freshness not measured here; JS/npm CVEs are scored in D30 (Dependency Vulnerabilities), which answers every ecosystem
  • S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X1 Async correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X12 Unreachable branch — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X13 Undrained process stream — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X14 Bypassable address classification — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X15 Unvalidated length from an untrusted reader — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X16 Unfloored truncation loop — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X17 Uncapped recursion over a caller-supplied document — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X18 Disposal-pattern correctness — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X19 Unrestored process-global state — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X2 Cancellation propagation — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X20 Mistyped argument guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X21 Side-effecting pattern guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X22 Contradicted release guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X23 Unguarded diagnostic materialisation — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X26 Unsynchronised callback handoff — Not applicable: this check looks for a collection written by a callback on one thread while the body waiting on it touches it on another, and in this repository's languages no collection is reachable from two threads at once. TypeScript/JavaScript runs every callback on the one thread that owns its objects: a callback runs only when the body waiting on it has yielded, never alongside it, and a worker thread receives a COPY of what it is sent. A SharedArrayBuffer carries raw bytes, never an Array, Map or Set, so no collection is reachable from two threads at once. Not a gap in the analyzer and not a finding about your code.
  • X27 Collection changed while being enumerated — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X28 Index access outside its own emptiness guard — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X3 Exception handling — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X30 Support guard that admits what it rejects — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X7 Silent fallback defaults — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.

Critical — 17 finding(s)
D30 · Dependency Vulnerabilities · High CVE · ×8
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
R9 · Circular Imports · Import cycle (2 files) · ×3
  • Import cycle (2 files) packages/transformers/src/models/auto/tokenization_auto.js — packages/transformers/src/models/auto/tokenization_auto.js → packages/transformers/src/models/tokenizers.js → packages/transformers/src/models/auto/tokenization_auto.js
  • Import cycle (2 files) packages/transformers/src/ops/registry.js — packages/transformers/src/ops/registry.js → packages/transformers/src/utils/tensor.js → packages/transformers/src/ops/registry.js
  • Import cycle (2 files) packages/transformers/src/utils/hub.js — packages/transformers/src/utils/hub.js → packages/transformers/src/utils/model_registry/get_file_metadata.js → packages/transformers/src/utils/hub.js
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
R8 · Dependency Hygiene · Unlisted import '@jest/globals' · ×1
  • Unlisted import '@jest/globals' packages/transformers/tests/models/chatterbox/test_modeling_chatterbox.js:1 — Imported but not declared in any reachable package.json — installs work only by hoisting accident.
R8 · Dependency Hygiene · Unlisted import 'onnxruntime-common' · ×1
  • Unlisted import 'onnxruntime-common' packages/transformers/src/backends/onnx.js:23 — Imported but not declared in any reachable package.json — installs work only by hoisting accident.
R9 · Circular Imports · Import cycle (3 files) · ×1
  • Import cycle (3 files) packages/transformers/src/models/modeling_utils.js — packages/transformers/src/models/modeling_utils.js → packages/transformers/src/utils/model_registry/get_model_files.js → packages/transformers/src/utils/model_registry/resolve_model_type.js → packages/transformers/src/models/modeling_utils.js
Serious — 235 finding(s)
R4 · Test Coverage · No test reaches this file · ×10
  • No test reaches this file packages/transformers/scripts/dev.mjs — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file scripts/dev.mjs — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/transformers-structured-output/scripts/dev.mjs — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file scripts/logger.mjs — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file scripts/rebuildPlugin.mjs — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/transformers/src/generation/parameters.js — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/transformers-structured-output/scripts/build.mjs — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file packages/transformers/scripts/build.mjs — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file scripts/reportSize.mjs — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file scripts/prepareOutDir.mjs — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D3 · God Classes · FileTooLong · ×4
  • FileTooLong: engine/json.ts packages/transformers-structured-output/src/engine/json.ts — FileTooLong — 1365 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 865 over it, 2.73× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: models/modeling_utils.js packages/transformers/src/models/modeling_utils.js — FileTooLong — 804 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 304 over it, 1.61× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: utils/tensor.js packages/transformers/src/utils/tensor.js — FileTooLong — 681 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 181 over it, 1.36× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: utils/maths.js packages/transformers/src/utils/maths.js — FileTooLong — 541 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 41 over it, 1.08× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
R10 · Code Duplication · Duplicated block with local edits (11 matched lines × 2 locations) · ×4
  • Duplicated block with local edits (11 matched lines × 2 locations) packages/transformers/src/models/encodec/feature_extraction_encodec.js:4 — packages/transformers/src/models/encodec/feature_extraction_encodec.js:4 · packages/transformers/src/models/pyannote/feature_extraction_pyannote.js:5 — the two spans are one implementation copied and then locally edited — 56 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
  • Duplicated block with local edits (11 matched lines × 2 locations) packages/transformers/src/models/m2m_100/tokenization_m2m_100.js:13 — packages/transformers/src/models/m2m_100/tokenization_m2m_100.js:13 · packages/transformers/src/models/mbart/tokenization_mbart.js:3 — the two spans are one implementation copied and then locally edited — 88 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
  • Duplicated block with local edits (11 matched lines × 2 locations) packages/transformers/src/models/m2m_100/tokenization_m2m_100.js:13 — packages/transformers/src/models/m2m_100/tokenization_m2m_100.js:13 · packages/transformers/src/models/nllb/tokenization_nllb.js:16 — the two spans are one implementation copied and then locally edited — 79 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
  • Duplicated block with local edits (11 matched lines × 2 locations) packages/transformers/src/models/mbart/tokenization_mbart.js:3 — packages/transformers/src/models/mbart/tokenization_mbart.js:3 · packages/transformers/src/models/nllb/tokenization_nllb.js:16 — the two spans are one implementation copied and then locally edited — 80 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R11 · Import Boundaries · Boundary violation [package · ×4
  • Boundary violation [package:relative-cross-package] packages/transformers/scripts/build.mjs:2 — packages/transformers/scripts/build.mjs:2 reaches into another package with a relative path (../../../scripts/prepareOutDir.mjs) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] packages/transformers/scripts/build.mjs:3 — packages/transformers/scripts/build.mjs:3 reaches into another package with a relative path (../../../scripts/logger.mjs) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] packages/transformers/scripts/dev.mjs:6 — packages/transformers/scripts/dev.mjs:6 reaches into another package with a relative path (../../../scripts/prepareOutDir.mjs) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] packages/transformers/scripts/dev.mjs:7 — packages/transformers/scripts/dev.mjs:7 reaches into another package with a relative path (../../../scripts/logger.mjs) — import the package by name instead.
R10 · Code Duplication · Duplicated block (16 lines × 2 locations) · ×3
  • Duplicated block (16 lines × 2 locations) packages/transformers/src/models/gemma3/processing_gemma3.js:15 — packages/transformers/src/models/gemma3/processing_gemma3.js:15 · packages/transformers/src/models/gemma3n/processing_gemma3n.js:32 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (16 lines × 2 locations) packages/transformers/src/models/gemma3n/modeling_gemma3n.js:19 — packages/transformers/src/models/gemma3n/modeling_gemma3n.js:19 · packages/transformers/src/models/phi3_v/modeling_phi3_v.js:12 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (16 lines × 2 locations) packages/transformers/src/models/granite_speech/processing_granite_speech.js:45 — packages/transformers/src/models/granite_speech/processing_granite_speech.js:45 · packages/transformers/src/models/ultravox/processing_ultravox.js:37 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
D10 · Test Quality · No assertions · ×2
  • No assertions: compiles ${file} without errors packages/transformers/tests/types.test.js:65 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: no progress_total without progress_callback packages/transformers/tests/progress_callbacks.test.js:246 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
PF3 · Async & latency hygiene · Sync-over-async blocking · ×2
  • Sync-over-async blocking packages/transformers/tests/test_utils.js:16 — `collect_tests` is async and calls readdirSync, existsSync, statSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking packages/transformers/tests/test_utils.js:55 — `collect_and_execute_pipeline_tests` is async and calls readdirSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
R10 · Code Duplication · Duplicated block (15 lines × 2 locations) · ×2
  • Duplicated block (15 lines × 2 locations) packages/transformers/src/models/voxtral_realtime/feature_extraction_voxtral_realtime.js:4 — packages/transformers/src/models/voxtral_realtime/feature_extraction_voxtral_realtime.js:4 · packages/transformers/src/models/whisper/feature_extraction_whisper.js:6 — the 2 copies are spread across 2 files, and each CITED SPAN is a SPECIALISATION DECLARATION — a type whose `extends` clause names a base and whose body hands that base its own values through `super(…)`. The shared module this dimension usually asks you to extract already exists: it is that base, every one of these sites already reaches it, and the `super(…)` call this row matched on is where each site passes its differences in. So do not read this as an extract-a-helper row — there is no missing helper, and what is left at each site is the declaration of one distinct specialisation, which cannot be deleted without deleting the thing it declares. Read what actually differs between the spans, because two different answers follow. Where the sites differ only in the values they hand the base — a type argument, a service, an alias, a cache — the repetition is a TEMPLATE, and the only moves that collapse it are to generate these declarations from the set they enumerate or to replace the repeated construction with one factory each site calls with its own values; where that set is the point, each site pinning one distinct thing, the repetition IS the enumeration and there is nothing to remove. Where instead a span carries logic OUTSIDE the delegation that is the same at every site, that logic is the part to move, and its home is the base type rather than a new module. Reported because the copies still drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2 locations) packages/transformers/src/utils/tensor.js:846 — packages/transformers/src/utils/tensor.js:846 · packages/transformers/src/utils/tensor.js:868 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (14 lines × 2 locations) · ×2
  • Duplicated block (14 lines × 2 locations) packages/transformers/src/generation/logits_process.js:201 — packages/transformers/src/generation/logits_process.js:201 · packages/transformers/src/generation/logits_process.js:441 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (14 lines × 2 locations) packages/transformers/src/utils/maths.js:399 — packages/transformers/src/utils/maths.js:399 · packages/transformers/src/utils/maths.js:572 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (12 lines × 2 locations) · ×2
  • Duplicated block (12 lines × 2 locations) packages/transformers/src/generation/logits_sampler.js:120 — packages/transformers/src/generation/logits_sampler.js:120 · packages/transformers/src/generation/logits_sampler.js:151 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (12 lines × 2 locations) packages/transformers/src/models/chatterbox/feature_extraction_chatterbox.js:10 — packages/transformers/src/models/chatterbox/feature_extraction_chatterbox.js:10 · packages/transformers/src/models/moonshine/feature_extraction_moonshine.js:10 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
R10 · Code Duplication · Duplicated block (12 lines × 4 locations) · ×2
  • Duplicated block (12 lines × 4 locations) packages/transformers/src/models/detr/modeling_detr.js:1 — packages/transformers/src/models/detr/modeling_detr.js:1 · packages/transformers/src/models/hubert/modeling_hubert.js:2 · packages/transformers/src/models/rt_detr/modeling_rt_detr.js:1 · packages/transformers/src/models/yolos/modeling_yolos.js:1 — the 4 copies are spread across 4 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
  • Duplicated block (12 lines × 4 locations) packages/transformers/src/models/unispeech/modeling_unispeech.js:2 — packages/transformers/src/models/unispeech/modeling_unispeech.js:2 · packages/transformers/src/models/unispeech_sat/modeling_unispeech_sat.js:2 · packages/transformers/src/models/wav2vec2/modeling_wav2vec2.js:2 · packages/transformers/src/models/wav2vec2_bert/modeling_wav2vec2_bert.js:2 — the 4 copies are spread across 4 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
D1 · Cyclomatic Complexity · json.checkSchema (cyclomatic 64) · ×1
  • json.checkSchema (cyclomatic 64) packages/transformers-structured-output/src/engine/json.ts:1568 — json.checkSchema has cyclomatic complexity 64 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: packages/transformers-structured-output/src/engine/json.ts holds 14 of the 51 methods over the threshold — including the worst — and 150 of the 441 points over it (34%), 3.8× the next-largest file (packages/transformers/src/models/whisper/tokenization_whisper.js at 39). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · WhisperTokenizer._decode_asr (cyclomatic 52) · ×1
  • WhisperTokenizer._decode_asr (cyclomatic 52) packages/transformers/src/models/whisper/tokenization_whisper.js:29 — WhisperTokenizer._decode_asr has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · spectrogram (cyclomatic 48) · ×1
  • spectrogram (cyclomatic 48) packages/transformers/src/utils/audio.js:484 — spectrogram has cyclomatic complexity 48 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · json.validateObjectNode (cyclomatic 43) · ×1
  • json.validateObjectNode (cyclomatic 43) packages/transformers-structured-output/src/engine/json.ts:1083 — json.validateObjectNode has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: packages/transformers-structured-output/src/engine/json.ts holds 14 of the 51 methods over the threshold — including the worst — and 150 of the 441 points over it (34%), 3.8× the next-largest file (packages/transformers/src/models/whisper/tokenization_whisper.js at 39). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · hub.loadResourceFile (cyclomatic 43) · ×1
  • hub.loadResourceFile (cyclomatic 43) packages/transformers/src/utils/hub.js:265 — hub.loadResourceFile has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · json.validateNode (cyclomatic 37) · ×1
  • json.validateNode (cyclomatic 37) packages/transformers-structured-output/src/engine/json.ts:984 — json.validateNode has cyclomatic complexity 37 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This file is where this pass's cyclomatic complexity CONCENTRATES: packages/transformers-structured-output/src/engine/json.ts holds 14 of the 51 methods over the threshold — including the worst — and 150 of the 441 points over it (34%), 3.8× the next-largest file (packages/transformers/src/models/whisper/tokenization_whisper.js at 39). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · getCacheNames (cyclomatic 37) · ×1
  • getCacheNames (cyclomatic 37) packages/transformers/src/configs.js:344 — getCacheNames has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: getNormalizedConfig (cyclomatic 120) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · _call (cyclomatic 35) · ×1
  • _call (cyclomatic 35) REDACTED:376 — _call has cyclomatic complexity 35 (threshold 15). Of this number, 32 points are the body's own statements and 3 belong to 7 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · json.transition (cyclomatic 29) · ×1
  • json.transition (cyclomatic 29) packages/transformers-structured-output/src/engine/json.ts:259 — json.transition has cyclomatic complexity 29 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This file is where this pass's cyclomatic complexity CONCENTRATES: packages/transformers-structured-output/src/engine/json.ts holds 14 of the 51 methods over the threshold — including the worst — and 150 of the 441 points over it (34%), 3.8× the next-largest file (packages/transformers/src/models/whisper/tokenization_whisper.js at 39). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · get_file_metadata._get_file_metadata (cyclomatic 29) · ×1
  • get_file_metadata._get_file_metadata (cyclomatic 29) packages/transformers/src/utils/model_registry/get_file_metadata.js:59 — get_file_metadata._get_file_metadata has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · constraint.createTokenConstraint (cyclomatic 28) · ×1
  • constraint.createTokenConstraint (cyclomatic 28) packages/transformers-structured-output/src/engine/constraint.ts:49 — constraint.createTokenConstraint has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · tokenizer.extractTokenizer (cyclomatic 26) · ×1
  • tokenizer.extractTokenizer (cyclomatic 26) packages/transformers-structured-output/src/engine/tokenizer.ts:14 — tokenizer.extractTokenizer has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PreTrainedModel._get_logits_processor (cyclomatic 26) · ×1
  • PreTrainedModel._get_logits_processor (cyclomatic 26) packages/transformers/src/models/modeling_utils.js:404 — PreTrainedModel._get_logits_processor has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · preprocess (cyclomatic 26) · ×1
  • preprocess (cyclomatic 26) packages/transformers/src/image_processors_utils.js:921 — preprocess has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · json.formatMatches (cyclomatic 25) · ×1
  • json.formatMatches (cyclomatic 25) packages/transformers-structured-output/src/engine/json.ts:1392 — json.formatMatches has cyclomatic complexity 25 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This file is where this pass's cyclomatic complexity CONCENTRATES: packages/transformers-structured-output/src/engine/json.ts holds 14 of the 51 methods over the threshold — including the worst — and 150 of the 441 points over it (34%), 3.8× the next-largest file (packages/transformers/src/models/whisper/tokenization_whisper.js at 39). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · _call (cyclomatic 25) · ×1
  • _call (cyclomatic 25) packages/transformers/src/pipelines/image-segmentation.js:68 — _call has cyclomatic complexity 25 (threshold 15). Of this number, 24 points are the body's own statements and 1 belongs to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WhisperForConditionalGeneration._generate_with_seek (cyclomatic 24) · ×1
  • WhisperForConditionalGeneration._generate_with_seek (cyclomatic 24) packages/transformers/src/models/whisper/modeling_whisper.js:195 — WhisperForConditionalGeneration._generate_with_seek has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PreTrainedModel.generate (cyclomatic 23) · ×1
  • PreTrainedModel.generate (cyclomatic 23) packages/transformers/src/models/modeling_utils.js:845 — PreTrainedModel.generate has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · getSession (cyclomatic 23) · ×1
  • getSession (cyclomatic 23) packages/transformers/src/models/session.js:26 — getSession has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · json.validateArrayNode (cyclomatic 22) · ×1
  • json.validateArrayNode (cyclomatic 22) packages/transformers-structured-output/src/engine/json.ts:1052 — json.validateArrayNode has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: packages/transformers-structured-output/src/engine/json.ts holds 14 of the 51 methods over the threshold — including the worst — and 150 of the 441 points over it (34%), 3.8× the next-largest file (packages/transformers/src/models/whisper/tokenization_whisper.js at 39). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · json.compareDecimal (cyclomatic 19) · ×1
  • json.compareDecimal (cyclomatic 19) packages/transformers-structured-output/src/engine/json.ts:1205 — json.compareDecimal has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: packages/transformers-structured-output/src/engine/json.ts holds 14 of the 51 methods over the threshold — including the worst — and 150 of the 441 points over it (34%), 3.8× the next-largest file (packages/transformers/src/models/whisper/tokenization_whisper.js at 39). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · json.validUriText (cyclomatic 19) · ×1
  • json.validUriText (cyclomatic 19) packages/transformers-structured-output/src/engine/json.ts:1509 — json.validUriText has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This file is where this pass's cyclomatic complexity CONCENTRATES: packages/transformers-structured-output/src/engine/json.ts holds 14 of the 51 methods over the threshold — including the worst — and 150 of the 441 points over it (34%), 3.8× the next-largest file (packages/transformers/src/models/whisper/tokenization_whisper.js at 39). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · render-api.renderType (cyclomatic 19) · ×1
  • render-api.renderType (cyclomatic 19) packages/transformers/docs/scripts/lib/render-api.mjs:444 — render-api.renderType has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · structure.extractEntities (cyclomatic 19) · ×1
  • structure.extractEntities (cyclomatic 19) packages/transformers/docs/scripts/lib/structure.mjs:9 — structure.extractEntities has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 8 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 24). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · validate.collectDocWarnings (cyclomatic 19) · ×1
  • validate.collectDocWarnings (cyclomatic 19) packages/transformers/docs/scripts/lib/validate.mjs:64 — validate.collectDocWarnings has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Tensor.slice (cyclomatic 19) · ×1
  • Tensor.slice (cyclomatic 19) packages/transformers/src/utils/tensor.js:416 — Tensor.slice has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ImageProcessor.pad_image (cyclomatic 19) · ×1
  • ImageProcessor.pad_image (cyclomatic 19) packages/transformers/src/image_processors_utils.js:711 — ImageProcessor.pad_image has cyclomatic complexity 19 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · _call (cyclomatic 19) · ×1
  • _call (cyclomatic 19) packages/transformers/src/pipelines/text-generation.js:108 — _call has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · json.stringByte (cyclomatic 18) · ×1
  • json.stringByte (cyclomatic 18) packages/transformers-structured-output/src/engine/json.ts:359 — json.stringByte has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This file is where this pass's cyclomatic complexity CONCENTRATES: packages/transformers-structured-output/src/engine/json.ts holds 14 of the 51 methods over the threshold — including the worst — and 150 of the 441 points over it (34%), 3.8× the next-largest file (packages/transformers/src/models/whisper/tokenization_whisper.js at 39). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · json.unicodeByte (cyclomatic 18) · ×1
  • json.unicodeByte (cyclomatic 18) packages/transformers-structured-output/src/engine/json.ts:412 — json.unicodeByte has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This file is where this pass's cyclomatic complexity CONCENTRATES: packages/transformers-structured-output/src/engine/json.ts holds 14 of the 51 methods over the threshold — including the worst — and 150 of the 441 points over it (34%), 3.8× the next-largest file (packages/transformers/src/models/whisper/tokenization_whisper.js at 39). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · json.constrainedPropertyKeys (cyclomatic 18) · ×1
  • json.constrainedPropertyKeys (cyclomatic 18) packages/transformers-structured-output/src/engine/json.ts:930 — json.constrainedPropertyKeys has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: packages/transformers-structured-output/src/engine/json.ts holds 14 of the 51 methods over the threshold — including the worst — and 150 of the 441 points over it (34%), 3.8× the next-largest file (packages/transformers/src/models/whisper/tokenization_whisper.js at 39). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · scan.splitConditional (cyclomatic 18) · ×1
  • scan.splitConditional (cyclomatic 18) packages/transformers/docs/scripts/lib/scan.mjs:38 — scan.splitConditional has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · exports.visitTopLevel (cyclomatic 18) · ×1
  • exports.visitTopLevel (cyclomatic 18) packages/transformers/docs/scripts/lib/exports.mjs:33 — exports.visitTopLevel has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _call_whisper (cyclomatic 18) · ×1
  • _call_whisper (cyclomatic 18) packages/transformers/src/pipelines/automatic-speech-recognition.js:200 — _call_whisper has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · pipeline (cyclomatic 18) · ×1
  • pipeline (cyclomatic 18) packages/transformers/src/pipelines.js:100 — pipeline has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to 3 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · tokenizer.tokenBytesConverter (cyclomatic 17) · ×1
  • tokenizer.tokenBytesConverter (cyclomatic 17) packages/transformers-structured-output/src/engine/tokenizer.ts:112 — tokenizer.tokenBytesConverter has cyclomatic complexity 17 (threshold 15). Of this number, 9 points are the body's own statements and 8 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · render-api.renderFunction (cyclomatic 17) · ×1
  • render-api.renderFunction (cyclomatic 17) packages/transformers/docs/scripts/lib/render-api.mjs:223 — render-api.renderFunction has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · render-api.rewriteConditionals (cyclomatic 17) · ×1
  • render-api.rewriteConditionals (cyclomatic 17) packages/transformers/docs/scripts/lib/render-api.mjs:587 — render-api.rewriteConditionals has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WhisperTokenizer.findLongestCommonSequence (cyclomatic 17) · ×1
  • WhisperTokenizer.findLongestCommonSequence (cyclomatic 17) packages/transformers/src/models/whisper/tokenization_whisper.js:346 — WhisperTokenizer.findLongestCommonSequence has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · constructor (cyclomatic 17) · ×1
  • constructor (cyclomatic 17) packages/transformers/src/image_processors_utils.js:577 — constructor has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · get_resize_output_image_size (cyclomatic 17) · ×1
  • get_resize_output_image_size (cyclomatic 17) packages/transformers/src/image_processors_utils.js:803 — get_resize_output_image_size has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · resize (cyclomatic 17) · ×1
  • resize (cyclomatic 17) packages/transformers/src/utils/image.js:373 — resize has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · json.integerScaleReachable (cyclomatic 16) · ×1
  • json.integerScaleReachable (cyclomatic 16) packages/transformers-structured-output/src/engine/json.ts:575 — json.integerScaleReachable has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: packages/transformers-structured-output/src/engine/json.ts holds 14 of the 51 methods over the threshold — including the worst — and 150 of the 441 points over it (34%), 3.8× the next-largest file (packages/transformers/src/models/whisper/tokenization_whisper.js at 39). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · json.propertySchema (cyclomatic 16) · ×1
  • json.propertySchema (cyclomatic 16) packages/transformers-structured-output/src/engine/json.ts:707 — json.propertySchema has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: packages/transformers-structured-output/src/engine/json.ts holds 14 of the 51 methods over the threshold — including the worst — and 150 of the 441 points over it (34%), 3.8× the next-largest file (packages/transformers/src/models/whisper/tokenization_whisper.js at 39). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · json.schemaMayAcceptKind (cyclomatic 16) · ×1
  • json.schemaMayAcceptKind (cyclomatic 16) packages/transformers-structured-output/src/engine/json.ts:1264 — json.schemaMayAcceptKind has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This file is where this pass's cyclomatic complexity CONCENTRATES: packages/transformers-structured-output/src/engine/json.ts holds 14 of the 51 methods over the threshold — including the worst — and 150 of the 441 points over it (34%), 3.8× the next-largest file (packages/transformers/src/models/whisper/tokenization_whisper.js at 39). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · streamers.is_chinese_char (cyclomatic 16) · ×1
  • streamers.is_chinese_char (cyclomatic 16) packages/transformers/src/generation/streamers.js:26 — streamers.is_chinese_char has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ChatterboxModel.forward (cyclomatic 16) · ×1
  • ChatterboxModel.forward (cyclomatic 16) packages/transformers/src/models/chatterbox/modeling_chatterbox.js:37 — ChatterboxModel.forward has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ensureWasmLoaded (cyclomatic 16) · ×1
  • ensureWasmLoaded (cyclomatic 16) packages/transformers/src/backends/onnx.js:195 — ensureWasmLoaded has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 223, 235, 250). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · _call (cyclomatic 16) · ×1
  • _call (cyclomatic 16) packages/transformers/src/models/lfm2_vl/image_processing_lfm2_vl.js:191 — _call has cyclomatic complexity 16 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · selectDtype (cyclomatic 16) · ×1
  • selectDtype (cyclomatic 16) packages/transformers/src/utils/dtypes.js:85 — selectDtype has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · getCache (cyclomatic 16) · ×1
  • getCache (cyclomatic 16) packages/transformers/src/utils/cache.js:22 — getCache has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D15 · Churn × Complexity Hotspots · Hotspot · ×1
  • Hotspot: packages/transformers/src/utils/hub.js packages/transformers/src/utils/hub.js:265 — packages/transformers/src/utils/hub.js changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 43 in hub.loadResourceFile at line 265. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-25..2026-09-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-25 14:31:55 +02:00' --until='2026-09-23 14:31:55 +02:00' --full-history --no-merges -- packages/transformers/src/utils/hub.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
D2 · Cognitive Complexity · WhisperTokenizer._decode_asr (cognitive 151) · ×1
  • WhisperTokenizer._decode_asr (cognitive 151) packages/transformers/src/models/whisper/tokenization_whisper.js:29 — WhisperTokenizer._decode_asr has cognitive complexity 151 (threshold 15). Drivers by points: if/else 38 (115 pts), loops 7 (24 pts), boolean chains 10, ternaries 1 (2 pts) (nesting depth added 95). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · spectrogram (cognitive 75) · ×1
  • spectrogram (cognitive 75) packages/transformers/src/utils/audio.js:484 — spectrogram has cognitive complexity 75 (threshold 15). Drivers by points: loops 14 (34 pts), if/else 23 (31 pts), boolean chains 4, match/switch 2 (4 pts), other 1, ternaries 1 (nesting depth added 30). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · loadResourceFile (cognitive 75) · ×1
  • loadResourceFile (cognitive 75) packages/transformers/src/utils/hub.js:265 — loadResourceFile has cognitive complexity 75 (threshold 15). Drivers by points: if/else 29 (53 pts), boolean chains 13, error handling 2 (9 pts) (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _call (cognitive 73) · ×1
  • _call (cognitive 73) REDACTED:376 — _call has cognitive complexity 73 (threshold 15). Drivers by points: if/else 26 (49 pts), loops 5 (13 pts), ternaries 1 (5 pts), boolean chains 3, other 3 (nesting depth added 35). Of this number, 59 points are the body's own statements and 14 belong to 7 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · json.checkSchema (cognitive 72) · ×1
  • json.checkSchema (cognitive 72) packages/transformers-structured-output/src/engine/json.ts:1568 — json.checkSchema has cognitive complexity 72 (threshold 15). Drivers by points: if/else 23 (32 pts), boolean chains 24, loops 8 (10 pts), ternaries 3 (6 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · json.validateObjectNode (cognitive 62) · ×1
  • json.validateObjectNode (cognitive 62) packages/transformers-structured-output/src/engine/json.ts:1083 — json.validateObjectNode has cognitive complexity 62 (threshold 15). Drivers by points: if/else 18 (38 pts), boolean chains 12, loops 5 (6 pts), ternaries 6 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · getCacheNames (cognitive 61) · ×1
  • getCacheNames (cognitive 61) packages/transformers/src/configs.js:344 — getCacheNames has cognitive complexity 61 (threshold 15). Drivers by points: if/else 23 (37 pts), loops 6 (12 pts), other 5, boolean chains 4, ternaries 2 (3 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _get_file_metadata (cognitive 53) · ×1
  • _get_file_metadata (cognitive 53) packages/transformers/src/utils/model_registry/get_file_metadata.js:59 — _get_file_metadata has cognitive complexity 53 (threshold 15). Drivers by points: if/else 12 (28 pts), ternaries 3 (10 pts), boolean chains 8, error handling 2 (7 pts) (nesting depth added 28). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · validate.collectDocWarnings (cognitive 48) · ×1
  • validate.collectDocWarnings (cognitive 48) packages/transformers/docs/scripts/lib/validate.mjs:64 — validate.collectDocWarnings has cognitive complexity 48 (threshold 15). Drivers by points: if/else 8 (28 pts), loops 7 (17 pts), boolean chains 3 (nesting depth added 30). Of this number, 47 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WhisperForConditionalGeneration._generate_with_seek (cognitive 48) · ×1
  • WhisperForConditionalGeneration._generate_with_seek (cognitive 48) packages/transformers/src/models/whisper/modeling_whisper.js:195 — WhisperForConditionalGeneration._generate_with_seek has cognitive complexity 48 (threshold 15). Drivers by points: if/else 15 (31 pts), loops 5 (11 pts), boolean chains 3, ternaries 2 (3 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImageProcessor.pad_image (cognitive 45) · ×1
  • ImageProcessor.pad_image (cognitive 45) packages/transformers/src/image_processors_utils.js:711 — ImageProcessor.pad_image has cognitive complexity 45 (threshold 15). Drivers by points: loops 7 (24 pts), if/else 9 (17 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 26). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · _call (cognitive 45) · ×1
  • _call (cognitive 45) packages/transformers/src/pipelines/image-segmentation.js:68 — _call has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (26 pts), loops 6 (14 pts), boolean chains 3, other 2 (nesting depth added 20). Of this number, 44 points are the body's own statements and 1 belongs to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · json.validateNode (cognitive 40) · ×1
  • json.validateNode (cognitive 40) packages/transformers-structured-output/src/engine/json.ts:984 — json.validateNode has cognitive complexity 40 (threshold 15). Drivers by points: if/else 19 (21 pts), boolean chains 15, ternaries 2 (4 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · tokenizer.extractTokenizer (cognitive 40) · ×1
  • tokenizer.extractTokenizer (cognitive 40) packages/transformers-structured-output/src/engine/tokenizer.ts:14 — tokenizer.extractTokenizer has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 8 (14 pts), boolean chains 3 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PreTrainedModel.generate (cognitive 39) · ×1
  • PreTrainedModel.generate (cognitive 39) packages/transformers/src/models/modeling_utils.js:845 — PreTrainedModel.generate has cognitive complexity 39 (threshold 15). Drivers by points: if/else 16 (26 pts), loops 5 (11 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · preprocess (cognitive 36) · ×1
  • preprocess (cognitive 36) packages/transformers/src/image_processors_utils.js:921 — preprocess has cognitive complexity 36 (threshold 15). Drivers by points: if/else 18 (24 pts), loops 3 (7 pts), other 4, boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _call_whisper (cognitive 36) · ×1
  • _call_whisper (cognitive 36) packages/transformers/src/pipelines/automatic-speech-recognition.js:200 — _call_whisper has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 4 (10 pts), loops 3 (6 pts), other 4 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · image_processors_utils.post_process_object_detection (cognitive 35) · ×1
  • image_processors_utils.post_process_object_detection (cognitive 35) packages/transformers/src/image_processors_utils.js:83 — image_processors_utils.post_process_object_detection has cognitive complexity 35 (threshold 15). Drivers by points: if/else 7 (22 pts), loops 4 (10 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · slice (cognitive 35) · ×1
  • slice (cognitive 35) packages/transformers/src/utils/tensor.js:416 — slice has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 5 (10 pts), ternaries 2 (6 pts), boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · constraint.createTokenConstraint (cognitive 33) · ×1
  • constraint.createTokenConstraint (cognitive 33) packages/transformers-structured-output/src/engine/constraint.ts:49 — constraint.createTokenConstraint has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (20 pts), loops 4 (7 pts), boolean chains 4, ternaries 2 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · _call (cognitive 32) · ×1
  • _call (cognitive 32) packages/transformers/src/models/lfm2_vl/image_processing_lfm2_vl.js:191 — _call has cognitive complexity 32 (threshold 15). Drivers by points: loops 5 (15 pts), if/else 7 (12 pts), boolean chains 4, other 1 (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · json.validateArrayNode (cognitive 29) · ×1
  • json.validateArrayNode (cognitive 29) packages/transformers-structured-output/src/engine/json.ts:1052 — json.validateArrayNode has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 5, loops 3 (5 pts), ternaries 3 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · findLongestCommonSequence (cognitive 28) · ×1
  • findLongestCommonSequence (cognitive 28) packages/transformers/src/models/whisper/tokenization_whisper.js:346 — findLongestCommonSequence has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 3 (5 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 11). Of this number, 27 points are the body's own statements and 1 belongs to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · json.constrainedPropertyKeys (cognitive 27) · ×1
  • json.constrainedPropertyKeys (cognitive 27) packages/transformers-structured-output/src/engine/json.ts:930 — json.constrainedPropertyKeys has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 4 (8 pts), boolean chains 3, ternaries 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · structure.extractEntities (cognitive 27) · ×1
  • structure.extractEntities (cognitive 27) packages/transformers/docs/scripts/lib/structure.mjs:9 — structure.extractEntities has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 9). Most of this is not in the body itself: 11 of the 27 points are its own statements and the rest belongs to one function literal inside it that branches (line 24). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · _get_logits_processor (cognitive 27) · ×1
  • _get_logits_processor (cognitive 27) packages/transformers/src/models/modeling_utils.js:404 — _get_logits_processor has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 10, ternaries 1 (2 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · tasks.parseSupportedTasks (cognitive 26) · ×1
  • tasks.parseSupportedTasks (cognitive 26) packages/transformers/docs/scripts/lib/tasks.mjs:28 — tasks.parseSupportedTasks has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · validate.formatValidationResult (cognitive 26) · ×1
  • validate.formatValidationResult (cognitive 26) packages/transformers/docs/scripts/lib/validate.mjs:30 — validate.formatValidationResult has cognitive complexity 26 (threshold 15). Drivers by points: loops 4 (11 pts), if/else 6 (9 pts), ternaries 2 (6 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SeamlessM4TFeatureExtractor._call (cognitive 26) · ×1
  • SeamlessM4TFeatureExtractor._call (cognitive 26) packages/transformers/src/models/seamless_m4t/feature_extraction_seamless_m4t.js:72 — SeamlessM4TFeatureExtractor._call has cognitive complexity 26 (threshold 15). Drivers by points: loops 5 (14 pts), if/else 8 (12 pts) (nesting depth added 13). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · Phi3VImageProcessor._call (cognitive 26) · ×1
  • Phi3VImageProcessor._call (cognitive 26) packages/transformers/src/models/phi3_v/image_processing_phi3_v.js:75 — Phi3VImageProcessor._call has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 3 (8 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChatterboxModel.forward (cognitive 26) · ×1
  • ChatterboxModel.forward (cognitive 26) packages/transformers/src/models/chatterbox/modeling_chatterbox.js:37 — ChatterboxModel.forward has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mask.applyMask (cognitive 25) · ×1
  • mask.applyMask (cognitive 25) packages/transformers-structured-output/src/utils/mask.ts:5 — mask.applyMask has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 4 (9 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · render-api.renderFunction (cognitive 25) · ×1
  • render-api.renderFunction (cognitive 25) packages/transformers/docs/scripts/lib/render-api.mjs:223 — render-api.renderFunction has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 7 (15 pts), if/else 5, loops 2 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · render-api.rewriteConditionals (cognitive 24) · ×1
  • render-api.rewriteConditionals (cognitive 24) packages/transformers/docs/scripts/lib/render-api.mjs:587 — render-api.rewriteConditionals has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 3 (6 pts), ternaries 2 (4 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RawImage.center_crop (cognitive 24) · ×1
  • RawImage.center_crop (cognitive 24) packages/transformers/src/utils/image.js:549 — RawImage.center_crop has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WhisperForConditionalGeneration._extract_token_timestamps (cognitive 24) · ×1
  • WhisperForConditionalGeneration._extract_token_timestamps (cognitive 24) packages/transformers/src/models/whisper/modeling_whisper.js:381 — WhisperForConditionalGeneration._extract_token_timestamps has cognitive complexity 24 (threshold 15). Drivers by points: loops 6 (13 pts), if/else 6 (9 pts), ternaries 2 (nesting depth added 10). Of this number, 22 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · json.integerDigitsReachable (cognitive 23) · ×1
  • json.integerDigitsReachable (cognitive 23) packages/transformers-structured-output/src/engine/json.ts:552 — json.integerDigitsReachable has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 2, ternaries 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · json.compareDecimal (cognitive 23) · ×1
  • json.compareDecimal (cognitive 23) packages/transformers-structured-output/src/engine/json.ts:1205 — json.compareDecimal has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 9 (14 pts), if/else 6, boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · exports.visitTopLevel (cognitive 23) · ×1
  • exports.visitTopLevel (cognitive 23) packages/transformers/docs/scripts/lib/exports.mjs:33 — exports.visitTopLevel has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 2 (4 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · get_resize_output_image_size (cognitive 23) · ×1
  • get_resize_output_image_size (cognitive 23) packages/transformers/src/image_processors_utils.js:803 — get_resize_output_image_size has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (15 pts), ternaries 2 (4 pts), boolean chains 3, other 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · getSession (cognitive 23) · ×1
  • getSession (cognitive 23) packages/transformers/src/models/session.js:26 — getSession has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 6, other 5, loops 1 (3 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · _call (cognitive 23) · ×1
  • _call (cognitive 23) packages/transformers/src/pipelines/text-generation.js:108 — _call has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, ternaries 3 (4 pts), other 3, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · selectDtype (cognitive 23) · ×1
  • selectDtype (cognitive 23) packages/transformers/src/utils/dtypes.js:85 — selectDtype has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 4, ternaries 1 (3 pts), other 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · json.unicodeByte (cognitive 22) · ×1
  • json.unicodeByte (cognitive 22) packages/transformers-structured-output/src/engine/json.ts:412 — json.unicodeByte has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 5, ternaries 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · constraint.cachedTokenizer (cognitive 22) · ×1
  • constraint.cachedTokenizer (cognitive 22) packages/transformers-structured-output/src/engine/constraint.ts:163 — constraint.cachedTokenizer has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (15 pts), ternaries 1 (3 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pipeline (cognitive 22) · ×1
  • pipeline (cognitive 22) packages/transformers/src/pipelines.js:100 — pipeline has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (13 pts), other 3, ternaries 3, error handling 1 (2 pts), boolean chains 1 (nesting depth added 4). Of this number, 19 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · _call (cognitive 22) · ×1
  • _call (cognitive 22) packages/transformers/src/models/lfm2_vl/processing_lfm2_vl.js:18 — _call has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 2 (7 pts), other 4, boolean chains 1, ternaries 1 (nesting depth added 9). Most of this is not in the body itself: 8 of the 22 points are its own statements and the rest belongs to 3 function items inside it that branch ((anonymous)::(anonymous), ds, (anonymous)). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · json.propertySchema (cognitive 21) · ×1
  • json.propertySchema (cognitive 21) packages/transformers-structured-output/src/engine/json.ts:707 — json.propertySchema has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (15 pts), ternaries 2 (3 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · json.validUriText (cognitive 21) · ×1
  • json.validUriText (cognitive 21) packages/transformers-structured-output/src/engine/json.ts:1509 — json.validUriText has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (12 pts), ternaries 3 (5 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · scan.splitConditional (cognitive 21) · ×1
  • scan.splitConditional (cognitive 21) packages/transformers/docs/scripts/lib/scan.mjs:38 — scan.splitConditional has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 5, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · render-api.renderType (cognitive 21) · ×1
  • render-api.renderType (cognitive 21) packages/transformers/docs/scripts/lib/render-api.mjs:444 — render-api.renderType has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · P2FFT._realTransform4 (cognitive 21) · ×1
  • P2FFT._realTransform4 (cognitive 21) packages/transformers/src/utils/maths.js:581 — P2FFT._realTransform4 has cognitive complexity 21 (threshold 15). Drivers by points: loops 6 (11 pts), if/else 4 (10 pts) (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · tokenization_utils._build_translation_inputs (cognitive 21) · ×1
  • tokenization_utils._build_translation_inputs (cognitive 21) REDACTED:811 — tokenization_utils._build_translation_inputs has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 5, loops 1 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClapFeatureExtractor._get_input_mel (cognitive 21) · ×1
  • ClapFeatureExtractor._get_input_mel (cognitive 21) packages/transformers/src/models/clap/feature_extraction_clap.js:54 — ClapFeatureExtractor._get_input_mel has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2 (8 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · image_processing_lfm2_vl.convert_image_to_patches (cognitive 21) · ×1
  • image_processing_lfm2_vl.convert_image_to_patches (cognitive 21) packages/transformers/src/models/lfm2_vl/image_processing_lfm2_vl.js:78 — image_processing_lfm2_vl.convert_image_to_patches has cognitive complexity 21 (threshold 15). Drivers by points: loops 6 (21 pts) (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · _call (cognitive 21) · ×1
  • _call (cognitive 21) packages/transformers/src/models/idefics3/image_processing_idefics3.js:40 — _call has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 2 (3 pts), boolean chains 1, other 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · api-links.buildApiSymbolLinks (cognitive 20) · ×1
  • api-links.buildApiSymbolLinks (cognitive 20) packages/transformers/docs/scripts/lib/api-links.mjs:3 — api-links.buildApiSymbolLinks has cognitive complexity 20 (threshold 15). Drivers by points: loops 6 (11 pts), if/else 3 (9 pts) (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · ir.buildTypedefIndex (cognitive 20) · ×1
  • ir.buildTypedefIndex (cognitive 20) packages/transformers/docs/scripts/lib/ir.mjs:37 — ir.buildTypedefIndex has cognitive complexity 20 (threshold 15). Drivers by points: loops 7 (11 pts), if/else 2 (6 pts), boolean chains 3 (nesting depth added 8). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · validate.validateInternalLinks (cognitive 20) · ×1
  • validate.validateInternalLinks (cognitive 20) packages/transformers/docs/scripts/lib/validate.mjs:124 — validate.validateInternalLinks has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (17 pts), loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Idefics3ImageProcessor.split_image (cognitive 20) · ×1
  • Idefics3ImageProcessor.split_image (cognitive 20) packages/transformers/src/models/idefics3/image_processing_idefics3.js:160 — Idefics3ImageProcessor.split_image has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VitPoseImageProcessor.post_process_pose_estimation (cognitive 20) · ×1
  • VitPoseImageProcessor.post_process_pose_estimation (cognitive 20) packages/transformers/src/models/vitpose/image_processing_vitpose.js:18 — VitPoseImageProcessor.post_process_pose_estimation has cognitive complexity 20 (threshold 15). Drivers by points: loops 5 (15 pts), if/else 1 (4 pts), boolean chains 1 (nesting depth added 13). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · json.stringByte (cognitive 19) · ×1
  • json.stringByte (cognitive 19) packages/transformers-structured-output/src/engine/json.ts:359 — json.stringByte has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · resolve_model_type.resolve_model_type (cognitive 19) · ×1
  • resolve_model_type.resolve_model_type (cognitive 19) packages/transformers/src/utils/model_registry/resolve_model_type.js:26 — resolve_model_type.resolve_model_type has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · post_process_semantic_segmentation (cognitive 19) · ×1
  • post_process_semantic_segmentation (cognitive 19) packages/transformers/src/image_processors_utils.js:160 — post_process_semantic_segmentation has cognitive complexity 19 (threshold 15). Drivers by points: loops 4 (8 pts), if/else 3 (7 pts), ternaries 1 (2 pts), boolean chains 1, other 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · (anonymous) (cognitive 19) · ×1
  • (anonymous) (cognitive 19) packages/transformers/src/utils/maths.js:1050 — (anonymous) has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (8 pts) (nesting depth added 10). Most of this is not in the body itself: 0 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 1053). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · getCache (cognitive 19) · ×1
  • getCache (cognitive 19) packages/transformers/src/utils/cache.js:22 — getCache has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4, error handling 1 (2 pts), other 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · json.integerScaleReachable (cognitive 18) · ×1
  • json.integerScaleReachable (cognitive 18) packages/transformers-structured-output/src/engine/json.ts:575 — json.integerScaleReachable has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 7, if/else 4 (6 pts), ternaries 2 (4 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tokenizer.tokenBytesConverter (cognitive 18) · ×1
  • tokenizer.tokenBytesConverter (cognitive 18) packages/transformers-structured-output/src/engine/tokenizer.ts:112 — tokenizer.tokenBytesConverter has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, ternaries 2 (3 pts) (nesting depth added 3). Most of this is not in the body itself: 7 of the 18 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 140, 119). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · tensor.cat (cognitive 18) · ×1
  • tensor.cat (cognitive 18) packages/transformers/src/utils/tensor.js:1396 — tensor.cat has cognitive complexity 18 (threshold 15). Drivers by points: loops 4 (11 pts), if/else 3 (7 pts) (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · image_processing_gemma4.patchify (cognitive 18) · ×1
  • image_processing_gemma4.patchify (cognitive 18) packages/transformers/src/models/gemma4/image_processing_gemma4.js:60 — image_processing_gemma4.patchify has cognitive complexity 18 (threshold 15). Drivers by points: loops 7 (18 pts) (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · Qwen2VLForConditionalGeneration._get_multimodal_rope_positions (cognitive 18) · ×1
  • Qwen2VLForConditionalGeneration._get_multimodal_rope_positions (cognitive 18) packages/transformers/src/models/qwen2_vl/modeling_qwen2_vl.js:108 — Qwen2VLForConditionalGeneration._get_multimodal_rope_positions has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 4 (5 pts), boolean chains 4, loops 1 (nesting depth added 5). Of this number, 15 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PretrainedMixin.from_pretrained (cognitive 18) · ×1
  • PretrainedMixin.from_pretrained (cognitive 18) packages/transformers/src/models/auto/modeling_auto.js:79 — PretrainedMixin.from_pretrained has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TokenClassificationPipeline._call (cognitive 18) · ×1
  • TokenClassificationPipeline._call (cognitive 18) packages/transformers/src/pipelines/token-classification.js:117 — TokenClassificationPipeline._call has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (7 pts), ternaries 4 (7 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · from_pretrained (cognitive 18) · ×1
  • from_pretrained (cognitive 18) packages/transformers/src/models/modeling_utils.js:274 — from_pretrained has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), other 3, ternaries 1 (3 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 6). Of this number, 11 points are the body's own statements and 7 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · scan.splitTopLevel (cognitive 17) · ×1
  • scan.splitTopLevel (cognitive 17) packages/transformers/docs/scripts/lib/scan.mjs:93 — scan.splitTopLevel has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 4, loops 1, ternaries 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · render-api.renderModule (cognitive 17) · ×1
  • render-api.renderModule (cognitive 17) packages/transformers/docs/scripts/lib/render-api.mjs:35 — render-api.renderModule has cognitive complexity 17 (threshold 15). Drivers by points: loops 5 (9 pts), if/else 7 (8 pts) (nesting depth added 5). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · Random.seed (cognitive 17) · ×1
  • Random.seed (cognitive 17) packages/transformers/src/utils/random.js:66 — Random.seed has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 4, boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · json.transition (cognitive 16) · ×1
  • json.transition (cognitive 16) packages/transformers-structured-output/src/engine/json.ts:259 — json.transition has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 2 (4 pts), boolean chains 3, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RegexParser.characterClass (cognitive 16) · ×1
  • RegexParser.characterClass (cognitive 16) packages/transformers-structured-output/src/engine/regex.ts:103 — RegexParser.characterClass has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · maths.dynamic_time_warping (cognitive 16) · ×1
  • maths.dynamic_time_warping (cognitive 16) packages/transformers/src/utils/maths.js:971 — maths.dynamic_time_warping has cognitive complexity 16 (threshold 15). Drivers by points: loops 5 (6 pts), if/else 3 (5 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PreTrainedTokenizer.get_chat_template (cognitive 16) · ×1
  • PreTrainedTokenizer.get_chat_template (cognitive 16) REDACTED:662 — PreTrainedTokenizer.get_chat_template has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WhisperTimeStampLogitsProcessor._call (cognitive 16) · ×1
  • WhisperTimeStampLogitsProcessor._call (cognitive 16) packages/transformers/src/generation/logits_process.js:305 — WhisperTimeStampLogitsProcessor._call has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NoBadWordsLogitsProcessor._call (cognitive 16) · ×1
  • NoBadWordsLogitsProcessor._call (cognitive 16) packages/transformers/src/generation/logits_process.js:588 — NoBadWordsLogitsProcessor._call has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 3 (6 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · image_processing_lfm2_vl.get_target_ratios (cognitive 16) · ×1
  • image_processing_lfm2_vl.get_target_ratios (cognitive 16) packages/transformers/src/models/lfm2_vl/image_processing_lfm2_vl.js:49 — image_processing_lfm2_vl.get_target_ratios has cognitive complexity 16 (threshold 15). Drivers by points: if/else 2 (9 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · constructor (cognitive 16) · ×1
  • constructor (cognitive 16) packages/transformers/src/image_processors_utils.js:577 — constructor has cognitive complexity 16 (threshold 15). Drivers by points: other 10, boolean chains 5, if/else 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · load_video (cognitive 16) · ×1
  • load_video (cognitive 16) packages/transformers/src/utils/video.js:82 — load_video has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, ternaries 2 (4 pts), loops 2, boolean chains 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D3 · God Classes · FunctionTooLong · ×1
  • FunctionTooLong: configs.getNormalizedConfig packages/transformers/src/configs.js:59 — FunctionTooLong — getNormalizedConfig runs 255 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 155 over it, 2.55× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D3 · God Classes · TooManyMethods · ×1
  • TooManyMethods: Tensor packages/transformers/src/utils/tensor.js:36 — TooManyMethods — 53 methods. The bar is 30 methods; this is 23 over it, 1.77× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D30 · Dependency Vulnerabilities · Medium CVE · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D8 · Code Coverage · Coverage not measured · ×1
  • Coverage not measured — JavaScript/TypeScript suite — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — the jest suite in packages/transformers/ ran and not one test passed (FAIL tests/utils/maths.test.js), so the coverage would describe the failed run, not the code. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan. Alternatively, commit the lcov/Cobertura report your CI produces and it is read without a re-run.
P4 · Deployment & Rollback · No deployment automation · ×1
  • No deployment automation — No release automation was found in CI — neither a deploy stage (Helm/Kubernetes/compose manifests, an orchestrated rollout) nor a publish job that ships the built artifact. Releases appear to be run by hand, which is slower, less repeatable and harder to reverse.
R10 · Code Duplication · Duplication concentrated across 66 sibling directories (63 clone groups) · ×1
  • Duplication concentrated across 66 sibling directories (63 clone groups) packages/transformers/src/models/dac/modeling_dac.js:6 — 63 duplicated blocks under packages/transformers/src/models/ have copies in at least two of the sibling directories albert, audio_spectrogram_transformer, bart, bert, camembert, chatterbox (+60 more sibling(s) not listed) — 26 of them are reported below, and 37 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 63 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 63 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 63 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplicated block (33 lines × 2 locations) · ×1
  • Duplicated block (33 lines × 2 locations) packages/transformers/src/models/dac/modeling_dac.js:6 — packages/transformers/src/models/dac/modeling_dac.js:6 · packages/transformers/src/models/mimi/modeling_mimi.js:6 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
R10 · Code Duplication · Duplicated block (31 lines × 2 locations) · ×1
  • Duplicated block (31 lines × 2 locations) packages/transformers/src/models/auto/modeling_auto.js:75 — packages/transformers/src/models/auto/modeling_auto.js:75 · packages/transformers/src/models/modeling_utils.js:256 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (26 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (26 matched lines × 2 locations) packages/transformers/src/utils/model_registry/clear_cache.js:48 — packages/transformers/src/utils/model_registry/clear_cache.js:48 · packages/transformers/src/utils/model_registry/is_cached.js:32 — the two spans are one implementation copied and then locally edited — 170 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (25 lines × 2 locations) · ×1
  • Duplicated block (25 lines × 2 locations) packages/transformers/src/utils/maths.js:460 — packages/transformers/src/utils/maths.js:460 · packages/transformers/src/utils/maths.js:634 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (21 lines × 2 locations) · ×1
  • Duplicated block (21 lines × 2 locations) packages/transformers/src/models/idefics3/image_processing_idefics3.js:178 — packages/transformers/src/models/idefics3/image_processing_idefics3.js:178 · packages/transformers/src/models/phi3_v/image_processing_phi3_v.js:109 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (20 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (20 matched lines × 2 locations) packages/transformers/src/pipelines/audio-classification.js:71 — packages/transformers/src/pipelines/audio-classification.js:71 · packages/transformers/src/pipelines/image-classification.js:84 — the two spans are one implementation copied and then locally edited — 161 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (19 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (19 matched lines × 2 locations) packages/transformers/src/generation/logits_process.js:516 — packages/transformers/src/generation/logits_process.js:516 · packages/transformers/src/generation/logits_process.js:555 — the two spans are one implementation copied and then locally edited — 108 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (18 lines × 3 locations) · ×1
  • Duplicated block (18 lines × 3 locations) packages/transformers/src/models/audio_spectrogram_transformer/feature_extraction_audio_spectrogram_transformer.js:5 — packages/transformers/src/models/audio_spectrogram_transformer/feature_extraction_audio_spectrogram_transformer.js:5 · packages/transformers/src/models/seamless_m4t/feature_extraction_seamless_m4t.js:5 · packages/transformers/src/models/wespeaker/feature_extraction_wespeaker.js:5 — the 3 copies are spread across 3 files, and each CITED SPAN is a SPECIALISATION DECLARATION — a type whose `extends` clause names a base and whose body hands that base its own values through `super(…)`. The shared module this dimension usually asks you to extract already exists: it is that base, every one of these sites already reaches it, and the `super(…)` call this row matched on is where each site passes its differences in. So do not read this as an extract-a-helper row — there is no missing helper, and what is left at each site is the declaration of one distinct specialisation, which cannot be deleted without deleting the thing it declares. Read what actually differs between the spans, because two different answers follow. Where the sites differ only in the values they hand the base — a type argument, a service, an alias, a cache — the repetition is a TEMPLATE, and the only moves that collapse it are to generate these declarations from the set they enumerate or to replace the repeated construction with one factory each site calls with its own values; where that set is the point, each site pinning one distinct thing, the repetition IS the enumeration and there is nothing to remove. Where instead a span carries logic OUTSIDE the delegation that is the same at every site, that logic is the part to move, and its home is the base type rather than a new module. Reported because the copies still drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (18 lines × 2 locations) · ×1
  • Duplicated block (18 lines × 2 locations) packages/transformers/src/utils/image.js:248 — packages/transformers/src/utils/image.js:248 · packages/transformers/src/utils/image.js:280 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (17 lines × 2 locations) · ×1
  • Duplicated block (17 lines × 2 locations) packages/transformers/src/models/seamless_m4t/feature_extraction_seamless_m4t.js:33 — packages/transformers/src/models/seamless_m4t/feature_extraction_seamless_m4t.js:33 · packages/transformers/src/models/wespeaker/feature_extraction_wespeaker.js:33 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (16 lines × 8 locations) · ×1
  • Duplicated block (16 lines × 8 locations) packages/transformers/src/models/clap/modeling_clap.js:5 — packages/transformers/src/models/clap/modeling_clap.js:5 · packages/transformers/src/models/clip/modeling_clip.js:48 · packages/transformers/src/models/clip/modeling_clip.js:99 · packages/transformers/src/models/dac/modeling_dac.js:55 · +4 more site(s) not listed — the 8 copies are spread across 7 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (15 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (15 matched lines × 2 locations) packages/transformers/src/image_processors_utils.js:1051 — packages/transformers/src/image_processors_utils.js:1051 · packages/transformers/src/models/vitmatte/image_processing_vitmatte.js:13 — the two spans are one implementation copied and then locally edited — 99 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (14 lines × 3 locations) · ×1
  • Duplicated block (14 lines × 3 locations) packages/transformers/src/models/dac/modeling_dac.js:6 — packages/transformers/src/models/dac/modeling_dac.js:6 · packages/transformers/src/models/mimi/modeling_mimi.js:6 · packages/transformers/src/models/modeling_outputs.js:49 — the 3 copies are spread across 3 files, and each CITED SPAN is a SPECIALISATION DECLARATION — a type whose `extends` clause names a base and whose body hands that base its own values through `super(…)`. The shared module this dimension usually asks you to extract already exists: it is that base, every one of these sites already reaches it, and the `super(…)` call this row matched on is where each site passes its differences in. So do not read this as an extract-a-helper row — there is no missing helper, and what is left at each site is the declaration of one distinct specialisation, which cannot be deleted without deleting the thing it declares. Read what actually differs between the spans, because two different answers follow. Where the sites differ only in the values they hand the base — a type argument, a service, an alias, a cache — the repetition is a TEMPLATE, and the only moves that collapse it are to generate these declarations from the set they enumerate or to replace the repeated construction with one factory each site calls with its own values; where that set is the point, each site pinning one distinct thing, the repetition IS the enumeration and there is nothing to remove. Where instead a span carries logic OUTSIDE the delegation that is the same at every site, that logic is the part to move, and its home is the base type rather than a new module. Reported because the copies still drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block with local edits (14 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (14 matched lines × 2 locations) packages/transformers/src/models/encodec/feature_extraction_encodec.js:10 — packages/transformers/src/models/encodec/feature_extraction_encodec.js:10 · packages/transformers/src/models/wav2vec2/feature_extraction_wav2vec2.js:22 — the two spans are one implementation copied and then locally edited — 56 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (13 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (13 matched lines × 2 locations) packages/transformers/src/configs.js:520 — packages/transformers/src/configs.js:520 · REDACTED:310 — the two spans are one implementation copied and then locally edited — 52 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (13 lines × 3 locations) · ×1
  • Duplicated block (13 lines × 3 locations) packages/transformers/src/generation/logits_process.js:166 — packages/transformers/src/generation/logits_process.js:166 · packages/transformers/src/generation/logits_process.js:486 · packages/transformers/src/generation/logits_process.js:561 — all 3 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (13 lines × 6 locations) · ×1
  • Duplicated block (13 lines × 6 locations) packages/transformers/src/ops/registry.js:49 — packages/transformers/src/ops/registry.js:49 · packages/transformers/src/ops/registry.js:66 · packages/transformers/src/ops/registry.js:84 · packages/transformers/src/ops/registry.js:99 · +2 more site(s) not listed — all 6 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (12 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (12 matched lines × 2 locations) packages/transformers/src/models/modeling_utils.js:335 — packages/transformers/src/models/modeling_utils.js:335 · packages/transformers/src/pipelines.js:147 — the two spans are one implementation copied and then locally edited — 75 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (11 lines × 3 locations) · ×1
  • Duplicated block (11 lines × 3 locations) packages/transformers/src/models/sam/modeling_sam.js:4 — packages/transformers/src/models/sam/modeling_sam.js:4 · packages/transformers/src/models/vits/modeling_vits.js:1 · packages/transformers/src/models/wavlm/modeling_wavlm.js:2 — the 3 copies are spread across 3 files, and each CITED SPAN is a SPECIALISATION DECLARATION — a type whose `extends` clause names a base and whose body hands that base its own values through `super(…)`. The shared module this dimension usually asks you to extract already exists: it is that base, every one of these sites already reaches it, and the `super(…)` call this row matched on is where each site passes its differences in. So do not read this as an extract-a-helper row — there is no missing helper, and what is left at each site is the declaration of one distinct specialisation, which cannot be deleted without deleting the thing it declares. Read what actually differs between the spans, because two different answers follow. Where the sites differ only in the values they hand the base — a type argument, a service, an alias, a cache — the repetition is a TEMPLATE, and the only moves that collapse it are to generate these declarations from the set they enumerate or to replace the repeated construction with one factory each site calls with its own values; where that set is the point, each site pinning one distinct thing, the repetition IS the enumeration and there is nothing to remove. Where instead a span carries logic OUTSIDE the delegation that is the same at every site, that logic is the part to move, and its home is the base type rather than a new module. Reported because the copies still drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (10 lines × 27 locations) · ×1
  • Duplicated block (10 lines × 27 locations) packages/transformers/src/models/albert/modeling_albert.js:2 — packages/transformers/src/models/albert/modeling_albert.js:2 · packages/transformers/src/models/bert/modeling_bert.js:7 · packages/transformers/src/models/camembert/modeling_camembert.js:7 · packages/transformers/src/models/convbert/modeling_convbert.js:7 · +23 more site(s) not listed — the 27 copies are spread across 27 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (10 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (10 matched lines × 2 locations) packages/transformers/src/models/ultravox/processing_ultravox.js:8 — packages/transformers/src/models/ultravox/processing_ultravox.js:8 · packages/transformers/src/models/voxtral/processing_voxtral.js:27 — the two spans are one implementation copied and then locally edited — 60 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (10 lines × 2 locations) · ×1
  • Duplicated block (10 lines × 2 locations) packages/transformers/src/models/whisper/tokenization_whisper.js:193 — packages/transformers/src/models/whisper/tokenization_whisper.js:193 · packages/transformers/src/models/whisper/tokenization_whisper.js:291 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (10 lines × 5 locations) · ×1
  • Duplicated block (10 lines × 5 locations) packages/transformers/src/utils/tensor.js:223 — packages/transformers/src/utils/tensor.js:223 · packages/transformers/src/utils/tensor.js:247 · packages/transformers/src/utils/tensor.js:269 · packages/transformers/src/utils/tensor.js:291 · +1 more site(s) not listed — all 5 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (9 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (9 matched lines × 2 locations) packages/transformers-structured-output/scripts/dev.mjs:9 — packages/transformers-structured-output/scripts/dev.mjs:9 · scripts/rebuildPlugin.mjs:14 — the two spans are one implementation copied and then locally edited — 60 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R2 · Cyclomatic Complexity · Complex function getNormalizedConfig (cyclomatic 120, cognitive 7) · ×1
  • Complex function getNormalizedConfig (cyclomatic 120, cognitive 7) packages/transformers/src/configs.js:59 — getNormalizedConfig has cyclomatic complexity 120 and cognitive complexity 7; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function checkSchema (cyclomatic 64, cognitive 71) · ×1
  • Complex function checkSchema (cyclomatic 64, cognitive 71) packages/transformers-structured-output/src/engine/json.ts:1568 — checkSchema has cyclomatic complexity 64 and cognitive complexity 71; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function _decode_asr (cyclomatic 52, cognitive 151) · ×1
  • Complex function _decode_asr (cyclomatic 52, cognitive 151) packages/transformers/src/models/whisper/tokenization_whisper.js:29 — _decode_asr has cyclomatic complexity 52 and cognitive complexity 151; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function spectrogram (cyclomatic 48, cognitive 75) · ×1
  • Complex function spectrogram (cyclomatic 48, cognitive 75) packages/transformers/src/utils/audio.js:484 — spectrogram has cyclomatic complexity 48 and cognitive complexity 75; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function loadResourceFile (cyclomatic 43, cognitive 75) · ×1
  • Complex function loadResourceFile (cyclomatic 43, cognitive 75) packages/transformers/src/utils/hub.js:265 — loadResourceFile has cyclomatic complexity 43 and cognitive complexity 75; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function validateObjectNode (cyclomatic 40, cognitive 59) · ×1
  • Complex function validateObjectNode (cyclomatic 40, cognitive 59) packages/transformers-structured-output/src/engine/json.ts:1083 — validateObjectNode has cyclomatic complexity 40 and cognitive complexity 59; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function getCacheNames (cyclomatic 37, cognitive 61) · ×1
  • Complex function getCacheNames (cyclomatic 37, cognitive 61) packages/transformers/src/configs.js:344 — getCacheNames has cyclomatic complexity 37 and cognitive complexity 61; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function validateNode (cyclomatic 36, cognitive 42) · ×1
  • Complex function validateNode (cyclomatic 36, cognitive 42) packages/transformers-structured-output/src/engine/json.ts:984 — validateNode has cyclomatic complexity 36 and cognitive complexity 42; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function _call (cyclomatic 32, cognitive 59) · ×1
  • Complex function _call (cyclomatic 32, cognitive 59) REDACTED:376 — _call has cyclomatic complexity 32 and cognitive complexity 59; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function _get_file_metadata (cyclomatic 29, cognitive 53) · ×1
  • Complex function _get_file_metadata (cyclomatic 29, cognitive 53) packages/transformers/src/utils/model_registry/get_file_metadata.js:59 — _get_file_metadata has cyclomatic complexity 29 and cognitive complexity 53; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function transition (cyclomatic 29, cognitive 16) · ×1
  • Complex function transition (cyclomatic 29, cognitive 16) packages/transformers-structured-output/src/engine/json.ts:259 — transition has cyclomatic complexity 29 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function extractTokenizer (cyclomatic 26, cognitive 44) · ×1
  • Complex function extractTokenizer (cyclomatic 26, cognitive 44) packages/transformers-structured-output/src/engine/tokenizer.ts:14 — extractTokenizer has cyclomatic complexity 26 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function preprocess (cyclomatic 26, cognitive 36) · ×1
  • Complex function preprocess (cyclomatic 26, cognitive 36) packages/transformers/src/image_processors_utils.js:921 — preprocess has cyclomatic complexity 26 and cognitive complexity 36; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function _get_logits_processor (cyclomatic 26, cognitive 27) · ×1
  • Complex function _get_logits_processor (cyclomatic 26, cognitive 27) packages/transformers/src/models/modeling_utils.js:404 — _get_logits_processor has cyclomatic complexity 26 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function formatMatches (cyclomatic 25, cognitive 13) · ×1
  • Complex function formatMatches (cyclomatic 25, cognitive 13) packages/transformers-structured-output/src/engine/json.ts:1392 — formatMatches has cyclomatic complexity 25 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function _generate_with_seek (cyclomatic 24, cognitive 48) · ×1
  • Complex function _generate_with_seek (cyclomatic 24, cognitive 48) packages/transformers/src/models/whisper/modeling_whisper.js:195 — _generate_with_seek has cyclomatic complexity 24 and cognitive complexity 48; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function _call (cyclomatic 24, cognitive 44) · ×1
  • Complex function _call (cyclomatic 24, cognitive 44) packages/transformers/src/pipelines/image-segmentation.js:68 — _call has cyclomatic complexity 24 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function generate (cyclomatic 23, cognitive 39) · ×1
  • Complex function generate (cyclomatic 23, cognitive 39) packages/transformers/src/models/modeling_utils.js:845 — generate has cyclomatic complexity 23 and cognitive complexity 39; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function validateArrayNode (cyclomatic 23, cognitive 31) · ×1
  • Complex function validateArrayNode (cyclomatic 23, cognitive 31) packages/transformers-structured-output/src/engine/json.ts:1052 — validateArrayNode has cyclomatic complexity 23 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function getSession (cyclomatic 23, cognitive 23) · ×1
  • Complex function getSession (cyclomatic 23, cognitive 23) packages/transformers/src/models/session.js:26 — getSession has cyclomatic complexity 23 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R7 · Dead Code · Dead file (~42 LoC) · ×1
  • Dead file (~42 LoC) scripts/rebuildPlugin.mjs — no import path from any entry point (51 application, 4 tooling, 188 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~21 LoC) · ×1
  • Dead file (~21 LoC) scripts/reportSize.mjs — no import path from any entry point (51 application, 4 tooling, 188 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Minor — 11 finding(s)
D26 · Project Cohesion · Split packages/transformers · ×1
  • Split packages/transformers — A generic catch-all name that is huge (34k LoC) and sprawls across 232 namespaces. Suggested:
D30 · Dependency Vulnerabilities · Low CVE · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
M4 · Documentation accuracy · README/code drift · ×1
  • README/code drift — README advertises Salesforce integration, but no Salesforce code/dependency exists — searched for: `salesforce`, `sfdx`, `apex`. Each was matched case- and separator-insensitively against file and directory NAMES anywhere in the tree, and against the CONTENTS of manifest files (package.json, *.csproj, *.props, *.slnx, *.yml, Dockerfile); the README's own prose never counts, so a claim is never refuted by merely being made. Nothing outside that search was read — a footprint living only in a submodule, in a file type not listed here, or under a name none of those terms matches is not seen, and this row is then wrong.
P3 · Security & performance tooling · No SAST · ×1
  • No SAST — No static application security testing detected. For this repository's stack, add CodeQL's javascript-typescript pack, `semgrep --config=p/typescript`, or eslint-plugin-security as a CI step. What was searched, so you can tell an absence from a miss: the 4989 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
P6 · Release Hygiene · No changelog · ×1
  • No changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
X10 · Duplicated predicate · Duplicated predicate · ×1
  • Duplicated predicate packages/transformers-structured-output/src/engine/json.ts:1852 — `value !== null && typeof value === 'object' && !Array.isArray(value)` appears character-identically in 2 files — packages/transformers-structured-output/src/engine/json.ts, packages/transformers-structured-output/src/engine/tokenizer.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
X6 · Hand-rolled structured-format parsing · Hand-rolled JSON/XML parsing via regex · ×1
  • Hand-rolled JSON/XML parsing via regex packages/transformers/docs/scripts/lib/validate.mjs:199 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Minor — 1 finding(s)
D12 · Dependency Hygiene · Outdated (npm) · ×1
  • Outdated (npm): sharp — sharp is pinned at 0.35.4; registry.npmjs.org publishes 0.35.5 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.

Appendix B — Reproduction & audit trail

Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-12dff38789cd484286898c635329f656/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-12dff38789cd484286898c635329f656/tree.json --exit-code 0 --source .0artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/watchdog-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off .8artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** . --skip-db-update10artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.0—
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.0—
D37 · Vulnerability-disclosure Policydisclosure—disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** . --skip-db-update0artifacts/raw/trivy-fs.json

Run 01a0f95c-807b-7e51-a4c8-fd01f235f500 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

Downloadable artifacts

Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.

⬇ Findings, MITRE CWE-tagged .sarif⬇ Health changelog .md