Public report — typescript-go, published 24 Sep 2026. Concrete security findings (which rule fired, in which file, on which line; CVE IDs, secret matches, dependency versions) are REDACTED in this version; ask the repo owner for the full report.
Public
Codebase survey Measured under the Code Assurance Index, but not filed — nothing here carries a record a reader can check independently. How a survey is verified No record

Microsoft/typescript-Go

Measured 24 September 2026, 16:34 UTC

No baseline yet — first run
69% Strong
CriticalWeakAdequateStrongExemplary

Very large · 1,057,249 LoC · rebuild ~10.3 person-years · weakest lens: Code Health (56%)

Findings by grade

10 critical 727 serious 28 minor 46 could not be resolved — could be critical — see Limitations

This survey was produced by

Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
24 September 2026, 16:34 UTC

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

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

32/35dimensions tool-verifieddeterministic · confidence 1.0 · 3 LLM-assisted, advisory
749findings with an exact file:lineof 765 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
35/126dimensions across the health lenses1057249 LoC — wide & deep
Chapters

Executive summary

Template / example. This repo declares itself a template, kata, sample or demo — code to read or copy, not operate — so the ship-it and operate-it dimensions (CI/CD, observability, ADRs, architecture docs, deployment security) are N/A and what remains is judged accordingly.

The system holds a strong overall standing of 69%, indicating a robust architectural foundation that supports significant business value. However, this stability is undermined by substantial technical debt in the codebase, creating a fragile balance where high-level design excellence is offset by difficult-to-maintain implementation details. For leadership, this means the platform is reliable today but increasingly expensive and slow to evolve tomorrow if underlying complexity is not addressed.

The asset is very large, comprising over one million lines of production code, with a rebuild effort estimated at roughly ten person-years and a cost near €1.5 million. This scale represents a massive capital investment tied up in the current state. The composition suggests a highly structured, non-boilerplate environment, meaning the value lies in complex, custom logic rather than generic scaffolding. Changing this system requires significant resources, making efficiency in maintenance critical to protecting that investment.

The primary risk is concentrated in code health, which scores only 56%. This lens measures how easy the code is to understand and modify. Poor health here directly threatens delivery speed, as engineers spend more time deciphering logic than building features, and increases the likelihood of defects during changes. While the architecture is excellent at 99%, ensuring changes do not ripple unexpectedly, the messy implementation details create a bottleneck. New teams will struggle to onboard, and operational costs will rise as debugging becomes more time-consuming.

Conversely, the system demonstrates genuine strength in maturity and security, scoring 88% and 90% respectively. The codebase is well-documented, and security exposure is low, providing a safe and observable environment for operations. These areas are not immediate concerns and allow the team to focus energy elsewhere without fearing systemic instability or compliance failures.

The highest-leverage action is to break down branch-heavy functions, aiming for a complexity score of five or less. This single move offers the best return on effort by immediately improving readability and reducing defect rates. Focusing here first protects the large investment by making the system cheaper to maintain, while other improvements can follow once the core complexity is tamed.

How the score is built — each lens's share of the headline Width is the lens's weight in the worst-heaviest fold (the weakest area pulls hardest); colour is that lens's own band. A lens fixes the score in proportion to its width.
Code Health 56% · 47% weightReadiness 73% · 26% weightMaturity 88% · 14% weightSecurity 90% · 8% weightArchitecture 99% · 4% weight

Raise Code Health 56 → 70 (the Healthy floor) ⇒ headline 69 → ~76.

