Public report of huggingface/transformers.js, published 15 November 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.4). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 15 November 2026, 04:41 UTC · Survey ID cd_6edc2a1b87e648d7bb0bc8cb3366f1c4
huggingface/transformers.js
Measured 15 November 2026, 04:40 UTC, at code version 205e9c2
Code coverage is not measured: JavaScript/TypeScript suite (CouldNotMeasureTestRunFailed).
CAI scoreAdequate
CriticalWeakAdequateStrongExemplary
Down 1 since the last survey
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A medium codebase: 37,684 lines of product code in 3 projects, tests not counted · Estimated rebuild effort: about 0.4 person-years · Weakest lens: Production Readiness, 49
Findings by how serious they are
32 critical273 serious80 minor
8 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Canine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
15 November 2026, 04:40 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that
implements it, and today the Canine Code Analyzer is the only one that does.
The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
64of 64 dimensions measured by tools.
369of 385 findings point to an exact file and line, so you can open each one in the code. The other 16 concern the repository as a whole, such as missing documentation.
64dimensions across 6 lenses, read from 37,684 lines of product code in 3 projects.
huggingface/transformers.js falls short of our standard for production, in part because it has packages under a licence on your banned list. It scores 54 out of 100 and is rated Adequate, and 12 of its 32 critical findings are security problems.
Production Readiness, at 49, is the weakest lens and counts most in the score. The best first step is replacing the 14 packages under a banned licence, worth about 5 points. Automating the release comes next, worth about 3 points. Raising Production Readiness to 70 would lift the score to about 58.
Fourteen packages carry licence risk. Nine known security holes in the packages the code depends on can be used by attackers, and two weaknesses in the code could be used by an attacker. Replacing or clearing the banned-licence packages, updating the vulnerable packages and fixing the weaknesses the scanner points to would close these risks. Setting a waiting period for automatic updates would fix the automatic dependency update that takes a new release at once. The four loops of files that import each other need breaking.
The product code is 37,684 lines, about €61,000 to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
We compare every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.
Fixed since the last survey: 51 findings
These 51 critical or serious findings were in the previous survey, on 29 October 2026, and are gone from this one.
€20,000 to €100,000, for 339 to 1,077 hours of work, about 0.4 person-years for one engineer
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.8 at a score of 54. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Medium: 37,684 lines of product code
What it is not
Not a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.
How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Resolve the 14 Banned license finding(s) in License Compliance — start with REDACTED (14).
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.
Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.
Where the investment is most exposed · Value at risk
This code would cost about €61,000 to build again, about 0.4 person-years of work. Its weakest lens is Production Readiness, at 49 (Weak). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Resolve the 14 Banned license finding(s) in License Compliance. Of all the actions in this report, it raises the score most for the work it takes: about 5 points for medium effort, because it clears the 14 License Compliance findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.0 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 5% to 11% on every change. The history of the code shows how much it changes: about 11,642 lines over the last 90 days, which is about 47,215 lines a year. At that pace, the extra work comes to an estimated 5.9 to 35.4 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.
Architecture: which parts of the code depend on which
The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.
445 modules, with 388 dependencies between them. Every module uses only modules listed above it, so there are no loops.
The table shows the 40 modules with the most connections; 405 more are left out to keep it readable.
Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
transformers-structured-output.src.engine uses transformers-structured-output.src.engine.constraint, so a change to transformers-structured-output.src.engine.constraint can break transformers-structured-output.src.engine, while a change to transformers-structured-output.src.engine can't break transformers-structured-output.src.engine.constraint.
Position
Below the diagonal: transformers-structured-output.src.engine uses a module listed above it, which is the healthy direction.
transformers-structured-output.src.engine uses transformers-structured-output.src.engine.types, so a change to transformers-structured-output.src.engine.types can break transformers-structured-output.src.engine, while a change to transformers-structured-output.src.engine can't break transformers-structured-output.src.engine.types.
Position
Below the diagonal: transformers-structured-output.src.engine uses a module listed above it, which is the healthy direction.
transformers.src.feature_extraction_utils uses transformers.src.utils.generic, so a change to transformers.src.utils.generic can break transformers.src.feature_extraction_utils, while a change to transformers.src.feature_extraction_utils can't break transformers.src.utils.generic.
Position
Below the diagonal: transformers.src.feature_extraction_utils uses a module listed above it, which is the healthy direction.
transformers.src.generation.logits_process uses transformers.src.utils.generic, so a change to transformers.src.utils.generic can break transformers.src.generation.logits_process, while a change to transformers.src.generation.logits_process can't break transformers.src.utils.generic.
Position
Below the diagonal: transformers.src.generation.logits_process uses a module listed above it, which is the healthy direction.
transformers.src.generation.stopping_criteria uses transformers.src.utils.generic, so a change to transformers.src.utils.generic can break transformers.src.generation.stopping_criteria, while a change to transformers.src.generation.stopping_criteria can't break transformers.src.utils.generic.
Position
Below the diagonal: transformers.src.generation.stopping_criteria uses a module listed above it, which is the healthy direction.
transformers.src.image_processors_utils uses transformers.src.utils.generic, so a change to transformers.src.utils.generic can break transformers.src.image_processors_utils, while a change to transformers.src.image_processors_utils can't break transformers.src.utils.generic.
Position
Below the diagonal: transformers.src.image_processors_utils uses a module listed above it, which is the healthy direction.
transformers.src.models.mbart.tokenization_mbart uses transformers.src.tokenization_utils, so a change to transformers.src.tokenization_utils can break transformers.src.models.mbart.tokenization_mbart, while a change to transformers.src.models.mbart.tokenization_mbart can't break transformers.src.tokenization_utils.
Position
Below the diagonal: transformers.src.models.mbart.tokenization_mbart uses a module listed above it, which is the healthy direction.
transformers.src.models.modeling_utils uses transformers.src.utils.generic, so a change to transformers.src.utils.generic can break transformers.src.models.modeling_utils, while a change to transformers.src.models.modeling_utils can't break transformers.src.utils.generic.
Position
Below the diagonal: transformers.src.models.modeling_utils uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in transformers.src.models.qwen3_vl.modeling_qwen3_vl uses a type in transformers.src.models.qwen2_5_vl.modeling_qwen2_5_vl.
transformers.src.models.qwen3_vl.modeling_qwen3_vl uses transformers.src.models.qwen2_5_vl.modeling_qwen2_5_vl, so a change to transformers.src.models.qwen2_5_vl.modeling_qwen2_5_vl can break transformers.src.models.qwen3_vl.modeling_qwen3_vl, while a change to transformers.src.models.qwen3_vl.modeling_qwen3_vl can't break transformers.src.models.qwen2_5_vl.modeling_qwen2_5_vl.
Position
Below the diagonal: transformers.src.models.qwen3_vl.modeling_qwen3_vl uses a module listed above it, which is the healthy direction.
transformers.src.processing_utils uses transformers.src.utils.generic, so a change to transformers.src.utils.generic can break transformers.src.processing_utils, while a change to transformers.src.processing_utils can't break transformers.src.utils.generic.
Position
Below the diagonal: transformers.src.processing_utils uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in transformers-structured-output.src.StructuredOutputProcessor uses a type in transformers-structured-output.src.engine.constraint.
transformers-structured-output.src.StructuredOutputProcessor uses transformers-structured-output.src.engine.constraint, so a change to transformers-structured-output.src.engine.constraint can break transformers-structured-output.src.StructuredOutputProcessor, while a change to transformers-structured-output.src.StructuredOutputProcessor can't break transformers-structured-output.src.engine.constraint.
Position
Below the diagonal: transformers-structured-output.src.StructuredOutputProcessor uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in transformers-structured-output.src.StructuredOutputProcessor uses a type in transformers-structured-output.src.engine.types.
transformers-structured-output.src.StructuredOutputProcessor uses transformers-structured-output.src.engine.types, so a change to transformers-structured-output.src.engine.types can break transformers-structured-output.src.StructuredOutputProcessor, while a change to transformers-structured-output.src.StructuredOutputProcessor can't break transformers-structured-output.src.engine.types.
Position
Below the diagonal: transformers-structured-output.src.StructuredOutputProcessor uses a module listed above it, which is the healthy direction.
transformers-structured-output.src.StructuredOutputProcessor uses transformers.src.utils.tensor, so a change to transformers.src.utils.tensor can break transformers-structured-output.src.StructuredOutputProcessor, while a change to transformers-structured-output.src.StructuredOutputProcessor can't break transformers.src.utils.tensor.
Position
Below the diagonal: transformers-structured-output.src.StructuredOutputProcessor uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in transformers-structured-output.src.StructuredOutputProcessor uses a type in transformers.src.generation.logits_process.
transformers-structured-output.src.StructuredOutputProcessor uses transformers.src.generation.logits_process, so a change to transformers.src.generation.logits_process can break transformers-structured-output.src.StructuredOutputProcessor, while a change to transformers-structured-output.src.StructuredOutputProcessor can't break transformers.src.generation.logits_process.
Position
Below the diagonal: transformers-structured-output.src.StructuredOutputProcessor uses a module listed above it, which is the healthy direction.
transformers.src.models.clip.modeling_clip uses transformers.src.models.modeling_utils, so a change to transformers.src.models.modeling_utils can break transformers.src.models.clip.modeling_clip, while a change to transformers.src.models.clip.modeling_clip can't break transformers.src.models.modeling_utils.
Position
Below the diagonal: transformers.src.models.clip.modeling_clip uses a module listed above it, which is the healthy direction.
transformers.src.models.dac.modeling_dac uses transformers.src.models.modeling_outputs, so a change to transformers.src.models.modeling_outputs can break transformers.src.models.dac.modeling_dac, while a change to transformers.src.models.dac.modeling_dac can't break transformers.src.models.modeling_outputs.
Position
Below the diagonal: transformers.src.models.dac.modeling_dac uses a module listed above it, which is the healthy direction.
transformers.src.models.dac.modeling_dac uses transformers.src.models.modeling_utils, so a change to transformers.src.models.modeling_utils can break transformers.src.models.dac.modeling_dac, while a change to transformers.src.models.dac.modeling_dac can't break transformers.src.models.modeling_utils.
Position
Below the diagonal: transformers.src.models.dac.modeling_dac uses a module listed above it, which is the healthy direction.
transformers.src.models.detr.modeling_detr uses transformers.src.models.modeling_outputs, so a change to transformers.src.models.modeling_outputs can break transformers.src.models.detr.modeling_detr, while a change to transformers.src.models.detr.modeling_detr can't break transformers.src.models.modeling_outputs.
Position
Below the diagonal: transformers.src.models.detr.modeling_detr uses a module listed above it, which is the healthy direction.
transformers.src.models.detr.modeling_detr uses transformers.src.models.modeling_utils, so a change to transformers.src.models.modeling_utils can break transformers.src.models.detr.modeling_detr, while a change to transformers.src.models.detr.modeling_detr can't break transformers.src.models.modeling_utils.
Position
Below the diagonal: transformers.src.models.detr.modeling_detr uses a module listed above it, which is the healthy direction.
transformers.src.models.donut.image_processing_donut uses transformers.src.image_processors_utils, so a change to transformers.src.image_processors_utils can break transformers.src.models.donut.image_processing_donut, while a change to transformers.src.models.donut.image_processing_donut can't break transformers.src.image_processors_utils.
Position
Below the diagonal: transformers.src.models.donut.image_processing_donut uses a module listed above it, which is the healthy direction.
transformers.src.models.encodec.feature_extraction_encodec uses transformers.src.feature_extraction_utils, so a change to transformers.src.feature_extraction_utils can break transformers.src.models.encodec.feature_extraction_encodec, while a change to transformers.src.models.encodec.feature_extraction_encodec can't break transformers.src.feature_extraction_utils.
Position
Below the diagonal: transformers.src.models.encodec.feature_extraction_encodec uses a module listed above it, which is the healthy direction.
transformers.src.models.gemma3n.feature_extraction_gemma3n uses transformers.src.feature_extraction_utils, so a change to transformers.src.feature_extraction_utils can break transformers.src.models.gemma3n.feature_extraction_gemma3n, while a change to transformers.src.models.gemma3n.feature_extraction_gemma3n can't break transformers.src.feature_extraction_utils.
Position
Below the diagonal: transformers.src.models.gemma3n.feature_extraction_gemma3n uses a module listed above it, which is the healthy direction.
transformers.src.models.gemma3n.modeling_gemma3n uses transformers.src.models.modeling_utils, so a change to transformers.src.models.modeling_utils can break transformers.src.models.gemma3n.modeling_gemma3n, while a change to transformers.src.models.gemma3n.modeling_gemma3n can't break transformers.src.models.modeling_utils.
Position
Below the diagonal: transformers.src.models.gemma3n.modeling_gemma3n uses a module listed above it, which is the healthy direction.
transformers.src.models.gemma4.processing_gemma4 uses transformers.src.processing_utils, so a change to transformers.src.processing_utils can break transformers.src.models.gemma4.processing_gemma4, while a change to transformers.src.models.gemma4.processing_gemma4 can't break transformers.src.processing_utils.
Position
Below the diagonal: transformers.src.models.gemma4.processing_gemma4 uses a module listed above it, which is the healthy direction.
transformers.src.models.hubert.modeling_hubert uses transformers.src.models.modeling_utils, so a change to transformers.src.models.modeling_utils can break transformers.src.models.hubert.modeling_hubert, while a change to transformers.src.models.hubert.modeling_hubert can't break transformers.src.models.modeling_utils.
Position
Below the diagonal: transformers.src.models.hubert.modeling_hubert uses a module listed above it, which is the healthy direction.
transformers.src.models.llava.modeling_llava uses transformers.src.models.modeling_utils, so a change to transformers.src.models.modeling_utils can break transformers.src.models.llava.modeling_llava, while a change to transformers.src.models.llava.modeling_llava can't break transformers.src.models.modeling_utils.
Position
Below the diagonal: transformers.src.models.llava.modeling_llava uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in transformers.src.models.maskformer.image_processing_maskformer uses a type in transformers.src.image_processors_utils.
transformers.src.models.maskformer.image_processing_maskformer uses transformers.src.image_processors_utils, so a change to transformers.src.image_processors_utils can break transformers.src.models.maskformer.image_processing_maskformer, while a change to transformers.src.models.maskformer.image_processing_maskformer can't break transformers.src.image_processors_utils.
Position
Below the diagonal: transformers.src.models.maskformer.image_processing_maskformer uses a module listed above it, which is the healthy direction.
transformers.src.models.mgp_str.modeling_mgp_str uses transformers.src.models.modeling_outputs, so a change to transformers.src.models.modeling_outputs can break transformers.src.models.mgp_str.modeling_mgp_str, while a change to transformers.src.models.mgp_str.modeling_mgp_str can't break transformers.src.models.modeling_outputs.
Position
Below the diagonal: transformers.src.models.mgp_str.modeling_mgp_str uses a module listed above it, which is the healthy direction.
transformers.src.models.mgp_str.modeling_mgp_str uses transformers.src.models.modeling_utils, so a change to transformers.src.models.modeling_utils can break transformers.src.models.mgp_str.modeling_mgp_str, while a change to transformers.src.models.mgp_str.modeling_mgp_str can't break transformers.src.models.modeling_utils.
Position
Below the diagonal: transformers.src.models.mgp_str.modeling_mgp_str uses a module listed above it, which is the healthy direction.
transformers.src.models.mimi.modeling_mimi uses transformers.src.models.modeling_outputs, so a change to transformers.src.models.modeling_outputs can break transformers.src.models.mimi.modeling_mimi, while a change to transformers.src.models.mimi.modeling_mimi can't break transformers.src.models.modeling_outputs.
Position
Below the diagonal: transformers.src.models.mimi.modeling_mimi uses a module listed above it, which is the healthy direction.
transformers.src.models.mimi.modeling_mimi uses transformers.src.models.modeling_utils, so a change to transformers.src.models.modeling_utils can break transformers.src.models.mimi.modeling_mimi, while a change to transformers.src.models.mimi.modeling_mimi can't break transformers.src.models.modeling_utils.
Position
Below the diagonal: transformers.src.models.mimi.modeling_mimi uses a module listed above it, which is the healthy direction.
transformers.src.models.owlvit.image_processing_owlvit uses transformers.src.image_processors_utils, so a change to transformers.src.image_processors_utils can break transformers.src.models.owlvit.image_processing_owlvit, while a change to transformers.src.models.owlvit.image_processing_owlvit can't break transformers.src.image_processors_utils.
Position
Below the diagonal: transformers.src.models.owlvit.image_processing_owlvit uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in transformers.src.models.parakeet.feature_extraction_parakeet uses a type in transformers.src.feature_extraction_utils.
transformers.src.models.parakeet.feature_extraction_parakeet uses transformers.src.feature_extraction_utils, so a change to transformers.src.feature_extraction_utils can break transformers.src.models.parakeet.feature_extraction_parakeet, while a change to transformers.src.models.parakeet.feature_extraction_parakeet can't break transformers.src.feature_extraction_utils.
Position
Below the diagonal: transformers.src.models.parakeet.feature_extraction_parakeet uses a module listed above it, which is the healthy direction.
transformers.src.models.qwen2_vl.image_processing_qwen2_vl uses transformers.src.image_processors_utils, so a change to transformers.src.image_processors_utils can break transformers.src.models.qwen2_vl.image_processing_qwen2_vl, while a change to transformers.src.models.qwen2_vl.image_processing_qwen2_vl can't break transformers.src.image_processors_utils.
Position
Below the diagonal: transformers.src.models.qwen2_vl.image_processing_qwen2_vl uses a module listed above it, which is the healthy direction.
transformers.src.models.qwen2_vl.processing_qwen2_vl uses transformers.src.processing_utils, so a change to transformers.src.processing_utils can break transformers.src.models.qwen2_vl.processing_qwen2_vl, while a change to transformers.src.models.qwen2_vl.processing_qwen2_vl can't break transformers.src.processing_utils.
Position
Below the diagonal: transformers.src.models.qwen2_vl.processing_qwen2_vl uses a module listed above it, which is the healthy direction.
transformers.src.models.rt_detr.modeling_rt_detr uses transformers.src.models.modeling_outputs, so a change to transformers.src.models.modeling_outputs can break transformers.src.models.rt_detr.modeling_rt_detr, while a change to transformers.src.models.rt_detr.modeling_rt_detr can't break transformers.src.models.modeling_outputs.
Position
Below the diagonal: transformers.src.models.rt_detr.modeling_rt_detr uses a module listed above it, which is the healthy direction.
transformers.src.models.rt_detr.modeling_rt_detr uses transformers.src.models.modeling_utils, so a change to transformers.src.models.modeling_utils can break transformers.src.models.rt_detr.modeling_rt_detr, while a change to transformers.src.models.rt_detr.modeling_rt_detr can't break transformers.src.models.modeling_utils.
Position
Below the diagonal: transformers.src.models.rt_detr.modeling_rt_detr uses a module listed above it, which is the healthy direction.
transformers.src.models.ultravox.modeling_ultravox uses transformers.src.models.modeling_utils, so a change to transformers.src.models.modeling_utils can break transformers.src.models.ultravox.modeling_ultravox, while a change to transformers.src.models.ultravox.modeling_ultravox can't break transformers.src.models.modeling_utils.
Position
Below the diagonal: transformers.src.models.ultravox.modeling_ultravox uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in transformers.src.models.dac.feature_extraction_dac uses a type in transformers.src.models.encodec.feature_extraction_encodec.
transformers.src.models.dac.feature_extraction_dac uses transformers.src.models.encodec.feature_extraction_encodec, so a change to transformers.src.models.encodec.feature_extraction_encodec can break transformers.src.models.dac.feature_extraction_dac, while a change to transformers.src.models.dac.feature_extraction_dac can't break transformers.src.models.encodec.feature_extraction_encodec.
Position
Below the diagonal: transformers.src.models.dac.feature_extraction_dac uses a module listed above it, which is the healthy direction.
transformers.src.models.gemma3.modeling_gemma3 uses transformers.src.models.modeling_utils, so a change to transformers.src.models.modeling_utils can break transformers.src.models.gemma3.modeling_gemma3, while a change to transformers.src.models.gemma3.modeling_gemma3 can't break transformers.src.models.modeling_utils.
Position
Below the diagonal: transformers.src.models.gemma3.modeling_gemma3 uses a module listed above it, which is the healthy direction.
transformers.src.models.gemma3.modeling_gemma3 uses transformers.src.models.llava.modeling_llava, so a change to transformers.src.models.llava.modeling_llava can break transformers.src.models.gemma3.modeling_gemma3, while a change to transformers.src.models.gemma3.modeling_gemma3 can't break transformers.src.models.llava.modeling_llava.
Position
Below the diagonal: transformers.src.models.gemma3.modeling_gemma3 uses a module listed above it, which is the healthy direction.
transformers.src.models.idefics3.modeling_idefics3 uses transformers.src.models.llava.modeling_llava, so a change to transformers.src.models.llava.modeling_llava can break transformers.src.models.idefics3.modeling_idefics3, while a change to transformers.src.models.idefics3.modeling_idefics3 can't break transformers.src.models.llava.modeling_llava.
Position
Below the diagonal: transformers.src.models.idefics3.modeling_idefics3 uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in transformers.src.models.qwen2_5_vl.processing_qwen2_5_vl uses a type in transformers.src.models.qwen2_vl.processing_qwen2_vl.
transformers.src.models.qwen2_5_vl.processing_qwen2_5_vl uses transformers.src.models.qwen2_vl.processing_qwen2_vl, so a change to transformers.src.models.qwen2_vl.processing_qwen2_vl can break transformers.src.models.qwen2_5_vl.processing_qwen2_5_vl, while a change to transformers.src.models.qwen2_5_vl.processing_qwen2_5_vl can't break transformers.src.models.qwen2_vl.processing_qwen2_vl.
Position
Below the diagonal: transformers.src.models.qwen2_5_vl.processing_qwen2_5_vl uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 52% · Adequate · gated by D2, X5 ·
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 category
Findings
Severity
A03:2025 — Software Supply Chain Failures
19
High / Critical
A05:2025 — Injection
12
High / Critical
Roadmap
Top priorities: Resolve the 14 Banned license finding(s) in License Compliance — start with REDACTED (14); 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; 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.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 14 Banned license finding(s) in License Compliance — start with REDACTED (14).
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.
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 findings name the configuration each number was taken from and, for the assertions, the files that hold them. Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`).
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 — 32
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 — 273
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 — 80
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 8
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
This survey 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. All 64 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, the weighted average across measured dimensions.
Every figure here is one of two 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. 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.
What we checked — 64 dimensions across the health lenses
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
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, 369 of 385 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.)
Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
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.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
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 — We 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 (83 contributor(s) across 2027 commit(s) sampled, automation and bot accounts excluded). One of them holds 91% of the history; the other 82 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.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we 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. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we 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. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D22 Internal API Consistency — not measured this run — We 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's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
D44 Platform End-of-Life — not measured this run — We 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.
AXB2 Runtime readiness — not measured this run — We 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. A program the dev server needs is not installed in our sandbox image. This is a limit of our sandbox, not of your repository. (rule: missing-tool). The renderer reported: the dev server (`npm run dev`) exited before it served a page. Likely cause (our sandbox): a program the dev server needs is not installed in our sandbox image. This is a limit of our sandbox, not of your repository. Last output: "> @huggingface/transformers-monorepo@0.0.1 dev / > node scripts/dev.mjs / === DEV SERVERS === / [info] Discovering packages with dev scripts... / [info] Found 2 package(s) with dev scripts: / [info] - @huggingface/transformers (transformers) / [info] - @huggingface/transformers-structured-output (transformers-structured-output) / [info] / Starting development servers... / /bin/sh: 1: pnpm: not found / [error] @huggingface/transformers dev server exited with code 127 / [stop] Stopping all dev servers... / [stop] Stopping all dev servers..." No runtime evidence was gathered.
AXR1 Runtime accessibility — not measured this run — We 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. Render strategy: boot via DevServer (dev). the dev server (`npm run dev`) exited before it served a page. Likely cause (our sandbox): a program the dev server needs is not installed in our sandbox image. This is a limit of our sandbox, not of your repository. Last output: "> @huggingface/transformers-monorepo@0.0.1 dev / > node scripts/dev.mjs / === DEV SERVERS === / [info] Discovering packages with dev scripts... / [info] Found 2 package(s) with dev scripts: / [info] - @huggingface/transformers (transformers) / [info] - @huggingface/transformers-structured-output (transformers-structured-output) / [info] / Starting development servers... / /bin/sh: 1: pnpm: not found / [error] @huggingface/transformers dev server exited with code 127 / [stop] Stopping all dev servers... / [stop] Stopping all dev servers..." No runtime evidence was gathered.
M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we 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. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
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 — We measured this, but not all of it. What we 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.
R2 Cyclomatic Complexity — measured, with a gap in what it reached — We measured this, but not all of it. What we 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. 39 further occurrence(s) are not listed individually; the score already reflects all 79.
S1 Web-Security Posture — not measured this run — We 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. 493 JavaScript/TypeScript file(s) were read for weak hashes and ciphers, key material fixed in the source, disabled certificate validation, obsolete TLS versions, plaintext password storage and session cookies set without HttpOnly, Secure or SameSite, and none was found. The server controls this dimension also scores were not assessed, so no score is given.
X4 Structured logging — not measured this run — We 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 JavaScript/TypeScript, Java, Kotlin, Python, PHP, Dart, Ruby, Scala and Rust source only, and no C# was loaded, and this repository's JavaScript/TypeScript, Python and PHP log through no library that carries a message's values as fields (pino, winston, bunyan, tslog, LogTape, roarr; Python's logging, structlog; PHP's PSR-3 loggers), so its log calls cannot be judged, 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.
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
We assess the repository exactly as committed, and only the repository. By design we do 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.
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 publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
D23 Boundary Type-Coupling: Boundary leakage is detected from type references across detected contexts — leaks that flow through primitives, serialization or shared infrastructure may not surface as a typed reference.
D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
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.
D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
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: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
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.
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.
69 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 122 — 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.
+ 44 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 1 body over 60 down to 60 or less in Cyclomatic Complexity — start with json.checkSchema (cyclomatic 64). — Refactoring it lifts Cyclomatic Complexity from 6.0 to about 6.1/10.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
+ 80 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 1 body over 120 down to 120 or less in Cognitive Complexity — start with WhisperTokenizer._decode_asr (cognitive 151). — Refactoring it lifts Cognitive Complexity from 2.0 to about 2.5/10.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes9.2 / 10Stronggated by 6 serious findings✓ 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.
Resolve the 4 FileTooLong finding(s) in God Classes — start with REDACTED, modeling_utils.js, tensor.js. — One of this dimension's main actionable groups (4 warning-level).
Resolve the 1 FunctionTooLong finding(s) in God Classes — start with configs.js. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 TooManyMethods finding(s) in God Classes — start with tensor.js. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
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.
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, declare types in source no model reads, or have no source directory of their own).
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.
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.
0 skipped, 2 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 373 tests.
No assertions: no progress_total without progress_callback · ×2packages/transformers/tests/progress_callbacks.test.js:246
What to do
Resolve the 2 No assertions finding(s) in Test Quality — start with progress_callbacks.test.js, types.test.js. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether dependencies are current, not deprecated, and not bloated. Known vulnerabilities are D30's.
Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (capped-linear for deprecation, prerelease and outdated) per KLoC. Known-vulnerable packages are D30's and are not charged here (rubric-2026.11.2). Exhaustive.
4 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 for currency: that grade is about what SHIPS. 0 direct dependency(ies) — production, development or optional — are marked DEPRECATED by their publisher (the registry's per-version mark, or the lockfile's copy of it when the registry could not be asked); deprecated transitive packages are listed but not charged. Whether any is UNMAINTAINED is not graded — the registry publishes no maintenance status, and release age does not stand in for one. 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.
Deprecated: glob · ×2REDACTED:1157
Outdated (npm): @huggingface/jinja · ×4
✓ On the Gold path — maintain.
Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
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.
14 of 67 shipped npm package(s) use a banned license. Licences were resolved from registry.npmjs.org over the 67 package(s) this repository's committed lockfile installs for a consumer — its 5 production, optional and peer dependency(ies), across 3 product package.json manifest(s), and everything those install in turn. Its 15 `devDependencies` declaration(s), and every package only they reach, are excluded: a consumer installs none of them. ★ 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.
Resolve the 14 Banned license finding(s) in License Compliance — start with REDACTED (14). — One of this dimension's main actionable groups (14 issue-level).
Detailed fixes: d14_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
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.
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.
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.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Seven vocabulary-free rules (N1-N7) mine each naming convention from the repository and flag a name that breaks a convention its structural peers in the same unit follow; production C# and TypeScript, each its own population. Deterministic, no model, no sample. Advisory.
3 naming inconsistencies among 109 declarations measured against a convention their peers follow.
`StableLmPreTrainedModel` spells `Lm` where 106 names in the project spell it `LM`packages/transformers/src/models/stablelm/modeling_stablelm.js:3
`StableLmModel` spells `Lm` where 106 names in the project spell it `LM`packages/transformers/src/models/stablelm/modeling_stablelm.js:8
`StableLmForCausalLM` spells `Lm` where 106 names in the project spell it `LM`packages/transformers/src/models/stablelm/modeling_stablelm.js:13
What to do
Resolve the 1 `StableLmPreTrainedModel` spells `Lm` where 106 names in the project… finding(s) in Naming Consistency — start with modeling_stablelm.js. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 `StableLmModel` spells `Lm` where 106 names in the project spell it `LM` finding(s) in Naming Consistency — start with modeling_stablelm.js. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 `StableLmForCausalLM` spells `Lm` where 106 names in the project spell… finding(s) in Naming Consistency — start with modeling_stablelm.js. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d21_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether domain types (IDs, enums, value objects) leak across bounded-context boundaries.
Method: Cross-context domain-type leakage via Roslyn structural classification (strongly-typed IDs / value objects) over every public surface. Exhaustive, deterministic, type-level aggregate-boundary check.
Coverage: Bounded contexts derived from NAMESPACE prefix (or graph-inferred where available); cross-boundary domain-type leakage then checked exhaustively over every public member of every type.
What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).
Method: Every inline C# comment compared word by word with the identifiers, literals and constructs of the code it annotates (taken from the syntax); a comment whose words that code already contains is redundant, as are closing-brace labels and generator template text. Comments giving a reason or a reference are kept; other scripts and languages are not judged. Deterministic, exhaustive, advisory.
doc comments repeat the namespackages/transformers/src/backends/onnx.js:312
What to do
Resolve the 37 redundant comment finding(s) in Comment Value — start with image.js (4), init.js (2), image_processors_utils.js. — One of this dimension's main actionable groups (37 recommendation-level).
Detailed fixes: d24_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D26 · Project Cohesion3.3 / 10Weak✓ Tool-verified
What it measures: Whether each project is a focused, coherent unit rather than an oversized grab-bag.
1 of 3 build units (npm) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion
What to do
Resolve the 1 Projects may be oversized for their cohesion 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.
What it measures: How far you must trace to follow a call — low indirection and co-located slices read easier.
Method: Call indirection (interface hops, cross-namespace calls, slice-locality scaled) over a sampled set of method invocations, size-aware baseline. Sampled; confidence discounted by symbol-resolution gaps. C# also names each pass-through layer (a class whose every public method only forwards its own parameters to one collaborator) as a located finding; the score is not affected.
Coverage: Slice locality from the first namespace segments, SAMPLED (≤400 methods) — not exhaustive.
4 % of calls cross a namespace and 1 % go through an interface, but 95 % of collaborators are co-located — so a call's collaborators sit together and tracing stays easy. Baseline: small — navigation cost is tolerated.
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.
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).
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. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
Resolve the 9 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (9). — One of this dimension's main actionable groups (9 issue-level).
Resolve the 2 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (2). — One of this dimension's main actionable groups (2 warning-level).
Resolve the 2 Low CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (2). — One of this dimension's main actionable groups (2 recommendation-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
2 of 153 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is packages/transformers/src/utils/model_registry/get_available_dtypes.js. Counted over 153 of the 464 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
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.
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.
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — 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.
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. Reported 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. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
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.
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.
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.
Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').
Method: Roslyn scan: public interface declared-member counts (accessors fold into their property/event); fat-interface threshold (over 15 declared members) flagged per type. Each finding also reports the distinct-OPERATION count — members counted by name, so an overload group counts once — which decides whether it states the caller-side ISP harm or the implementer-side burden of an overload set. TypeScript: exported interfaces that declare behaviour, counted over their REQUIRED operations (method signatures and function-typed properties with no `?`, once per signature) — data-shape interfaces and ambient .d.ts declarations are outside the population; JavaScript declares no interfaces and is not applicable. Deterministic, type-level.
Other · Code Health — Unreviewed-generation residue in this repository's JavaScript/TypeScript: functions whose whole body still throws a "not implemented" error, and placeholder text (lorem ipsum, changeme/replace_me…) left in strings and JSX of non-test, non-generated code. Scored as a quality signature, never as a claim about authorship.
Method: Roslyn syntax scan: NotImplementedException throws and placeholder string literals in non-test, non-generated shipped code. Deterministic, code-shape signature.
A shipped function's whole body still throws a "not implemented" error — generated scaffolding that was never completed. Implement it or remove the dead surface. — packages/transformers/src/image_processors_utils.js:539
What to do
Finish or delete the functions that still throw "not implemented", and replace placeholder text before shipping.
Other · Code Health — Unfinished work detected by code SHAPE, not keywords, in this repository's JavaScript/TypeScript: functions that only throw a "not implemented" error, functions that take inputs and return a constant or do nothing, async functions that never await, dead `if (false)` branches, and skeleton classes most of whose methods are holes.
Method: Roslyn syntax scan: incompleteness by code shape (constant-returning methods, async-never-await, #if false branches, guards that return what the code already falls through to, tests an earlier guard already decided, comparisons against NaN, skeleton types), not keyword-gated. Deterministic, code-shape heuristic.
`post_process_instance_segmentation` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it. — packages/transformers/src/image_processors_utils.js:539
A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something. (×12) — packages/transformers/tests/models/embedding_gemma2/test_modeling_embedding_gemma2.js:15, packages/transformers/tests/models/embedding_gemma2/test_modeling_embedding_gemma2.js:148, packages/transformers/tests/models/embedding_gemma2/test_processor_embedding_gemma2.js:19, …
What to do
Finish or delete the unfinished stubs (functions that throw "not implemented", or whose body is empty or a bare constant) — they are dead surface that looks live.
Clear the softer debt: re-enable or delete skipped tests, decide whether each empty function is a deliberate no-op (and say so in a comment), and replace blanket `eslint-disable` / `@ts-nocheck` with targeted, justified suppressions.
Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.
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
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
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 your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.
Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.
Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.
Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.
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.
Do you agree with this assessment?
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's code 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.
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 5 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. — REDACTED:4
`.github/dependabot.yml` schedules updates, but no `package-ecosystem` entry covers `npm`, which this tree depends on — so those dependencies get no update pull requests and no advisory pressure, however complete the dep-scan credit looks. Add the missing entry to the `updates:` list. — .github/dependabot.yml:2
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.
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.
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.
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 each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
Do you agree with this assessment?
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
Every frontend file is already type-checked. tsconfig.json leaves `noImplicitAny`, `strictNullChecks` and `noImplicitThis` off: turn them on in compilerOptions one at a time, fixing the errors each one surfaces before the next.
React / JS · Code Health — The share of the scored frontend lines inside a near-exact copy-pasted block of substantial extent (the D4 clone algorithm over JS/TS tokens, D-386; each line once, 10 at none and 0 at a quarter of the lines, as D4): 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. Scored on the share of the scored frontend lines inside a reported copy, on the same curve as D4. Deterministic.
64 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 (+62 more sibling(s) not listed) — 26 of them are reported below, and 38 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 64 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 64 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 64 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/configs.js:356 · packages/transformers/src/configs.js:385 — the two spans are one implementation copied and then locally edited — 140 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/configs.js:356
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:522 · 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:522
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
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.
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.
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. — REDACTED: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. — REDACTED:1083
getCacheNames has cyclomatic complexity 38 and cognitive complexity 62; 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:346
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. — REDACTED: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. — REDACTED: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. — REDACTED: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. — REDACTED: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
stringByte has cyclomatic complexity 22 and cognitive complexity 30; 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:359
unicodeByte has cyclomatic complexity 22 and cognitive complexity 26; 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:412
pad_image has cyclomatic complexity 19 and cognitive complexity 45; 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:711
slice has cyclomatic complexity 19 and cognitive complexity 35; 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/tensor.js:416
_call has cyclomatic complexity 19 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/pipelines/text-generation.js:108
compareDecimal has cyclomatic complexity 19 and cognitive complexity 22; 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:1205
validUriText has cyclomatic complexity 19 and cognitive complexity 21; 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:1509
_call_whisper has cyclomatic complexity 18 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/pipelines/automatic-speech-recognition.js:200
constrainedPropertyKeys has cyclomatic complexity 18 and cognitive complexity 28; 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:930
compare has cyclomatic complexity 18 and cognitive complexity 28; 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/tests/init.js:76
get_resize_output_image_size has cyclomatic complexity 17 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/image_processors_utils.js:803
constructor has cyclomatic complexity 17 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/src/image_processors_utils.js:577
resize has cyclomatic complexity 17 and cognitive complexity 15; 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/utils/image.js:373
_call has cyclomatic complexity 16 and cognitive complexity 32; 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/lfm2_vl/image_processing_lfm2_vl.js:191
findLongestCommonSequence has cyclomatic complexity 16 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/whisper/tokenization_whisper.js:346
forward has cyclomatic complexity 16 and cognitive complexity 26; 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/chatterbox/modeling_chatterbox.js:37
selectDtype has cyclomatic complexity 16 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/utils/dtypes.js:85
integerScaleReachable has cyclomatic complexity 16 and cognitive complexity 21; 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:575
propertySchema has cyclomatic complexity 16 and cognitive complexity 21; 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:707
pipeline has cyclomatic complexity 16 and cognitive complexity 19; 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.js:100
getCache has cyclomatic complexity 16 and cognitive complexity 19; 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/cache.js:22
Do you agree with this assessment?
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.
REDACTED has 1745 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
packages/transformers/src/utils/tensor.js has 1566 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/transformers/src/utils/tensor.js:1
packages/transformers/src/models/modeling_utils.js has 1565 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/transformers/src/models/modeling_utils.js:1
packages/transformers/src/image_processors_utils.js has 954 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/transformers/src/image_processors_utils.js:1
packages/transformers/src/utils/maths.js has 954 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/transformers/src/utils/maths.js:1
packages/transformers/src/utils/audio.js has 821 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/transformers/src/utils/audio.js:1
REDACTED has 776 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
packages/transformers/src/utils/image.js has 727 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/transformers/src/utils/image.js:1
packages/transformers/src/generation/logits_process.js has 696 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/transformers/src/generation/logits_process.js:1
packages/transformers/src/models/registry.js has 649 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/transformers/src/models/registry.js:1
packages/transformers/src/models/whisper/tokenization_whisper.js has 604 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/transformers/src/models/whisper/tokenization_whisper.js:1
packages/transformers/src/configs.js has 554 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/transformers/src/configs.js:1
packages/transformers/src/utils/hub.js has 541 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/transformers/src/utils/hub.js:1
packages/transformers/src/models/auto/modeling_auto.js has 540 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/transformers/src/models/auto/modeling_auto.js:1
packages/transformers/src/models/whisper/modeling_whisper.js has 450 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/transformers/src/models/whisper/modeling_whisper.js:1
What to do
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Do you agree with this assessment?
R4 · Test Coverage9.9 / 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. (×5) — packages/transformers/scripts/dev.mjs:1, packages/transformers-structured-output/scripts/dev.mjs:1, packages/transformers/src/generation/parameters.js:1, …
What to do
Add tests that import the unreached modules (directly or through their public entry).
Do you agree with this assessment?
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.
Do you agree with this assessment?
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 194 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, 194 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
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.
Do you agree with this assessment?
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.
Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.
Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.
Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.
Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.
Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.
Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.
Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.
Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X17 · Uncapped recursion over a caller-supplied document3.5 / 10Weak✓ Tool-verified
Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.
Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.
`sessionRun` is exported, takes a document from its caller (line 192) and hands it to `replaceTensors`, which calls itself at line 175 (`replaceTensors`) with a piece of `obj` — and nowhere in `replaceTensors` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `replaceTensors` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — packages/transformers/src/models/session.js:175
What to do
Each finding names the externally-callable member that accepts the document and the self-call that descends, and states that no depth parameter or counter exists anywhere in the walk. Confirm from the two, then thread a depth argument through the walk and reject documents past a fixed maximum, or rewrite it with an explicit stack.
Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.
Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether async functions that make a cancellable request accept or pass on an AbortSignal (adoption curve).
Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same question: every named async function that itself makes a request an AbortSignal can cancel (global `fetch`, axios and its file-local instances, ky, ofetch) counts, and it is compliant when its parameters or body name a signal or it hands one of its own parameters to the request as options; signatures a framework fixes (JSX event handlers, route and lifecycle exports, request-first handlers, `override`, `'use server'` modules, TanStack `mutationFn`) are exempt unless they take a signal. Deterministic, adoption percentage.
Only 0/1 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
`_getLfsFileHash` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — packages/transformers/src/utils/cache/CrossOriginStorageCache.js:224
What to do
Thread an AbortSignal through async functions that make requests, so the work stops when its caller gives up.
Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.
Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
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.
Do you agree with this assessment?
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.
Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
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.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
`catch (e)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included. — packages/transformers/src/utils/cache.js:85
An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×7) — packages/transformers/src/utils/hub.js:418, packages/transformers/src/utils/model_registry/get_file_metadata.js:99, packages/transformers/src/utils/model_registry/get_file_metadata.js:129, …
What to do
Swallowed exception (caught, then discarded)
Do you agree with this assessment?
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.
Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether strict null checking is enabled and not undermined by heavy `!` assertion — TypeScript's `strictNullChecks` (which `strict` turns on) is what makes `string` exclude `null` and `undefined`, and the postfix `!` is the operator that silences it.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
1/3 of this repository's type-checking configuration(s) turn on strict null checking (`"strict": true`, or `"strictNullChecks": true`). A configuration that states neither is counted as OFF, because off is tsc's own default; a solution-style one whose `"files"` is empty and whose `"references"` point at other projects is in neither number, because it checks no source itself. Where it is off, `string` admits `null` and `undefined`: passing a value that is null compiles silently and throws on the first property access.
~7.4 `!` null assertions per 1k TypeScript source lines — 22 assertion(s) across the 2966 source line(s) of the 9 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: REDACTED (11), packages/transformers-structured-output/src/engine/constraint.ts (5), REDACTED (3). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.
What to do
The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`).
Do you agree with this assessment?
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.
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 — 4 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 — 1 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.
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 62 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.
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
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 (`npm run dev`) exited before it served a page. Likely cause (our sandbox): a program the dev server needs is not installed in our sandbox image. This is a limit of our sandbox, not of your repository. Last output: "> @huggingface/transformers-monorepo@0.0.1 dev / > node scripts/dev.mjs / === DEV SERVERS === / [info] Discovering packages with dev scripts... / [info] Found 2 package(s) with dev scripts: / [info] - @huggingface/transformers (transformers) / [info] - @huggingface/transformers-structured-output (transformers-structured-output) / [info] / Starting development servers... / /bin/sh: 1: pnpm: not found / [error] @huggingface/transformers dev server exited with code 127 / [stop] Stopping all dev servers... / [stop] Stopping all dev servers..." No runtime evidence was gathered. 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 — No access-control surface detected in the analyzed source — this repository stands up no server (no Express, Fastify, Koa, Hono, NestJS or similar app, no Next.js/SvelteKit/Nuxt server route, no edge function), creates no Supabase tables and talks to no hosted backend. Access control is therefore N/A here — a browser application or library is authorized by the server it calls, not by itself; a client-side route guard hides a page and authorizes nothing. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
C3 Audit Trail — 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 sensitive data whose changes an audit trail would record. If it does (through a hosted backend configured outside this repository, for instance), the trail belongs to wherever that data is stored.
C4 Data Retention — 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 personal data whose lifetime a retention limit would bound. If it does (through a hosted backend configured outside this repository, for instance), the limit belongs wherever that data is stored.
C5 Data-Subject Rights — 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 personal data for a data subject to erase, export or consent over. If it does (through a hosted backend configured outside this repository, for instance), the rights are served wherever that data is stored.
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 — API consistency is measured on C# only; the exposed JavaScript, TypeScript surface was not measured.
D25 ADR Conformance — no ADRs to check
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.
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.
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 — no mutating command handlers or message consumers detected — idempotency check not applicable
ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
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), 493 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 — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
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 scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
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: 493 JavaScript/TypeScript file(s) were read for weak hashes and ciphers, key material fixed in the source, disabled TLS certificate validation, obsolete TLS versions, passwords stored or checked as plaintext and session cookies set without HttpOnly, Secure or SameSite, and none was found. That half of the dimension is clean, but it is not scored on its own: a C# repository with the same clean reading is scored on its server controls as well, or is N/A for having no web surface, and neither can be decided here. Of the server controls, two are read where the source shows them: every session or sign-in cookie the code sets is read for HttpOnly, Secure and SameSite at the line that sets it (a raw `Set-Cookie` header, Express, Fastify, Hono, Koa, Next.js, `cookie.serialize`, express-session and cookie-session), and every Node listener for HTTPS enforcement. HSTS, security response headers and input validation are NOT assessed for JavaScript/TypeScript: each is scored as an absence, an absence is only reportable over the production HTTP server, and in this ecosystem the file that opens the port is build output or a framework launcher rather than a file in the source tree. Their absence here is 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.
X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X25 Inert configuration knob — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
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 applicable: this check looks for a loop whose body adds to or removes from the very collection the loop is walking, invalidating the enumerator it holds, and in this repository's languages that cannot happen. JavaScript and TypeScript have no iterator that a change can invalidate: an `Array` is walked by index against its live length, and a `Map` or `Set` by the ECMAScript specification's live entry list, so a body that adds to, removes from or empties what it walks raises nothing — every loop form (`for…of`, `for…in`, `forEach`, `map`, `filter`, `reduce`, `entries()`) on every built-in collection (`Array`, `Map`, `Set`, plain objects, `URLSearchParams`, `Headers`, `FormData`) runs to completion. Such a loop can still skip an element or never end, which is a different defect and not the one this check asks about. Not a gap in the analyzer and not a finding about your code.
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
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.
Banned license: @img/sharp-libvips-darwin-arm64 REDACTED:442— `@img/sharp-libvips-darwin-arm64` 1.3.3 is published on registry.npmjs.org under `LGPL-3.0-or-later`, which this policy bans, and it is not declared by this repository but is installed by one of its production, optional or peer dependencies, as its committed lockfile resolves — a transitive dependency ships its licence just the same — so it is installed by everything that depends on this repository, not just by its build toolchain. A package offering SEVERAL licences is a choice and is only charged when every one of them is banned. Replace the package (or the dependency that pulls it in), or record an accepted exception. ★ The licence that makes this row is LGPL-3.0, and unmodified use is often permitted: the LGPL lets your code use an UNMODIFIED copy of the library that stays a separately installed package (its own entry in node_modules, site-packages or the gem path, which a user can replace) without your code coming under the LGPL. What it then asks is that you pass on its licence and notices and let users swap in their own build of it (LGPL-3.0 section 4). Modifying it, copying its code into yours, or merging it into one bundled or statically linked artifact is where the obligations grow, and this policy cannot see which you do — that is why it denies LGPL-3.0 by default. If you use it unmodified and separately installed, allow it in your repository's licence policy rather than replacing it: add `LGPL-3.0-only` / `LGPL-3.0-or-later` to the allow-list of the licence check your CI runs (`license-checker --onlyAllow`, the `allow-licenses` input of GitHub's dependency-review-action, `[licenses] allow` in cargo-deny's deny.toml), record why in the same change, and hide this row on the findings page with that reason. This scan's banned set is not read from that file, so the row stays until it is hidden.
Banned license: @img/sharp-libvips-darwin-x64 REDACTED:447— `@img/sharp-libvips-darwin-x64` 1.3.3 is published on registry.npmjs.org under `LGPL-3.0-or-later`, which this policy bans, and it is not declared by this repository but is installed by one of its production, optional or peer dependencies, as its committed lockfile resolves — a transitive dependency ships its licence just the same — so it is installed by everything that depends on this repository, not just by its build toolchain. A package offering SEVERAL licences is a choice and is only charged when every one of them is banned. Replace the package (or the dependency that pulls it in), or record an accepted exception. ★ The licence that makes this row is LGPL-3.0, and unmodified use is often permitted: the LGPL lets your code use an UNMODIFIED copy of the library that stays a separately installed package (its own entry in node_modules, site-packages or the gem path, which a user can replace) without your code coming under the LGPL. What it then asks is that you pass on its licence and notices and let users swap in their own build of it (LGPL-3.0 section 4). Modifying it, copying its code into yours, or merging it into one bundled or statically linked artifact is where the obligations grow, and this policy cannot see which you do — that is why it denies LGPL-3.0 by default. If you use it unmodified and separately installed, allow it in your repository's licence policy rather than replacing it: add `LGPL-3.0-only` / `LGPL-3.0-or-later` to the allow-list of the licence check your CI runs (`license-checker --onlyAllow`, the `allow-licenses` input of GitHub's dependency-review-action, `[licenses] allow` in cargo-deny's deny.toml), record why in the same change, and hide this row on the findings page with that reason. This scan's banned set is not read from that file, so the row stays until it is hidden.
Banned license: @img/sharp-libvips-linux-arm REDACTED:457— `@img/sharp-libvips-linux-arm` 1.3.3 is published on registry.npmjs.org under `LGPL-3.0-or-later`, which this policy bans, and it is not declared by this repository but is installed by one of its production, optional or peer dependencies, as its committed lockfile resolves — a transitive dependency ships its licence just the same — so it is installed by everything that depends on this repository, not just by its build toolchain. A package offering SEVERAL licences is a choice and is only charged when every one of them is banned. Replace the package (or the dependency that pulls it in), or record an accepted exception. ★ The licence that makes this row is LGPL-3.0, and unmodified use is often permitted: the LGPL lets your code use an UNMODIFIED copy of the library that stays a separately installed package (its own entry in node_modules, site-packages or the gem path, which a user can replace) without your code coming under the LGPL. What it then asks is that you pass on its licence and notices and let users swap in their own build of it (LGPL-3.0 section 4). Modifying it, copying its code into yours, or merging it into one bundled or statically linked artifact is where the obligations grow, and this policy cannot see which you do — that is why it denies LGPL-3.0 by default. If you use it unmodified and separately installed, allow it in your repository's licence policy rather than replacing it: add `LGPL-3.0-only` / `LGPL-3.0-or-later` to the allow-list of the licence check your CI runs (`license-checker --onlyAllow`, the `allow-licenses` input of GitHub's dependency-review-action, `[licenses] allow` in cargo-deny's deny.toml), record why in the same change, and hide this row on the findings page with that reason. This scan's banned set is not read from that file, so the row stays until it is hidden.
Banned license: @img/sharp-libvips-linux-arm64 REDACTED:452— `@img/sharp-libvips-linux-arm64` 1.3.3 is published on registry.npmjs.org under `LGPL-3.0-or-later`, which this policy bans, and it is not declared by this repository but is installed by one of its production, optional or peer dependencies, as its committed lockfile resolves — a transitive dependency ships its licence just the same — so it is installed by everything that depends on this repository, not just by its build toolchain. A package offering SEVERAL licences is a choice and is only charged when every one of them is banned. Replace the package (or the dependency that pulls it in), or record an accepted exception. ★ The licence that makes this row is LGPL-3.0, and unmodified use is often permitted: the LGPL lets your code use an UNMODIFIED copy of the library that stays a separately installed package (its own entry in node_modules, site-packages or the gem path, which a user can replace) without your code coming under the LGPL. What it then asks is that you pass on its licence and notices and let users swap in their own build of it (LGPL-3.0 section 4). Modifying it, copying its code into yours, or merging it into one bundled or statically linked artifact is where the obligations grow, and this policy cannot see which you do — that is why it denies LGPL-3.0 by default. If you use it unmodified and separately installed, allow it in your repository's licence policy rather than replacing it: add `LGPL-3.0-only` / `LGPL-3.0-or-later` to the allow-list of the licence check your CI runs (`license-checker --onlyAllow`, the `allow-licenses` input of GitHub's dependency-review-action, `[licenses] allow` in cargo-deny's deny.toml), record why in the same change, and hide this row on the findings page with that reason. This scan's banned set is not read from that file, so the row stays until it is hidden.
Banned license: @img/sharp-libvips-linux-ppc64 REDACTED:462— `@img/sharp-libvips-linux-ppc64` 1.3.3 is published on registry.npmjs.org under `LGPL-3.0-or-later`, which this policy bans, and it is not declared by this repository but is installed by one of its production, optional or peer dependencies, as its committed lockfile resolves — a transitive dependency ships its licence just the same — so it is installed by everything that depends on this repository, not just by its build toolchain. A package offering SEVERAL licences is a choice and is only charged when every one of them is banned. Replace the package (or the dependency that pulls it in), or record an accepted exception. ★ The licence that makes this row is LGPL-3.0, and unmodified use is often permitted: the LGPL lets your code use an UNMODIFIED copy of the library that stays a separately installed package (its own entry in node_modules, site-packages or the gem path, which a user can replace) without your code coming under the LGPL. What it then asks is that you pass on its licence and notices and let users swap in their own build of it (LGPL-3.0 section 4). Modifying it, copying its code into yours, or merging it into one bundled or statically linked artifact is where the obligations grow, and this policy cannot see which you do — that is why it denies LGPL-3.0 by default. If you use it unmodified and separately installed, allow it in your repository's licence policy rather than replacing it: add `LGPL-3.0-only` / `LGPL-3.0-or-later` to the allow-list of the licence check your CI runs (`license-checker --onlyAllow`, the `allow-licenses` input of GitHub's dependency-review-action, `[licenses] allow` in cargo-deny's deny.toml), record why in the same change, and hide this row on the findings page with that reason. This scan's banned set is not read from that file, so the row stays until it is hidden.
Banned license: @img/sharp-libvips-linux-riscv64 REDACTED:467— `@img/sharp-libvips-linux-riscv64` 1.3.3 is published on registry.npmjs.org under `LGPL-3.0-or-later`, which this policy bans, and it is not declared by this repository but is installed by one of its production, optional or peer dependencies, as its committed lockfile resolves — a transitive dependency ships its licence just the same — so it is installed by everything that depends on this repository, not just by its build toolchain. A package offering SEVERAL licences is a choice and is only charged when every one of them is banned. Replace the package (or the dependency that pulls it in), or record an accepted exception. ★ The licence that makes this row is LGPL-3.0, and unmodified use is often permitted: the LGPL lets your code use an UNMODIFIED copy of the library that stays a separately installed package (its own entry in node_modules, site-packages or the gem path, which a user can replace) without your code coming under the LGPL. What it then asks is that you pass on its licence and notices and let users swap in their own build of it (LGPL-3.0 section 4). Modifying it, copying its code into yours, or merging it into one bundled or statically linked artifact is where the obligations grow, and this policy cannot see which you do — that is why it denies LGPL-3.0 by default. If you use it unmodified and separately installed, allow it in your repository's licence policy rather than replacing it: add `LGPL-3.0-only` / `LGPL-3.0-or-later` to the allow-list of the licence check your CI runs (`license-checker --onlyAllow`, the `allow-licenses` input of GitHub's dependency-review-action, `[licenses] allow` in cargo-deny's deny.toml), record why in the same change, and hide this row on the findings page with that reason. This scan's banned set is not read from that file, so the row stays until it is hidden.
Banned license: @img/sharp-libvips-linux-s390x REDACTED:472— `@img/sharp-libvips-linux-s390x` 1.3.3 is published on registry.npmjs.org under `LGPL-3.0-or-later`, which this policy bans, and it is not declared by this repository but is installed by one of its production, optional or peer dependencies, as its committed lockfile resolves — a transitive dependency ships its licence just the same — so it is installed by everything that depends on this repository, not just by its build toolchain. A package offering SEVERAL licences is a choice and is only charged when every one of them is banned. Replace the package (or the dependency that pulls it in), or record an accepted exception. ★ The licence that makes this row is LGPL-3.0, and unmodified use is often permitted: the LGPL lets your code use an UNMODIFIED copy of the library that stays a separately installed package (its own entry in node_modules, site-packages or the gem path, which a user can replace) without your code coming under the LGPL. What it then asks is that you pass on its licence and notices and let users swap in their own build of it (LGPL-3.0 section 4). Modifying it, copying its code into yours, or merging it into one bundled or statically linked artifact is where the obligations grow, and this policy cannot see which you do — that is why it denies LGPL-3.0 by default. If you use it unmodified and separately installed, allow it in your repository's licence policy rather than replacing it: add `LGPL-3.0-only` / `LGPL-3.0-or-later` to the allow-list of the licence check your CI runs (`license-checker --onlyAllow`, the `allow-licenses` input of GitHub's dependency-review-action, `[licenses] allow` in cargo-deny's deny.toml), record why in the same change, and hide this row on the findings page with that reason. This scan's banned set is not read from that file, so the row stays until it is hidden.
Banned license: @img/sharp-libvips-linux-x64 REDACTED:477— `@img/sharp-libvips-linux-x64` 1.3.3 is published on registry.npmjs.org under `LGPL-3.0-or-later`, which this policy bans, and it is not declared by this repository but is installed by one of its production, optional or peer dependencies, as its committed lockfile resolves — a transitive dependency ships its licence just the same — so it is installed by everything that depends on this repository, not just by its build toolchain. A package offering SEVERAL licences is a choice and is only charged when every one of them is banned. Replace the package (or the dependency that pulls it in), or record an accepted exception. ★ The licence that makes this row is LGPL-3.0, and unmodified use is often permitted: the LGPL lets your code use an UNMODIFIED copy of the library that stays a separately installed package (its own entry in node_modules, site-packages or the gem path, which a user can replace) without your code coming under the LGPL. What it then asks is that you pass on its licence and notices and let users swap in their own build of it (LGPL-3.0 section 4). Modifying it, copying its code into yours, or merging it into one bundled or statically linked artifact is where the obligations grow, and this policy cannot see which you do — that is why it denies LGPL-3.0 by default. If you use it unmodified and separately installed, allow it in your repository's licence policy rather than replacing it: add `LGPL-3.0-only` / `LGPL-3.0-or-later` to the allow-list of the licence check your CI runs (`license-checker --onlyAllow`, the `allow-licenses` input of GitHub's dependency-review-action, `[licenses] allow` in cargo-deny's deny.toml), record why in the same change, and hide this row on the findings page with that reason. This scan's banned set is not read from that file, so the row stays until it is hidden.
Banned license: @img/sharp-libvips-linuxmusl-arm64 REDACTED:482— `@img/sharp-libvips-linuxmusl-arm64` 1.3.3 is published on registry.npmjs.org under `LGPL-3.0-or-later`, which this policy bans, and it is not declared by this repository but is installed by one of its production, optional or peer dependencies, as its committed lockfile resolves — a transitive dependency ships its licence just the same — so it is installed by everything that depends on this repository, not just by its build toolchain. A package offering SEVERAL licences is a choice and is only charged when every one of them is banned. Replace the package (or the dependency that pulls it in), or record an accepted exception. ★ The licence that makes this row is LGPL-3.0, and unmodified use is often permitted: the LGPL lets your code use an UNMODIFIED copy of the library that stays a separately installed package (its own entry in node_modules, site-packages or the gem path, which a user can replace) without your code coming under the LGPL. What it then asks is that you pass on its licence and notices and let users swap in their own build of it (LGPL-3.0 section 4). Modifying it, copying its code into yours, or merging it into one bundled or statically linked artifact is where the obligations grow, and this policy cannot see which you do — that is why it denies LGPL-3.0 by default. If you use it unmodified and separately installed, allow it in your repository's licence policy rather than replacing it: add `LGPL-3.0-only` / `LGPL-3.0-or-later` to the allow-list of the licence check your CI runs (`license-checker --onlyAllow`, the `allow-licenses` input of GitHub's dependency-review-action, `[licenses] allow` in cargo-deny's deny.toml), record why in the same change, and hide this row on the findings page with that reason. This scan's banned set is not read from that file, so the row stays until it is hidden.
Banned license: @img/sharp-libvips-linuxmusl-x64 REDACTED:487— `@img/sharp-libvips-linuxmusl-x64` 1.3.3 is published on registry.npmjs.org under `LGPL-3.0-or-later`, which this policy bans, and it is not declared by this repository but is installed by one of its production, optional or peer dependencies, as its committed lockfile resolves — a transitive dependency ships its licence just the same — so it is installed by everything that depends on this repository, not just by its build toolchain. A package offering SEVERAL licences is a choice and is only charged when every one of them is banned. Replace the package (or the dependency that pulls it in), or record an accepted exception. ★ The licence that makes this row is LGPL-3.0, and unmodified use is often permitted: the LGPL lets your code use an UNMODIFIED copy of the library that stays a separately installed package (its own entry in node_modules, site-packages or the gem path, which a user can replace) without your code coming under the LGPL. What it then asks is that you pass on its licence and notices and let users swap in their own build of it (LGPL-3.0 section 4). Modifying it, copying its code into yours, or merging it into one bundled or statically linked artifact is where the obligations grow, and this policy cannot see which you do — that is why it denies LGPL-3.0 by default. If you use it unmodified and separately installed, allow it in your repository's licence policy rather than replacing it: add `LGPL-3.0-only` / `LGPL-3.0-or-later` to the allow-list of the licence check your CI runs (`license-checker --onlyAllow`, the `allow-licenses` input of GitHub's dependency-review-action, `[licenses] allow` in cargo-deny's deny.toml), record why in the same change, and hide this row on the findings page with that reason. This scan's banned set is not read from that file, so the row stays until it is hidden.
Banned license: @img/sharp-wasm32 REDACTED:540— `@img/sharp-wasm32` 0.35.4 is published on registry.npmjs.org under `Apache-2.0 AND LGPL-3.0-or-later AND MIT`, which this policy bans, and it is not declared by this repository but is installed by one of its production, optional or peer dependencies, as its committed lockfile resolves — a transitive dependency ships its licence just the same — so it is installed by everything that depends on this repository, not just by its build toolchain. A package offering SEVERAL licences is a choice and is only charged when every one of them is banned. Replace the package (or the dependency that pulls it in), or record an accepted exception. ★ The licence that makes this row is LGPL-3.0, and unmodified use is often permitted: the LGPL lets your code use an UNMODIFIED copy of the library that stays a separately installed package (its own entry in node_modules, site-packages or the gem path, which a user can replace) without your code coming under the LGPL. What it then asks is that you pass on its licence and notices and let users swap in their own build of it (LGPL-3.0 section 4). Modifying it, copying its code into yours, or merging it into one bundled or statically linked artifact is where the obligations grow, and this policy cannot see which you do — that is why it denies LGPL-3.0 by default. If you use it unmodified and separately installed, allow it in your repository's licence policy rather than replacing it: add `LGPL-3.0-only` / `LGPL-3.0-or-later` to the allow-list of the licence check your CI runs (`license-checker --onlyAllow`, the `allow-licenses` input of GitHub's dependency-review-action, `[licenses] allow` in cargo-deny's deny.toml), record why in the same change, and hide this row on the findings page with that reason. This scan's banned set is not read from that file, so the row stays until it is hidden.
Banned license: @img/sharp-win32-arm64 REDACTED:549— `@img/sharp-win32-arm64` 0.35.4 is published on registry.npmjs.org under `Apache-2.0 AND LGPL-3.0-or-later`, which this policy bans, and it is not declared by this repository but is installed by one of its production, optional or peer dependencies, as its committed lockfile resolves — a transitive dependency ships its licence just the same — so it is installed by everything that depends on this repository, not just by its build toolchain. A package offering SEVERAL licences is a choice and is only charged when every one of them is banned. Replace the package (or the dependency that pulls it in), or record an accepted exception. ★ The licence that makes this row is LGPL-3.0, and unmodified use is often permitted: the LGPL lets your code use an UNMODIFIED copy of the library that stays a separately installed package (its own entry in node_modules, site-packages or the gem path, which a user can replace) without your code coming under the LGPL. What it then asks is that you pass on its licence and notices and let users swap in their own build of it (LGPL-3.0 section 4). Modifying it, copying its code into yours, or merging it into one bundled or statically linked artifact is where the obligations grow, and this policy cannot see which you do — that is why it denies LGPL-3.0 by default. If you use it unmodified and separately installed, allow it in your repository's licence policy rather than replacing it: add `LGPL-3.0-only` / `LGPL-3.0-or-later` to the allow-list of the licence check your CI runs (`license-checker --onlyAllow`, the `allow-licenses` input of GitHub's dependency-review-action, `[licenses] allow` in cargo-deny's deny.toml), record why in the same change, and hide this row on the findings page with that reason. This scan's banned set is not read from that file, so the row stays until it is hidden.
Banned license: @img/sharp-win32-ia32 REDACTED:555— `@img/sharp-win32-ia32` 0.35.4 is published on registry.npmjs.org under `Apache-2.0 AND LGPL-3.0-or-later`, which this policy bans, and it is not declared by this repository but is installed by one of its production, optional or peer dependencies, as its committed lockfile resolves — a transitive dependency ships its licence just the same — so it is installed by everything that depends on this repository, not just by its build toolchain. A package offering SEVERAL licences is a choice and is only charged when every one of them is banned. Replace the package (or the dependency that pulls it in), or record an accepted exception. ★ The licence that makes this row is LGPL-3.0, and unmodified use is often permitted: the LGPL lets your code use an UNMODIFIED copy of the library that stays a separately installed package (its own entry in node_modules, site-packages or the gem path, which a user can replace) without your code coming under the LGPL. What it then asks is that you pass on its licence and notices and let users swap in their own build of it (LGPL-3.0 section 4). Modifying it, copying its code into yours, or merging it into one bundled or statically linked artifact is where the obligations grow, and this policy cannot see which you do — that is why it denies LGPL-3.0 by default. If you use it unmodified and separately installed, allow it in your repository's licence policy rather than replacing it: add `LGPL-3.0-only` / `LGPL-3.0-or-later` to the allow-list of the licence check your CI runs (`license-checker --onlyAllow`, the `allow-licenses` input of GitHub's dependency-review-action, `[licenses] allow` in cargo-deny's deny.toml), record why in the same change, and hide this row on the findings page with that reason. This scan's banned set is not read from that file, so the row stays until it is hidden.
Banned license: @img/sharp-win32-x64 REDACTED:561— `@img/sharp-win32-x64` 0.35.4 is published on registry.npmjs.org under `Apache-2.0 AND LGPL-3.0-or-later`, which this policy bans, and it is not declared by this repository but is installed by one of its production, optional or peer dependencies, as its committed lockfile resolves — a transitive dependency ships its licence just the same — so it is installed by everything that depends on this repository, not just by its build toolchain. A package offering SEVERAL licences is a choice and is only charged when every one of them is banned. Replace the package (or the dependency that pulls it in), or record an accepted exception. ★ The licence that makes this row is LGPL-3.0, and unmodified use is often permitted: the LGPL lets your code use an UNMODIFIED copy of the library that stays a separately installed package (its own entry in node_modules, site-packages or the gem path, which a user can replace) without your code coming under the LGPL. What it then asks is that you pass on its licence and notices and let users swap in their own build of it (LGPL-3.0 section 4). Modifying it, copying its code into yours, or merging it into one bundled or statically linked artifact is where the obligations grow, and this policy cannot see which you do — that is why it denies LGPL-3.0 by default. If you use it unmodified and separately installed, allow it in your repository's licence policy rather than replacing it: add `LGPL-3.0-only` / `LGPL-3.0-or-later` to the allow-list of the licence check your CI runs (`license-checker --onlyAllow`, the `allow-licenses` input of GitHub's dependency-review-action, `[licenses] allow` in cargo-deny's deny.toml), record why in the same change, and hide this row on the findings page with that reason. This scan's banned set is not read from that file, so the row stays until it is hidden.
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.
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.
Swallowed exception (empty catch) packages/transformers/src/utils/hub.js:418— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) packages/transformers/src/utils/model_registry/get_file_metadata.js:99— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) packages/transformers/src/utils/model_registry/get_file_metadata.js:129— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) packages/transformers/src/utils/cache/CrossOriginStorageCache.js:150— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) packages/transformers/src/utils/cache/CrossOriginStorageCache.js:153— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) packages/transformers/src/utils/cache/FileCache.js:101— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) packages/transformers/scripts/dev.mjs:21— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
R4 · Test Coverage· No test reaches this file · ×5
No test reaches this file packages/transformers/scripts/dev.mjs:1— 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:1— 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:1— 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:1— 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:1— 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.
FileTooLong: REDACTED REDACTED— 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.
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.
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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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.
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.
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.
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.
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.
json.checkSchema (cyclomatic 64) REDACTED: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: REDACTED holds 14 of the 49 methods over the threshold — including the worst — and 150 of the 427 points over it (35%), 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.
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.
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.
json.validateObjectNode (cyclomatic 43) REDACTED: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: REDACTED holds 14 of the 49 methods over the threshold — including the worst — and 150 of the 427 points over it (35%), 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.
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.
getCacheNames (cyclomatic 38) packages/transformers/src/configs.js:346— getCacheNames has cyclomatic complexity 38 (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 122) 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.
json.validateNode (cyclomatic 37) REDACTED: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: REDACTED holds 14 of the 49 methods over the threshold — including the worst — and 150 of the 427 points over it (35%), 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.
_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.
json.transition (cyclomatic 29) REDACTED: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: REDACTED holds 14 of the 49 methods over the threshold — including the worst — and 150 of the 427 points over it (35%), 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.
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.
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.
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.
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.
json.formatMatches (cyclomatic 25) REDACTED: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: REDACTED holds 14 of the 49 methods over the threshold — including the worst — and 150 of the 427 points over it (35%), 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.
_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.
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.
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.
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.
json.validateArrayNode (cyclomatic 22) REDACTED: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: REDACTED holds 14 of the 49 methods over the threshold — including the worst — and 150 of the 427 points over it (35%), 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.
json.compareDecimal (cyclomatic 19) REDACTED: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: REDACTED holds 14 of the 49 methods over the threshold — including the worst — and 150 of the 427 points over it (35%), 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.
json.validUriText (cyclomatic 19) REDACTED: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: REDACTED holds 14 of the 49 methods over the threshold — including the worst — and 150 of the 427 points over it (35%), 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.
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.
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.
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 item 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.
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.
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.
_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.
json.stringByte (cyclomatic 18) REDACTED: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: REDACTED holds 14 of the 49 methods over the threshold — including the worst — and 150 of the 427 points over it (35%), 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.
json.unicodeByte (cyclomatic 18) REDACTED: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: REDACTED holds 14 of the 49 methods over the threshold — including the worst — and 150 of the 427 points over it (35%), 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.
json.constrainedPropertyKeys (cyclomatic 18) REDACTED: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: REDACTED holds 14 of the 49 methods over the threshold — including the worst — and 150 of the 427 points over it (35%), 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.
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.
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.
_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.
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.
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.
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.
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.
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.
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.
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.
json.integerScaleReachable (cyclomatic 16) REDACTED: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: REDACTED holds 14 of the 49 methods over the threshold — including the worst — and 150 of the 427 points over it (35%), 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.
json.propertySchema (cyclomatic 16) REDACTED: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: REDACTED holds 14 of the 49 methods over the threshold — including the worst — and 150 of the 427 points over it (35%), 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.
json.schemaMayAcceptKind (cyclomatic 16) REDACTED: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: REDACTED holds 14 of the 49 methods over the threshold — including the worst — and 150 of the 427 points over it (35%), 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.
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.
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.
ensureWasmLoaded (cyclomatic 16) packages/transformers/src/backends/onnx.js:204— 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 232, 244, 259). 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.
_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.
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.
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.
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-08-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 07:00:23 -08:00' --until='2026-11-10 07:00:23 -08: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.
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.
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.
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.
_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.
json.checkSchema (cognitive 72) REDACTED: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.
json.validateObjectNode (cognitive 62) REDACTED: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.
getCacheNames (cognitive 62) packages/transformers/src/configs.js:346— getCacheNames has cognitive complexity 62 (threshold 15). Drivers by points: if/else 23 (37 pts), loops 6 (12 pts), boolean chains 5, other 5, 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.
_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.
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 item 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.
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.
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.
_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.
json.validateNode (cognitive 40) REDACTED: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.
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.
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.
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.
_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.
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.
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.
_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.
json.validateArrayNode (cognitive 29) REDACTED: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.
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.
json.constrainedPropertyKeys (cognitive 27) REDACTED: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.
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.
_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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
json.integerDigitsReachable (cognitive 23) REDACTED: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.
json.compareDecimal (cognitive 23) REDACTED: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.
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.
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.
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.
_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.
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.
json.unicodeByte (cognitive 22) REDACTED: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.
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.
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.
_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 (a function literal at line 48, ds, a function literal at line 42). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
json.propertySchema (cognitive 21) REDACTED: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.
json.validUriText (cognitive 21) REDACTED: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.
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.
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.
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.
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.
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.
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.
_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.
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.
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.
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.
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.
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.
json.stringByte (cognitive 19) REDACTED: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.
constraint.createTokenConstraint.fillMask (cognitive 19) packages/transformers-structured-output/src/engine/constraint.ts:69— constraint.createTokenConstraint.fillMask has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 3 (5 pts), ternaries 2, boolean chains 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.
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.
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.
(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). None of this is in the body itself: all 19 points belong 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.
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.
json.integerScaleReachable (cognitive 18) REDACTED: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.
Random.seed (cognitive 18) packages/transformers/src/utils/random.js:66— Random.seed has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 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.
tensor.cat (cognitive 18) packages/transformers/src/utils/tensor.js:1395— 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.
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.
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.
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.
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.
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.
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.
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.
json.transition (cognitive 16) REDACTED: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.
RegexParser.characterClass (cognitive 16) REDACTED: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.
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.
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.
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.
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.
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.
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.
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.
FunctionTooLong: configs.getNormalizedConfig packages/transformers/src/configs.js:59— FunctionTooLong — getNormalizedConfig runs 257 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 157 over it, 2.57× 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.
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.
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.
Unfinished stub — throws a "not implemented" error packages/transformers/src/image_processors_utils.js:539— A shipped function's whole body still throws a "not implemented" error — generated scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws a "not implemented" exception packages/transformers/src/image_processors_utils.js:539— `post_process_instance_segmentation` throws an exception whose message says it isn't finished — a not-implemented stub wearing an ordinary exception. Implement it or remove it.
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.
Duplication concentrated across 68 sibling directories (64 clone groups) packages/transformers/src/models/dac/modeling_dac.js:6— 64 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 (+62 more sibling(s) not listed) — 26 of them are reported below, and 38 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 64 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 64 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 64 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.
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.
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.
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.
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.
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.
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 with local edits (17 matched lines × 2 locations) · ×1
Duplicated block with local edits (17 matched lines × 2 locations) packages/transformers/src/configs.js:356— packages/transformers/src/configs.js:356 · packages/transformers/src/configs.js:385 — the two spans are one implementation copied and then locally edited — 140 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.
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.
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.
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:522— packages/transformers/src/configs.js:522 · 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.
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.
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.
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.
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.
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.
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.
Complex function checkSchema (cyclomatic 64, cognitive 71) REDACTED: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.
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.
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.
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.
Complex function validateObjectNode (cyclomatic 40, cognitive 59) REDACTED: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.
Complex function getCacheNames (cyclomatic 38, cognitive 62) packages/transformers/src/configs.js:346— getCacheNames has cyclomatic complexity 38 and cognitive complexity 62; 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.
Complex function validateNode (cyclomatic 36, cognitive 42) REDACTED: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.
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.
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.
Complex function transition (cyclomatic 29, cognitive 16) REDACTED: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.
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.
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.
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.
Complex function formatMatches (cyclomatic 25, cognitive 13) REDACTED: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.
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.
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.
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.
Complex function validateArrayNode (cyclomatic 23, cognitive 31) REDACTED: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.
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.
Complex function stringByte (cyclomatic 22, cognitive 30) REDACTED:359— stringByte has cyclomatic complexity 22 and cognitive complexity 30; 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.
Complex function unicodeByte (cyclomatic 22, cognitive 26) REDACTED:412— unicodeByte has cyclomatic complexity 22 and cognitive complexity 26; 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.
Complex function pad_image (cyclomatic 19, cognitive 45) packages/transformers/src/image_processors_utils.js:711— pad_image has cyclomatic complexity 19 and cognitive complexity 45; 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.
Complex function slice (cyclomatic 19, cognitive 35) packages/transformers/src/utils/tensor.js:416— slice has cyclomatic complexity 19 and cognitive complexity 35; 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.
Complex function _call (cyclomatic 19, cognitive 23) packages/transformers/src/pipelines/text-generation.js:108— _call has cyclomatic complexity 19 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.
Complex function compareDecimal (cyclomatic 19, cognitive 22) REDACTED:1205— compareDecimal has cyclomatic complexity 19 and cognitive complexity 22; 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.
Complex function validUriText (cyclomatic 19, cognitive 21) REDACTED:1509— validUriText has cyclomatic complexity 19 and cognitive complexity 21; 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.
Complex function _call_whisper (cyclomatic 18, cognitive 36) packages/transformers/src/pipelines/automatic-speech-recognition.js:200— _call_whisper has cyclomatic complexity 18 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.
Complex function constrainedPropertyKeys (cyclomatic 18, cognitive 28) REDACTED:930— constrainedPropertyKeys has cyclomatic complexity 18 and cognitive complexity 28; 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.
Complex function compare (cyclomatic 18, cognitive 28) packages/transformers/tests/init.js:76— compare has cyclomatic complexity 18 and cognitive complexity 28; 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.
Complex function get_resize_output_image_size (cyclomatic 17, cognitive 23) packages/transformers/src/image_processors_utils.js:803— get_resize_output_image_size has cyclomatic complexity 17 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.
Complex function constructor (cyclomatic 17, cognitive 16) packages/transformers/src/image_processors_utils.js:577— constructor has cyclomatic complexity 17 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.
Complex function resize (cyclomatic 17, cognitive 15) packages/transformers/src/utils/image.js:373— resize has cyclomatic complexity 17 and cognitive complexity 15; 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.
Complex function _call (cyclomatic 16, cognitive 32) packages/transformers/src/models/lfm2_vl/image_processing_lfm2_vl.js:191— _call has cyclomatic complexity 16 and cognitive complexity 32; 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.
Complex function findLongestCommonSequence (cyclomatic 16, cognitive 27) packages/transformers/src/models/whisper/tokenization_whisper.js:346— findLongestCommonSequence has cyclomatic complexity 16 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.
Complex function forward (cyclomatic 16, cognitive 26) packages/transformers/src/models/chatterbox/modeling_chatterbox.js:37— forward has cyclomatic complexity 16 and cognitive complexity 26; 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.
Complex function selectDtype (cyclomatic 16, cognitive 23) packages/transformers/src/utils/dtypes.js:85— selectDtype has cyclomatic complexity 16 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.
Complex function integerScaleReachable (cyclomatic 16, cognitive 21) REDACTED:575— integerScaleReachable has cyclomatic complexity 16 and cognitive complexity 21; 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.
Complex function propertySchema (cyclomatic 16, cognitive 21) REDACTED:707— propertySchema has cyclomatic complexity 16 and cognitive complexity 21; 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.
Complex function pipeline (cyclomatic 16, cognitive 19) packages/transformers/src/pipelines.js:100— pipeline has cyclomatic complexity 16 and cognitive complexity 19; 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.
Complex function getCache (cyclomatic 16, cognitive 19) packages/transformers/src/utils/cache.js:22— getCache has cyclomatic complexity 16 and cognitive complexity 19; 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: 1745 lines of code REDACTED:1— REDACTED has 1745 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/transformers/src/utils/tensor.js · ×1
packages/transformers/src/utils/tensor.js: 1566 lines of code packages/transformers/src/utils/tensor.js:1— packages/transformers/src/utils/tensor.js has 1566 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/transformers/src/models/modeling_utils.js · ×1
packages/transformers/src/models/modeling_utils.js: 1565 lines of code packages/transformers/src/models/modeling_utils.js:1— packages/transformers/src/models/modeling_utils.js has 1565 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/transformers/src/image_processors_utils.js · ×1
packages/transformers/src/image_processors_utils.js: 954 lines of code packages/transformers/src/image_processors_utils.js:1— packages/transformers/src/image_processors_utils.js has 954 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/transformers/src/utils/maths.js · ×1
packages/transformers/src/utils/maths.js: 954 lines of code packages/transformers/src/utils/maths.js:1— packages/transformers/src/utils/maths.js has 954 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/transformers/src/utils/audio.js · ×1
packages/transformers/src/utils/audio.js: 821 lines of code packages/transformers/src/utils/audio.js:1— packages/transformers/src/utils/audio.js has 821 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
REDACTED: 776 lines of code REDACTED:1— REDACTED has 776 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/transformers/src/utils/image.js · ×1
packages/transformers/src/utils/image.js: 727 lines of code packages/transformers/src/utils/image.js:1— packages/transformers/src/utils/image.js has 727 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/transformers/src/generation/logits_process.js · ×1
packages/transformers/src/generation/logits_process.js: 696 lines of code packages/transformers/src/generation/logits_process.js:1— packages/transformers/src/generation/logits_process.js has 696 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/transformers/src/models/registry.js · ×1
packages/transformers/src/models/registry.js: 649 lines of code packages/transformers/src/models/registry.js:1— packages/transformers/src/models/registry.js has 649 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/transformers/src/models/whisper/tokenization_whisper.js · ×1
packages/transformers/src/models/whisper/tokenization_whisper.js: 604 lines of code packages/transformers/src/models/whisper/tokenization_whisper.js:1— packages/transformers/src/models/whisper/tokenization_whisper.js has 604 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/transformers/src/configs.js · ×1
packages/transformers/src/configs.js: 554 lines of code packages/transformers/src/configs.js:1— packages/transformers/src/configs.js has 554 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/transformers/src/utils/hub.js · ×1
packages/transformers/src/utils/hub.js: 541 lines of code packages/transformers/src/utils/hub.js:1— packages/transformers/src/utils/hub.js has 541 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/transformers/src/models/auto/modeling_auto.js · ×1
packages/transformers/src/models/auto/modeling_auto.js: 540 lines of code packages/transformers/src/models/auto/modeling_auto.js:1— packages/transformers/src/models/auto/modeling_auto.js has 540 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/transformers/src/models/whisper/modeling_whisper.js · ×1
packages/transformers/src/models/whisper/modeling_whisper.js: 450 lines of code packages/transformers/src/models/whisper/modeling_whisper.js:1— packages/transformers/src/models/whisper/modeling_whisper.js has 450 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
Dead file (~42 LoC) scripts/rebuildPlugin.mjs— no import path from any entry point (51 application, 4 tooling, 194 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
Dead file (~21 LoC) scripts/reportSize.mjs— no import path from any entry point (51 application, 4 tooling, 194 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
X17 · Uncapped recursion over a caller-supplied document· Recursive walk over a caller-supplied document has no depth cap · ×1
Recursive walk over a caller-supplied document has no depth cap packages/transformers/src/models/session.js:175— `sessionRun` is exported, takes a document from its caller (line 192) and hands it to `replaceTensors`, which calls itself at line 175 (`replaceTensors`) with a piece of `obj` — and nowhere in `replaceTensors` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `replaceTensors` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
X2 · Cancellation propagation· Async function without AbortSignal · ×1
Async function without AbortSignal: _getLfsFileHash packages/transformers/src/utils/cache/CrossOriginStorageCache.js:224— `_getLfsFileHash` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Swallowed exception (caught, then discarded) packages/transformers/src/utils/cache.js:85— `catch (e)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included.
redundant comment packages/transformers/src/image_processors_utils.js:1058— "Stack pixel values" repeats the code it sits on: 3 of its 3 words (stack, pixel, values) are already in `const pixel_values = stack(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/transformers/src/models/auto/feature_extraction_auto.js:41— "Instantiate feature extractor" repeats the code it sits on: 3 of its 3 words (instantiate, feature, extractor) are already in `return new feature_extractor_class(preprocessorConfig);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/transformers/src/models/auto/image_processing_auto.js:47— "Instantiate image processor" repeats the code it sits on: 3 of its 3 words (instantiate, image, processor) are already in `return new image_processor_class(preprocessorConfig);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/transformers/src/models/convnext/image_processing_convnext.js:32— "then crop to (shortest_edge, shortest_edge)" repeats the code it sits on: 3 of its 3 words (crop, shortest, edge) are already in `image = await image.center_crop(shortest_edge, shortest_edge);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/transformers/src/models/idefics3/image_processing_idefics3.js:66— "Original sizes of images" repeats the code it sits on: 3 of its 3 words (original, sizes, images) are already in `original_sizes.push(...images_list.map((x) => x.original_size));`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/transformers/src/models/modeling_utils.js:971— "prepare model inputs" repeats the code it sits on: 3 of its 3 words (prepare, model, inputs) are already in `model_inputs = this.prepare_inputs_for_generation(all_input_ids, model_inputs, generation_config);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/transformers/src/models/vitmatte/image_processing_vitmatte.js:32— "Stack pixel values" repeats the code it sits on: 3 of its 3 words (stack, pixel, values) are already in `const pixel_values = stack(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/transformers/src/models/voxtral_realtime/modeling_voxtral_realtime.js:62— "Set up iterator from input_features" repeats the code it sits on: 4 of its 4 words (set, iterator, input, features) are already in `const chunks_iter = input_features[Symbol.asyncIterator]?.() ?? input_features[Symbol.iterator]?.();`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/transformers/src/pipelines/text-to-audio.js:109— "Repeat speaker embeddings for batch size" repeats the code it sits on: 5 of its 5 words (repeat, speaker, embeddings, batch, size) are already in `speaker_embeddings = speaker_embeddings.repeat(batch_size, 1);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/transformers/src/pipelines/zero-shot-audio-classification.js:84— "Run model with both text and audio inputs" repeats the code it sits on: 4 of its 5 words (model, text, audio, inputs) are already in `const output = await this.model({ ...text_inputs, ...audio_inputs });`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/transformers/src/pipelines/zero-shot-image-classification.js:79— "Run model with both text and pixel inputs" repeats the code it sits on: 4 of its 5 words (model, text, pixel, inputs) are already in `const output = await this.model({ ...text_inputs, pixel_values });`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/transformers/src/pipelines/zero-shot-object-detection.js:136— "Run model with both text and pixel inputs" repeats the code it sits on: 4 of its 5 words (model, text, pixel, inputs) are already in `const output = await this.model({ ...text_inputs, pixel_values });`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/transformers/src/utils/hub.js:305— "Update the cache key to be the local path" repeats the code it sits on: 4 of its 5 words (cache, key, local, path) are already in `cacheKey = localPath;`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/transformers/src/utils/image.js:411— "Create image from the resized data" repeats the code it sits on: 4 of its 4 words (create, image, resized, data) are already in `const resizedImage = new RawImage(ctx.getImageData(0, 0, width, height).data, width, height, 4);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/transformers/src/utils/image.js:486— "Create image from the padded data" repeats the code it sits on: 4 of its 4 words (create, image, padded, data) are already in `const paddedImage = new RawImage(ctx.getImageData(0, 0, newWidth, newHeight).data, newWidth, newHeight, 4);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/transformers/src/utils/image.js:526— "Create image from the resized data" repeats the code it sits on: 4 of its 4 words (create, image, resized, data) are already in `const resizedImage = new RawImage(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/transformers/src/utils/image.js:590— "Create image from the resized data" repeats the code it sits on: 4 of its 4 words (create, image, resized, data) are already in `const resizedImage = new RawImage(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/transformers/src/utils/io.js:41— "Create the file write stream" repeats the code it sits on: 4 of its 4 words (create, file, write, stream) are already in `const fileStream = fs.createWriteStream(path);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/transformers/src/utils/tensor.js:96— "Create new tensor" repeats the code it sits on: 3 of its 3 words (create, new, tensor) are already in `this.ort_tensor = new ONNXTensor(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/transformers/tests/init.js:35— "For each typed array constructor" repeats the code it sits on: 3 of its 3 words (typed, array, constructor) are already in `for (const ctorName of TYPED_ARRAYS_CONSTRUCTOR_NAMES)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/transformers/tests/init.js:53— "Call the original method" repeats the code it sits on: 3 of its 3 words (call, original, method) are already in `return originalMethod.apply(this, args);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/transformers/tests/models/audio_spectrogram_transformer/test_feature_extraction_audio_spectrogram_transformer.js:7— "ASTFeatureExtractor" repeats the code it sits on: 3 of its 3 words (ast, feature, extractor) are already in `describe("ASTFeatureExtractor", () =>`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/transformers/tests/models/clap/test_feature_extraction_clap.js:8— "ClapFeatureExtractor" repeats the code it sits on: 3 of its 3 words (clap, feature, extractor) are already in `describe("ClapFeatureExtractor", () =>`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/transformers/tests/models/convnext/test_image_processing_convnext.js:7— "ConvNextFeatureExtractor" repeats the code it sits on: 4 of its 4 words (conv, next, feature, extractor) are already in `describe("ConvNextFeatureExtractor", () =>`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/transformers/tests/models/dpt/test_image_processing_dpt.js:7— "DPTFeatureExtractor" repeats the code it sits on: 3 of its 3 words (dpt, feature, extractor) are already in `describe("DPTFeatureExtractor", () =>`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
Disabled test packages/transformers/tests/models/embedding_gemma2/test_modeling_embedding_gemma2.js:15— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test packages/transformers/tests/models/embedding_gemma2/test_modeling_embedding_gemma2.js:148— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test packages/transformers/tests/models/embedding_gemma2/test_processor_embedding_gemma2.js:19— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test packages/transformers/tests/models/florence2/test_modeling_florence2.js:38— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test packages/transformers/tests/models/florence2/test_modeling_florence2.js:55— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test packages/transformers/tests/models/gemma4/test_feature_extraction_gemma4.js:7— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test packages/transformers/tests/models/gemma4/test_image_processing_gemma4.js:7— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test packages/transformers/tests/models/gemma4/test_processor_gemma4.js:7— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test packages/transformers/tests/models/lfm3_vl/test_image_processing_lfm3_vl.js:7— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test packages/transformers/tests/models/lfm3_vl/test_processor_lfm3_vl.js:7— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test packages/transformers/tests/models/musicgen/test_modeling_musicgen.js:6— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test packages/transformers/tests/models/qwen3_5/test_modeling_qwen3_5.js:90— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Duplicated predicate packages/transformers-structured-output/src/engine/constraint.ts:326— `byte === 0x09 || byte === 0x0a || byte === 0x0d || byte === 0x20` appears character-identically in 2 files — packages/transformers-structured-output/src/engine/constraint.ts, REDACTED. 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.
Duplicated predicate packages/transformers/src/models/modeling_utils.js:750— `generation_config.guidance_scale !== null && generation_config.guidance_scale > 1` appears character-identically in 3 files — packages/transformers/src/models/modeling_utils.js, packages/transformers/src/models/multi_modality/modeling_multi_modality.js, packages/transformers/src/models/musicgen/modeling_musicgen.js. 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.
Duplicated predicate packages/transformers/src/image_processors_utils.js:88— `target_sizes !== null && target_sizes.length !== batch_size` appears character-identically in 2 files — packages/transformers/src/image_processors_utils.js, packages/transformers/src/models/grounding_dino/processing_grounding_dino.js. 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.
Duplicated predicate REDACTED:1852— `value !== null && typeof value === 'object' && !Array.isArray(value)` appears character-identically in 2 files — REDACTED, 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.
Deprecated: glob REDACTED:1157— glob 7.2.3 is resolved in REDACTED and is marked deprecated by its publisher: "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
Deprecated: inflight REDACTED:1202— inflight 1.0.6 is resolved in REDACTED and is marked deprecated by its publisher: "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
Orphaned file packages/transformers/src/utils/model_registry/get_available_dtypes.js:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file packages/transformers/src/utils/model_registry/resolve_model_type.js:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
D21 · Naming Consistency· `StableLmPreTrainedModel` spells `Lm` where 106 names in the project spell it `LM` · ×1
`StableLmPreTrainedModel` spells `Lm` where 106 names in the project spell it `LM` packages/transformers/src/models/stablelm/modeling_stablelm.js:3— 106 of 109 names in project @huggingface/transformers-monorepo spell the token `LM` (106 of 109; unit: names in project @huggingface/transformers-monorepo containing `LM`). Peers: packages.transformers.src.models.afmoe.modeling_afmoe.AfmoeForCausalLM (packages/transformers/src/models/afmoe/modeling_afmoe.js:5); packages.transformers.src.models.albert.modeling_albert.AlbertForMaskedLM (packages/transformers/src/models/albert/modeling_albert.js:28); packages.transformers.src.models.apertus.modeling_apertus.ApertusForCausalLM (packages/transformers/src/models/apertus/modeling_apertus.js:5); packages.transformers.src.models.arcee.modeling_arcee.ArceeForCausalLM (packages/transformers/src/models/arcee/modeling_arcee.js:5); packages.transformers.src.models.auto.modeling_auto.AutoModelForSeq2SeqLM (packages/transformers/src/models/auto/modeling_auto.js:198). Rename to `StableLMPreTrainedModel`. [rule N6]
D21 · Naming Consistency· `StableLmModel` spells `Lm` where 106 names in the project spell it `LM` · ×1
`StableLmModel` spells `Lm` where 106 names in the project spell it `LM` packages/transformers/src/models/stablelm/modeling_stablelm.js:8— 106 of 109 names in project @huggingface/transformers-monorepo spell the token `LM` (106 of 109; unit: names in project @huggingface/transformers-monorepo containing `LM`). Peers: packages.transformers.src.models.afmoe.modeling_afmoe.AfmoeForCausalLM (packages/transformers/src/models/afmoe/modeling_afmoe.js:5); packages.transformers.src.models.albert.modeling_albert.AlbertForMaskedLM (packages/transformers/src/models/albert/modeling_albert.js:28); packages.transformers.src.models.apertus.modeling_apertus.ApertusForCausalLM (packages/transformers/src/models/apertus/modeling_apertus.js:5); packages.transformers.src.models.arcee.modeling_arcee.ArceeForCausalLM (packages/transformers/src/models/arcee/modeling_arcee.js:5); packages.transformers.src.models.auto.modeling_auto.AutoModelForSeq2SeqLM (packages/transformers/src/models/auto/modeling_auto.js:198). Rename to `StableLMModel`. [rule N6]
D21 · Naming Consistency· `StableLmForCausalLM` spells `Lm` where 106 names in the project spell it `LM` · ×1
`StableLmForCausalLM` spells `Lm` where 106 names in the project spell it `LM` packages/transformers/src/models/stablelm/modeling_stablelm.js:13— 106 of 109 names in project @huggingface/transformers-monorepo spell the token `LM` (106 of 109; unit: names in project @huggingface/transformers-monorepo containing `LM`). Peers: packages.transformers.src.models.afmoe.modeling_afmoe.AfmoeForCausalLM (packages/transformers/src/models/afmoe/modeling_afmoe.js:5); packages.transformers.src.models.albert.modeling_albert.AlbertForMaskedLM (packages/transformers/src/models/albert/modeling_albert.js:28); packages.transformers.src.models.apertus.modeling_apertus.ApertusForCausalLM (packages/transformers/src/models/apertus/modeling_apertus.js:5); packages.transformers.src.models.arcee.modeling_arcee.ArceeForCausalLM (packages/transformers/src/models/arcee/modeling_arcee.js:5); packages.transformers.src.models.auto.modeling_auto.AutoModelForSeq2SeqLM (packages/transformers/src/models/auto/modeling_auto.js:198). Rename to `StableLMForCausalLM`. [rule N6]
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 1 of 3 project(s) overshoot their size bounds, lowering Project Cohesion to 3.3/10. The most over is `packages/transformers` (34668 LoC, 1012 module-visible types across 235 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D34 · Knowledge Freshness· Orphaned files with no living knowledge · ×1
Orphaned files with no living knowledge — 2 of 153 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 153 of the 464 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: packages/transformers/src/utils/model_registry/get_available_dtypes.js, packages/transformers/src/utils/model_registry/resolve_model_type.js. Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
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.
No SAST REDACTED:4— 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 5 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.
P3 · Security & performance tooling· Dependabot does not watch npm · ×1
Dependabot does not watch npm .github/dependabot.yml:2— `.github/dependabot.yml` schedules updates, but no `package-ecosystem` entry covers `npm`, which this tree depends on — so those dependencies get no update pull requests and no advisory pressure, however complete the dep-scan credit looks. Add the missing entry to the `updates:` list.
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.)
X2 · Cancellation propagation· Not all async functions that make a request accept an AbortSignal · ×1
Not all async functions that make a request accept an AbortSignal — Only 0/1 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
X5 · Nullable reference types· Strict null checking is not enabled everywhere the repository type-checks · ×1
Strict null checking is not enabled everywhere the repository type-checks — 1/3 of this repository's type-checking configuration(s) turn on strict null checking (`"strict": true`, or `"strictNullChecks": true`). A configuration that states neither is counted as OFF, because off is tsc's own default; a solution-style one whose `"files"` is empty and whose `"references"` point at other projects is in neither number, because it checks no source itself. Where it is off, `string` admits `null` and `undefined`: passing a value that is null compiles silently and throws on the first property access.
Null assertions (`!`) override strict null checking — ~7.4 `!` null assertions per 1k TypeScript source lines — 22 assertion(s) across the 2966 source line(s) of the 9 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: REDACTED (11), packages/transformers-structured-output/src/engine/constraint.ts (5), REDACTED (3). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.
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.
Outdated (npm): @huggingface/jinja — @huggingface/jinja is pinned at 0.5.10; registry.npmjs.org publishes 0.5.13 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.
Outdated (npm): onnxruntime-node — onnxruntime-node is pinned at 1.30.0; registry.npmjs.org publishes 1.31.1 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.
Outdated (npm): onnxruntime-web — onnxruntime-web is pinned at 1.31.0-dev.20260914-8d85527a0; registry.npmjs.org publishes 1.31.1 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.
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.
doc comments repeat the names packages/transformers/src/backends/onnx.js:312— 136 of 1257 documented parameters and 4 of 1096 summaries in `@huggingface/transformers` only repeat the member or parameter name (e.g. "Run an inference session." for `runInferenceSession`). Delete the restating tags, or add what the name does not say.
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.
trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
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.
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.
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.
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.
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.
Run 01a1dd81-b35e-7aa6-b76f-9be5ec4c9a67 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 32 · Warnings: 273 · Recommendations: 75 · Info: 5 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 15-11-2026 @ 04:40 UTC.
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.