Code composition — where the lines go
Tests 100%
Rebuild cost & value ~ Modeled — €500,000–€2,500,000
Cost to rebuild€500,000–€2,500,000 (5.0–15.7 person-years (8,319–26,392 h), ~6–20 engineers)
Domain complexityStandard — harder problems cost more per line
Quality factor1.0× (at 69% quality) — the last 20% of quality is most of the work
Size & shapeVery large · effort split not classified (source measured from disk; the effort-tier breakdown is a C#-only syntax walk)

This codebase represents roughly ~10.3 person-years of build effort (about ~€1,500,000 to rebuild). Its weakest lens is Code Health at 56% — the part of that asset most exposed by the findings below.

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

Top priorities

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

1
Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
+12.9 pts · Medium effort · Cyclomatic Complexity
2
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
+12.9 pts · Medium effort · Large Files
3
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.
+6.6 pts · Medium effort · Code Duplication

Diagnosis — what's actually going on

Value concentrated against a weak lens · Medium · Value at risk
This is a Very large asset (~10.3 person-years to rebuild), and its weakest lens is Code Health at 56%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
Evidence: valuation: Very large, ~10.3 person-years rebuild (1,057,249 LoC) · weakest lens: Code Health 56%
→ Direct remediation budget at Code Health first — highest risk-reduction per euro on an asset this size.
Highest-leverage move · Medium · Leverage
Of everything flagged, the best return on effort is: Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5. The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.

Architecture — module dependency matrix

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

102 modules, 548 dependencies. 1 dependency cycle across 40 modules, marked above the diagonal.

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

Module dependency matrix. The row depends on the column; the number is how many type pairs create the dependency. A cell above the diagonal is part of a dependency cycle.
depends on →1 com/microsoft/typescript-go/internal/collections2 com/microsoft/typescript-go/internal/tspath3 com/microsoft/typescript-go/internal/vfs4 com/microsoft/typescript-go/internal/lsp/lsproto5 com/microsoft/typescript-go/internal/packagejson6 com/microsoft/typescript-go/internal/scanner7 com/microsoft/typescript-go/internal/sourcemap8 com/microsoft/typescript-go/internal/spanmap9 com/microsoft/typescript-go/internal/transformers10 com/microsoft/typescript-go/internal/transformers/declarations11 com/microsoft/typescript-go/internal/vfs/iovfs12 com/microsoft/typescript-go/internal/contentmapper13 com/microsoft/typescript-go/internal/diagnosticwriter14 com/microsoft/typescript-go/internal/ls/lsconv15 com/microsoft/typescript-go/internal/module16 com/microsoft/typescript-go/internal/outputpaths17 com/microsoft/typescript-go/internal/project/ata18 com/microsoft/typescript-go/internal/tsoptions19 com/microsoft/typescript-go/internal/modulespecifiers20 com/microsoft/typescript-go/internal/compiler21 com/microsoft/typescript-go/internal/execute/incremental22 com/microsoft/typescript-go/internal/ls/lsutil23 com/microsoft/typescript-go/internal/execute/tsc24 com/microsoft/typescript-go/internal/ls/autoimport25 com/microsoft/typescript-go/internal/testutil/harnessutil26 com/microsoft/typescript-go/internal/ls27 com/microsoft/typescript-go/internal/project28 com/microsoft/typescript-go/internal/fourslash29 com/microsoft/typescript-go/internal/lsp30 com/microsoft/typescript-go/internal/checker31 com/microsoft/typescript-go/internal/locale32 com/microsoft/typescript-go/internal/diagnostics33 com/microsoft/typescript-go/internal/binder34 com/microsoft/typescript-go/internal/printer35 com/microsoft/typescript-go/internal/core36 com/microsoft/typescript-go/internal/ast37 com/microsoft/typescript-go/internal/api38 com/microsoft/typescript-go/internal/execute39 com/microsoft/typescript-go/internal/execute/build40 com/microsoft/typescript-go/internal/execute/tsctests
1 com/microsoft/typescript-go/internal/collections
2 com/microsoft/typescript-go/internal/tspath
3 com/microsoft/typescript-go/internal/vfs
4 com/microsoft/typescript-go/internal/lsp/lsproto1
5 com/microsoft/typescript-go/internal/packagejson511
6 com/microsoft/typescript-go/internal/scanner1289
7 com/microsoft/typescript-go/internal/sourcemap28
8 com/microsoft/typescript-go/internal/spanmap7
9 com/microsoft/typescript-go/internal/transformers16411
10 com/microsoft/typescript-go/internal/transformers/declarations11228334
11 com/microsoft/typescript-go/internal/vfs/iovfs3
12 com/microsoft/typescript-go/internal/contentmapper23347
13 com/microsoft/typescript-go/internal/diagnosticwriter132143
14 com/microsoft/typescript-go/internal/ls/lsconv1161162
15 com/microsoft/typescript-go/internal/module7173124
16 com/microsoft/typescript-go/internal/outputpaths1121
17 com/microsoft/typescript-go/internal/project/ata32323
18 com/microsoft/typescript-go/internal/tsoptions9845212112215
19 com/microsoft/typescript-go/internal/modulespecifiers1322147
20 com/microsoft/typescript-go/internal/compiler14206221231026314261681863
21 com/microsoft/typescript-go/internal/execute/incremental151521521141018
22 com/microsoft/typescript-go/internal/ls/lsutil131164
23 com/microsoft/typescript-go/internal/execute/tsc43131671212
24 com/microsoft/typescript-go/internal/ls/autoimport1716316316135313911722
25 com/microsoft/typescript-go/internal/testutil/harnessutil233511572157
26 com/microsoft/typescript-go/internal/ls841111152613919102833924100
27 com/microsoft/typescript-go/internal/project23301981411364615105361221312
28 com/microsoft/typescript-go/internal/fourslash21112141138151511182
29 com/microsoft/typescript-go/internal/lsp2121821141115121
30 com/microsoft/typescript-go/internal/checker8111112232216114551224411731323144
31 com/microsoft/typescript-go/internal/locale111223221211235122441151423
32 com/microsoft/typescript-go/internal/diagnostics2
33 com/microsoft/typescript-go/internal/binder12427
34 com/microsoft/typescript-go/internal/printer324112743
35 com/microsoft/typescript-go/internal/core32
36 com/microsoft/typescript-go/internal/ast3712111161320
37 com/microsoft/typescript-go/internal/api1331211181710168
38 com/microsoft/typescript-go/internal/execute534151110124
39 com/microsoft/typescript-go/internal/execute/build672826369317
40 com/microsoft/typescript-go/internal/execute/tsctests312111113311211
Dependency, pointing down the layeringAbove the diagonal — part of a cycleThe module itself
…/internal/collections…pt-go/internal/tspath…cript-go/internal/vfs…/internal/lsp/lsproto…/internal/packagejson…t-go/internal/scanner…go/internal/sourcemap…t-go/internal/spanmap…internal/transformers…sformers/declarations…go/internal/vfs/iovfs…nternal/contentmapper…rnal/diagnosticwriter…go/internal/ls/lsconv…pt-go/internal/module…/internal/outputpaths…/internal/project/ata…go/internal/tsoptions…rnal/modulespecifiers…-go/internal/compiler…l/execute/incremental…go/internal/ls/lsutil…/internal/execute/tsc…nternal/ls/autoimport…/testutil/harnessutil…script-go/internal/ls…t-go/internal/project…go/internal/fourslash…cript-go/internal/lsp…t-go/internal/checker…pt-go/internal/locale…/internal/diagnostics…pt-go/internal/binder…t-go/internal/printer…ript-go/internal/core…cript-go/internal/ast…cript-go/internal/api…t-go/internal/execute…nternal/execute/build…rnal/execute/tsctests…/internal/collections1…pt-go/internal/tspath2…cript-go/internal/vfs3…/internal/lsp/lsproto4…/internal/packagejson5…t-go/internal/scanner6…go/internal/sourcemap7…t-go/internal/spanmap8…internal/transformers9…sformers/declarations10…go/internal/vfs/iovfs11…nternal/contentmapper12…rnal/diagnosticwriter13…go/internal/ls/lsconv14…pt-go/internal/module15…/internal/outputpaths16…/internal/project/ata17…go/internal/tsoptions18…rnal/modulespecifiers19…-go/internal/compiler20…l/execute/incremental21…go/internal/ls/lsutil22…/internal/execute/tsc23…nternal/ls/autoimport24…/testutil/harnessutil25…script-go/internal/ls26…t-go/internal/project27…go/internal/fourslash28…cript-go/internal/lsp29…t-go/internal/checker30…pt-go/internal/locale31…/internal/diagnostics32…pt-go/internal/binder33…t-go/internal/printer34…ript-go/internal/core35…cript-go/internal/ast36…cript-go/internal/api37…t-go/internal/execute38…nternal/execute/build39…rnal/execute/tsctests401511128928716411112283343233471321431161162717312411213232398452121122151322147142062212310263142616818631515215211410181311644313167121217163163161353139117222335115721578411111526139191028339241002330198141136461510536122131221112141138151511182212182114111512181111122322161145512244117313231441112232212112351224411514232124273241127433237121111613201331211181710168534151110124672826369317312111113311211+62 more modules (most-connected shown)

At a glance — Code Health · 56% · Adequate · gated by R2, R3 ·

At a glance — Architecture · 99% · Exemplary ·

At a glance — Maturity · 88% · Exemplary ·

At a glance — Readiness · 73% · Adequate · gated by R4 ·

At a glance — Security · 90% · Exemplary ·

Security & Compliance — OWASP Top-10 mapping

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

OWASP categoryFindingsSeverity
A06:2021 — Vulnerable & Outdated Components9High / Critical

Roadmap

First, reduce cyclomatic complexity by breaking down branch-heavy functions and split large files into smaller, focused modules to improve maintainability. Next, address code duplication by extracting shared executable logic into common functions and consolidating repeated declarations into shared types or factories. Finally, increase test coverage by importing and testing unreached modules, and clean up dependencies by removing unused packages and correctly categorizing type- and test-only tools.

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

Do thisHelpsEffortDimension
Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.+12.9 ptsMediumCyclomatic Complexity
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.+12.9 ptsMediumLarge Files
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.+6.6 ptsMediumCode Duplication
Add tests that import the unreached modules (directly or through their public entry).+5.1 ptsMediumTest Coverage
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.+5.1 ptsMediumDependency Hygiene
Keep the changelog current — add a versioned entry (Keep-a-Changelog ## [x.y.z]) for each release so the history isn't a stub.+4.5 ptsMediumRelease Hygiene
Resolve the 1 Orphaned knowledge finding(s) in Knowledge Freshness — start with namedevaluation.go.+0.7 ptsLowKnowledge Freshness
Resolve the 7 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (7).+0.6 ptsLowDependency Vulnerabilities

File quality

Per-file score 0–10 — a quality signature. Of 154 files carrying findings, judged against the Template bar: 0% slop · 1% mixed · 99% near-clean.

FileScoreBandWorst signal
REDACTED2.3MixedDependency Vulnerabilities: High CVE: REDACTED
internal/api/session.go6.0Near-cleanExplicit Debt: TodoComment
internal/printer/printer.go6.0Near-cleanExplicit Debt: TodoComment
internal/checker/services.go6.0Near-cleanExplicit Debt: TodoComment
internal/format/indent.go6.0Near-cleanExplicit Debt: TodoComment
internal/transformers/tstransforms/runtimesyntax.go6.0Near-cleanExplicit Debt: TodoComment
internal/fourslash/fourslash.go6.0Near-cleanExplicit Debt: TodoComment
internal/transformers/estransforms/classfields.go6.0Near-cleanExplicit Debt: TodoComment
internal/transformers/jsxtransforms/jsx.go6.0Near-cleanExplicit Debt: TodoComment
internal/checker/checker.go6.0Near-cleanExplicit Debt: TodoComment
internal/compiler/emitter.go6.0Near-cleanExplicit Debt: TodoComment
internal/transformers/declarations/transform.go6.0Near-cleanExplicit Debt: TodoComment
internal/ls/completions.go6.0Near-cleanExplicit Debt: TodoComment
internal/transformers/estransforms/esdecorator.go6.0Near-cleanExplicit Debt: TodoComment
internal/ls/findallreferences.go6.0Near-cleanExplicit Debt: TodoComment
internal/parser/jsdoc.go6.0Near-cleanExplicit Debt: TodoComment
internal/printer/factory.go6.0Near-cleanExplicit Debt: TodoComment
internal/compiler/program.go6.0Near-cleanExplicit Debt: TodoComment
internal/parser/parser.go6.0Near-cleanExplicit Debt: TodoComment
internal/checker/pseudotypenodebuilder.go6.0Near-cleanExplicit Debt: TodoComment

How the grades work

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

Critical — 10

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 — 727

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 — 28

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

Could not be resolved — 46

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

Methodology & how to trust this report

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

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

What we checked — 35 dimensions across the health lenses
D4D9D10D12D13D14D15D16D17D19D21D28D29D30D34D35D37D43AX10M1M3M4P1P3P6R1R10R2R3R4R5R6R7R8R9

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

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

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

Tools & methods

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

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

Every finding is locatable in findings.md. Run 01a0d444-62ad-7d6f-a24d-a03207272891.

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

Run transparency — what happened this run

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

  • D1 Cyclomatic Complexity — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Most of this repository's production source (.js, .mjs, .mts, .ts) had no cyclomatic complexity computed for it: no method bodies were exposed for those file kinds by any language model this pass could load.
  • D2 Cognitive Complexity — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Most of this repository's production source (.js, .mjs, .mts, .ts) had no cognitive complexity computed for it: no method bodies were exposed for those file kinds by any language model this pass could load.
  • D8 Code Coverage — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT READ here — but this repository measures it: a Codecov configuration (.github/codecov.yml) and a coverage step in CI (`codecov/codecov-action`) shows that coverage is collected and tracked in your own CI. The built-in collector has no runner for this ecosystem (.ts, .go, .tsx, .js), so the analyzer could not read the number — a gap in the analyzer's language coverage, not an unmeasured repo. Not scored. To have the real number read, produce a coverage report in a standard format (lcov — `vitest --coverage`, `jest --coverage`, `bun test --coverage --coverage-reporter=lcov`, or `nyc`, or `go test -coverprofile=coverage.out ./...`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures. You can widen what we reach: optional: produce a coverage report in a standard format (lcov — `vitest --coverage`, `jest --coverage`, `bun test --coverage --coverage-reporter=lcov`, or `nyc`, or `go test -coverprofile=coverage.out ./...`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures — then the real number is read on the next scan.
  • D10 Test Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 585 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 757 test source file(s) (.go) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
  • D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability NOT SCORED: this repository's production source includes .js, and the built-in reliability runner cannot re-run the .js test suite(s) — so reliability was not measured for the repository as a whole. The Go (2 modules): measured (0 flaky) suite(s) did re-run, and came back with 0 flaky across 1 measured tier(s) — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — test reliability is excluded from the score rather than counted.
  • D14 License Compliance — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares a Go module (REDACTED/go.sum), but the licence verdict published here was taken over its npm package dependencies. Nothing was read about its Go dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. A language sidecar this run needed FAILED, so the code model the non-MSBuild public-API collector reads was never built — this is a DEGRADED run, not a settled gap, and the surface may well be collectable on a re-run: The TypeScript/JavaScript sidecar EXITED with code 1 after 2.5s, so the TypeScript/JavaScript code model degraded to null. This is the sidecar's own failure, not a budget of ours.
  • D32 Data Compliance (PII/GDPR) — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `_extension/src/client.ts`, `_extension/src/languageFeatures/onAutoInsert.ts`, `_packages/native-preview/src/api/async/api.ts`, `_packages/native-preview/src/api/sync/api.ts`, `_packages/native-preview/src/ast/is.generated.ts`, … (+27 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
  • D44 Platform End-of-Life — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This dimension reads a project's own statement about the platform it runs on: a TargetFramework in a .NET project file, a .nvmrc or .python-version, a capped requires-python, 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 (REDACTED, a Gemfile's ruby directive, a Dockerfile) is simply not read here yet.
  • AX3 Project dependency cycles — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over which project references which — facts that live in .csproj references. This repository either commits no MSBuild project at all (its C# may still have been parsed as syntax-only projects, which carry no references between them) or its projects failed to load, so there was no graph to read. That is a gap in this analyzer's reach — not a finding that the repository is free of what this check looks for.
  • AX4 Dependency direction — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over the direction each project reference points — facts that live in .csproj references. This repository either commits no MSBuild project at all (its C# may still have been parsed as syntax-only projects, which carry no references between them) or its projects failed to load, so there was no graph to read. That is a gap in this analyzer's reach — not a finding that the repository is free of what this check looks for.
  • AX6 Interface segregation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • AX8 Test isolation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over which projects are test projects, and what they reference — facts that live in .csproj references. This repository either commits no MSBuild project at all (its C# may still have been parsed as syntax-only projects, which carry no references between them) or its projects failed to load, so there was no graph to read. That is a gap in this analyzer's reach — not a finding that the repository is free of what this check looks for.
  • C1 Data Protection — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
  • C2 Access Controls — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
  • C3 Audit Trail — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
  • C4 Data Retention — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These retention controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks retention controls.
  • C5 Data-Subject Rights — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These data-subject rights controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks data-subject rights controls.
  • ED5 Idempotency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check finds retry-prone mutations by walking the repository's declared types, and NONE was loaded on this run, so it had nothing to look at. That is a limit of the analyzer's reach — it reads .NET projects — not a finding that this repository has no command handlers or message consumers.
  • GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • R10 Code Duplication — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 57 further occurrence(s) are not listed individually; the score already reflects all 97.
  • R4 Test Coverage — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 5 further occurrence(s) are not listed individually; the score already reflects all 45.
  • S1 Web-Security Posture — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
  • X1 Async correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X12 Unreachable branch — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X13 Undrained process stream — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X14 Bypassable address classification — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X15 Unvalidated length from an untrusted reader — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X16 Unfloored truncation loop — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X17 Uncapped recursion over a caller-supplied document — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X18 Disposal-pattern correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X19 Unrestored process-global state — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X2 Cancellation propagation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X20 Mistyped argument guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X21 Side-effecting pattern guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X22 Contradicted release guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X23 Unguarded diagnostic materialisation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X24 Document value interpolated into markup unescaped — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X25 Inert configuration knob — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X26 Unsynchronised callback handoff — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X27 Collection changed while being enumerated — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X28 Index access outside its own emptiness guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X29 Per-element action decided by a fixed element — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X3 Exception handling — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X30 Support guard that admits what it rejects — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X32 Type resolved by simple name across every loaded assembly — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X4 Structured logging — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X5 Nullable reference types — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • Production source was not modelled — run is Degraded — No code model read .mts, .ts, so the complexity, duplication and architecture dimensions were scored over a minority of this repository rather than its product, and dimensions that abstained did so for want of a model rather than for want of findings. The grade is NOT representative of this repository; diagnostics.md records the exact cause. The TypeScript/JavaScript sidecar EXITED with code 1 after 2.5s, so the TypeScript/JavaScript code model degraded to null. This is the sidecar's own failure, not a budget of ours.

Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
  • D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

The LLM boundary

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

Dimensions

D4 · Code Duplication9.6 / 10Stronggated by 236 serious findings✓ Tool-verified

What it measures: Copy-pasted code that should be shared instead.

Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.

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

227 duplicated block group(s) detected. A further 9 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 2 of the 236 are in trees this repository does not ship — vendored, example/demo, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population. Measured on part of this repository only: .js (74% of production source) was not exposed to THIS dimension's token comparison and is not in this count; duplication there is measured by R10 Code Duplication, the frontend lens's card running the same clone algorithm over the JS/TS token stream.

Duplicated block (5 lines × 2) · ×24internal/api/encoder/encoder.go:499
Duplicated block (8 lines × 2) · ×18internal/checker/checker.go:13502
Duplicated block (9 lines × 2) · ×17internal/api/session.go:2607
Duplicated block (12 lines × 2) · ×16internal/api/session.go:1302
Duplicated block (10 lines × 2) · ×15internal/api/encoder/encoder.go:755

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

What to do

  1. Resolve the 24 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with printer.go (3), encoder.go (2), checker.go (2). — One of this dimension's main actionable groups (24 warning-level).
  2. Resolve the 18 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with services.go (2), checker.go, program.go. — One of this dimension's main actionable groups (18 warning-level).
  3. Resolve the 17 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with classfields.go (3), checker.go (2), session.go. — One of this dimension's main actionable groups (17 warning-level).
  4. Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

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

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

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

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

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

6012 test methods: 6012 unit, 0 integration, 0 BDD, 0 e2e. The JavaScript/TypeScript suite contributes 585 `it`/`test` case(s) across 15 test file(s) declaring at least one; its tier split is read from package names and paths only. The Go suite contributes 5427 test case(s) across 4515 `_test.go` file(s) declaring at least one — every `func Test…(t *testing.T)` that `go test` would collect, plus the suite methods a testify-style runner reaches; a table-driven case list counts once, so this is a floor. Its tier split is INFERRED from file names, paths and build constraints, not declared: 4423 of those file(s) use Go's external test package (`package x_test`), which is a visibility boundary rather than a pyramid tier and was not read as one.

✓ On the Gold path — maintain.

Detailed fixes: d9_recommendation.md.

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

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

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

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

4 skipped (4 with a documented reason), 2 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 585 tests. Measured on the JavaScript/TypeScript suite only — at least 757 test source file(s) (.go) went unread, so its test quality is unmeasured and is not in these counts.

No assertions: Benchmarks · ×2_packages/native-preview/test/async/api.test.ts:6455
Skipped (documented): (unnamed test) · ×4testdata/tests/cases/compiler/typePredicateParameterMismatch.ts:17

What to do

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

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

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

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

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

Maturity: Documented → Verified → Prevented · effective 9.0 / 10 · rule-coverage 93% · ceiling Verified

7 outdated, 0 author-deprecated direct Go module(s), 0 pinning or checksum defect(s). 15 of 15 direct requirement(s) were graded against proxy.golang.org (0 not served there, 1 publishing no tagged release to be behind). Whether any of these modules is UNMAINTAINED is not graded — proxy.golang.org 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, not a registry one. Known CVEs in this module graph are D30's question, read from REDACTED and go.sum there.

Outdated: github.com/mackerelio/go-osstat · ×7

✓ On the Gold path — maintain.

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

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

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

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

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

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

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

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

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

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

0 of 3 shipped npm package(s) use a banned license. Licences were resolved from registry.npmjs.org over the 3 production dependency(ies) this repository's committed lockfile resolves, across 3 product package.json manifest(s). Its 24 `devDependencies` declaration(s) are excluded: a consumer installs none of them. ★ DEPTH: this is the DIRECT production set the lockfile resolves, NOT the transitive closure — only one of the four lock dialects this pass reads states a full graph, so a banned licence pulled in only by a dependency's OWN dependencies is outside this verdict, exactly as the JVM arm's declaration-site verdict is. ★ Each licence is the one the registry publishes for the package's CURRENT release rather than for the pinned version, which is the same caveat the Hex and RubyGems arms carry. This repository publishes itself under Apache-2.0, which is its own choice and is not judged here. ★ COVERAGE OF THIS VERDICT: it grades this repository's npm package dependencies and nothing else. The repository also declares a Go module (REDACTED/go.sum), and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

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

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

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

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

Top hotspots: internal/checker/checker.go (56×106=5936); internal/api/session.go (39×142=5538); internal/ls/completions.go (8×312=2496)

Hotspot: internal/checker/checker.go · ×119internal/checker/checker.go:15243

What to do

  1. Resolve the 119 Hotspot finding(s) in Churn × Complexity Hotspots — start with utilities.go (4), session.go (2), program.go (2). — One of this dimension's main actionable groups (119 warning-level).

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

D16 · Bus Factor9.6 / 10Exemplary✓ Tool-verified

What it measures: Whether knowledge is concentrated in too few people (the "bus factor").

Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.

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

14 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is internal/transformers/declarations/diagnostics.go. Counted over 350 of the 501 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Off-boarding risk: anonymized user #1 · ×2
Further sole-owners (lower concentration)

✓ On the Gold path — maintain.

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

D17 · Explicit Debt9.8 / 10Stronggated by 261 serious findings✓ Tool-verified

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

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

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

261 deducted task-comment markers across 271346 LoC (0.1/KLoC) → score 9.8. 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.

TodoComment · ×254_extension/src/session.ts:251
XxxComment · ×6internal/fswatch/inotify_linux.go:363
FixmeCommentinternal/ls/lsutil/symbol_display.go:253

What to do

  1. Resolve the 254 TodoComment finding(s) in Explicit Debt — start with nodebuilderimpl.go (26), nodecopy.go (18), emitresolver.go (17). — One of this dimension's main actionable groups (254 warning-level).
  2. Resolve the 6 XxxComment finding(s) in Explicit Debt — start with parser.go (5), inotify_linux.go. — One of this dimension's main actionable groups (6 warning-level).
  3. Resolve the 1 FixmeComment finding(s) in Explicit Debt — start with symbol_display.go. — One of this dimension's main actionable groups (1 warning-level).
  4. Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D19 · Documentation QualityAdequate◐ Sampled · advisory

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

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

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

The repository's READMEs and architecture/Docs markdown files together provide a clear overview of what the project is (TypeScript 7.0 native port preview), its preview build, usage examples, and an extensive What-Works section with status notes, plus a dedicated fswatch Go package document. However there are gaps: no installation/build instructions for the TypeScript 7 preview or the native-preview package; no architecture/design documentation; and only one README (the main repo README) is written for insiders rather than the public.

What to do

  1. Improve Documentation Quality — currently 6.0/10. — The repository's READMEs and architecture/Docs markdown files together provide a clear overview of what the project is (TypeScript 7.0 native port preview), its preview build, usage examples, and an extensive What-Works section with status notes, plus a dedicated fswatch Go package document. However there are gaps: no installation/build instructions for the TypeScript 7 preview or the native-preview package; no architecture/design documentation; and only one README (the main repo README) is written for insiders rather than the public.

Detailed fixes: d19_recommendation.md.

D21 · Naming ConsistencyExemplary◐ Sampled · advisory

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

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

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

0 naming inconsistencies across 0 sampled symbols.

✓ On the Gold path — maintain.

Detailed fixes: d21_recommendation.md.

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

D29 · Static Analysis (SAST)10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

semgrep found no security issues.

✓ On the Gold path — maintain.

Detailed fixes: d29_recommendation.md.

D30 · Dependency Vulnerabilities5.2 / 10Adequate✓ Tool-verified

What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir/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, Go, Java and Kotlin via Maven/Gradle, npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05.

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

9 finding(s): 0 critical, 7 high, 2 medium, 0 low.

REDACTED
REDACTED

What to do

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

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

D34 · Knowledge Freshness9.7 / 10Adequategated by 1 critical finding✓ Tool-verified

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

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

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

11 of 350 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is internal/transformers/estransforms/namedevaluation.go. Counted over 350 of the 501 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned knowledgeinternal/transformers/estransforms/namedevaluation.go
Further orphaned files (smaller)

What to do

  1. Resolve the 1 Orphaned knowledge finding(s) in Knowledge Freshness — start with namedevaluation.go. — One of this dimension's main actionable groups (1 issue-level).
  2. Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).

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

D35 · Change Coupling10.0 / 10Adequategated by 2 critical findings✓ Tool-verified

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

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

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

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

Strongest change-coupling: main.go↔host.go 72%; main.go↔diagnosticwriter.go 53%

Boundary-crossing change coupling: main.go ↔ host.go · ×2cmd/tsgo/main.go

What to do

  1. Resolve the 2 Boundary-crossing change coupling finding(s) in Change Coupling — start with main.go (2). — One of this dimension's main actionable groups (2 issue-level).

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

D37 · Vulnerability-disclosure Policy10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.

Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.

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

A vulnerability-disclosure policy (SECURITY.md) is published with a reporting contact.

✓ On the Gold path — maintain.

Detailed fixes: d37_recommendation.md.

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

Frontend & cross-cutting dimensions

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

AX10 · Code composition9.8 / 10Exemplary✓ Tool-verified

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

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

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

What to do

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

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

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

What to do

  • Add a build/run (quick start) section to the root README — the first thing a newcomer needs.
  • Add a 'Testing' section to the root README — how to run the test suite.
  • Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
  • Add a README to the 3 of 6 project(s) that lack one — worth up to 1 pts.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

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

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

M4 · Documentation accuracy10.0 / 10Exemplary◐ Sampled · advisory

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

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

P1 · CI/CD gates10.0 / 10Exemplary○ Nothing flagged

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

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

P3 · Security & performance tooling9.0 / 10Exemplary✓ Tool-verified

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

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

What to do

  • Dependabot is configured but does not watch `npm`, `gomod`, `gitsubmodule` — add those `package-ecosystem` entries 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.
P6 · Release Hygiene8.0 / 10Exemplary✓ Tool-verified

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

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

  • The changelog this check read carries 1 versioned entry, against a bar of 3. Counted as either an `x.y.z` string or a version-shaped section heading (`## [1.2.0]`, `## V14.x.x`, `## Updates in 8.0.x`), whichever is the larger — so a log sectioned by minor series counts its sections, not its individual patch numbers. Entries recorded somewhere this check does not read — release notes generated at tag time from a generator config it did not recognise, or a log kept outside the repository — are not counted here, and this row is about what is re-findable in the tree rather than about how often you release.

What to do

  • Keep the changelog current — add a versioned entry (Keep-a-Changelog ## [x.y.z]) for each release so the history isn't a stub.
R1 · Type Safety10.0 / 10Exemplary✓ 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.

R10 · Code Duplication8.6 / 10Exemplary✓ Tool-verified

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

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

  • _packages/native-preview/src/api/async/api.ts:1555 · _packages/native-preview/src/api/async/api.ts:1745 — the two spans are one implementation copied and then locally edited — 338 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/native-preview/src/api/async/api.ts:1555
  • _scripts/generate-go-ast.ts:465 · _scripts/generate-go-ast.ts:694 — 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. — _scripts/generate-go-ast.ts:465
  • internal/fourslash/_scripts/convertFourslash.mts:3365 · internal/fourslash/_scripts/convertFourslash.mts:3390 — 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. — internal/fourslash/_scripts/convertFourslash.mts:3365
  • _packages/native-preview/src/api/async/api.ts:546 · _packages/native-preview/src/api/async/api.ts:669 — 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/native-preview/src/api/async/api.ts:546
  • _packages/native-preview/src/api/async/api.ts:1320 · _packages/native-preview/src/api/async/api.ts:1465 — 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/native-preview/src/api/async/api.ts:1320
  • _scripts/generate-encoder.ts:342 · _scripts/generate-encoder.ts:589 — 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. — _scripts/generate-encoder.ts:342
  • _packages/native-preview/src/api/node/msgpack.ts:71 · _packages/native-preview/src/api/node/msgpack.ts:95 — 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/native-preview/src/api/node/msgpack.ts:71
  • _packages/native-preview/src/ast/scanner.ts:1814 · _packages/native-preview/src/ast/scanner.ts:1843 · _packages/native-preview/src/ast/scanner.ts:1905 — 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/native-preview/src/ast/scanner.ts:1814
  • _packages/native-preview/src/api/node/msgpack.ts:162 · _packages/native-preview/src/api/node/msgpack.ts:179 — 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/native-preview/src/api/node/msgpack.ts:162
  • _scripts/generate-encoder.ts:368 · _scripts/generate-encoder.ts:1137 — 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. — _scripts/generate-encoder.ts:368
  • _scripts/generate-encoder.ts:648 · _scripts/generate-encoder.ts:920 — 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. — _scripts/generate-encoder.ts:648
  • internal/fourslash/_scripts/convertFourslash.mts:2097 · internal/fourslash/_scripts/convertFourslash.mts:2112 — 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. — internal/fourslash/_scripts/convertFourslash.mts:2097
  • internal/lsp/lsproto/_generate/generate.mts:3318 · internal/lsp/lsproto/_generate/generate.mts:3351 — 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. — internal/lsp/lsproto/_generate/generate.mts:3318
  • _packages/native-preview/src/ast/scanner.ts:1631 · _packages/native-preview/src/ast/scanner.ts:1887 — 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/native-preview/src/ast/scanner.ts:1631
  • _packages/native-preview/src/ast/scanner.ts:1838 · _packages/native-preview/src/ast/scanner.ts:1861 — 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/native-preview/src/ast/scanner.ts:1838
  • _packages/native-preview/src/ast/scanner.ts:1937 · _packages/native-preview/src/ast/scanner.ts:2416 — 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/native-preview/src/ast/scanner.ts:1937
  • _scripts/generate-encoder.ts:559 · _scripts/generate-encoder.ts:676 — 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. — _scripts/generate-encoder.ts:559
  • _scripts/generate-encoder.ts:896 · _scripts/generate-encoder.ts:909 — 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. — _scripts/generate-encoder.ts:896
  • _scripts/generate-ts-ast.ts:922 · _scripts/generate-ts-ast.ts:1088 — 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. — _scripts/generate-ts-ast.ts:922
  • _scripts/generate-ts-ast.ts:950 · _scripts/generate-ts-ast.ts:1102 — 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. — _scripts/generate-ts-ast.ts:950
  • _packages/native-preview/src/api/async/api.ts:1169 · _packages/native-preview/src/api/async/api.ts:1189 — 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/native-preview/src/api/async/api.ts:1169
  • _packages/native-preview/src/api/async/api.ts:2569 · _packages/native-preview/src/api/async/api.ts:2607 — 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/native-preview/src/api/async/api.ts:2569
  • _scripts/schema.ts:1091 · _scripts/schema.ts:1107 — 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. — _scripts/schema.ts:1091
  • internal/fourslash/_scripts/convertFourslash.mts:1626 · internal/fourslash/_scripts/convertFourslash.mts:1748 — 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. — internal/fourslash/_scripts/convertFourslash.mts:1626
  • _extension/src/client.ts:393 · _extension/src/client.ts:409 — 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. — _extension/src/client.ts:393
  • _extension/src/session.ts:287 · _extension/src/session.ts:299 — 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. — _extension/src/session.ts:287
  • _packages/native-preview/src/api/async/api.ts:1098 · _packages/native-preview/src/api/async/api.ts:1114 · _packages/native-preview/src/api/async/api.ts:1130 · _packages/native-preview/src/api/async/api.ts:1146 · +1 more site(s) not listed — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. — _packages/native-preview/src/api/async/api.ts:1098
  • _packages/native-preview/src/api/async/api.ts:1379 · _packages/native-preview/src/api/async/api.ts:1541 · _packages/native-preview/src/api/async/api.ts:1570 · _packages/native-preview/src/api/async/api.ts:1746 · +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/native-preview/src/api/async/api.ts:1379
  • _packages/native-preview/src/api/async/client.ts:76 · _packages/native-preview/src/api/sync/client.ts:38 — 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/native-preview/src/api/async/client.ts:76
  • _packages/native-preview/src/api/node/node.ts:116 · _packages/native-preview/src/api/node/node.ts:136 · _packages/native-preview/src/api/node/node.ts:151 — 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/native-preview/src/api/node/node.ts:116
  • _packages/native-preview/src/ast/scanner.ts:1660 · _packages/native-preview/src/ast/scanner.ts:1672 — 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/native-preview/src/ast/scanner.ts:1660
  • _scripts/generate-encoder.ts:397 · _scripts/generate-encoder.ts:447 · _scripts/generate-encoder.ts:544 · _scripts/generate-encoder.ts:662 · +4 more site(s) not listed — the 8 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. — _scripts/generate-encoder.ts:397
  • _scripts/generate-encoder.ts:848 · _scripts/generate-encoder.ts:981 — 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. — _scripts/generate-encoder.ts:848
  • _scripts/generate-go-ast.ts:511 · _scripts/generate-go-ast.ts:614 — 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. — _scripts/generate-go-ast.ts:511
  • _scripts/generate-ts-ast.ts:1109 · _scripts/generate-ts-ast.ts:1150 — 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. — _scripts/generate-ts-ast.ts:1109
  • internal/fourslash/_scripts/convertFourslash.mts:2123 · internal/fourslash/_scripts/convertFourslash.mts:2308 — 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. — internal/fourslash/_scripts/convertFourslash.mts:2123
  • internal/lsp/lsproto/_generate/generate.mts:3335 · internal/lsp/lsproto/_generate/generate.mts:3372 — 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. — internal/lsp/lsproto/_generate/generate.mts:3335
  • _packages/native-preview/src/api/async/api.ts:1001 · _packages/native-preview/src/api/async/api.ts:1062 · _packages/native-preview/src/api/async/api.ts:1171 · _packages/native-preview/src/api/async/api.ts:1193 — all 4 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/native-preview/src/api/async/api.ts:1001
  • _packages/native-preview/src/api/syncChannel.ts:545 · _packages/native-preview/src/api/syncChannel.ts:582 · _packages/native-preview/src/api/syncChannel.ts:609 — 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/native-preview/src/api/syncChannel.ts:545
  • _packages/native-preview/src/ast/scanner.ts:460 · _packages/native-preview/src/ast/scanner.ts:641 — 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/native-preview/src/ast/scanner.ts:460

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.
R2 · Cyclomatic Complexity3.0 / 10Weak✓ Tool-verified

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

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

  • scan has cyclomatic complexity 164 and cognitive complexity 278; 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/native-preview/src/ast/scanner.ts:1531
  • generateCode has cyclomatic complexity 121 and cognitive complexity 356; 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. — internal/lsp/lsproto/_generate/generate.mts:2164
  • generateFactory has cyclomatic complexity 99 and cognitive complexity 215; 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. — _scripts/generate-ts-ast.ts:554
  • parseFourslashStatement has cyclomatic complexity 80 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 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. — internal/fourslash/_scripts/convertFourslash.mts:292
  • parseExpectedCompletionItem has cyclomatic complexity 68 and cognitive complexity 138; 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. — internal/fourslash/_scripts/convertFourslash.mts:1329
  • generateCmd has cyclomatic complexity 67 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 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. — internal/fourslash/_scripts/convertFourslash.mts:4538
  • patchAndPreprocessModel has cyclomatic complexity 57 and cognitive complexity 94; 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. — internal/lsp/lsproto/_generate/generate.mts:1035
  • scanEscapeSequence has cyclomatic complexity 55 and cognitive complexity 51; 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/native-preview/src/ast/scanner.ts:1261
  • isExpressionNode has cyclomatic complexity 55 and cognitive complexity 9; 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/native-preview/src/ast/is.ts:241
  • parseVerifyCompletionArg has cyclomatic complexity 54 and cognitive complexity 114; 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. — internal/fourslash/_scripts/convertFourslash.mts:1134
  • parseOrganizeImportsArgs has cyclomatic complexity 53 and cognitive complexity 102; 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. — internal/fourslash/_scripts/convertFourslash.mts:2914
  • parseUserPreferences has cyclomatic complexity 51 and cognitive complexity 76; 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. — internal/fourslash/_scripts/convertFourslash.mts:2358
  • generateIsGenerated has cyclomatic complexity 41 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. — _scripts/generate-ts-ast.ts:1222
  • isInExpressionContext has cyclomatic complexity 39 and cognitive complexity 8; 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/native-preview/src/ast/is.ts:322
  • generateTSNodeGenerated has cyclomatic complexity 37 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. — _scripts/generate-encoder.ts:1284
  • reScanSlashToken has cyclomatic complexity 37 and cognitive complexity 66; 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/native-preview/src/ast/scanner.ts:2068
  • scanJsDocToken has cyclomatic complexity 36 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 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/native-preview/src/ast/scanner.ts:2358
  • validate has cyclomatic complexity 34 and cognitive complexity 63; 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. — _scripts/schema.ts:1089
  • iterateCommentRanges has cyclomatic complexity 33 and cognitive complexity 78; 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/native-preview/src/ast/scanner.ts:617

What to do

  • Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
R3 · Large Files1.2 / 10Critical✓ 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.

  • 15 file(s) over 400 lines (counted as significant lines — blank lines excluded — over production source only, tests excluded), largest first: _packages/native-preview/src/api/async/api.ts (2409), _packages/native-preview/src/ast/scanner.ts (2328), Herebyfile.mjs (2136), _scripts/generate-encoder.ts (1846), _scripts/generate-ts-ast.ts (1586), _scripts/schema.ts (1078) (+9 more).

What to do

  • Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
R4 · Test Coverage3.8 / 10Adequate✓ 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. (×40) — internal/fourslash/_scripts/convertFourslash.mts, internal/lsp/lsproto/_generate/generate.mts, Herebyfile.mjs, …

What to do

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

React / JS · Readiness — How outdated the npm dependencies are (a maturity signal). JS/npm CVEs are scored separately in D30 (JS/npm Dependency Vulnerabilities).

Method: npm dependency staleness from manifest/registry metadata (a maturity signal; JS/npm CVEs are scored separately in D30, which answers dependency vulnerabilities for every ecosystem). Deterministic.

R6 · Tooling10.0 / 10Exemplary✓ Tool-verified

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

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

R7 · Dead Code9.4 / 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 142 application, 143 tooling and 13046 test entry point(s) detected in this repo. Gate removals on `npm run build` — an undetected custom entry would make these reachable.
  • no import path from any entry point (142 application, 143 tooling, 13046 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (_packages/native-preview/src/api/sync/client.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — _packages/native-preview/src/api/syncChannel.ts
  • no import path from any entry point (142 application, 143 tooling, 13046 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) — _packages/native-preview/src/api/sync/client.ts, _extension/src/managedFileContext.ts
  • Nothing imports this binding — it is safe to review for removal. (×9) — _extension/src/util.ts:10, _extension/src/util.ts:19, _extension/src/util.ts:170, …
  • Nothing ultimately consumes this binding: its only referrer is the re-export in _packages/native-preview/src/api/node/node.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in _packages/native-preview/src/api/node/node.ts in the same commit, or the barrel will import a name that no longer exists. — _packages/native-preview/src/api/node/node.infrastructure.ts:140
  • Nothing imports THIS copy of 'NODE_EXTENDED_DATA_MASK' — but _packages/native-preview/src/api/node/node.infrastructure.ts:35 in the same directory exports that same name, and it is the copy every import site resolves to. Grepping the name therefore finds live callers that do not reach this binding: it is the dead half of a duplicated pair, left behind when the API moved. Delete it here and keep _packages/native-preview/src/api/node/node.infrastructure.ts's, or, if this one is meant to be the survivor, repoint the importers before removing the other. — _packages/native-preview/src/api/node/protocol.ts:33

What to do

  • Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
R8 · Dependency Hygiene7.0 / 10Strong✓ Tool-verified

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

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

  • Imported only as a TYPE and declared in no reachable package.json. The import is erased at compile time, so nothing is installed and no runtime resolution depends on it — but type-checking a clean clone will fail. Declare the typings it resolves through (or the package itself) in the owning package.json. — _extension/src/configurationMiddleware.ts:4
  • Declared in the root package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it. (×2)

What to do

  • Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
R9 · Circular Imports10.0 / 10Exemplary✓ 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.

Reference — by lens

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

LensScoreRatingImpact
Code Health56%Adequate — gated by R2, R3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture99%ExemplaryStrongest area.
Maturity88%ExemplarySolid.
Readiness73%Adequate — gated by R4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security90%ExemplarySolid.
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.

  • P12 CI test-gate honesty — 1 observation(s) recorded · Reported, not scored — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
  • X9 Subsumed condition operand — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 5 control(s) we could not find positive evidence for

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

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

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

  • AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
  • AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
  • AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
  • AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
  • AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
  • AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
  • AC7 A11y enforcement — No web markup found — accessibility is not applicable to this repository.
  • AX1 Captive dependencies — no DI registrations detected
  • AX2 Stateful singletons — no singleton implementations detected
  • AX3 Project dependency cycles — not assessed — project cycles and dependency direction are computed over a project-reference graph 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
  • AX4 Dependency direction — not assessed — project cycles and dependency direction are computed over a project-reference graph 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
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX6 Interface segregation — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — not assessed — test isolation is computed from a project graph (which projects are test projects, and what they reference) 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
  • AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
  • C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • D1 Cyclomatic Complexity — cyclomatic complexity not measured — .js, .mjs, .mts, .ts exposed no member bodies
  • D11 Test Reliability — Test reliability not scored — polyglot repository, one half has no runner
  • 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.
  • D2 Cognitive Complexity — cognitive complexity not measured — .js, .mjs, .mts, .ts exposed no member bodies
  • D20 ADR Quality — N/A — this repo declares itself a template / kata / sample / demo; a formal ADR log is deferred to a real application built from it.
  • D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
  • D23 Boundary Type-Coupling — Production source is present (.go, .mts, .ts) but bounded contexts are resolved over the C#/VB project set, which exposed none, so context scope could not be assessed. Not scored — this is a gap in the analyzer, not a verdict about this repository. Declaring the codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed — see the recommendation on this dimension for where. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — No inline comments to assess — comment value is not applicable here.
  • D25 ADR Conformance — no ADRs to check
  • D26 Project Cohesion — Project cohesion is assessed over the .NET project set; this target exposed no projects, so project size and spread could not be assessed. Not scored — this is a gap in the analyzer's reach, not a verdict about this repository.
  • D27 Navigability — Most of this repository's production source (.mts, .ts) was not read by navigability analysis, so tracing effort was not assessed — whatever else resolved (another language's projects) is not this repository's navigability. Not scored — this is a gap in the analyzer's reach, not a verdict about this repository.
  • D3 God Classes — Most of this repository's production source (.js, .mjs, .mts, .ts) was not read by god-class detection, so class size was not assessed for the languages that are the product — whatever else this pass did read is not this repository's class size. Not scored — this is a gap in the analyzer, not a verdict about this repository.
  • 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) — 32 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • D36 Supply-chain Provenance & Signing — The CI pipeline builds and tests but publishes no released artifact — no package publish, container push, GitHub release or deployment step. Supply-chain provenance, signing and SBOM attest RELEASED artifacts, so there is nothing to attest here. Add them to the release pipeline when this repo starts shipping artifacts (a published package, a container image, a deployed service or a tagged release).
  • D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
  • 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
  • D5 Coupling — Inter-project coupling could not be assessed — no analyzable project graph was found for this repository. Not scored: a gap in the analyzer's reach, not a verdict about this repository. (Coupling here is Martin afferent/efferent/instability plus reference cycles across a project-reference graph, read today from .NET project files; other ecosystems' module graphs are not read yet.)
  • D6 Cohesion (LCOM4) — Cohesion (LCOM4) is measured over a CS/VB/GO/SCALA/SWIFT/DART class graph, and this repository's production source is mostly .mts, .ts, which this pass does not read, so cohesion was not assessed for this repository. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • 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 included — suite not readable by the collector
  • DM1 Domain Modelling — applicable but not scored (2 signals for this style, 2 needed — the count is met but a required primary signal is absent): 15 strongly-typed id(s); 11 value object(s)
  • ED1 Event-Driven — not scored — this repository shows only 1 of the 3 signals this lens looks for (1 event-sourced shape(s) (event folds / event-recording aggregates))
  • ED5 Idempotency — This check finds retry-prone mutations (command handlers and message/event consumers) by walking the repository's declared types, and none was loaded here, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • ES1 Event Sourcing — not scored — this repository shows only 1 of the 3 signals this lens looks for (1 Go aggregate(s) recording domain events (own events-slice append / raise-record))
  • GD1 Unfinished & placeholder code — no source files were read — this check reads C# syntax, and none was loaded for this repository. That is a limit of the analyzer, not a finding about your code.
  • IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • M2 Architecture documentation — This repo declares itself a template / kata / sample / demo — formal architecture documentation (ADRs, C4 diagrams) is deferred to a real application built from it, so its absence is not a defect here.
  • P2 Observability — Observability was not assessed: this check reads a source model that does not carry this repository's product — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of a logging idiom this check recognises is NOT evidence that this repo lacks structured logging (it may log through its own ecosystem's logger). This is a gap in the analyzer, not a finding about this repository.
  • P7 Outbound HTTP resilience — not measured — the application kind could not be determined for this repo
  • P8 Schema migrations — not assessed — schema-migration practice is read from 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
  • P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (`go test -coverprofile=coverage.out ./...`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
  • PF1 Benchmark discipline — Performance was not assessed: this lens reads a source model that was not loaded for this repository, because the repository is written in a language this lens does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
  • PF2 Allocation hygiene — Performance was not assessed: this lens reads a source model that was not loaded for this repository, because the repository is written in a language this lens does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
  • PF3 Async & latency hygiene — Performance was not assessed: this lens reads a source model that was not loaded for this repository, because the repository is written in a language this lens does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
  • R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
  • S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X1 Async correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X12 Unreachable branch — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X13 Undrained process stream — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X14 Bypassable address classification — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X15 Unvalidated length from an untrusted reader — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X16 Unfloored truncation loop — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X17 Uncapped recursion over a caller-supplied document — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X18 Disposal-pattern correctness — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X19 Unrestored process-global state — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X2 Cancellation propagation — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X20 Mistyped argument guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X21 Side-effecting pattern guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X22 Contradicted release guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X23 Unguarded diagnostic materialisation — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X24 Document value interpolated into markup unescaped — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X25 Inert configuration knob — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X26 Unsynchronised callback handoff — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X27 Collection changed while being enumerated — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X28 Index access outside its own emptiness guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X29 Per-element action decided by a fixed element — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X3 Exception handling — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X30 Support guard that admits what it rejects — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X32 Type resolved by simple name across every loaded assembly — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository

Appendix A — Findings (grouped)

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

Critical — 10 finding(s)
D30 · Dependency Vulnerabilities · High CVE · ×7
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D35 · Change Coupling · Boundary-crossing change coupling · ×2
  • Boundary-crossing change coupling: main.go ↔ host.go cmd/tsgo/main.go — `cmd/tsgo/main.go` (context cmd) and `internal/compiler/host.go` (context internal) sit in DIFFERENT parts of the tree yet change together 72% of the time (13 of the 18 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 13 shared commits counted here, the most recent 3 are `bf00a76c` Remove module resolution caching for now, make resolved modules avail…; `08dddf46` Cache ASTs in test runner (with supporting changes) (#372); `7edbf22e` Move DefaultLibraryPath onto hosts (#325) — run `git show` on any of them.
  • Boundary-crossing change coupling: main.go ↔ diagnosticwriter.go cmd/tsgo/main.go — `cmd/tsgo/main.go` (context cmd) and `internal/diagnosticwriter/diagnosticwriter.go` (context internal) sit in DIFFERENT parts of the tree yet change together 53% of the time (8 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `2cf4cb4f` execute command line initial implementation (#241); `18416640` Separate error reporting, string baselining from compiler baselining …; `9385c45e` Port more type checking (#133) (at that commit the file was still `internal/compiler/error_reporting.go`) — run `git show` on any of them.
D34 · Knowledge Freshness · Orphaned knowledge · ×1
  • Orphaned knowledge internal/transformers/estransforms/namedevaluation.go — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Serious — 727 finding(s)
D17 · Explicit Debt · TodoComment · ×254
  • TodoComment _extension/src/session.ts:251 — // TODO: Support the standard reload/go-to-project-config commands while — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment internal/api/session.go:912 — // TODO: Implement notification handling — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment internal/api/server.go:88 — // TODO: Add logging support — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment internal/ast/utilities.go:499 — // TODO(rbuckton): Move `node != nil` test to call sites — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment internal/ast/utilities.go:519 — // TODO(rbuckton): Move `node != nil` test to call sites — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment internal/ast/utilities.go:1674 — // TODO: Should we deprecate `IsExternalOrCommonJSModule` in favor of this function? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment internal/ast/utilities.go:4290 — // TODO(rbuckton): ParameterDeclaration decorator support for ES decorators must wait until it is standardized — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment internal/ast/precedence.go:113 — // UpdateExpression: // TODO: Do we need to investigate the precedence here? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment internal/ast/precedence.go:154 — // TODO: JSXElement? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment internal/ast/precedence.go:260 — // TODO: Should prefix `++` and `--` be moved to the `Update` precedence? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment internal/binder/binder.go:388 — // TODO: Make this a more specific error and decouple it from the exclusion logic. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment internal/checker/utilities.go:304 — // !!! TODO: JSDoc support — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment internal/checker/emitresolver.go:625 — // !!! TODO: JSDoc support — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment internal/transformers/declarations/util.go:166 — // !!! TODO: JSDoc support — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment internal/transformers/declarations/transform.go:1734 — // !!! TODO: JSDoc support — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment internal/checker/symbolaccessibility.go:22 — // TODO: Strada bug? Why is this allowModules: false? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment internal/checker/symbolaccessibility.go:38 — // TODO: going through emit resolver here is weird. Relayer these APIs. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment internal/checker/nodebuilderimpl.go:2083 — // TODO: going through emit resolver here is weird. Relayer these APIs. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment internal/checker/symbolaccessibility.go:769 — // TODO: the below is shared with similar code in `resolveName` - in fact, rephrasing all this symbol — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment internal/checker/symbolaccessibility.go:776 — // TODO: Should this filtered table be cached in some way? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment internal/checker/services.go:647 — // TODO: Cache symbol existence for files to save text search — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment internal/checker/relater.go:980 — // TODO: remove this when we support static private identifier fields and find other solutions to get privateNamesAndStaticFields test to pass — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment internal/checker/relater.go:3250 — // TODO: Stack errors so we get a pyramid for the "normal" comparison above, _and_ a second for this — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment internal/checker/relater.go:3587 — // TODO: Find a nice way to include potential conditional type breakdowns in error output, if they seem good (they usually don't) — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment internal/checker/pseudotypenodebuilder.go:611 — // TODO: spread tuple params may mess with this check — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • + 229 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Hotspot · ×119
  • Hotspot: internal/checker/checker.go internal/checker/checker.go:15243 — internal/checker/checker.go changed 56 times in last 90 days, max cyclomatic complexity 106 in Checker.resolveExternalModule at line 15243. 22 of those changes were fix/bug commits, and the other 34 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-05-22..2026-08-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-22 06:46:10 +00:00' --until='2026-08-20 06:46:10 +00:00' --full-history --no-merges -- internal/checker/checker.go`: 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.
  • Hotspot: internal/api/session.go internal/api/session.go:583 — internal/api/session.go changed 39 times in last 90 days, max cyclomatic complexity 142 in Session.HandleRequest at line 583. 3 of those changes were fix/bug commits, and the other 36 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-05-22..2026-08-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-22 06:46:10 +00:00' --until='2026-08-20 06:46:10 +00:00' --full-history --no-merges -- internal/api/session.go`: 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.
  • Hotspot: internal/ls/completions.go internal/ls/completions.go:529 — internal/ls/completions.go changed 8 times in last 90 days, max cyclomatic complexity 312 in LanguageService.getCompletionData at line 529. 1 of those changes was a fix/bug commit, and the other 7 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-05-22..2026-08-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-22 06:46:10 +00:00' --until='2026-08-20 06:46:10 +00:00' --full-history --no-merges -- internal/ls/completions.go`: 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.
  • Hotspot: internal/compiler/program.go internal/compiler/program.go:857 — internal/compiler/program.go changed 15 times in last 90 days, max cyclomatic complexity 157 in Program.verifyCompilerOptions at line 857. 4 of those changes were fix/bug commits, and the other 11 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-05-22..2026-08-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-22 06:46:10 +00:00' --until='2026-08-20 06:46:10 +00:00' --full-history --no-merges -- internal/compiler/program.go`: 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.
  • Hotspot: internal/checker/relater.go internal/checker/relater.go:3293 — internal/checker/relater.go changed 9 times in last 90 days, max cyclomatic complexity 229 in Relater.structuredTypeRelatedToWorker at line 3293. 4 of those changes were fix/bug commits, and the other 5 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-05-22..2026-08-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-22 06:46:10 +00:00' --until='2026-08-20 06:46:10 +00:00' --full-history --no-merges -- internal/checker/relater.go`: 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.
  • Hotspot: internal/ls/hover.go internal/ls/hover.go:380 — internal/ls/hover.go changed 13 times in last 90 days, max cyclomatic complexity 132 in ls.getQuickInfoAndDeclarationAtLocation at line 380. 6 of those changes were fix/bug commits, and the other 7 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-05-22..2026-08-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-22 06:46:10 +00:00' --until='2026-08-20 06:46:10 +00:00' --full-history --no-merges -- internal/ls/hover.go`: 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.
  • Hotspot: internal/checker/nodebuilderimpl.go internal/checker/nodebuilderimpl.go:3224 — internal/checker/nodebuilderimpl.go changed 17 times in last 90 days, max cyclomatic complexity 91 in NodeBuilderImpl.typeToTypeNode at line 3224. 8 of those changes were fix/bug commits, and the other 9 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-05-22..2026-08-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-22 06:46:10 +00:00' --until='2026-08-20 06:46:10 +00:00' --full-history --no-merges -- internal/checker/nodebuilderimpl.go`: 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.
  • Hotspot: internal/transformers/declarations/transform.go internal/transformers/declarations/transform.go:574 — internal/transformers/declarations/transform.go changed 24 times in last 90 days, max cyclomatic complexity 59 in DeclarationTransformer.visitDeclarationSubtree at line 574. 7 of those changes were fix/bug commits, and the other 17 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-05-22..2026-08-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-22 06:46:10 +00:00' --until='2026-08-20 06:46:10 +00:00' --full-history --no-merges -- internal/transformers/declarations/transform.go`: 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.
  • Hotspot: internal/checker/grammarchecks.go internal/checker/grammarchecks.go:214 — internal/checker/grammarchecks.go changed 6 times in last 90 days, max cyclomatic complexity 193 in Checker.checkGrammarModifiers at line 214. 1 of those changes was a fix/bug commit, and the other 5 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-05-22..2026-08-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-22 06:46:10 +00:00' --until='2026-08-20 06:46:10 +00:00' --full-history --no-merges -- internal/checker/grammarchecks.go`: 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.
  • Hotspot: internal/tsoptions/tsconfigparsing.go internal/tsoptions/tsconfigparsing.go:1237 — internal/tsoptions/tsconfigparsing.go changed 14 times in last 90 days, max cyclomatic complexity 72 in tsoptions.parseJsonConfigFileContentWorker at line 1237. 5 of those changes were fix/bug commits, and the other 9 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-05-22..2026-08-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-22 06:46:10 +00:00' --until='2026-08-20 06:46:10 +00:00' --full-history --no-merges -- internal/tsoptions/tsconfigparsing.go`: 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.
  • Hotspot: _packages/native-preview/src/api/async/api.ts _packages/native-preview/src/api/async/api.ts:2249 — _packages/native-preview/src/api/async/api.ts changed 40 times in last 90 days, max cyclomatic complexity 25 in constructor at line 2249. 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-05-22..2026-08-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-22 06:46:10 +00:00' --until='2026-08-20 06:46:10 +00:00' --full-history --no-merges -- _packages/native-preview/src/api/async/api.ts`: 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.
  • Hotspot: internal/scanner/scanner.go internal/scanner/scanner.go:469 — internal/scanner/scanner.go changed 6 times in last 90 days, max cyclomatic complexity 143 in Scanner.Scan at line 469. 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-05-22..2026-08-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-22 06:46:10 +00:00' --until='2026-08-20 06:46:10 +00:00' --full-history --no-merges -- internal/scanner/scanner.go`: 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.
  • Hotspot: internal/api/proto.go internal/api/proto.go:850 — internal/api/proto.go changed 36 times in last 90 days, max cyclomatic complexity 22 in api.newTypeResponse at line 850. 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-05-22..2026-08-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-22 06:46:10 +00:00' --until='2026-08-20 06:46:10 +00:00' --full-history --no-merges -- internal/api/proto.go`: 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.
  • Hotspot: internal/parser/parser.go internal/parser/parser.go:824 — internal/parser/parser.go changed 16 times in last 90 days, max cyclomatic complexity 49 in Parser.isListElement at line 824. 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-05-22..2026-08-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-22 06:46:10 +00:00' --until='2026-08-20 06:46:10 +00:00' --full-history --no-merges -- internal/parser/parser.go`: 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.
  • Hotspot: _scripts/generate-ts-ast.ts _scripts/generate-ts-ast.ts:554 — _scripts/generate-ts-ast.ts changed 6 times in last 90 days, max cyclomatic complexity 99 in generateFactory at line 554. 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-05-22..2026-08-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-22 06:46:10 +00:00' --until='2026-08-20 06:46:10 +00:00' --full-history --no-merges -- _scripts/generate-ts-ast.ts`: 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.
  • Hotspot: internal/parser/reparser.go internal/parser/reparser.go:342 — internal/parser/reparser.go changed 6 times in last 90 days, max cyclomatic complexity 97 in Parser.reparseHosted at line 342. 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-05-22..2026-08-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-22 06:46:10 +00:00' --until='2026-08-20 06:46:10 +00:00' --full-history --no-merges -- internal/parser/reparser.go`: 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.
  • Hotspot: Herebyfile.mjs Herebyfile.mjs:1311 — Herebyfile.mjs changed 22 times in last 90 days, max cyclomatic complexity 25 in sign at line 1311. 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-05-22..2026-08-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-22 06:46:10 +00:00' --until='2026-08-20 06:46:10 +00:00' --full-history --no-merges -- Herebyfile.mjs`: 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.
  • Hotspot: internal/ls/utilities.go internal/ls/utilities.go:459 — internal/ls/utilities.go changed 5 times in last 90 days, max cyclomatic complexity 110 in ls.getAdjustedLocation at line 459. 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-05-22..2026-08-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-22 06:46:10 +00:00' --until='2026-08-20 06:46:10 +00:00' --full-history --no-merges -- internal/ls/utilities.go`: 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.
  • Hotspot: internal/fourslash/fourslash.go internal/fourslash/fourslash.go:4328 — internal/fourslash/fourslash.go changed 12 times in last 90 days, max cyclomatic complexity 45 in FourslashTest.VerifySignatureHelp at line 4328. 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-05-22..2026-08-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-22 06:46:10 +00:00' --until='2026-08-20 06:46:10 +00:00' --full-history --no-merges -- internal/fourslash/fourslash.go`: 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.
  • Hotspot: internal/checker/pseudotypenodebuilder.go internal/checker/pseudotypenodebuilder.go:362 — internal/checker/pseudotypenodebuilder.go changed 7 times in last 90 days, max cyclomatic complexity 74 in NodeBuilderImpl.pseudoTypeEquivalentToType at line 362. 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-05-22..2026-08-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-22 06:46:10 +00:00' --until='2026-08-20 06:46:10 +00:00' --full-history --no-merges -- internal/checker/pseudotypenodebuilder.go`: 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.
  • Hotspot: internal/ast/ast.go internal/ast/ast.go:310 — internal/ast/ast.go changed 14 times in last 90 days, max cyclomatic complexity 36 in Node.Expression at line 310. 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-05-22..2026-08-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-22 06:46:10 +00:00' --until='2026-08-20 06:46:10 +00:00' --full-history --no-merges -- internal/ast/ast.go`: 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.
  • Hotspot: internal/lsp/server.go internal/lsp/server.go:352 — internal/lsp/server.go changed 19 times in last 90 days, max cyclomatic complexity 26 in Server.supportsContentMapperRegistration at line 352. 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-05-22..2026-08-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-22 06:46:10 +00:00' --until='2026-08-20 06:46:10 +00:00' --full-history --no-merges -- internal/lsp/server.go`: 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.
  • Hotspot: internal/checker/nodecopy.go internal/checker/nodecopy.go:288 — internal/checker/nodecopy.go changed 3 times in last 90 days, max cyclomatic complexity 148 in checker.getExistingNodeTreeVisitor at line 288. 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-05-22..2026-08-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-22 06:46:10 +00:00' --until='2026-08-20 06:46:10 +00:00' --full-history --no-merges -- internal/checker/nodecopy.go`: 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.
  • Hotspot: internal/module/resolver.go internal/module/resolver.go:1462 — internal/module/resolver.go changed 8 times in last 90 days, max cyclomatic complexity 54 in resolutionState.tryAddingExtensions at line 1462. 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-05-22..2026-08-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-22 06:46:10 +00:00' --until='2026-08-20 06:46:10 +00:00' --full-history --no-merges -- internal/module/resolver.go`: 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.
  • Hotspot: internal/printer/printer.go internal/printer/printer.go:5069 — internal/printer/printer.go changed 6 times in last 90 days, max cyclomatic complexity 70 in Printer.Write at line 5069. 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-05-22..2026-08-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-22 06:46:10 +00:00' --until='2026-08-20 06:46:10 +00:00' --full-history --no-merges -- internal/printer/printer.go`: 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.
  • + 94 more in this group — see findings.md.
R4 · Test Coverage · No test reaches this file · ×40
  • No test reaches this file internal/fourslash/_scripts/convertFourslash.mts — 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 internal/lsp/lsproto/_generate/generate.mts — 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 Herebyfile.mjs — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file _scripts/generate-encoder.ts — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file _scripts/generate-ts-ast.ts — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file _scripts/schema.ts — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file _scripts/generate-go-ast.ts — 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 _extension/src/client.ts — 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 _extension/src/session.ts — 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 internal/lsp/lsproto/_generate/metaModelSchema.mts — 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/native-preview/src/api/syncChannel.ts — 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 _extension/src/configurationMiddleware.ts — 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/native-preview/scripts/generateSync.ts — 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 _extension/src/extension.ts — 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 internal/stringutil/_scripts/generate-unicode-data.mts — 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 _extension/src/projectStatus.ts — 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 _extension/src/languageFeatures/onAutoInsert.ts — 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/native-preview/src/api/sync/client.ts — 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 internal/fourslash/_scripts/updateFailing.mts — 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/native-preview/src/enums/characterCodes.enum.ts — 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/native-preview/src/enums/characterCodes.ts — 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 _extension/src/telemetryReporting.ts — 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 _extension/src/commands.ts — 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 _extension/src/contentMapperContributions.ts — 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 _extension/src/languageFeatures/util/dependentRegistration.ts — 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.
  • + 15 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×24
  • Duplicated block (5 lines × 2) internal/api/encoder/encoder.go:499 — internal/api/encoder/encoder.go:499-503 | internal/api/encoder/encoder.go:532-536 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/api/encoder/encoder.go:499` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) internal/api/encoder/encoder.go:852 — internal/api/encoder/encoder.go:852-856 | internal/api/encoder/encoder.go:865-869 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/api/encoder/encoder.go:852` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) internal/checker/checker.go:5648 — internal/checker/checker.go:5648-5653 | internal/checker/checker.go:28679-28683 — 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 (5 lines × 2) internal/checker/checker.go:13662 — internal/checker/checker.go:13662-13666 | internal/checker/checker.go:13692-13696 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/checker/checker.go:13662` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) internal/checker/flow.go:2468 — internal/checker/flow.go:2468-2472 | internal/checker/flow.go:2490-2494 — 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 (5 lines × 2) internal/checker/flow.go:2478 — internal/checker/flow.go:2478-2482 | internal/checker/flow.go:2501-2505 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/checker/flow.go:2478` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) internal/execute/tsc.go:297 — internal/execute/tsc.go:297-301 | internal/execute/tsc.go:355-359 — 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (5 lines × 2) internal/execute/watcher.go:441 — internal/execute/watcher.go:441-445 | internal/execute/watcher.go:501-505 — 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 (5 lines × 2) internal/lsp/server.go:1339 — internal/lsp/server.go:1339-1343 | internal/lsp/server.go:1405-1409 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/lsp/server.go:1339` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) internal/printer/printer.go:1780 — internal/printer/printer.go:1780-1784 | internal/printer/printer.go:2683-2687 — 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 (5 lines × 2) internal/transformers/declarations/transform.go:1113 — internal/transformers/declarations/transform.go:1113-1117 | internal/transformers/declarations/transform.go:1131-1135 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/transformers/declarations/transform.go:1113` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) internal/transformers/jsxtransforms/jsx.go:281 — internal/transformers/jsxtransforms/jsx.go:281-285 | internal/transformers/jsxtransforms/jsx.go:290-294 — 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 (5 lines × 2) internal/transformers/tstransforms/metadata.go:118 — internal/transformers/tstransforms/metadata.go:118-122 | internal/transformers/tstransforms/metadata.go:172-176 — 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 (5 lines × 2) internal/ls/change/delete.go:183 — internal/ls/change/delete.go:183-187 | internal/ls/change/tracker.go:330-334 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) internal/printer/printer.go:3781 — internal/printer/printer.go:3781-3785 | internal/printer/printer.go:3799-3803 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `internal/printer/printer.go:3786` calls `emitList`, `AsNode` and `internal/printer/printer.go:3804` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 2) internal/fourslash/fourslash.go:2117 — internal/fourslash/fourslash.go:2117-2121 | internal/fourslash/fourslash.go:3975-3979 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/fourslash/fourslash.go:2117` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `internal/fourslash/fourslash.go:3983` calls `LineAndCharacterToPosition` and `internal/fourslash/fourslash.go:2123` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 2) internal/ls/definition.go:38 — internal/ls/definition.go:38-42 | internal/ls/sourcedefinition.go:31-35 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ls/definition.go:38` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `internal/ls/definition.go:35` calls `GetClientCapabilities` and `internal/ls/sourcedefinition.go:30` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 2) internal/module/resolver.go:1148 — internal/module/resolver.go:1148-1152 | internal/module/resolver.go:1688-1692 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/module/resolver.go:1148` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) internal/modulespecifiers/specifiers.go:1247 — internal/modulespecifiers/specifiers.go:1247-1251 | internal/modulespecifiers/specifiers.go:1255-1259 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/modulespecifiers/specifiers.go:1247` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) internal/printer/printer.go:3938 — internal/printer/printer.go:3938-3942 | internal/printer/printer.go:4082-4086 — 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 (5 lines × 2) internal/transformers/estransforms/async.go:614 — internal/transformers/estransforms/async.go:614-618 | internal/transformers/estransforms/async.go:720-724 — 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 (5 lines × 2) internal/transformers/moduletransforms/commonjsmodule.go:1703 — internal/transformers/moduletransforms/commonjsmodule.go:1703-1707 | internal/transformers/moduletransforms/commonjsmodule.go:1741-1745 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/transformers/moduletransforms/commonjsmodule.go:1703` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) internal/transformers/tstransforms/metadata.go:134 — internal/transformers/tstransforms/metadata.go:134-138 | internal/transformers/tstransforms/metadata.go:154-158 — 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 (5 lines × 2) internal/parser/reparser.go:95 — internal/parser/reparser.go:95-99 | internal/parser/reparser.go:114-118 — 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.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×18
  • Duplicated block (8 lines × 2) internal/checker/checker.go:13502 — internal/checker/checker.go:13502-13509 | internal/checker/checker.go:13511-13518 — 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 (8 lines × 2) internal/execute/incremental/program.go:457 — internal/execute/incremental/program.go:457-464 | internal/execute/incremental/program.go:492-499 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/execute/incremental/program.go:457` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) internal/execute/incremental/snapshot.go:170 — internal/execute/incremental/snapshot.go:170-177 | internal/execute/incremental/snapshot.go:213-220 — 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 (8 lines × 2) internal/execute/tsc/help.go:126 — internal/execute/tsc/help.go:126-133 | internal/execute/tsc/help.go:140-147 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/execute/tsc/help.go:126` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) internal/fourslash/baselineutil.go:387 — internal/fourslash/baselineutil.go:387-394 | internal/fourslash/baselineutil.go:442-449 — 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 (8 lines × 2) internal/fswatch/fanotify_linux.go:222 — internal/fswatch/fanotify_linux.go:222-229 | internal/fswatch/inotify_linux.go:138-145 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (8 lines × 2) internal/ls/hover.go:411 — internal/ls/hover.go:411-418 | internal/ls/hover.go:449-456 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ls/hover.go:411` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) internal/parser/jsdoc.go:28 — internal/parser/jsdoc.go:28-35 | internal/parser/jsdoc.go:82-89 — 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 (8 lines × 2) internal/project/snapshotfs.go:562 — internal/project/snapshotfs.go:562-569 | internal/project/snapshotfs.go:575-582 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/project/snapshotfs.go:562` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) internal/spanmap/spanmap.go:563 — internal/spanmap/spanmap.go:563-570 | internal/spanmap/spanmap.go:591-598 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/spanmap/spanmap.go:563` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) internal/testutil/contentmappertest/dynamic_verbatim.go:35 — internal/testutil/contentmappertest/dynamic_verbatim.go:35-42 | internal/testutil/contentmappertest/protocol.go:60-67 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) internal/transformers/estransforms/optionalchain.go:80 — internal/transformers/estransforms/optionalchain.go:80-87 | internal/transformers/estransforms/optionalchain.go:174-181 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/transformers/estransforms/optionalchain.go:80` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) internal/transformers/moduletransforms/commonjsmodule.go:1179 — internal/transformers/moduletransforms/commonjsmodule.go:1179-1186 | internal/transformers/moduletransforms/commonjsmodule.go:1331-1338 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/transformers/moduletransforms/commonjsmodule.go:1179` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) internal/transformers/tstransforms/metadata.go:89 — internal/transformers/tstransforms/metadata.go:89-96 | internal/transformers/tstransforms/metadata.go:108-115 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/transformers/tstransforms/metadata.go:89` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) internal/transformers/tstransforms/typeeraser.go:166 — internal/transformers/tstransforms/typeeraser.go:166-173 | internal/transformers/tstransforms/typeeraser.go:178-185 — 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 (8 lines × 2) internal/checker/services.go:635 — internal/checker/services.go:635-642 | internal/ls/findallreferences.go:1634-1641 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) internal/checker/services.go:613 — internal/checker/services.go:613-620 | internal/ls/utilities.go:73-80 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) internal/checker/utilities.go:1627 — internal/checker/utilities.go:1627-1634 | internal/printer/utilities.go:553-565 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×17
  • Duplicated block (9 lines × 2) internal/api/session.go:2607 — internal/api/session.go:2607-2615 | internal/api/session.go:2778-2786 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) internal/checker/checker.go:4912 — internal/checker/checker.go:4912-4920 | internal/checker/checker.go:4953-4961 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/checker/checker.go:4912` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) internal/checker/checker.go:30286 — internal/checker/checker.go:30286-30294 | internal/checker/checker.go:30433-30441 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/checker/checker.go:30286` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) internal/fourslash/fourslash.go:4329 — internal/fourslash/fourslash.go:4329-4337 | internal/fourslash/fourslash.go:4489-4497 — 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 (9 lines × 2) internal/parser/jsdoc.go:1145 — internal/parser/jsdoc.go:1145-1153 | internal/parser/jsdoc.go:1161-1169 — 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 (9 lines × 2) internal/printer/printer.go:4382 — internal/printer/printer.go:4382-4390 | internal/printer/printer.go:4425-4433 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/printer/printer.go:4382` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) internal/testutil/harnessutil/harnessutil.go:665 — internal/testutil/harnessutil/harnessutil.go:665-673 | internal/testutil/harnessutil/harnessutil.go:681-689 — 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 (9 lines × 2) internal/transformers/estransforms/async.go:235 — internal/transformers/estransforms/async.go:235-243 | internal/transformers/estransforms/async.go:252-260 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/transformers/estransforms/async.go:235` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) internal/transformers/estransforms/classfields.go:1141 — internal/transformers/estransforms/classfields.go:1141-1149 | internal/transformers/estransforms/classfields.go:3581-3589 — 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 (9 lines × 2) internal/transformers/estransforms/classfields.go:1546 — internal/transformers/estransforms/classfields.go:1546-1555 | internal/transformers/estransforms/esdecorator.go:1959-1967 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/transformers/estransforms/classfields.go:1546` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) internal/transformers/estransforms/classfields.go:2030 — internal/transformers/estransforms/classfields.go:2030-2038 | internal/transformers/estransforms/classfields.go:2118-2126 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `internal/transformers/estransforms/classfields.go:2128` calls `EmitContext`, `MostOriginal`, `getClassLexicalEnvironment` and `internal/transformers/estransforms/classfields.go:2039` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) internal/transformers/estransforms/forawait.go:556 — internal/transformers/estransforms/forawait.go:556-564 | internal/transformers/estransforms/forawait.go:574-582 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/transformers/estransforms/forawait.go:556` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (9 lines × 2) internal/transformers/estransforms/objectrestspread.go:302 — internal/transformers/estransforms/objectrestspread.go:302-310 | internal/transformers/estransforms/objectrestspread.go:360-368 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/transformers/estransforms/objectrestspread.go:302` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) internal/transformers/tstransforms/typeeraser.go:327 — internal/transformers/tstransforms/typeeraser.go:327-335 | internal/transformers/tstransforms/typeeraser.go:364-373 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) internal/ls/file_rename.go:366 — internal/ls/file_rename.go:366-374 | internal/tsoptions/tsconfigparsing.go:1787-1795 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9 lines × 2) internal/testutil/contentmappertest/editing.go:16 — internal/testutil/contentmappertest/editing.go:16-24 | internal/testutil/contentmappertest/supplemental_diagnostics.go:16-24 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/testutil/contentmappertest/editing.go:16` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) internal/printer/factory.go:1023 — internal/printer/factory.go:1023-1031 | internal/printer/factory.go:1078-1086 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/printer/factory.go:1023` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `internal/printer/factory.go:1075` calls `NewBinaryExpression`, `NewToken`, `NewIdentifier` and `internal/printer/factory.go:1020` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×16
  • Duplicated block (12 lines × 2) internal/api/session.go:1302 — internal/api/session.go:1302-1313 | internal/api/session.go:1328-1339 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/api/session.go:1302` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) internal/checker/checker.go:16106 — internal/checker/checker.go:16106-16117 | internal/checker/checker.go:19777-19788 — 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 (12 lines × 2) internal/ls/callhierarchy.go:574 — internal/ls/callhierarchy.go:574-585 | internal/ls/callhierarchy.go:944-955 — 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 (12 lines × 2) internal/ls/callhierarchy.go:1051 — internal/ls/callhierarchy.go:1051-1062 | internal/ls/callhierarchy.go:1087-1098 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ls/callhierarchy.go:1051` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) internal/ls/findallreferences.go:534 — internal/ls/findallreferences.go:534-545 | internal/ls/findallreferences.go:548-559 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ls/findallreferences.go:534` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) internal/ls/findallreferences.go:897 — internal/ls/findallreferences.go:897-908 | internal/ls/findallreferences.go:952-963 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ls/findallreferences.go:897` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) internal/printer/printer.go:1936 — internal/printer/printer.go:1936-1947 | internal/printer/printer.go:1954-1965 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/printer/printer.go:1936` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) internal/project/configfileregistrybuilder.go:459 — internal/project/configfileregistrybuilder.go:459-470 | internal/project/configfileregistrybuilder.go:472-483 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/project/configfileregistrybuilder.go:459` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) internal/transformers/estransforms/async.go:361 — internal/transformers/estransforms/async.go:361-372 | internal/transformers/estransforms/async.go:379-390 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/transformers/estransforms/async.go:361` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (12 lines × 2) internal/transformers/estransforms/classfields.go:1141 — internal/transformers/estransforms/classfields.go:1141-1152 | internal/transformers/estransforms/esdecorator.go:2023-2034 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/transformers/estransforms/classfields.go:1141` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `internal/transformers/estransforms/esdecorator.go:2020` calls `Factory`, `EmitContext` and `internal/transformers/estransforms/classfields.go:1140` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) internal/transformers/estransforms/classfields.go:3030 — internal/transformers/estransforms/classfields.go:3030-3041 | internal/transformers/estransforms/classfields.go:3058-3069 — 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 (12 lines × 2) internal/transformers/moduletransforms/commonjsmodule.go:804 — internal/transformers/moduletransforms/commonjsmodule.go:804-815 | internal/transformers/moduletransforms/esmodule.go:133-144 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/transformers/moduletransforms/commonjsmodule.go:804` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 2) internal/fswatch/fsevents_darwin.go:571 — internal/fswatch/fsevents_darwin.go:571-582 | internal/fswatch/fsevents_darwin.go:596-607 — 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 (12 lines × 2) internal/testutil/contentmappertest/editing.go:57 — internal/testutil/contentmappertest/editing.go:57-73 | internal/testutil/contentmappertest/lisp.go:33-44 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/testutil/contentmappertest/editing.go:57` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) internal/api/session.go:2522 — internal/api/session.go:2522-2533 | internal/api/session.go:2562-2573 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/api/session.go:2522` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) internal/testrunner/compiler_runner.go:399 — internal/testrunner/compiler_runner.go:399-410 | internal/testutil/tsbaseline/type_symbol_baseline.go:85-96 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/testrunner/compiler_runner.go:399` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×15
  • Duplicated block (10 lines × 2) internal/api/encoder/encoder.go:755 — internal/api/encoder/encoder.go:755-764 | internal/api/encoder/encoder.go:770-779 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (10 lines × 2) internal/api/session.go:2417 — internal/api/session.go:2417-2426 | internal/api/session.go:2943-2952 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (10 lines × 2) internal/api/session.go:2880 — internal/api/session.go:2880-2889 | internal/api/session.go:2896-2905 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (10 lines × 2) internal/api/session.go:3436 — internal/api/session.go:3436-3445 | internal/api/session.go:3451-3460 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (10 lines × 2) internal/binder/binder.go:245 — internal/binder/binder.go:245-254 | internal/binder/binder.go:260-269 — 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 (10 lines × 2) internal/fourslash/fourslash.go:1193 — internal/fourslash/fourslash.go:1193-1202 | internal/fourslash/fourslash.go:1214-1223 — 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 (10 lines × 2) internal/fourslash/fourslash.go:2065 — internal/fourslash/fourslash.go:2065-2074 | internal/fourslash/fourslash.go:2310-2321 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/fourslash/fourslash.go:2065` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) internal/fourslash/fourslash.go:2953 — internal/fourslash/fourslash.go:2953-2962 | internal/fourslash/fourslash.go:3137-3146 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/fourslash/fourslash.go:2953` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `internal/fourslash/fourslash.go:3135` calls `Sprintf` and `internal/fourslash/fourslash.go:2951` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) internal/fourslash/fourslash.go:4505 — internal/fourslash/fourslash.go:4505-4514 | internal/fourslash/fourslash.go:4531-4540 — 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 (10 lines × 2) internal/printer/factory.go:48 — internal/printer/factory.go:48-57 | internal/printer/factory.go:128-137 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/printer/factory.go:48` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (10 lines × 2) internal/printer/printer.go:1797 — internal/printer/printer.go:1797-1806 | internal/printer/printer.go:5136-5145 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/printer/printer.go:1797` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `internal/printer/printer.go:5135` calls `emitMethodSignature`, `AsMethodSignatureDeclaration` and `internal/printer/printer.go:1796` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) internal/transformers/estransforms/classfields.go:1076 — internal/transformers/estransforms/classfields.go:1076-1085 | internal/transformers/estransforms/classfields.go:1119-1128 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/transformers/estransforms/classfields.go:1076` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) internal/printer/utilities.go:815 — internal/printer/utilities.go:815-825 | internal/printer/utilities.go:831-840 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/printer/utilities.go:831` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) internal/testutil/autoimporttestutil/fixtures.go:484 — internal/testutil/autoimporttestutil/fixtures.go:484-493 | internal/testutil/autoimporttestutil/fixtures.go:518-527 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/testutil/autoimporttestutil/fixtures.go:484` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) internal/testutil/autoimporttestutil/fixtures.go:498 — internal/testutil/autoimporttestutil/fixtures.go:498-507 | internal/testutil/autoimporttestutil/fixtures.go:531-540 — 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.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×12
  • Duplicated block (11 lines × 2) internal/api/session.go:1048 — internal/api/session.go:1048-1058 | internal/api/session.go:1106-1116 — 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 (11 lines × 2) internal/fourslash/fourslash.go:4838 — internal/fourslash/fourslash.go:4838-4848 | internal/fourslash/fourslash.go:5171-5181 — 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (11 lines × 2) internal/ipc/conn_async.go:169 — internal/ipc/conn_async.go:169-179 | internal/ipc/conn_sync.go:130-140 — before extracting anything, compare `internal/ipc/conn_async.go` and `internal/ipc/conn_sync.go` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ipc/conn_async.go:169` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) internal/ls/signaturehelp.go:534 — internal/ls/signaturehelp.go:534-544 | internal/ls/signaturehelp.go:601-611 — 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 (11 lines × 2) internal/parser/jsdoc.go:312 — internal/parser/jsdoc.go:312-322 | internal/parser/jsdoc.go:621-631 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/parser/jsdoc.go:312` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) internal/printer/factory.go:30 — internal/printer/factory.go:30-40 | internal/printer/factory.go:108-118 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/printer/factory.go:30` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) internal/printer/printer.go:3970 — internal/printer/printer.go:3970-3980 | internal/printer/printer.go:4111-4121 — 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 (11 lines × 2) internal/transformers/estransforms/esdecorator.go:2586 — internal/transformers/estransforms/esdecorator.go:2586-2596 | internal/transformers/estransforms/esdecorator.go:2605-2615 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/transformers/estransforms/esdecorator.go:2586` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) internal/transformers/estransforms/objectrestspread.go:200 — internal/transformers/estransforms/objectrestspread.go:200-210 | internal/transformers/estransforms/objectrestspread.go:231-241 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/transformers/estransforms/objectrestspread.go:200` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) internal/execute/incremental/snapshottobuildinfo.go:181 — internal/execute/incremental/snapshottobuildinfo.go:181-191 | internal/execute/tsctests/readablebuildinfo.go:282-292 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (11 lines × 2) internal/ls/autoimport/import_adder.go:225 — internal/ls/autoimport/import_adder.go:225-235 | internal/ls/autoimport/import_adder.go:249-259 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ls/autoimport/import_adder.go:225` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) internal/fswatch/fanotify_linux.go:325 — internal/fswatch/fanotify_linux.go:325-335 | internal/fswatch/inotify_linux.go:218-228 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/fswatch/fanotify_linux.go:325` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×12
  • Duplicated block (6 lines × 2) _tools/gen-proto/main.go:558 — _tools/gen-proto/main.go:558-563 | _tools/gen-proto/main.go:598-603 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `_tools/gen-proto/main.go:558` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) internal/fswatch/fanotify_linux.go:723 — internal/fswatch/fanotify_linux.go:723-728 | internal/fswatch/inotify_linux.go:368-373 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/fswatch/fanotify_linux.go:723` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `internal/fswatch/inotify_linux.go:374` calls `InotifyRmWatch` and `internal/fswatch/fanotify_linux.go:729` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 2) internal/modulespecifiers/specifiers.go:1273 — internal/modulespecifiers/specifiers.go:1273-1278 | internal/modulespecifiers/specifiers.go:1281-1286 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/modulespecifiers/specifiers.go:1273` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) internal/printer/factory.go:1013 — internal/printer/factory.go:1013-1018 | internal/printer/factory.go:1037-1042 — 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 (6 lines × 2) internal/printer/printer.go:2647 — internal/printer/printer.go:2647-2652 | internal/printer/printer.go:3736-3741 — 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 (6 lines × 2) internal/project/watch.go:128 — internal/project/watch.go:128-133 | internal/project/watch.go:143-149 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/project/watch.go:143` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) internal/testutil/harnessutil/harnessutil.go:560 — internal/testutil/harnessutil/harnessutil.go:560-565 | internal/testutil/harnessutil/harnessutil.go:572-577 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/testutil/harnessutil/harnessutil.go:560` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) internal/transformers/declarations/transform.go:2289 — internal/transformers/declarations/transform.go:2289-2294 | internal/transformers/inliners/constenum.go:47-52 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/transformers/declarations/transform.go:2289` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) internal/format/indent.go:137 — internal/format/indent.go:137-142 | internal/ls/utilities.go:1212-1217 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) internal/execute/incremental/buildInfo.go:230 — internal/execute/incremental/buildInfo.go:230-235 | internal/execute/tsctests/readablebuildinfo.go:89-94 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) internal/testrunner/compiler_runner.go:485 — internal/testrunner/compiler_runner.go:485-490 | internal/testrunner/compiler_runner.go:505-510 — 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (6 lines × 2) internal/pprof/pprof.go:126 — internal/pprof/pprof.go:126-131 | internal/pprof/pprof.go:148-153 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/pprof/pprof.go:126` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×11
  • Duplicated block (7 lines × 2) internal/printer/printer.go:506 — internal/printer/printer.go:506-513 | internal/printer/printer.go:602-608 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/printer/printer.go:506` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) internal/scanner/regexp.go:570 — internal/scanner/regexp.go:570-576 | internal/scanner/regexp.go:675-681 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/scanner/regexp.go:570` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) internal/testutil/contentmappertest/component.go:44 — internal/testutil/contentmappertest/component.go:44-50 | internal/testutil/contentmappertest/transforming.go:115-121 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/testutil/contentmappertest/component.go:44` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) internal/transformers/estransforms/async.go:672 — internal/transformers/estransforms/async.go:672-678 | internal/transformers/estransforms/forawait.go:736-742 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/transformers/estransforms/async.go:672` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) internal/transformers/estransforms/esdecorator.go:1966 — internal/transformers/estransforms/esdecorator.go:1966-1972 | internal/transformers/estransforms/esdecorator.go:2043-2050 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `internal/transformers/estransforms/esdecorator.go:1964` calls `Visitor`, `VisitNode`, `IsCompoundAssignment` and `internal/transformers/estransforms/esdecorator.go:2042` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) internal/transformers/tstransforms/metadata.go:80 — internal/transformers/tstransforms/metadata.go:80-86 | internal/transformers/tstransforms/metadata.go:99-105 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (7 lines × 2) internal/checker/pseudotypenodebuilder.go:184 — internal/checker/pseudotypenodebuilder.go:184-190 | internal/checker/pseudotypenodebuilder.go:243-249 — 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 (7 lines × 2) internal/parser/reparser.go:401 — internal/parser/reparser.go:401-407 | internal/parser/reparser.go:413-419 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/parser/reparser.go:401` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) internal/transformers/estransforms/classfields.go:1108 — internal/transformers/estransforms/classfields.go:1108-1114 | internal/transformers/tstransforms/legacydecorators.go:83-92 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) internal/printer/printer.go:2988 — internal/printer/printer.go:2988-2994 | internal/printer/printer.go:2998-3004 — 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 (7 lines × 2) internal/transformers/tstransforms/runtimesyntax.go:337 — internal/transformers/tstransforms/runtimesyntax.go:337-343 | internal/transformers/tstransforms/runtimesyntax.go:479-485 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/transformers/tstransforms/runtimesyntax.go:337` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×9
  • Duplicated block (13 lines × 2) internal/api/encoder/encoder.go:374 — internal/api/encoder/encoder.go:374-386 | internal/api/encoder/encoder.go:516-528 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/api/encoder/encoder.go:374` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (13 lines × 2) internal/api/session.go:3262 — internal/api/session.go:3262-3274 | internal/api/session.go:3391-3403 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (13 lines × 2) internal/ls/completions.go:980 — internal/ls/completions.go:980-992 | internal/ls/completions.go:1007-1019 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ls/completions.go:980` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (13 lines × 2) internal/ls/inlay_hints.go:652 — internal/ls/inlay_hints.go:652-664 | internal/ls/inlay_hints.go:678-690 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `internal/ls/inlay_hints.go:691` calls `visitParametersAndTypeParameters` and `internal/ls/inlay_hints.go:665` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (13 lines × 2) internal/ls/signaturehelp.go:559 — internal/ls/signaturehelp.go:559-571 | internal/ls/signaturehelp.go:637-649 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ls/signaturehelp.go:559` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) internal/transformers/declarations/transform.go:2521 — internal/transformers/declarations/transform.go:2521-2533 | internal/transformers/declarations/transform.go:2549-2561 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/transformers/declarations/transform.go:2521` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) internal/ast/deepclone.go:34 — internal/ast/deepclone.go:34-46 | internal/ast/deepclone.go:53-65 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ast/deepclone.go:34` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (13 lines × 2) internal/ast/diagnostic.go:444 — internal/ast/diagnostic.go:444-456 | internal/fourslash/fourslash.go:5655-5667 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (13 lines × 2) internal/printer/printer.go:1316 — internal/printer/printer.go:1316-1328 | internal/printer/printer.go:1342-1354 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
R10 · Code Duplication · Duplicated block (11 lines × 2 locations) · ×9
  • Duplicated block (11 lines × 2 locations) _extension/src/client.ts:393 — _extension/src/client.ts:393 · _extension/src/client.ts:409 — 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 (11 lines × 2 locations) _extension/src/session.ts:287 — _extension/src/session.ts:287 · _extension/src/session.ts:299 — 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 (11 lines × 2 locations) _packages/native-preview/src/api/async/client.ts:76 — _packages/native-preview/src/api/async/client.ts:76 · _packages/native-preview/src/api/sync/client.ts:38 — 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 (11 lines × 2 locations) _packages/native-preview/src/ast/scanner.ts:1660 — _packages/native-preview/src/ast/scanner.ts:1660 · _packages/native-preview/src/ast/scanner.ts:1672 — 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 (11 lines × 2 locations) _scripts/generate-encoder.ts:848 — _scripts/generate-encoder.ts:848 · _scripts/generate-encoder.ts:981 — 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 (11 lines × 2 locations) _scripts/generate-go-ast.ts:511 — _scripts/generate-go-ast.ts:511 · _scripts/generate-go-ast.ts:614 — 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 (11 lines × 2 locations) _scripts/generate-ts-ast.ts:1109 — _scripts/generate-ts-ast.ts:1109 · _scripts/generate-ts-ast.ts:1150 — 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 (11 lines × 2 locations) internal/fourslash/_scripts/convertFourslash.mts:2123 — internal/fourslash/_scripts/convertFourslash.mts:2123 · internal/fourslash/_scripts/convertFourslash.mts:2308 — 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 (11 lines × 2 locations) internal/lsp/lsproto/_generate/generate.mts:3335 — internal/lsp/lsproto/_generate/generate.mts:3335 · internal/lsp/lsproto/_generate/generate.mts:3372 — 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.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×8
  • Duplicated block (14 lines × 2) internal/api/session.go:1442 — internal/api/session.go:1442-1455 | internal/api/session.go:1772-1785 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/api/session.go:1442` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (14 lines × 2) internal/api/session.go:2081 — internal/api/session.go:2081-2094 | internal/api/session.go:2125-2138 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) internal/api/session.go:2207 — internal/api/session.go:2207-2220 | internal/api/session.go:2249-2262 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) internal/api/session.go:2231 — internal/api/session.go:2231-2244 | internal/api/session.go:2272-2285 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) internal/ipc/conn_async.go:184 — internal/ipc/conn_async.go:184-197 | internal/ipc/conn_sync.go:145-158 — before extracting anything, compare `internal/ipc/conn_async.go` and `internal/ipc/conn_sync.go` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ipc/conn_async.go:184` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) internal/checker/jsdoc.go:87 — internal/checker/jsdoc.go:87-100 | internal/ls/jsdoc.go:86-99 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 2) internal/transformers/declarations/transform.go:1459 — internal/transformers/declarations/transform.go:1459-1472 | internal/transformers/declarations/transform.go:1500-1513 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/transformers/declarations/transform.go:1459` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `internal/transformers/declarations/transform.go:1455` calls `IsIdentifier`, `Text` and `internal/transformers/declarations/transform.go:1497` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (14 lines × 2) internal/transformers/tstransforms/metadata.go:190 — internal/transformers/tstransforms/metadata.go:190-203 | internal/transformers/tstransforms/metadata.go:230-243 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/transformers/tstransforms/metadata.go:190` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×7
  • Duplicated block (17 lines × 2) internal/checker/checker.go:6456 — internal/checker/checker.go:6456-6472 | internal/checker/checker.go:6605-6621 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/checker/checker.go:6456` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (17 lines × 2) internal/fourslash/fourslash.go:1836 — internal/fourslash/fourslash.go:1836-1852 | internal/fourslash/fourslash.go:1894-1910 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/fourslash/fourslash.go:1836` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) internal/fourslash/fourslash.go:2284 — internal/fourslash/fourslash.go:2284-2300 | internal/fourslash/fourslash.go:2398-2414 — 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (17 lines × 2) internal/fourslash/fourslash.go:3729 — internal/fourslash/fourslash.go:3729-3745 | internal/fourslash/fourslash.go:4734-4750 — 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 (17 lines × 2) internal/ls/autoimport/registry.go:942 — internal/ls/autoimport/registry.go:942-958 | internal/ls/autoimport/registry.go:972-988 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ls/autoimport/registry.go:942` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) internal/ls/semantictokens.go:142 — internal/ls/semantictokens.go:142-158 | internal/ls/semantictokens.go:175-191 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ls/semantictokens.go:142` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (17 lines × 2) internal/scanner/scanner.go:2114 — internal/scanner/scanner.go:2114-2130 | internal/scanner/scanner.go:2162-2178 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/scanner/scanner.go:2114` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
R10 · Code Duplication · Duplicated block (13 lines × 2 locations) · ×7
  • Duplicated block (13 lines × 2 locations) _packages/native-preview/src/ast/scanner.ts:1631 — _packages/native-preview/src/ast/scanner.ts:1631 · _packages/native-preview/src/ast/scanner.ts:1887 — 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 (13 lines × 2 locations) _packages/native-preview/src/ast/scanner.ts:1838 — _packages/native-preview/src/ast/scanner.ts:1838 · _packages/native-preview/src/ast/scanner.ts:1861 — 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 (13 lines × 2 locations) _packages/native-preview/src/ast/scanner.ts:1937 — _packages/native-preview/src/ast/scanner.ts:1937 · _packages/native-preview/src/ast/scanner.ts:2416 — 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 (13 lines × 2 locations) _scripts/generate-encoder.ts:559 — _scripts/generate-encoder.ts:559 · _scripts/generate-encoder.ts:676 — 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 (13 lines × 2 locations) _scripts/generate-encoder.ts:896 — _scripts/generate-encoder.ts:896 · _scripts/generate-encoder.ts:909 — 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 (13 lines × 2 locations) _scripts/generate-ts-ast.ts:922 — _scripts/generate-ts-ast.ts:922 · _scripts/generate-ts-ast.ts:1088 — 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 (13 lines × 2 locations) _scripts/generate-ts-ast.ts:950 — _scripts/generate-ts-ast.ts:950 · _scripts/generate-ts-ast.ts:1102 — 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.
D17 · Explicit Debt · XxxComment · ×6
  • XxxComment internal/fswatch/inotify_linux.go:363 — // XXX: self events don't have IN_ISDIR set. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • XxxComment internal/parser/parser.go:3871 — // ( xxx : — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • XxxComment internal/parser/parser.go:3872 — // ( xxx , — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • XxxComment internal/parser/parser.go:3873 — // ( xxx ? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • XxxComment internal/parser/parser.go:3874 — // ( xxx = — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • XxxComment internal/parser/parser.go:3878 — // ( xxx ) => — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×6
  • Duplicated block (8 lines × 3) internal/fswatch/fanotify_linux.go:268 — internal/fswatch/fanotify_linux.go:268-275 | internal/fswatch/inotify_linux.go:186-193 | internal/fswatch/kqueue.go:244-251 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `internal/fswatch/fanotify_linux.go:266` calls `Lock`, `Unlock` and `internal/fswatch/kqueue.go:243` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 3) internal/transformers/estransforms/namedevaluation.go:332 — internal/transformers/estransforms/namedevaluation.go:332-339 | internal/transformers/estransforms/namedevaluation.go:366-373 | internal/transformers/estransforms/namedevaluation.go:402-409 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8 lines × 3) internal/fswatch/fanotify_linux.go:282 — internal/fswatch/fanotify_linux.go:282-289 | internal/fswatch/inotify_linux.go:204-211 | internal/fswatch/kqueue.go:278-285 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (8 lines × 3) internal/fourslash/fourslash.go:1741 — internal/fourslash/fourslash.go:1741-1748 | internal/fourslash/fourslash.go:1956-1964 | internal/fourslash/fourslash.go:2007-2015 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/fourslash/fourslash.go:1741` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) internal/checker/checker.go:10559 — internal/checker/checker.go:10559-10566 | internal/checker/checker.go:10575-10582 | internal/checker/checker.go:10650-10657 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/checker/checker.go:10559` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) internal/transformers/tstransforms/metadata.go:292 — internal/transformers/tstransforms/metadata.go:292-299 | internal/transformers/tstransforms/metadata.go:309-316 | internal/transformers/tstransforms/metadata.go:326-333 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/transformers/tstransforms/metadata.go:292` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×4
  • Members sharing a duplicated core (5 members, 50+ identical tokens) internal/api/session.go:1439 — internal/api/session.go:1439-1463 | internal/api/session.go:1468-1485 | internal/api/session.go:1510-1536 | internal/api/session.go:1769-1793 | internal/api/session.go:1796-1822 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) internal/api/session.go:2315 — internal/api/session.go:2315-2328 | internal/api/session.go:2331-2344 | internal/api/session.go:2363-2376 | internal/api/session.go:3050-3063 | internal/api/session.go:3123-3136 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) internal/api/session.go:3281 — internal/api/session.go:3281-3302 | internal/api/session.go:3307-3334 | internal/api/session.go:3338-3359 | internal/api/session.go:3363-3387 | internal/api/session.go:3770-3796 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) internal/printer/printer.go:1690 — internal/printer/printer.go:1690-1704 | internal/printer/printer.go:1715-1727 | internal/printer/printer.go:1729-1743 | internal/printer/printer.go:2646-2662 | internal/printer/printer.go:3735-3753 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
R10 · Code Duplication · Duplicated block (12 lines × 2 locations) · ×4
  • Duplicated block (12 lines × 2 locations) _packages/native-preview/src/api/async/api.ts:1169 — _packages/native-preview/src/api/async/api.ts:1169 · _packages/native-preview/src/api/async/api.ts:1189 — 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/native-preview/src/api/async/api.ts:2569 — _packages/native-preview/src/api/async/api.ts:2569 · _packages/native-preview/src/api/async/api.ts:2607 — 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) _scripts/schema.ts:1091 — _scripts/schema.ts:1091 · _scripts/schema.ts:1107 — 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 (12 lines × 2 locations) internal/fourslash/_scripts/convertFourslash.mts:1626 — internal/fourslash/_scripts/convertFourslash.mts:1626 · internal/fourslash/_scripts/convertFourslash.mts:1748 — 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.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×3
  • Duplicated block (19 lines × 2) internal/execute/incremental/snapshot.go:243 — internal/execute/incremental/snapshot.go:243-261 | internal/execute/incremental/snapshot.go:275-293 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/execute/incremental/snapshot.go:243` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (19 lines × 2) internal/ipc/conn_async.go:142 — internal/ipc/conn_async.go:142-160 | internal/ipc/conn_sync.go:103-121 — before extracting anything, compare `internal/ipc/conn_async.go` and `internal/ipc/conn_sync.go` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ipc/conn_async.go:142` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (19 lines × 2) internal/transformers/jsxtransforms/jsx.go:699 — internal/transformers/jsxtransforms/jsx.go:699-717 | internal/transformers/jsxtransforms/jsx.go:740-758 — 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.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×3
  • Duplicated block (16 lines × 2) internal/compiler/emitter.go:392 — internal/compiler/emitter.go:392-407 | internal/compiler/emitter.go:421-436 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/compiler/emitter.go:392` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) internal/ls/organizeimports.go:203 — internal/ls/organizeimports.go:203-218 | internal/ls/organizeimports.go:815-830 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ls/organizeimports.go:203` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) internal/transformers/jsxtransforms/jsx.go:719 — internal/transformers/jsxtransforms/jsx.go:719-734 | internal/transformers/jsxtransforms/jsx.go:760-775 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/transformers/jsxtransforms/jsx.go:719` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×3
  • Duplicated block (15 lines × 2) internal/api/session.go:2107 — internal/api/session.go:2107-2121 | internal/api/session.go:2255-2269 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/api/session.go:2107` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) internal/sourcemap/generator.go:274 — internal/sourcemap/generator.go:274-288 | internal/sourcemap/generator.go:295-309 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `internal/sourcemap/generator.go:311` calls `New` and `internal/sourcemap/generator.go:289` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (15 lines × 2) internal/stringutil/js_case.go:70 — internal/stringutil/js_case.go:70-84 | internal/stringutil/js_case.go:92-106 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/stringutil/js_case.go:70` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×3
  • Duplicated block (11–12 lines × 2) internal/execute/watcher.go:448 — internal/execute/watcher.go:448-458 | internal/execute/watcher.go:523-534 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/execute/watcher.go:448` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (11–12 lines × 2) internal/fourslash/fourslash.go:448 — internal/fourslash/fourslash.go:448-459 | internal/fourslash/fourslash.go:538-548 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (11–12 lines × 2) internal/transformers/tstransforms/importelision.go:93 — internal/transformers/tstransforms/importelision.go:93-103 | internal/transformers/tstransforms/typeeraser.go:352-363 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×3
  • Duplicated block (10 lines × 3) internal/api/session.go:1591 — internal/api/session.go:1591-1600 | internal/api/session.go:1629-1638 | internal/api/session.go:3245-3254 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (10 lines × 3) internal/transformers/estransforms/async.go:326 — internal/transformers/estransforms/async.go:326-335 | internal/transformers/estransforms/async.go:398-407 | internal/transformers/estransforms/async.go:433-442 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/transformers/estransforms/async.go:326` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 3) internal/ls/displaypartswriter.go:88 — internal/ls/displaypartswriter.go:88-97 | internal/printer/singlelinestringwriter.go:67-76 | internal/printer/textwriter.go:69-78 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
R10 · Code Duplication · Duplicated block (14 lines × 2 locations) · ×3
  • Duplicated block (14 lines × 2 locations) _scripts/generate-encoder.ts:648 — _scripts/generate-encoder.ts:648 · _scripts/generate-encoder.ts:920 — 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) internal/fourslash/_scripts/convertFourslash.mts:2097 — internal/fourslash/_scripts/convertFourslash.mts:2097 · internal/fourslash/_scripts/convertFourslash.mts:2112 — 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) internal/lsp/lsproto/_generate/generate.mts:3318 — internal/lsp/lsproto/_generate/generate.mts:3318 · internal/lsp/lsproto/_generate/generate.mts:3351 — 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.
D10 · Test Quality · No assertions · ×2
  • No assertions: Benchmarks _packages/native-preview/test/async/api.test.ts:6455 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: Benchmarks _packages/native-preview/test/sync/api.test.ts:6440 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
D30 · Dependency Vulnerabilities · Medium CVE · ×2
  • REDACTED
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (9 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (9 members, 50+ identical tokens) internal/api/session.go:1540 — internal/api/session.go:1540-1561 | internal/api/session.go:1714-1727 | internal/api/session.go:1730-1743 | internal/api/session.go:2291-2312 | internal/api/session.go:2347-2360 | internal/api/session.go:2453-2474 | internal/api/session.go:3184-3200 | internal/api/session.go:3203-3216 | internal/api/session.go:3220-3241 — These 9 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 9 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 9 times.
  • Members sharing a duplicated core (9 members, 50+ identical tokens) internal/api/session.go:1692 — internal/api/session.go:1692-1711 | internal/api/session.go:2975-2998 | internal/api/session.go:3002-3025 | internal/api/session.go:3029-3047 | internal/api/session.go:3067-3097 | internal/api/session.go:3101-3119 | internal/api/session.go:3140-3158 | internal/api/session.go:3162-3180 | internal/api/session.go:3410-3433 — These 9 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 9 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 9 times.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (4 members, 50+ identical tokens) internal/testutil/contentmappertest/diagnostic_code_collision.go:15 — internal/testutil/contentmappertest/diagnostic_code_collision.go:15-41 | internal/testutil/contentmappertest/supplemental.go:13-33 | internal/testutil/contentmappertest/verbatim.go:15-32 | internal/testutil/contentmappertest/verbatim.go:34-52 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) internal/transformers/estransforms/async.go:324 — internal/transformers/estransforms/async.go:324-354 | internal/transformers/estransforms/async.go:396-425 | internal/transformers/estransforms/async.go:431-460 | internal/transformers/estransforms/async.go:466-500 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Duplicated block (24 lines × 2) · ×2
  • Duplicated block (24 lines × 2) internal/fourslash/fourslash.go:2908 — internal/fourslash/fourslash.go:2908-2931 | internal/fourslash/fourslash.go:2968-2991 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/fourslash/fourslash.go:2908` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (24 lines × 2) internal/transformers/estransforms/classfields.go:3004 — internal/transformers/estransforms/classfields.go:3004-3027 | internal/transformers/estransforms/classfields.go:3031-3054 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/transformers/estransforms/classfields.go:3004` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×2
  • Duplicated block (20 lines × 2) internal/fourslash/fourslash.go:5937 — internal/fourslash/fourslash.go:5937-5956 | internal/fourslash/fourslash.go:5968-5987 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/fourslash/fourslash.go:5937` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 2) internal/format/rules.go:66 — internal/format/rules.go:66-85 | internal/ls/utilities.go:323-342 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (16–18 lines × 2) · ×2
  • Duplicated block (16–18 lines × 2) internal/api/session.go:1028 — internal/api/session.go:1028-1045 | internal/api/session.go:1090-1105 — 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 (16–18 lines × 2) internal/transformers/estransforms/async.go:693 — internal/transformers/estransforms/async.go:693-710 | internal/transformers/estransforms/forawait.go:744-759 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/transformers/estransforms/async.go:693` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×2
  • Duplicated block (18 lines × 2) internal/api/session.go:2501 — internal/api/session.go:2501-2518 | internal/api/session.go:2580-2597 — 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (18 lines × 2) internal/project/configfileregistrybuilder.go:558 — internal/project/configfileregistrybuilder.go:558-575 | internal/project/configfileregistrybuilder.go:596-613 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/project/configfileregistrybuilder.go:558` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `internal/project/configfileregistrybuilder.go:551` calls `FileNamesByPath`, `GetMatchedFileSpec` and `internal/project/configfileregistrybuilder.go:594` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×2
  • Duplicated block (14–15 lines × 2) internal/execute/incremental/programtosnapshot.go:382 — internal/execute/incremental/programtosnapshot.go:382-396 | internal/execute/incremental/programtosnapshot.go:419-432 — 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–15 lines × 2) internal/fourslash/fourslash.go:2502 — internal/fourslash/fourslash.go:2502-2516 | internal/fourslash/fourslash.go:2530-2543 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/fourslash/fourslash.go:2502` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–13 lines × 2) · ×2
  • Duplicated block (11–13 lines × 2) internal/fourslash/fourslash.go:489 — internal/fourslash/fourslash.go:489-501 | internal/fourslash/fourslash.go:594-604 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (11–13 lines × 2) internal/transformers/estransforms/esdecorator.go:1993 — internal/transformers/estransforms/esdecorator.go:1993-2003 | internal/transformers/estransforms/esdecorator.go:2082-2094 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/transformers/estransforms/esdecorator.go:1993` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11 lines × 4) · ×2
  • Duplicated block (11 lines × 4) internal/api/session.go:1441 — internal/api/session.go:1441-1451 | internal/api/session.go:1512-1522 | internal/api/session.go:1771-1781 | internal/api/session.go:1798-1808 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (11 lines × 4) internal/transformers/estransforms/exponentiation.go:12 — internal/transformers/estransforms/exponentiation.go:12-22 | internal/transformers/estransforms/logicalassignment.go:12-22 | internal/transformers/estransforms/nullishcoalescing.go:12-22 | internal/transformers/estransforms/optionalcatch.go:12-22 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×2
  • Duplicated block (11 lines × 3) internal/fourslash/fourslash.go:2037 — internal/fourslash/fourslash.go:2037-2047 | internal/fourslash/fourslash.go:2290-2300 | internal/fourslash/fourslash.go:2404-2414 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (11 lines × 3) internal/scanner/scanner.go:759 — internal/scanner/scanner.go:759-769 | internal/scanner/scanner.go:787-797 | internal/scanner/scanner.go:857-867 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/scanner/scanner.go:759` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10 lines × 9) · ×2
  • Duplicated block (10 lines × 9) internal/api/session.go:1541 — internal/api/session.go:1541-1550 | internal/api/session.go:1715-1724 | internal/api/session.go:1731-1740 | internal/api/session.go:2292-2301 | internal/api/session.go:2348-2357 | internal/api/session.go:2454-2463 | internal/api/session.go:3185-3194 | internal/api/session.go:3204-3213 | internal/api/session.go:3221-3230 — all 9 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (10 lines × 9) internal/api/session.go:1693 — internal/api/session.go:1693-1702 | internal/api/session.go:2976-2985 | internal/api/session.go:3003-3012 | internal/api/session.go:3030-3039 | internal/api/session.go:3068-3077 | internal/api/session.go:3102-3111 | internal/api/session.go:3141-3150 | internal/api/session.go:3163-3172 | internal/api/session.go:3411-3420 — all 9 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication · Duplicated block (10 lines × 5) · ×2
  • Duplicated block (10 lines × 5) internal/api/session.go:1440 — internal/api/session.go:1440-1449 | internal/api/session.go:1469-1478 | internal/api/session.go:1511-1520 | internal/api/session.go:1770-1779 | internal/api/session.go:1797-1806 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (10 lines × 5) internal/api/session.go:2316 — internal/api/session.go:2316-2325 | internal/api/session.go:2332-2341 | internal/api/session.go:2364-2373 | internal/api/session.go:3051-3060 | internal/api/session.go:3124-3133 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication · Duplicated block (9–10 lines × 2) · ×2
  • Duplicated block (9–10 lines × 2) internal/compiler/program.go:358 — internal/compiler/program.go:358-367 | internal/compiler/program.go:374-382 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/compiler/program.go:358` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9–10 lines × 2) internal/ls/completions.go:6206 — internal/ls/completions.go:6206-6214 | internal/ls/completions.go:6249-6258 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ls/completions.go:6249` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×2
  • Duplicated block (6 lines × 3) internal/transformers/declarations/transform.go:1465 — internal/transformers/declarations/transform.go:1465-1470 | internal/transformers/declarations/transform.go:1485-1490 | internal/transformers/declarations/transform.go:1506-1511 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/transformers/declarations/transform.go:1465` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 3) internal/transformers/tstransforms/metadata.go:146 — internal/transformers/tstransforms/metadata.go:146-151 | internal/transformers/tstransforms/metadata.go:164-169 | internal/transformers/tstransforms/metadata.go:182-187 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/transformers/tstransforms/metadata.go:146` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×2
  • Duplicated block (5 lines × 3) internal/checker/checker.go:22900 — internal/checker/checker.go:22900-22904 | internal/core/core.go:154-158 | internal/core/core.go:170-174 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `internal/checker/checker.go:22900` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 3) internal/printer/printer.go:3558 — internal/printer/printer.go:3558-3562 | internal/printer/printer.go:3577-3581 | internal/printer/printer.go:3621-3625 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/printer/printer.go:3558` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
R10 · Code Duplication · Duplicated block (15 lines × 2 locations) · ×2
  • Duplicated block (15 lines × 2 locations) _packages/native-preview/src/api/node/msgpack.ts:162 — _packages/native-preview/src/api/node/msgpack.ts:162 · _packages/native-preview/src/api/node/msgpack.ts:179 — 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 (15 lines × 2 locations) _scripts/generate-encoder.ts:368 — _scripts/generate-encoder.ts:368 · _scripts/generate-encoder.ts:1137 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (11 lines × 5 locations) · ×2
  • Duplicated block (11 lines × 5 locations) _packages/native-preview/src/api/async/api.ts:1098 — _packages/native-preview/src/api/async/api.ts:1098 · _packages/native-preview/src/api/async/api.ts:1114 · _packages/native-preview/src/api/async/api.ts:1130 · _packages/native-preview/src/api/async/api.ts:1146 · +1 more site(s) not listed — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (11 lines × 5 locations) _packages/native-preview/src/api/async/api.ts:1379 — _packages/native-preview/src/api/async/api.ts:1379 · _packages/native-preview/src/api/async/api.ts:1541 · _packages/native-preview/src/api/async/api.ts:1570 · _packages/native-preview/src/api/async/api.ts:1746 · +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.
D17 · Explicit Debt · FixmeComment · ×1
  • FixmeComment internal/ls/lsutil/symbol_display.go:253 — // FIXME: getter and setter use the same symbol. And it is rare to use only setter without getter, so in most cases the symbol always has getter flag. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
D4 · Code Duplication · Near-duplicate member pair (44 shared lines) · ×1
  • Near-duplicate member pair (44 shared lines) internal/ipc/conn_async.go:123 — internal/ipc/conn_async.go:123-197 | internal/ipc/conn_sync.go:84-158 — These two members are variants of one another: 44 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Duplicated block (43 lines × 2) · ×1
  • Duplicated block (43 lines × 2) internal/checker/services.go:645 — internal/checker/services.go:645-687 | internal/ls/findallreferences.go:1644-1686 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (26–39 lines × 2) · ×1
  • Duplicated block (26–39 lines × 2) internal/format/indent.go:150 — internal/format/indent.go:150-175 | internal/ls/format.go:159-197 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/format/indent.go:150` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `internal/format/indent.go:149` calls `GetTokenAtPosition` and `internal/ls/format.go:158` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (37 lines × 2) · ×1
  • Duplicated block (37 lines × 2) internal/transformers/tstransforms/runtimesyntax.go:296 — internal/transformers/tstransforms/runtimesyntax.go:296-332 | internal/transformers/tstransforms/runtimesyntax.go:438-474 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/transformers/tstransforms/runtimesyntax.go:296` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (33 lines × 2) · ×1
  • Duplicated block (33 lines × 2) internal/fourslash/fourslash.go:4901 — internal/fourslash/fourslash.go:4901-4933 | internal/fourslash/fourslash.go:4980-5012 — 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.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×1
  • Duplicated block (27 lines × 2) internal/fswatch/fanotify_linux.go:237 — internal/fswatch/fanotify_linux.go:237-263 | internal/fswatch/inotify_linux.go:152-178 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/fswatch/fanotify_linux.go:237` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (26 lines × 3) · ×1
  • Duplicated block (26 lines × 3) internal/transformers/estransforms/forawait.go:586 — internal/transformers/estransforms/forawait.go:586-611 | internal/transformers/estransforms/forawait.go:631-656 | internal/transformers/estransforms/forawait.go:693-718 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (25 lines × 2) · ×1
  • Duplicated block (25 lines × 2) internal/transformers/tstransforms/runtimesyntax.go:682 — internal/transformers/tstransforms/runtimesyntax.go:682-706 | internal/transformers/tstransforms/runtimesyntax.go:721-745 — 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.
D4 · Code Duplication · Duplicated block (23–24 lines × 2) · ×1
  • Duplicated block (23–24 lines × 2) internal/fourslash/fourslash.go:1454 — internal/fourslash/fourslash.go:1454-1476 | internal/fourslash/fourslash.go:1506-1529 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/fourslash/fourslash.go:1454` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (19–23 lines × 2) · ×1
  • Duplicated block (19–23 lines × 2) internal/printer/printer.go:2952 — internal/printer/printer.go:2952-2974 | internal/printer/printer.go:3759-3777 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/printer/printer.go:2952` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16–19 lines × 2) · ×1
  • Duplicated block (16–19 lines × 2) internal/tspath/path.go:298 — internal/tspath/path.go:298-313 | internal/tspath/path.go:368-386 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/tspath/path.go:298` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (13–18 lines × 2) · ×1
  • Duplicated block (13–18 lines × 2) internal/transformers/moduletransforms/commonjsmodule.go:1563 — internal/transformers/moduletransforms/commonjsmodule.go:1563-1580 | internal/transformers/tstransforms/runtimesyntax.go:890-902 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/transformers/moduletransforms/commonjsmodule.go:1563` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (14–18 lines × 2) · ×1
  • Duplicated block (14–18 lines × 2) internal/fswatch/kqueue.go:660 — internal/fswatch/kqueue.go:660-673 | internal/fswatch/kqueue.go:683-700 — 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.
D4 · Code Duplication · Duplicated block (4–17 lines × 3) · ×1
  • Duplicated block (4–17 lines × 3) internal/fswatch/kqueue.go:388 — internal/fswatch/kqueue.go:388-404 | internal/fswatch/kqueue.go:491-494 | internal/fswatch/kqueue.go:542-555 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: `internal/fswatch/kqueue.go:388` is reached only past a guard at line 377 that tests `entry.watchPath` and leaves the function early, and `internal/fswatch/kqueue.go:491` reads `entry.watchPath` with no such check. What separates these copies is not which lines they run but which PRECONDITION they enforce, so one of them is operating on state the other one refuses. Decide which is intended BEFORE unifying them — extract the shared part and whichever copy is missing the check keeps running unchecked, and if the guard is the correct behaviour then that hole is already live.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×1
  • Duplicated block (15–16 lines × 2) internal/transformers/estransforms/async.go:642 — internal/transformers/estransforms/async.go:642-656 | internal/transformers/estransforms/forawait.go:841-856 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/transformers/estransforms/async.go:642` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (7–15 lines × 3) · ×1
  • Duplicated block (7–15 lines × 3) internal/checker/checker.go:8605 — internal/checker/checker.go:8605-8619 | internal/checker/checker.go:8812-8819 | internal/checker/checker.go:8838-8844 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/checker/checker.go:8605` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `internal/checker/checker.go:8622` calls `isErrorType`, `TypeArguments`, `error` and `internal/checker/checker.go:8820` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (12–14 lines × 2) · ×1
  • Duplicated block (12–14 lines × 2) internal/api/session.go:1412 — internal/api/session.go:1412-1425 | internal/api/session.go:3846-3857 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×1
  • Duplicated block (13–14 lines × 2) internal/api/session.go:2380 — internal/api/session.go:2380-2393 | internal/api/session.go:2399-2411 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication · Duplicated block (13 lines × 5) · ×1
  • Duplicated block (13 lines × 5) internal/api/session.go:3282 — internal/api/session.go:3282-3294 | internal/api/session.go:3308-3320 | internal/api/session.go:3339-3351 | internal/api/session.go:3364-3376 | internal/api/session.go:3771-3783 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication · Duplicated block (12 lines × 5) · ×1
  • Duplicated block (12 lines × 5) internal/api/session.go:1542 — internal/api/session.go:1542-1553 | internal/api/session.go:2293-2304 | internal/api/session.go:2455-2466 | internal/api/session.go:3186-3197 | internal/api/session.go:3222-3233 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication · Duplicated block (12 lines × 4) · ×1
  • Duplicated block (12 lines × 4) internal/testutil/contentmappertest/diagnostic_code_collision.go:16 — internal/testutil/contentmappertest/diagnostic_code_collision.go:16-27 | internal/testutil/contentmappertest/supplemental.go:14-25 | internal/testutil/contentmappertest/verbatim.go:16-27 | internal/testutil/contentmappertest/verbatim.go:35-46 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `internal/testutil/contentmappertest/diagnostic_code_collision.go:16` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (9–12 lines × 2) · ×1
  • Duplicated block (9–12 lines × 2) internal/testutil/contentmappertest/editing.go:29 — internal/testutil/contentmappertest/editing.go:29-40 | internal/testutil/contentmappertest/supplemental_diagnostics.go:28-36 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/testutil/contentmappertest/editing.go:29` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (10–12 lines × 2) · ×1
  • Duplicated block (10–12 lines × 2) internal/transformers/moduletransforms/commonjsmodule.go:1490 — internal/transformers/moduletransforms/commonjsmodule.go:1490-1501 | internal/transformers/moduletransforms/commonjsmodule.go:1514-1523 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/transformers/moduletransforms/commonjsmodule.go:1490` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×1
  • Duplicated block (10–11 lines × 2) internal/api/session.go:1646 — internal/api/session.go:1646-1656 | internal/api/session.go:1668-1677 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication · Duplicated block (10 lines × 4) · ×1
  • Duplicated block (10 lines × 4) internal/scanner/scanner.go:757 — internal/scanner/scanner.go:757-766 | internal/scanner/scanner.go:785-794 | internal/scanner/scanner.go:810-819 | internal/scanner/scanner.go:855-864 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/scanner/scanner.go:757` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9 lines × 5) · ×1
  • Duplicated block (9 lines × 5) internal/printer/printer.go:1696 — internal/printer/printer.go:1696-1704 | internal/printer/printer.go:1719-1727 | internal/printer/printer.go:1735-1743 | internal/printer/printer.go:2654-2662 | internal/printer/printer.go:3745-3753 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/printer/printer.go:1696` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `internal/printer/printer.go:2651` calls `emitTokenNode`, `writeSpace`, `emitIdentifierNameNode` and `internal/printer/printer.go:1718` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×1
  • Duplicated block (9 lines × 3) internal/printer/printer.go:1680 — internal/printer/printer.go:1680-1688 | internal/printer/printer.go:1755-1763 | internal/printer/printer.go:1769-1777 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/printer/printer.go:1680` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×1
  • Duplicated block (8–9 lines × 2) internal/testutil/contentmappertest/duplicate.go:30 — internal/testutil/contentmappertest/duplicate.go:30-38 | internal/testutil/contentmappertest/duplicate.go:50-57 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×1
  • Duplicated block (7–8 lines × 2) internal/checker/flow.go:1162 — internal/checker/flow.go:1162-1169 | internal/checker/flow.go:1188-1194 — 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.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×1
  • Duplicated block (7 lines × 4) internal/transformers/estransforms/async.go:330 — internal/transformers/estransforms/async.go:330-336 | internal/transformers/estransforms/async.go:402-408 | internal/transformers/estransforms/async.go:437-443 | internal/transformers/estransforms/async.go:480-486 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/transformers/estransforms/async.go:330` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×1
  • Duplicated block (7 lines × 3) internal/transformers/declarations/transform.go:1274 — internal/transformers/declarations/transform.go:1274-1280 | internal/transformers/declarations/transform.go:1468-1474 | internal/transformers/declarations/transform.go:1509-1515 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (6–7 lines × 2) · ×1
  • Duplicated block (6–7 lines × 2) internal/parser/parser.go:3101 — internal/parser/parser.go:3101-3107 | internal/parser/parser.go:3148-3153 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/parser/parser.go:3101` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
P12 · CI test-gate honesty · Coverage collected but not gated · ×1
  • Coverage collected but not gated — CI collects a coverage report but no step enforces a minimum — coverage could halve and CI stays green. Add a step that fails the build when coverage drops below a floor (your coverage tool's minimum-threshold flag, or a coverage-gate action) so the number guards something. What was searched, so you can tell an absence from a miss: this repository's CI files AND its coverage configuration — the well-known coverage and test-runner config files, read at the repository root and inside workspace package directories two levels down, so a floor declared beside the tests rather than in the pipeline is credited — matched against the threshold settings this check knows by name. A floor set in your coverage service's web UI rather than in a committed file, or under a setting whose name is not one of those, is not seen here.
R10 · Code Duplication · Duplicated block with local edits (48 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (48 matched lines × 2 locations) _packages/native-preview/src/api/async/api.ts:1555 — _packages/native-preview/src/api/async/api.ts:1555 · _packages/native-preview/src/api/async/api.ts:1745 — the two spans are one implementation copied and then locally edited — 338 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (28 lines × 2 locations) · ×1
  • Duplicated block (28 lines × 2 locations) _scripts/generate-go-ast.ts:465 — _scripts/generate-go-ast.ts:465 · _scripts/generate-go-ast.ts:694 — 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 (24 lines × 2 locations) · ×1
  • Duplicated block (24 lines × 2 locations) internal/fourslash/_scripts/convertFourslash.mts:3365 — internal/fourslash/_scripts/convertFourslash.mts:3365 · internal/fourslash/_scripts/convertFourslash.mts:3390 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (22 lines × 2 locations) · ×1
  • Duplicated block (22 lines × 2 locations) _packages/native-preview/src/api/async/api.ts:546 — _packages/native-preview/src/api/async/api.ts:546 · _packages/native-preview/src/api/async/api.ts:669 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (18 lines × 2 locations) · ×1
  • Duplicated block (18 lines × 2 locations) _packages/native-preview/src/api/async/api.ts:1320 — _packages/native-preview/src/api/async/api.ts:1320 · _packages/native-preview/src/api/async/api.ts:1465 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (17 lines × 2 locations) · ×1
  • Duplicated block (17 lines × 2 locations) _scripts/generate-encoder.ts:342 — _scripts/generate-encoder.ts:342 · _scripts/generate-encoder.ts:589 — 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 (16 lines × 2 locations) · ×1
  • Duplicated block (16 lines × 2 locations) _packages/native-preview/src/api/node/msgpack.ts:71 — _packages/native-preview/src/api/node/msgpack.ts:71 · _packages/native-preview/src/api/node/msgpack.ts:95 — 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 (16 lines × 3 locations) · ×1
  • Duplicated block (16 lines × 3 locations) _packages/native-preview/src/ast/scanner.ts:1814 — _packages/native-preview/src/ast/scanner.ts:1814 · _packages/native-preview/src/ast/scanner.ts:1843 · _packages/native-preview/src/ast/scanner.ts:1905 — all 3 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (11 lines × 3 locations) · ×1
  • Duplicated block (11 lines × 3 locations) _packages/native-preview/src/api/node/node.ts:116 — _packages/native-preview/src/api/node/node.ts:116 · _packages/native-preview/src/api/node/node.ts:136 · _packages/native-preview/src/api/node/node.ts:151 — all 3 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (11 lines × 8 locations) · ×1
  • Duplicated block (11 lines × 8 locations) _scripts/generate-encoder.ts:397 — _scripts/generate-encoder.ts:397 · _scripts/generate-encoder.ts:447 · _scripts/generate-encoder.ts:544 · _scripts/generate-encoder.ts:662 · +4 more site(s) not listed — the 8 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 (10 lines × 4 locations) · ×1
  • Duplicated block (10 lines × 4 locations) _packages/native-preview/src/api/async/api.ts:1001 — _packages/native-preview/src/api/async/api.ts:1001 · _packages/native-preview/src/api/async/api.ts:1062 · _packages/native-preview/src/api/async/api.ts:1171 · _packages/native-preview/src/api/async/api.ts:1193 — all 4 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (10 lines × 3 locations) · ×1
  • Duplicated block (10 lines × 3 locations) _packages/native-preview/src/api/syncChannel.ts:545 — _packages/native-preview/src/api/syncChannel.ts:545 · _packages/native-preview/src/api/syncChannel.ts:582 · _packages/native-preview/src/api/syncChannel.ts:609 — all 3 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (10 lines × 2 locations) · ×1
  • Duplicated block (10 lines × 2 locations) _packages/native-preview/src/ast/scanner.ts:460 — _packages/native-preview/src/ast/scanner.ts:460 · _packages/native-preview/src/ast/scanner.ts:641 — 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.
R2 · Cyclomatic Complexity · Complex function scan (cyclomatic 164, cognitive 278) · ×1
  • Complex function scan (cyclomatic 164, cognitive 278) _packages/native-preview/src/ast/scanner.ts:1531 — scan has cyclomatic complexity 164 and cognitive complexity 278; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function generateCode (cyclomatic 121, cognitive 356) · ×1
  • Complex function generateCode (cyclomatic 121, cognitive 356) internal/lsp/lsproto/_generate/generate.mts:2164 — generateCode has cyclomatic complexity 121 and cognitive complexity 356; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function generateFactory (cyclomatic 99, cognitive 215) · ×1
  • Complex function generateFactory (cyclomatic 99, cognitive 215) _scripts/generate-ts-ast.ts:554 — generateFactory has cyclomatic complexity 99 and cognitive complexity 215; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function parseFourslashStatement (cyclomatic 80, cognitive 28) · ×1
  • Complex function parseFourslashStatement (cyclomatic 80, cognitive 28) internal/fourslash/_scripts/convertFourslash.mts:292 — parseFourslashStatement has cyclomatic complexity 80 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function parseExpectedCompletionItem (cyclomatic 68, cognitive 138) · ×1
  • Complex function parseExpectedCompletionItem (cyclomatic 68, cognitive 138) internal/fourslash/_scripts/convertFourslash.mts:1329 — parseExpectedCompletionItem has cyclomatic complexity 68 and cognitive complexity 138; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function generateCmd (cyclomatic 67, cognitive 19) · ×1
  • Complex function generateCmd (cyclomatic 67, cognitive 19) internal/fourslash/_scripts/convertFourslash.mts:4538 — generateCmd has cyclomatic complexity 67 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function patchAndPreprocessModel (cyclomatic 57, cognitive 94) · ×1
  • Complex function patchAndPreprocessModel (cyclomatic 57, cognitive 94) internal/lsp/lsproto/_generate/generate.mts:1035 — patchAndPreprocessModel has cyclomatic complexity 57 and cognitive complexity 94; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function scanEscapeSequence (cyclomatic 55, cognitive 51) · ×1
  • Complex function scanEscapeSequence (cyclomatic 55, cognitive 51) _packages/native-preview/src/ast/scanner.ts:1261 — scanEscapeSequence has cyclomatic complexity 55 and cognitive complexity 51; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function isExpressionNode (cyclomatic 55, cognitive 9) · ×1
  • Complex function isExpressionNode (cyclomatic 55, cognitive 9) _packages/native-preview/src/ast/is.ts:241 — isExpressionNode has cyclomatic complexity 55 and cognitive complexity 9; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function parseVerifyCompletionArg (cyclomatic 54, cognitive 114) · ×1
  • Complex function parseVerifyCompletionArg (cyclomatic 54, cognitive 114) internal/fourslash/_scripts/convertFourslash.mts:1134 — parseVerifyCompletionArg has cyclomatic complexity 54 and cognitive complexity 114; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function parseOrganizeImportsArgs (cyclomatic 53, cognitive 102) · ×1
  • Complex function parseOrganizeImportsArgs (cyclomatic 53, cognitive 102) internal/fourslash/_scripts/convertFourslash.mts:2914 — parseOrganizeImportsArgs has cyclomatic complexity 53 and cognitive complexity 102; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function parseUserPreferences (cyclomatic 51, cognitive 76) · ×1
  • Complex function parseUserPreferences (cyclomatic 51, cognitive 76) internal/fourslash/_scripts/convertFourslash.mts:2358 — parseUserPreferences has cyclomatic complexity 51 and cognitive complexity 76; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function generateIsGenerated (cyclomatic 41, cognitive 75) · ×1
  • Complex function generateIsGenerated (cyclomatic 41, cognitive 75) _scripts/generate-ts-ast.ts:1222 — generateIsGenerated has cyclomatic complexity 41 and cognitive complexity 75; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function isInExpressionContext (cyclomatic 39, cognitive 8) · ×1
  • Complex function isInExpressionContext (cyclomatic 39, cognitive 8) _packages/native-preview/src/ast/is.ts:322 — isInExpressionContext has cyclomatic complexity 39 and cognitive complexity 8; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function generateTSNodeGenerated (cyclomatic 37, cognitive 71) · ×1
  • Complex function generateTSNodeGenerated (cyclomatic 37, cognitive 71) _scripts/generate-encoder.ts:1284 — generateTSNodeGenerated has cyclomatic complexity 37 and cognitive complexity 71; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function reScanSlashToken (cyclomatic 37, cognitive 66) · ×1
  • Complex function reScanSlashToken (cyclomatic 37, cognitive 66) _packages/native-preview/src/ast/scanner.ts:2068 — reScanSlashToken has cyclomatic complexity 37 and cognitive complexity 66; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function scanJsDocToken (cyclomatic 36, cognitive 21) · ×1
  • Complex function scanJsDocToken (cyclomatic 36, cognitive 21) _packages/native-preview/src/ast/scanner.ts:2358 — scanJsDocToken has cyclomatic complexity 36 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function validate (cyclomatic 34, cognitive 63) · ×1
  • Complex function validate (cyclomatic 34, cognitive 63) _scripts/schema.ts:1089 — validate has cyclomatic complexity 34 and cognitive complexity 63; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function iterateCommentRanges (cyclomatic 33, cognitive 78) · ×1
  • Complex function iterateCommentRanges (cyclomatic 33, cognitive 78) _packages/native-preview/src/ast/scanner.ts:617 — iterateCommentRanges has cyclomatic complexity 33 and cognitive complexity 78; 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.
R3 · Large Files · Large Files · ×1
  • Large Files — 15 file(s) over 400 lines (counted as significant lines — blank lines excluded — over production source only, tests excluded), largest first: _packages/native-preview/src/api/async/api.ts (2409), _packages/native-preview/src/ast/scanner.ts (2328), Herebyfile.mjs (2136), _scripts/generate-encoder.ts (1846), _scripts/generate-ts-ast.ts (1586), _scripts/schema.ts (1078) (+9 more).
R7 · Dead Code · Dead file (~620 LoC) · ×1
  • Dead file (~620 LoC) _packages/native-preview/src/api/syncChannel.ts — no import path from any entry point (142 application, 143 tooling, 13046 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (_packages/native-preview/src/api/sync/client.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~161 LoC) · ×1
  • Dead file (~161 LoC) _packages/native-preview/src/api/sync/client.ts — no import path from any entry point (142 application, 143 tooling, 13046 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~56 LoC) · ×1
  • Dead file (~56 LoC) _extension/src/managedFileContext.ts — no import path from any entry point (142 application, 143 tooling, 13046 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
R8 · Dependency Hygiene · Unlisted import 'vscode-languageserver-protocol' · ×1
  • Unlisted import 'vscode-languageserver-protocol' _extension/src/configurationMiddleware.ts:4 — Imported only as a TYPE and declared in no reachable package.json. The import is erased at compile time, so nothing is installed and no runtime resolution depends on it — but type-checking a clean clone will fail. Declare the typings it resolves through (or the package itself) in the owning package.json.
R8 · Dependency Hygiene · Unused dependency '@unicode/unicode-15.1.0' · ×1
  • Unused dependency '@unicode/unicode-15.1.0' — Declared in the root package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
R8 · Dependency Hygiene · Unused dependency 'dprint' · ×1
  • Unused dependency 'dprint' — Declared in the root package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Minor — 17 finding(s)
D16 · Bus Factor · Off-boarding risk · ×2
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 7 significant file(s) lose their only recent owner: internal/fswatch/fsevents_darwin_ffi.go, internal/vfs/vfsmatch/vfsmatch.go, internal/glob/glob.go, internal/fswatch/event.go, internal/bundled/generate.go, internal/jsnum/jsnum.go, internal/json/json.go. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 5 significant file(s) lose their only recent owner: internal/ls/jsdoc.go, internal/project/dirty/syncmap.go, internal/project/refcountcache.go, internal/project/parsecache.go, internal/project/filechange.go. Pair on, review, or document these before any departure.
R7 · Dead Code · Unused export 'NODE_STRING_INDEX_MASK' · ×2
  • Unused export 'NODE_STRING_INDEX_MASK' _packages/native-preview/src/api/node/node.infrastructure.ts:34 — Nothing imports this binding — it is safe to review for removal.
  • Unused export 'NODE_STRING_INDEX_MASK' _packages/native-preview/src/api/node/protocol.ts:32 — Nothing imports this binding — it is safe to review for removal.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 1 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (14 single-owned of 350 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 350 of the 501 production source files in this repository met that bar). They are anonymized user #3 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above.
D34 · Knowledge Freshness · Further orphaned files (smaller) · ×1
  • Further orphaned files (smaller) — 10 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: internal/compiler/fileInclude.go, internal/compiler/projectreferencefilemapper.go, internal/evaluator/evaluator.go, internal/execute/tsc/init.go, internal/sourcemap/decoder.go, internal/symlinks/knownsymlinks.go, internal/testutil/fsbaselineutil/differ.go, internal/testutil/tsbaseline/sourcemap_baseline.go (and 2 more) (11 orphaned of 350 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 350 of the 501 production source files in this repository met that bar). 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.
P6 · Release Hygiene · Changelog looks stale/thin · ×1
  • Changelog looks stale/thin — The changelog this check read carries 1 versioned entry, against a bar of 3. Counted as either an `x.y.z` string or a version-shaped section heading (`## [1.2.0]`, `## V14.x.x`, `## Updates in 8.0.x`), whichever is the larger — so a log sectioned by minor series counts its sections, not its individual patch numbers. Entries recorded somewhere this check does not read — release notes generated at tag time from a generator config it did not recognise, or a log kept outside the repository — are not counted here, and this row is about what is re-findable in the tree rather than about how often you release.
R7 · Dead Code · Unused export 'enableContributedNightlyVersion' · ×1
  • Unused export 'enableContributedNightlyVersion' _extension/src/util.ts:10 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'builtinTSExtensionId' · ×1
  • Unused export 'builtinTSExtensionId' _extension/src/util.ts:19 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'hasTsdkConfigured' · ×1
  • Unused export 'hasTsdkConfigured' _extension/src/util.ts:170 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'hasNativeTsdkConfigured' · ×1
  • Unused export 'hasNativeTsdkConfigured' _extension/src/util.ts:174 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'popcount8' · ×1
  • Unused export 'popcount8' _packages/native-preview/src/api/node/node.infrastructure.ts:29 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'modifierToFlag' · ×1
  • Unused export 'modifierToFlag' _packages/native-preview/src/api/node/node.infrastructure.ts:97 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'RemoteNodeBase' · ×1
  • Unused export 'RemoteNodeBase' _packages/native-preview/src/api/node/node.infrastructure.ts:140 — Nothing ultimately consumes this binding: its only referrer is the re-export in _packages/native-preview/src/api/node/node.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in _packages/native-preview/src/api/node/node.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code · Unused export 'NODE_OFFSET_FLAGS' · ×1
  • Unused export 'NODE_OFFSET_FLAGS' _packages/native-preview/src/api/node/protocol.ts:24 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'NODE_EXTENDED_DATA_MASK' · ×1
  • Unused export 'NODE_EXTENDED_DATA_MASK' _packages/native-preview/src/api/node/protocol.ts:33 — Nothing imports THIS copy of 'NODE_EXTENDED_DATA_MASK' — but _packages/native-preview/src/api/node/node.infrastructure.ts:35 in the same directory exports that same name, and it is the copy every import site resolves to. Grepping the name therefore finds live callers that do not reach this binding: it is the dead half of a duplicated pair, left behind when the API moved. Delete it here and keep _packages/native-preview/src/api/node/node.infrastructure.ts's, or, if this one is meant to be the survivor, repoint the importers before removing the other.
X9 · Subsumed condition operand · Subsumed condition operand · ×1
  • Subsumed condition operand internal/vfs/vfsmatch/vfsmatch.go:472 — `strings.Contains(lit, ".min.js")` can never decide this `||` — every value satisfying `strings.Contains(lit, ".min.js")` also satisfies `strings.Contains(lit, ".min.")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Minor — 11 finding(s)
D12 · Dependency Hygiene · Outdated · ×7
  • Outdated: github.com/mackerelio/go-osstat — `github.com/mackerelio/go-osstat` is required at v0.2.7 in REDACTED, but v0.2.8 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/mackerelio/go-osstat@v0.2.8 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: golang.org/x/mod — `golang.org/x/mod` is required at v0.37.0 in REDACTED, but v0.41.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get golang.org/x/mod@v0.41.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: golang.org/x/sync — `golang.org/x/sync` is required at v0.21.0 in REDACTED, but v0.23.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get golang.org/x/sync@v0.23.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: golang.org/x/sys — `golang.org/x/sys` is required at v0.46.0 in REDACTED, but v0.48.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get golang.org/x/sys@v0.48.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: golang.org/x/term — `golang.org/x/term` is required at v0.44.0 in REDACTED, but v0.46.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get golang.org/x/term@v0.46.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: golang.org/x/text — `golang.org/x/text` is required at v0.38.0 in REDACTED, but v0.42.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get golang.org/x/text@v0.42.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: golang.org/x/tools — `golang.org/x/tools` is required at v0.47.0 in REDACTED, but v0.50.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get golang.org/x/tools@v0.50.0 && go mod tidy` and commit the updated REDACTED and go.sum.
D10 · Test Quality · Skipped (documented) · ×4
  • Skipped (documented): (unnamed test) testdata/tests/cases/compiler/typePredicateParameterMismatch.ts:17 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) testdata/tests/cases/compiler/jsDeclarationEmitFunction.ts:11 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) testdata/tests/cases/compiler/emitEndOfFileJSDocComments2.ts:13 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) testdata/tests/cases/compiler/assertsPredicateParameterMismatch.ts:16 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs

Appendix B — Reproduction & audit trail

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

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-b007c68ccd2341378d1dab9fc463fe1f/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-b007c68ccd2341378d1dab9fc463fe1f/tree.json --exit-code 0 --source .0artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/watchdog-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off .0artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** . --skip-db-update9artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.0—
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 32 file(s) — `_extension/src/client.ts`, `_extension/src/languageFeatures/onAutoInsert.ts`, `_packages/native-preview/src/api/async/api.ts`, `_packages/native-preview/src/api/sync/api.ts`, `_packages/native-preview/src/ast/is.generated.ts`, … (+27 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.0—
D36 · Supply-chain Provenance & Signingprovenance—provenance: not applicable — The CI pipeline builds and tests but publishes no released artifact — no package publish, container push, GitHub release or deployment step. Supply-chain provenance, signing and SBOM attest RELEASED artifacts, so there is nothing to attest here. Add them to the release pipeline when this repo starts shipping artifacts (a published package, a container image, a deployed service or a tagged release).0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** . --skip-db-update0artifacts/raw/trivy-fs.json

Run 01a0d444-62ad-7d6f-a24d-a03207272891 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

Downloadable artifacts

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

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