Public report of NuGet/NuGetGallery, published 16 November 2026. It has the same score, grades and number of findings as the full report. The details of security findings (where they are in the code, which known vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive report Measured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.4). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey → Signed and filed in the standard's public register, 16 November 2026, 17:42 UTC · Survey ID cd_e8235dc9fad9427c94b3f23ff18e598d

NuGet/NuGetGallery

Measured 16 November 2026, 17:25 UTC, at code version 63e6ee4

Test reliability is not measured: No test run produced results.

Boundary Type-Coupling is not measured: Bounded contexts not declared.

Knowledge freshness is not measured: Freshness signal contradicted by repo activity.

CAI score 36.7out of 100 Weak
CriticalWeakAdequateStrongExemplary

The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.

A large codebase: 232,846 lines of product code in 169 projects, tests not counted · Estimated rebuild effort: about 6.3 person-years · Weakest lens: Code Health, 31.3

Findings by how serious they are

171 critical 1538 serious 328 minor

6 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.

This survey was produced by

Assert small markCanine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
16 November 2026, 17:25 UTC

A measurement, not a certificate. The Code Assurance Index records a number together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that implements it, and today the Canine Code Analyzer is the only one that does.

The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸

93of 93 dimensions measured by tools.
1974of 2037 findings point to an exact file and line, so you can open each one in the code. The other 63 concern the repository as a whole, such as missing documentation.
93dimensions across 8 lenses, read from 232,846 lines of product code in 169 projects.
Chapters

Executive summary

NuGet/NuGetGallery falls short of our standard for production, held back most by its Code Health lens, the quality of the code itself. It scores 36.7 out of 100 and is rated Weak, and 34 of its 171 critical findings are security problems.

Code Health, at 31.3, is the weakest lens by a small margin, and the weakest lens counts most in the score. The best first step is fixing the silenced warnings, worth about 3.5 points. Adding type checking would lift Code Health itself, worth about 2.8 points.

Fourteen pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Eight weaknesses in the code could be used by an attacker, and twenty-seven form fields can't be read by a screen reader. Pinning each tool to an exact version, fixing the weaknesses the scanner points to and labelling the form fields would close these risks. Updating the vulnerable packages would fix the six packages with a known security hole, and the pipeline step that installs packages without pinning their versions needs the packages it installs pinned to exact versions. The 49 data fields that are written but never read need removing.

The product code is 232,846 lines, about €920,000 to rebuild. The check for the health of its packages couldn't finish, so that result is missing, not a clean pass.

A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.

How the score is built: what each lens counts for The lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Code Health 31.3 · counts for 45%Production Readiness 34.8 · counts for 25%Security and Compliance 35.8 · counts for 14%Accessibility 43.5 · counts for 8%Performance 60.0 · counts for 4%Architecture 66.6 · counts for 2%Maturity 73.6 · counts for 1%Event-Driven 100.0 · counts for 1%

The weakest lenses score close to each other, so improving any of them moves the score.

Code composition: what the lines of code are
Business logic 17%Supporting code 24%Tests 54%Generated by tools 4%
Rebuild cost: about €920,000 · Estimate
Cost to rebuild€300,000 to €1,500,000, for 5,031 to 16,163 hours of work, about 6.3 person-years for 3 to 12 engineers
Difficulty of the problemVery high, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.7 at a score of 37. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeLarge: 232,846 lines of product code
Comment linesThe estimate prices 213,081 lines. Comment lines count towards the size of 232,846 lines but aren't priced as work.
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty.

Top priorities

The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.

1
Resolve the 1 FileScopedPragmaDisable finding(s) in Explicit Debt — start with AdminApiController.cs.
Raises the score by about 3.5 points · Low effort · Explicit Debt
2
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED.
Raises the score by about 2.5 points · Low effort · REDACTED Scanning
3
Resolve the 25 EmptyCatchBlock finding(s) in Explicit Debt — start with TelemetryClientWrapper.cs (8), BackfillTfmMetadataCommand.cs (2), REDACTED (2).
Raises the score by about 3.5 points · Medium effort · Explicit Debt

Diagnosis: what the measurements show together

Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.

Where the investment is most exposed · Value at risk
This code would cost about €920,000 to build again, about 6.3 person-years of work. Its weakest lens is Code Health, at 31.3 (Weak). Code Health is about how easy the code is to read and change safely, and code that is hard to read is slow and risky to change, so every future change costs more than it should. Because the weakest lens counts most in the score, work on Code Health also moves the score most.
Based on: the rebuild estimate · the Code Health grade · how much each lens counts
What to do: Start with the Code Health actions in Top priorities.
If you do one thing first · First action
Resolve the 1 FileScopedPragmaDisable finding(s) in Explicit Debt. Of all the actions in this report, it raises the score most for the work it takes: about 3.5 points for low effort, because it clears the 1 Explicit Debt findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort

Architecture — module dependency graph

Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.

arch DatabaseMigrationTools DatabaseMigrationTools NuGet.Services.Validation Validation DatabaseMigrationTools->NuGet.Services.Validation NuGetGallery NuGetGallery DatabaseMigrationTools->NuGetGallery GitHubVulnerabilities2Db GitHubVulnerabilities2Db NuGet.Jobs.Common Common GitHubVulnerabilities2Db->NuGet.Jobs.Common NuGet.Services.Cursor Cursor GitHubVulnerabilities2Db->NuGet.Services.Cursor NuGetGallery.Services Services GitHubVulnerabilities2Db->NuGetGallery.Services NuGet.Services.Configuration Configuration NuGet.Jobs.Common->NuGet.Services.Configuration NuGet.Services.Logging Logging NuGet.Jobs.Common->NuGet.Services.Logging NuGet.Services.Storage Storage NuGet.Jobs.Common->NuGet.Services.Storage NuGetGallery.Core Core NuGet.Jobs.Common->NuGetGallery.Core NuGet.Services.AzureSearch AzureSearch NuGet.Services.Contracts Contracts NuGet.Services.Cursor->NuGet.Services.Storage NuGet.Services.Logging->NuGet.Services.Contracts NuGet.Services.Metadata.Catalog Catalog NuGet.Services.Metadata.Catalog->NuGet.Services.Configuration NuGet.Services.Metadata.Catalog->NuGet.Services.Logging NuGet.Services.Metadata.Catalog->NuGet.Services.Storage NuGet.Services.Metadata.Catalog->NuGetGallery.Core NuGet.Services.ServiceBus ServiceBus NuGet.Services.ServiceBus->NuGet.Services.Contracts NuGet.Services.Staging Staging NuGet.Services.Staging->NuGet.Services.ServiceBus NuGet.Services.Validation->NuGet.Services.Contracts NuGet.Services.Validation->NuGet.Services.ServiceBus NuGet.Services.Validation.Orchestrator Orchestrator NuGet.Services.Validation.Orchestrator->NuGet.Services.Staging NuGet.Services.Validation.Orchestrator->NuGetGallery.Core Validation.Common.Job Job NuGet.Services.Validation.Orchestrator->Validation.Common.Job Validation.PackageSigning.Core Core NuGet.Services.Validation.Orchestrator->Validation.PackageSigning.Core NuGetGallery->NuGet.Services.Configuration NuGetGallery->NuGet.Services.Contracts NuGetGallery->NuGet.Services.Logging NuGetGallery->NuGet.Services.ServiceBus NuGetGallery->NuGet.Services.Staging NuGetGallery->NuGet.Services.Validation NuGetGallery->NuGetGallery.Core NuGetGallery->NuGetGallery.Services NuGetGallery.AppHost AppHost NuGetGallery.AppHost->NuGet.Services.Validation.Orchestrator NuGetGallery.Core->NuGet.Services.Contracts NuGetGallery.Core->NuGet.Services.Validation NuGetGallery.Services->NuGet.Services.Configuration NuGetGallery.Services->NuGet.Services.Logging NuGetGallery.Services->NuGet.Services.Staging NuGetGallery.Services->NuGetGallery.Core Validation.Common.Job->NuGet.Jobs.Common Validation.Common.Job->NuGet.Services.ServiceBus Validation.Common.Job->NuGet.Services.Storage Validation.PackageSigning.Core->Validation.Common.Job __more__ +62 more projects

Architecture: which parts of the code depend on which

The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.

225 modules, with 406 dependencies between them. 7 loops run through 39 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 185 more are left out to keep it readable.

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 NuGet.Services.Entities2 NuGet.Services.FeatureFlags3 NuGet.Services.Messaging.Email4 NuGet.Services.Status.Table5 NuGet.Services.Storage6 NuGet.Services.Validation7 StatusAggregator.Table8 NuGet.Services.AzureSearch.SearchService9 NuGet.Services.Cursor10 NuGetGallery.Authentication.Providers11 NuGetGallery.Diagnostics12 NuGetGallery.Services.Authentication13 StatusAggregator.Update14 NuGet.Services.AzureSearch15 NuGetGallery.Auditing16 StatusAggregator.Factory17 NuGetGallery.Authentication18 NuGetGallery.Features19 StatusAggregator.Collector20 NuGetGallery.Configuration21 StatusAggregator.Export22 NuGetGallery.Areas.Admin.Models23 NuGetGallery.Infrastructure.Search24 NuGetGallery.Security25 NuGetGallery.Areas.Admin.Services26 NuGetGallery.Areas.Admin.ViewModels27 NuGetGallery28 NuGet.Jobs29 NuGet.Services.Metadata.Catalog.Persistence30 NuGetGallery.Areas.Admin.Controllers31 NuGetGallery.Infrastructure.Mail.Messages32 NuGetGallery.OData33 NuGet.Jobs.Validation34 NuGet.Services.Metadata.Catalog.Helpers35 StatusAggregator36 NuGet.Jobs.Validation.Storage37 NuGet.Services.Metadata.Catalog38 NuGet.Services.Validation.Orchestrator39 NuGet.Services.Metadata.Catalog.Monitoring40 NuGet.Services.Validation.Symbols
1 NuGet.Services.Entities
2 NuGet.Services.FeatureFlags
3 NuGet.Services.Messaging.Email
4 NuGet.Services.Status.Table
5 NuGet.Services.Storage
6 NuGet.Services.Validation
7 StatusAggregator.Table
8 NuGet.Services.AzureSearch.SearchService13
9 NuGet.Services.Cursor1
10 NuGetGallery.Authentication.Providers1
11 NuGetGallery.Diagnostics2
12 NuGetGallery.Services.Authentication6116
13 StatusAggregator.Update5321
14 NuGet.Services.AzureSearch2
15 NuGetGallery.Auditing19115
16 StatusAggregator.Factory551
17 NuGetGallery.Authentication421114
18 NuGetGallery.Features4912
19 StatusAggregator.Collector1211
20 NuGetGallery.Configuration12
21 StatusAggregator.Export23111
22 NuGetGallery.Areas.Admin.Models1
23 NuGetGallery.Infrastructure.Search1228
24 NuGetGallery.Security2217
25 NuGetGallery.Areas.Admin.Services25114
26 NuGetGallery.Areas.Admin.ViewModels922319
27 NuGetGallery40211974258191614313124
28 NuGet.Jobs2131
29 NuGet.Services.Metadata.Catalog.Persistence42
30 NuGetGallery.Areas.Admin.Controllers1122231149131950
31 NuGetGallery.Infrastructure.Mail.Messages49121332
32 NuGetGallery.OData314
33 NuGet.Jobs.Validation1
34 NuGet.Services.Metadata.Catalog.Helpers510
35 StatusAggregator5111
36 NuGet.Jobs.Validation.Storage51
37 NuGet.Services.Metadata.Catalog115
38 NuGet.Services.Validation.Orchestrator98
39 NuGet.Services.Metadata.Catalog.Monitoring25159
40 NuGet.Services.Validation.Symbols16212
Uses a module listed above itPart of a loopThe module itself
1 NuGet.Services.Entities2 NuGet.Services.FeatureFlags3 NuGet.Services.Messaging.Email4 NuGet.Services.Status.Table5 NuGet.Services.Storage6 NuGet.Services.Validation7 StatusAggregator.Table8 NuGet.Services.AzureSearch.SearchService9 NuGet.Services.Cursor10 NuGetGallery.Authentication.Providers11 NuGetGallery.Diagnostics12 NuGetGallery.Services.Authentication13 StatusAggregator.Update14 NuGet.Services.AzureSearch15 NuGetGallery.Auditing16 StatusAggregator.Factory17 NuGetGallery.Authentication18 NuGetGallery.Features19 StatusAggregator.Collector20 NuGetGallery.Configuration21 StatusAggregator.Export22 NuGetGallery.Areas.Admin.Models23 NuGetGallery.Infrastructure.Search24 NuGetGallery.Security25 NuGetGallery.Areas.Admin.Services26 NuGetGallery.Areas.Admin.ViewModels27 NuGetGallery28 NuGet.Jobs29 NuGet.Services.Metadata.Catalog.Persistence30 NuGetGallery.Areas.Admin.Controllers31 NuGetGallery.Infrastructure.Mail.Messages32 NuGetGallery.OData33 NuGet.Jobs.Validation34 NuGet.Services.Metadata.Catalog.Helpers35 StatusAggregator36 NuGet.Jobs.Validation.Storage37 NuGet.Services.Metadata.Catalog38 NuGet.Services.Validation.Orchestrator39 NuGet.Services.Metadata.Catalog.Monitoring40 NuGet.Services.Validation.SymbolsNuGet.Services.Entities1NuGet.Services.FeatureFlags2NuGet.Services.Messaging.Email3NuGet.Services.Status.Table4NuGet.Services.Storage5NuGet.Services.Validation6StatusAggregator.Table7NuGet.Services.AzureSearch.SearchService8NuGet.Services.Cursor9NuGetGallery.Authentication.Providers10NuGetGallery.Diagnostics11NuGetGallery.Services.Authentication12StatusAggregator.Update13NuGet.Services.AzureSearch14NuGetGallery.Auditing15StatusAggregator.Factory16NuGetGallery.Authentication17NuGetGallery.Features18StatusAggregator.Collector19NuGetGallery.Configuration20StatusAggregator.Export21NuGetGallery.Areas.Admin.Models22NuGetGallery.Infrastructure.Search23NuGetGallery.Security24NuGetGallery.Areas.Admin.Services25NuGetGallery.Areas.Admin.ViewModels26NuGetGallery27NuGet.Jobs28NuGet.Services.Metadata.Catalog.Persistence29NuGetGallery.Areas.Admin.Controllers30NuGetGallery.Infrastructure.Mail.Messages31NuGetGallery.OData32NuGet.Jobs.Validation33NuGet.Services.Metadata.Catalog.Helpers34StatusAggregator35NuGet.Jobs.Validation.Storage36NuGet.Services.Metadata.Catalog37NuGet.Services.Validation.Orchestrator38NuGet.Services.Metadata.Catalog.Monitoring39NuGet.Services.Validation.Symbols40131126116532121911555142111449121211122311111228221725114922319402119742581916143131242131421122231149131950491213323141510511151115982515916212+185 more modules (most-connected shown)

At a glance — Code Health · 31.3 · Weak · gated by R1, R2, IC1 ·

At a glance — Architecture · 66.6 · Adequate · gated by AX2 ·

At a glance — Maturity · 73.6 · Adequate · gated by M2 ·

At a glance — Readiness · 34.8 · Weak · gated by R4, R8, P7 ·

At a glance — Security · 35.8 · Weak · gated by D29, D36, C1, S1 ·

At a glance — Event-Driven · 100.0 · Exemplary ·

At a glance — Accessibility · 43.5 · Weak · gated by AC4 ·

At a glance — Performance · 60.0 · Adequate ·

Security & Compliance — OWASP Top-10 mapping

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

OWASP categoryFindingsSeverity
A05:2025 — Injection152High / Critical
A03:2025 — Software Supply Chain Failures18High / Critical
A07:2025 — Authentication Failures3High / Critical

Roadmap

Top priorities: Resolve the 1 FileScopedPragmaDisable finding(s) in Explicit Debt — start with AdminApiController.cs; Resolve the 25 EmptyCatchBlock finding(s) in Explicit Debt — start with TelemetryClientWrapper.cs (8), BackfillTfmMetadataCommand.cs (2), REDACTED (2); Resolve the 49 WriteOnlyPrivateField finding(s) in Explicit Debt — start with PackageSignatureProcessor.cs (5), PackageSignatureValidator.cs (5), PackageRegistrationExtensionsFacts.cs (3).

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

Do thisHelpsEffortDimension
Resolve the 1 FileScopedPragmaDisable finding(s) in Explicit Debt — start with AdminApiController.cs.+3.5 ptsLowExplicit Debt
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED.+2.5 ptsLowREDACTED Scanning
Resolve the 25 EmptyCatchBlock finding(s) in Explicit Debt — start with TelemetryClientWrapper.cs (8), BackfillTfmMetadataCommand.cs (2), REDACTED (2).+3.5 ptsMediumExplicit Debt
Resolve the 49 WriteOnlyPrivateField finding(s) in Explicit Debt — start with PackageSignatureProcessor.cs (5), PackageSignatureValidator.cs (5), PackageRegistrationExtensionsFacts.cs (3).+3.5 ptsMediumExplicit Debt
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.+2.8 ptsMediumType Safety
Finish or delete the unfinished stubs (NotImplementedException / empty / constant-returning bodies) — they are dead surface that looks live.+2.1 ptsMediumIncompleteness & stubs
Resolve the 40 finding(s) in Cyclomatic Complexity.+2.1 ptsMediumCyclomatic Complexity
Store passwords with a salted KDF — `Microsoft.AspNetCore.Identity.PasswordHasher<T>`, `Rfc2898DeriveBytes` (PBKDF2), or BCrypt/Argon2 — and compare with `CryptographicOperations.FixedTimeEquals`. (A fast/plain hash, or a client-hashed value stored and compared verbatim, is not password storage.) Start in `src/NuGetGallery.Services/Authentication/ApiKeyV3.cs:11`.+1.9 ptsMediumWeb-Security Posture

File quality

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

FileScoreBandWorst signal
REDACTED0.0SlopStatic Analysis (SAST): High: REDACTED
REDACTED0.3SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED2.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.6SlopStatic Analysis (SAST): High: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.3MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.4MixedStatic Analysis (SAST): Medium: REDACTED
src/Catalog/Persistence/AzureStorage.cs4.5MixedExplicit Debt: WriteOnlyPrivateField
REDACTED4.8MixedStatic Analysis (SAST): Medium: REDACTED
src/NuGetGallery/Services/PackageDeleteService.cs4.9MixedExplicit Debt: EmptyCatchBlock
src/NuGet.Services.Validation.Orchestrator/ContentScan/ContentScanValidator.cs4.9MixedExplicit Debt: WriteOnlyPrivateField
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED

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

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

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

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

Could not be resolved — 6

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

Methodology & how to trust this report

This survey is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. All 93 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.8, the weighted average across measured dimensions.

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

What we checked — 93 dimensions across the health lenses
D1D2D3D4D5D6D10D13D14D15D16D17D18D19D20D24D26D27D28D29D30D35D36D37D43D44AC1AC2AC3AC4AC5AC6AX1AX10AX2AX3AX5AX6AX8AX9C1C2C3C4ED1ED3ED4ED5GD1IC1M1M2M3M4P1P2P3P4P6P7PF3R1R10R2R3R4R5R6R7R8R9S1X1X12X13X14X16X17X18X19X2X20X22X23X24X25X27X28X29X3X30X4X5

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, 1974 of 2037 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 or a scanner, 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
Canine Code Analyzer 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

Every finding is locatable in findings.md. Run 01a1e564-956e-792d-90c7-567ae1ec79b6.

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.

  • D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: the test projects could not be restored because pkgs.dev.azure.com could not be reached (NU1301: Unable to load the service index for source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json. The proxy tunnel request to proxy 'http://egress:3128/' failed with status code '403'.), so no test was built or run on this run. This is OURS — the scan's network path to the registry — and a TRANSIENT condition, NOT a statement about this repository's tests; coverage is excluded from the score rather than counted as a near-zero, and a re-run with the registry reachable measures it.
  • D10 Test Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 7,561 test(s) behind this row are the ones the C# collector could read, and this repository also carries at least 4 test source file(s) (.py) that it cannot: it parses C# syntax and matches C# test attributes, so a vitest/jest/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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability NOT MEASURED: the test run produced no results for any test tier, so no test ever ran and flakiness could not be exercised. The cause could not be attributed, so it is excluded from the score rather than read as an absence of tests.
  • D12 Dependency Hygiene — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. The NuGet registry this repository's packages resolve from could not be reached on this run, so no outdated, vulnerable or deprecated package could be read. The tool said: NU1301: Unable to load the service index for source https://pkgs.dev.azure.com/dnceng/public/_packaging/nuget-build/nuget/v3/index.json. [NuGet.Server.Common.sln] The proxy tunnel request to proxy 'http://egress:3128/' failed with status code '403'." [NuGet.Server.Common.sln]. This is OUR side and an ENVIRONMENT fault — the collector exists and ran — so the remedy is the scan's network path to pkgs.dev.azure.com, and a re-run with it reachable measures this repository.
  • D17 Explicit Debt — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The C# workspace loaded this repository's projects but reported a load failure, and the dead-code reference search is unreliable over a graph that did not load cleanly, so it was skipped. The other debt markers on this row were read; dead symbols were not, and their absence from the score is not a finding that the code has none. First load diagnostic: Failure: solution references project 'src\NuGet.Services.Github\NuGet.Services.GitHub.csproj' but the on-disk path is 'src\NuGet.Services.GitHub\NuGet.Services.GitHub.csproj' (separator/casing mismatch); on a case-sensitive file system MSBuildWorkspace would load 0 of these projects. Loading a corrected copy of the solution.
  • D18 Solution Shape — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The build did not finish within its budget on this run; structural metrics are reported, build/warning status is unknown.
  • D18 Solution Shape — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. A scan loads every live solution in the repository into one workspace. Every score, lens, and finding here reflects the projects of `NuGetGallery.sln`, `NuGet.Jobs.sln`, `NuGet.Server.Common.sln`, `NuGetGallery.Aspire.slnx`, `python/StatsLogParser.slnx`; 1 further solution(s) found in this tree (`python/StatsLogParser.slnx`) could not be added to it — their project list could not be read, or none of their projects opened — so their code is not represented in the headline. (This is a count of the solutions discovery found and could not show to be covered by the analyzed ones — not a claim about how many solution files the repository contains.) If one of them is an archived or vendored tree, declaring it — `.gitattributes` (`path/** linguist-vendored`) or `.editorconfig` (`[path/**] generated_code = true`) — excludes it from discovery the same way generated code is. You can widen what we reach: if one of these solutions is live code, check that it opens on its own (`dotnet build <solution>`); if it is archived or vendored, declare it so.
  • D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
  • D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
  • D21 Naming Consistency — evaluation did not complete — Naming Consistency not included (check did not complete) — excluded from the score.
  • D23 Boundary Type-Coupling — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Large codebase (193,516 production LoC in the .NET projects) with no declared bounded contexts — cross-boundary type coupling is unassessed Bounded contexts cannot be inferred from a codebase that is not physically organised by them (D-321), so with none declared there are no boundaries for the coupling pass to measure across. You can widen what we reach: name this codebase's bounded contexts (≥2 module groups, e.g. per subsystem) so cross-boundary type coupling can be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
  • D28 Secrets (history) — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. D28's config-credential rule (WD-SECRET-0002) parses each committed `.json` config as a document and reads credential-named values; `content/DEV/Team.json`, `content/INT/Team.json`, `content/PROD/Team.json`, `src/Catalog/context/Catalog.json`, `src/Catalog/context/Container.json` and 4 more did not parse (JSON5, a template, several concatenated documents), so a credential bound there is UNMEASURED by that rule. gitleaks still scanned the same files as text.
  • D30 Dependency Vulnerabilities — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Pkgs.dev.azure.com could not be reached (Unable to load the service index for source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json. The proxy tunnel request to proxy 'http://egress:3128/' failed with status code '403'.). 2 of 3 declared ecosystem(s) (npm,osv) WERE scanned and every vulnerability they reported is included in this result; nuget was not, so this dimension's score covers less than the dependency surface this repository declares, and nothing here is evidence that nuget is free of known-vulnerable dependencies.
  • D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `src/NuGetGallery.AppHost.Tools/SeedBlobs.cs`, `REDACTED` 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.
  • D34 Knowledge Freshness — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. File-level freshness contradicts repo activity: 53 commits in the last 90 days, yet 713 of 760 significant files carry no living knowledge. Those two readings cannot both be true, so the per-file recency signal is treated as unreliable here and freshness is not scored for this run.
  • AC2 Forms & labels — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 35 further occurrence(s) are not listed individually; the score already reflects all 75.
  • AC6 Visual & motion safety — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 15 further occurrence(s) are not listed individually; the score already reflects all 55.
  • AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via AspireAppHost (src/NuGetGallery.AppHost/NuGetGallery.AppHost.csproj). the Aspire AppHost did not expose a crawlable HTTP endpoint in time (or only the dashboard) — no runtime evidence.
  • GD1 Unfinished & placeholder code — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 614 further occurrence(s) are not listed individually; the score already reflects all 654.
  • IC1 Incompleteness & stubs — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • IC1 Incompleteness & stubs — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 651 further occurrence(s) are not listed individually; the score already reflects all 691.
  • M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • R10 Code Duplication — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 32 further occurrence(s) are not listed individually; the score already reflects all 72.
  • R2 Cyclomatic Complexity — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 61 further occurrence(s) are not listed individually; the score already reflects all 101.
  • X1 Async correctness — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • X1 Async correctness — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 4 further occurrence(s) are not listed individually; the score already reflects all 44.
  • X10 Duplicated predicate — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 89 further occurrence(s) are not listed individually; the score already reflects all 129.
  • X12 Unreachable branch — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • X13 Undrained process stream — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • X14 Bypassable address classification — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • X16 Unfloored truncation loop — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • X17 Uncapped recursion over a caller-supplied document — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • X18 Disposal-pattern correctness — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • X19 Unrestored process-global state — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • X2 Cancellation propagation — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • X2 Cancellation propagation — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 1127 further occurrence(s) are not listed individually; the score already reflects all 1167.
  • X20 Mistyped argument guard — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 35 further occurrence(s) are not listed individually; the score already reflects all 75.
  • X22 Contradicted release guard — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • X23 Unguarded diagnostic materialisation — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • X24 Document value interpolated into markup unescaped — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 20 further occurrence(s) are not listed individually; the score already reflects all 60.
  • X25 Inert configuration knob — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • X27 Collection changed while being enumerated — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • X28 Index access outside its own emptiness guard — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • X29 Per-element action decided by a fixed element — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • X3 Exception handling — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • X30 Support guard that admits what it rejects — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • X4 Structured logging — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • Package restore incomplete — third-party types were unresolved in part of the solution — NuGet restore did not complete for src/NuGetGallery/NuGetGallery.csproj, tests/NuGetGallery.Facts/NuGetGallery.Facts.csproj, src/NuGetGallery.Core/NuGetGallery.Core.csproj, tests/NuGetGallery.Core.Facts/NuGetGallery.Core.Facts.csproj, src/GalleryTools/GalleryTools.csproj and 105 more, so those projects were analysed with framework references only: every check keyed on a third-party type saw an error type there and reported nothing. Findings on those projects are a lower bound; run `dotnet restore` on them and rescan.

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

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • 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.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • D13 REDACTED Scanning: REDACTED 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.
  • D18 Solution Shape: Build integrity reflects whether the solution compiled in this environment — a build that needs a private feed, a specific SDK, or a generated file absent from the repo can read as broken when it is merely unreproducible here.
  • D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
  • D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • 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.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
  • AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
  • AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
  • AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
  • AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
  • AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
  • 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.
  • AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
  • C3 Audit Trail: This control is scored from in-repo evidence only — a working control configured outside the repository leaves no signal a static scan can credit.
  • C4 Data Retention: This control is scored from in-repo evidence only — its real-world effectiveness, exercised only at runtime, is outside a static scan.
  • ED5 Idempotency: Idempotency is read from the handler body and one hop below: a mutation is flagged only on structural double-apply evidence (a fresh-identity insert, an accumulation, a growing list, an unkeyed POST/send/charge), so a duplicate effect through a home-grown gateway two hops down, or an insert keyed on the message with no unique constraint, is not flagged but counted as not classified; a guard enforced by a database constraint or a broker's exactly-once delivery is invisible either way. It flags the at-least-once double-apply SHAPE, not a runtime proof of a duplicate effect.
  • M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

Dimensions

D1 · Cyclomatic Complexity6.3 / 10Adequate✓ Tool-verified

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

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

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

99 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was d3.zoom at 77. A further 16 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being StagingController.CreateGroupViewModel at 30 — they are counted neither in the figure above nor in this dimension's score. 6 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: src/Gallery.Maintenance/ExpireStagingTask.cs (ExpireStagingTask.ProcessAsync at 22), src/NuGetGallery/Scripts/gallery/page-staging-group.js (page-staging-group.StagedPackageViewModel at 20), src/StatusAggregator/Parse/PingdomIncidentRegexParsingHandler.cs (PingdomIncidentRegexParsingHandler.TryParseAffectedComponentPath at 18), src/NuGetGallery.Core/Extensions/ValidationIssueExtensions.cs (ValidationIssueExtensions.ToPlainTextString at 17), src/NuGet.Services.Validation.Orchestrator/Configuration/SymbolPromotionValidationConfiguration.cs (SymbolPromotionValidationConfiguration.MatchesAttempt at 16), and 1 more not listed here. They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.

d3.brush$1::started::move (cyclomatic 24) · ×3REDACTED:4554
d3.zoom (cyclomatic 77)REDACTED:16971
page-manage-deprecation.ManageDeprecationViewModel (cyclomatic 55)src/NuGetGallery/Scripts/gallery/page-manage-deprecation.js:3
PublicExternalIconUrlPolicy.IsRestrictedAddress (cyclomatic 50)src/Catalog/Icons/PublicExternalIconUrlPolicy.cs:105
d3.clipCircle (cyclomatic 44)REDACTED:8398

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

What to do

  1. Bring the 1 body over 60 down to 60 or less in Cyclomatic Complexity — start with d3.zoom (cyclomatic 77). — Refactoring it lifts Cyclomatic Complexity from 6.3 to about 6.5/10.

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

D2 · Cognitive Complexity6.4 / 10Adequate✓ Tool-verified

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

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

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

193 method(s) exceeded the cognitive complexity threshold of 15; the worst was QueryResult.GetInnerResult at 72.

d3.brush$1::started::keyupped (cognitive 37) · ×3REDACTED:4657
d3.clipRectangle.<returned closure>::linePoint (cognitive 21) · ×2REDACTED:8761
QueryResult.GetInnerResult (cognitive 72)src/NuGetGallery/WebApi/QueryResult.cs:116
d3.linePoint (cognitive 66)REDACTED:7554
d3.zoom (cognitive 59)REDACTED:16971

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

What to do

  1. Bring the 2 bodies over 60 down to 60 or less in Cognitive Complexity — start with QueryResult.GetInnerResult (cognitive 72), d3.linePoint (cognitive 66). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 2 together lifts Cognitive Complexity from 6.4 to about 6.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.

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

D3 · God Classes9.0 / 10Stronggated by 75 serious findings✓ Tool-verified

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

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

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

75 god class(es) detected.

FileTooLong: REDACTED · ×22REDACTED
MethodTooLong: Routes.RegisterUIRoutes · ×14src/NuGetGallery/App_Start/Routes.cs:39
TooManyMethods: TelemetryService · ×14src/NuGetGallery.Services/Telemetry/TelemetryService.cs
FunctionTooLong: d3.brush$1 · ×13REDACTED:4318
ClassTooLong: Routes · ×12src/NuGetGallery/App_Start/Routes.cs

What to do

  1. Resolve the 22 FileTooLong finding(s) in God Classes — start with REDACTED, jquery-ui-1.10.3.js, REDACTED. — One of this dimension's main actionable groups (22 warning-level).
  2. Resolve the 14 MethodTooLong finding(s) in God Classes — start with REDACTED (3), ValidationEntitiesContext.cs (2), Routes.cs. — One of this dimension's main actionable groups (14 warning-level).
  3. Resolve the 14 TooManyMethods finding(s) in God Classes — start with TelemetryService.cs (2), REDACTED, REDACTED. — One of this dimension's main actionable groups (14 warning-level).

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

D4 · Code Duplication7.6 / 10Strong✓ Tool-verified

What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.

Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.

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

136 duplicated block group(s) detected. 5.9 % of the production lines (11,372 of 193,516) are in a reported copy. A further 322 rows report members as variants of one another; the share counts each copied line once, however many rows cite it.

Edited copy of a member (6 corresponding lines) · ×14src/GitHubVulnerabilities2Db/Job.cs:211
Edited copy of a member (4 corresponding lines) · ×13src/NuGet.Services.Cursor/AggregateCursor.cs:30
Edited copy of a member (13 corresponding lines) · ×11src/NuGetGallery.Core/Services/StagedSymbolPackagePromotionService.cs:44
Edited copy of a member (5 corresponding lines) · ×11src/NuGet.Services.Messaging/EmailMessageEnqueuer.cs:21
Duplicated block (6 lines × 2) · ×11src/NuGetGallery/Services/PackageMetadataValidationService.cs:480

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

What to do

  1. Resolve the 14 Edited copy of a member (6 corresponding lines) finding(s) in Code Duplication — start with Job.cs, AuxiliaryFileReloader.cs, nugetversion.py. — One of this dimension's main actionable groups (14 warning-level).
  2. Resolve the 13 Edited copy of a member (4 corresponding lines) finding(s) in Code Duplication — start with AggregateCursor.cs, IconProcessor.cs, PackageDownloader.cs. — One of this dimension's main actionable groups (13 warning-level).
  3. Resolve the 11 Edited copy of a member (13 corresponding lines) finding(s) in Code Duplication — start with StagedSymbolPackagePromotionService.cs, OrganizationMembershipRequestMessage.cs, ValidationSetProcessor.cs. — One of this dimension's main actionable groups (11 warning-level).

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

D5 · Coupling9.9 / 10Stronggated by 2 serious findings✓ Tool-verified

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

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

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

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

169 projects, 0 dependency cycle(s), 0 unstable depended-on project(s).

Off the main sequence: NuGet.Services.Entities(net472) · ×2src/NuGet.Services.Entities/NuGet.Services.Entities.csproj:1

What to do

  1. Resolve the 2 Off the main sequence finding(s) in Coupling — start with NuGet.Services.Entities.csproj, NuGet.Services.Storage.csproj. — One of this dimension's main actionable groups (2 warning-level).

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

D6 · Cohesion (LCOM4)9.8 / 10Stronggated by 7 serious findings✓ Tool-verified

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

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

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

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

7 of 550 classes have LCOM4 above 3.

Low cohesion: ApiController (LCOM4 6) · ×7REDACTED:35

What to do

  1. Resolve the 7 Low cohesion finding(s) in Cohesion (LCOM4) — start with REDACTED, Job.cs, LoginDiscontinuation.cs. — One of this dimension's main actionable groups (7 warning-level).

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

D10 · Test Quality10.0 / 10Stronggated by 18 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 10.0 / 10 · rule-coverage 100% · ceiling Prevented

5 skipped (4 with a documented reason), 8 zero-assertion, 9 racing the wall clock, 37 mock references across 7561 tests. Measured on the C# suite only — at least 4 test source file(s) (.py) went unread, so its test quality is unmeasured and is not in these counts.

Races the wall clock: SetsEnqueueTime · ×9tests/Validation.PackageSigning.ScanAndSign.Tests/ScanAndSignEnqueuerFacts.cs:118
No assertions: NullTelemetryItemDoesNotThrow · ×8tests/NuGetGallery.Facts/Telemetry/ClientTelemetryPIIProcessorTests.cs:30
Skipped test: RejectsUntrustedSigningCertificatetests/Validation.PackageSigning.ProcessSignature.Tests/SignatureValidatorIntegrationTests.cs:254
Mock framework: Moq · ×37
Skipped (documented): OneSecondCacheTime · ×4tests/NuGetGallery.Facts/Controllers/PackagesControllerFacts.cs:2350

What to do

  1. Resolve the 9 Races the wall clock finding(s) in Test Quality — start with ScanAndSignEnqueuerFacts.cs (4), ContentScanEnqueuerFacts.cs (4), SymbolsValidationEntitiesServiceFacts.cs. — One of this dimension's main actionable groups (9 warning-level).
  2. Resolve the 8 No assertions finding(s) in Test Quality — start with LinksTests.cs (5), ClientTelemetryPIIProcessorTests.cs (2), StagedPackageStatusProcessorFacts.cs. — One of this dimension's main actionable groups (8 warning-level).
  3. Resolve the 1 Skipped test finding(s) in Test Quality — start with SignatureValidatorIntegrationTests.cs. — One of this dimension's main actionable groups (1 warning-level).

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

D13 · REDACTED Scanning5.0 / 10Adequate✓ Tool-verified

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 5.0 / 10 · rule-coverage 100% · ceiling Prevented

1 secret(s) detected. 2 detection(s) were excluded as holding no minted credential in material that runs: a name, reference or comparison rather than a value, a readable phrase or pattern, a value that declares itself fake, or development, test, example, mock or demo material.

REDACTED

What to do

  1. Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).

Detailed fixes: d13_recommendation.md · top locations in Appendix A, every location in findings.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 70 packages use a banned license. ★ DEPTH: every package graded here is one this repository's MSBuild projects declare as a direct `PackageReference` (150 declared), and nothing beyond them was reached — this is the DECLARATION-SITE set, NOT the transitive closure. .NET has no lockfile a checkout is guaranteed to carry and this pass grades an unrestored tree, so a banned licence that only a direct dependency's OWN dependencies pull in is outside this verdict, exactly as the JVM arm's declaration-site verdict is.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

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

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

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

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

Top hotspots: REDACTED (2×22=44)

Hotspot: REDACTEDREDACTED:41

What to do

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

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

D16 · Bus Factor9.7 / 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.7 / 10 · rule-coverage 100% · ceiling Documented

13 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is src/NuGetGallery/Services/PackageDeleteService.cs. Counted over 520 of the 2459 production source files in this repository: 1699 are under the ~2,400-byte size floor this dimension measures over, and the remaining 240 have no attributable history left to measure.

Off-boarding risk: anonymized user #1
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.1 / 10Adequategated by 75 critical 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.1 / 10 · rule-coverage 100% · ceiling Prevented

137 deducted debt markers + unmeasured dead symbols across 193516 LoC in the .NET projects (0.5/KLoC) → score 9.1. Dead code not measured: the solution did not load cleanly, so the reference search was skipped.

WriteOnlyPrivateField · ×49src/AccountDeleter/GalleryAccountManager.cs:14
EmptyCatchBlock · ×25src/GalleryTools/Commands/BackfillTfmMetadataCommand.cs:56
FileScopedPragmaDisablesrc/NuGetGallery/Areas/Admin/Controllers/AdminApiController.cs:4
TodoComment · ×26src/ArchivePackages/ArchivePackages.Job.cs:95
BarePragmaDisable · ×13src/NuGet.Jobs.Common/JobRunner.cs:145

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

What to do

  1. Resolve the 49 WriteOnlyPrivateField finding(s) in Explicit Debt — start with PackageSignatureProcessor.cs (5), PackageSignatureValidator.cs (5), PackageRegistrationExtensionsFacts.cs (3). — One of this dimension's main actionable groups (49 issue-level).
  2. Resolve the 25 EmptyCatchBlock finding(s) in Explicit Debt — start with TelemetryClientWrapper.cs (8), BackfillTfmMetadataCommand.cs (2), REDACTED (2). — One of this dimension's main actionable groups (25 issue-level).
  3. Resolve the 1 FileScopedPragmaDisable finding(s) in Explicit Debt — start with AdminApiController.cs. — One of this dimension's main actionable groups (1 issue-level).

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

D18 · Solution Shape10.0 / 10Stronggated by 3 serious findings✓ Tool-verified

What it measures: Whether the solution is laid out in a sensible, conventional structure.

Method: Solution structure: project count, decomposition, shell-project detection, build success (confirmed failures cap the score); traced to actual .sln files and binaries. Deterministic.

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

169 projects, 4746 source files, 412516 hand-written lines of code (193516 production / 219000 test — the split is derived per file: test is what its project, its own path, or a compile-guarded region marks as test, and a file carrying no test signal counts as production), plus 18052 generated (machine-written code — designer, scaffolded and tool-emitted files — excluded from quality), 289 inter-project edges (build status unknown — did not finish). Measured across 5 solutions loaded as one workspace: `NuGetGallery.sln`, `NuGet.Jobs.sln`, `NuGet.Server.Common.sln`, `NuGetGallery.Aspire.slnx`, `python/StatsLogParser.slnx`.

Solution references a project that does not exist · ×2NuGetGallery.sln
Solution references 5 projects that do not existpython/StatsLogParser.slnx

What to do

  1. Resolve the 2 Solution references a project that does not exist finding(s) in Solution Shape — start with NuGetGallery.sln, NuGet.Jobs.sln. — One of this dimension's main actionable groups (2 warning-level).
  2. Resolve the 1 Solution references 5 projects that do not exist finding(s) in Solution Shape — start with StatsLogParser.slnx. — One of this dimension's main actionable groups (1 warning-level).

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

D19 · Documentation Quality9.7 / 10Exemplary✓ Tool-verified

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

Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.

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

1 of 2 documentation facets pass in full; short on: F2 example. 31 document(s) read across 83 unit(s).

Documentation: no build, run or usage examplesrc/GalleryTools/Readme.md:1

✓ On the Gold path — maintain.

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

D20 · ADR Quality0.0 / 10Critical✓ Tool-verified

What it measures: Whether architecture decisions are recorded well (context, decision, consequences).

Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.

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

No architecture decision records were found.

No ADRs foundsrc/AccountDeleter/AccountDeleter.csproj:4

What to do

  1. Resolve the 1 No ADRs found finding(s) in ADR Quality — start with AccountDeleter.csproj. — One of this dimension's main actionable groups (1 recommendation-level).

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

D24 · Comment Value7.6 7.4 / 10Strong✓ Tool-verified

What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).

Method: Every inline C# comment compared word by word with the identifiers, literals and constructs of the code it annotates (taken from the syntax); a comment whose words that code already contains is redundant, as are closing-brace labels and generator template text. Comments giving a reason or a reference are kept; other scripts and languages are not judged. Deterministic, exhaustive, advisory.

Maturity: Documented → Verified → Prevented · effective 7.4 / 10 · rule-coverage 97% · ceiling Documented

99 of 4105 judged comments only repeat the code they sit on (2.4 %). 161 comment(s) in another language or script were not judged.

redundant comment · ×95src/Catalog/Dnx/DnxConstants.cs:21
doc comments repeat the names · ×40src/AccountDeleter/AccountDeleteMessageHandler.cs:46

What to do

  1. Resolve the 95 redundant comment finding(s) in Comment Value — start with jquery-ui-1.10.3.js (4), AzureStorageFacts.cs (4), DnxConstants.cs (3). — One of this dimension's main actionable groups (95 recommendation-level).

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

D26 · Project Cohesion9.3 / 10Exemplary✓ Tool-verified

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

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

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

5 of 142 projects flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion · ×5src/NuGetGallery/NuGetGallery.csproj:1
Split NuGetGallery.Core(net472)src/NuGetGallery.Core/NuGetGallery.Core.csproj:1
Split NuGetGallery.Services(net472)src/NuGetGallery.Services/NuGetGallery.Services.csproj:1
Split NuGet.Services.Metadata.Catalog(net472)src/Catalog/NuGet.Services.Metadata.Catalog.csproj:1

✓ On the Gold path — maintain.

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

D27 · Navigability7.9 / 10Strong✓ Tool-verified

What it measures: How far you must trace to follow a call — low indirection and co-located slices read easier.

Method: Call indirection (interface hops, cross-namespace calls, slice-locality scaled) over a sampled set of method invocations, size-aware baseline. Sampled; confidence discounted by symbol-resolution gaps. C# also names each pass-through layer (a class whose every public method only forwards its own parameters to one collaborator) as a located finding; the score is not affected.

Coverage: Slice locality from the first namespace segments, SAMPLED (≤400 methods) — not exhaustive.

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

49 % of calls cross a namespace and 9 % go through an interface, but 89 % of collaborators are co-located — so a call's collaborators sit together and tracing stays easy. Baseline: large — vertical-slice locality expected.

Pass-through layer · ×2src/NuGetGallery/UrlHelperWrapper.cs:9

What to do

  1. Resolve the 2 Pass-through layer finding(s) in Navigability — start with UrlHelperWrapper.cs, ReadOnlyEntitiesContext.cs. — One of this dimension's main actionable groups (2 recommendation-level).

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

D28 · Secrets (history)9.0 / 10Adequategated by 1 critical finding✓ Tool-verified

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

Method: REDACTED 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 9.0 / 10 · rule-coverage 100% · ceiling Documented

1 finding(s): 0 critical, 1 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.

REDACTED
REDACTED

What to do

  1. Resolve the 1 REDACTED finding(s) in Secrets (history) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  2. Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).

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

D29 · Static Analysis (SAST)0.0 / 10Critical✓ Tool-verified

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

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

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

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

152 finding(s): 0 critical, 24 high, 128 medium, 0 low. 14 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 7 file(s) — `src/NuGetGallery.AppHost.Tools/SeedBlobs.cs` (line 95), `REDACTED` (line 1213), `REDACTED`, `src/NuGetGallery/Scripts/gallery/jquery-3.4.1.js`, `src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js`, … (+2 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. In 1 of those file(s) — `REDACTED` — the break is a C# primary constructor, which semgrep's grammar cannot parse and which hides the type from every rule scoped to it; those files were re-scanned from a shadow copy with the constructor's parameter list blanked (line and column preserving), which restores the type to the rules, and 0 additional row(s) came from that pass. Only the header's own parameter list is unread in them. In 1 of those file(s) — `REDACTED` — the break is at a TYPE DECLARATION (a C# primary constructor semgrep's grammar cannot parse), so the loss is wider than the named lines: rules scoped to that type see no type to scope to and are blind over its whole body, while rules matching statements keep working there. Absence of a type-scoped finding in those types is not evidence of anything. Separately, one or more rules could not re-parse an embedded snippet in 2 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

  1. Resolve the 4 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (4 issue-level).
  2. Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3). — One of this dimension's main actionable groups (3 issue-level).
  3. No action in Static Analysis (SAST) — all 14 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (14 issue-level, 0 of them charged here).

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

D30 · Dependency Vulnerabilities5.8 / 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 and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.

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

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

10 finding(s): 0 critical, 6 high, 2 medium, 2 low. Partial dependency scan: 2 of 3 declared ecosystem(s) were scanned (npm,osv), and the findings above are real and complete for them. nuget was not scanned (nuget: pkgs.dev.azure.com could not be reached (Unable to load the service index for source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json. The proxy tunnel request to proxy 'http://egress:3128/' failed with status code '403'.)), so this is not the whole dependency surface and the result is reported at reduced confidence.

REDACTED
REDACTED
REDACTED

What to do

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

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

D35 · Change Coupling10.0 / 10Adequategated by 1 critical finding✓ 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: REDACTED↔PackageListViewModel.cs 77%; ICoreFileStorageService.cs↔ISimpleCloudBlob.cs 64%; CloudBlobWrapper.cs↔ICoreFileStorageService.cs 64%

Boundary-crossing change coupling: FakeFeatureFlagService.cs ↔ REDACTEDsrc/GitHubVulnerabilities2Db/Fakes/FakeFeatureFlagService.cs:1
Change coupling: REDACTED ↔ PackageListViewModel.cs · ×6REDACTED:1

What to do

  1. Resolve the 1 Boundary-crossing change coupling finding(s) in Change Coupling — start with FakeFeatureFlagService.cs. — One of this dimension's main actionable groups (1 issue-level).
  2. Resolve the 6 Change coupling finding(s) in Change Coupling — start with REDACTED (2), ICoreFileStorageService.cs, CloudBlobWrapper.cs. — One of this dimension's main actionable groups (6 warning-level).

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

D36 · Supply-chain Provenance & Signing0.0 / 10Critical✓ Tool-verified

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

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

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

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

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

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

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

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. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.

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

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.

D44 · Platform End-of-Life6.0 / 10Adequate✓ Tool-verified

What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.

Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.

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

1 end-of-life runtime(s) and 0 end-of-life framework(s), read from 146 platform declaration(s) and 2 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.

End-of-life runtime: .NET net6.0src/Microsoft.PackageManagement.Search.Web/Microsoft.PackageManagement.Search.Web.csproj:4

What to do

  1. Resolve the 1 End-of-life runtime finding(s) in Platform End-of-Life — start with Microsoft.PackageManagement.Search.Web.csproj. — One of this dimension's main actionable groups (1 warning-level).

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

Frontend & cross-cutting dimensions

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

AC1 · Text alternatives5.3 / 10Adequate✓ Tool-verified

Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.

Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.

  • An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative. (×3) — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:7816, src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:7819, src/NuGetGallery/Views/Packages/_ManageOwners.cshtml:22

What to do

  • Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
AC2 · Forms & labels5.3 / 10Adequate✓ Tool-verified

Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.

Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label. (×17) — src/NuGetGallery/Areas/Admin/Views/ApiKeys/Index.cshtml:15, src/NuGetGallery/Areas/Admin/Views/ChangeUsername/Index.cshtml:15, src/NuGetGallery/Areas/Admin/Views/ChangeUsername/Index.cshtml:63, …
  • This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id. (×10) — src/NuGetGallery/Areas/Admin/Views/DeleteAccount/_DeleteUserAccountForm.cshtml:18, src/NuGetGallery/Areas/Admin/Views/Features/_AddFlight.cshtml:26, src/NuGetGallery/Areas/Admin/Views/Features/_AddFlight.cshtml:35, …
  • A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one. — src/NuGetGallery/Areas/Admin/Views/Lucene/Index.cshtml:41
  • This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. (×10) — src/NuGetGallery/Areas/Admin/Views/SecurityPolicy/Index.cshtml:37, src/NuGetGallery/Areas/Admin/Views/SecurityPolicy/Index.cshtml:46, src/NuGetGallery/Areas/Admin/Views/SiteAdmins/Index.cshtml:37, …
  • A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label. (×2) — src/NuGetGallery/Scripts/gallery/jquery-3.4.1.js:1308, src/NuGetGallery/Scripts/gallery/jquery-3.4.1.js:2734

What to do

  • Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
AC3 · Page structure6.6 / 10Adequate✓ Tool-verified

Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.

Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • An empty <title> gives no page name in the tab, history or screen-reader page list. Put descriptive text in the <title>. (×2) — src/NuGet.SupportRequests.Notifications/Templates/OnCallSummary.html:1, src/NuGet.SupportRequests.Notifications/Templates/WeeklySummary.html:1
  • No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. (×6) — src/NuGet.SupportRequests.Notifications/Templates/OnCallSummary.html:1, src/NuGet.SupportRequests.Notifications/Templates/WeeklySummary.html:1, src/NuGetCDNRedirect/Views/Shared/Error.cshtml:2, …
  • A <table> with data cells but no <th> gives assistive technology no way to associate cells with their headers. Mark the header row/column cells as <th> (with a scope). (×3) — src/NuGet.SupportRequests.Notifications/Templates/OnCallSummary.html:22, src/NuGet.SupportRequests.Notifications/Templates/WeeklySummary.html:22, src/NuGetGallery/Areas/Admin/Views/ReservedNamespace/Index.cshtml:28
  • The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en"). — src/NuGetCDNRedirect/Views/Shared/Error.cshtml:2
  • Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one. (×4) — src/NuGetGallery/Areas/Admin/Views/FederatedCredentials/Index.cshtml:230, REDACTED:39, REDACTED:1305, …
  • An empty heading appears in the document outline announced with no text. Give the heading text, or remove it if it's decorative. — src/NuGetGallery/Scripts/gallery/bootstrap.js:2012

What to do

  • Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
AC4 · Keyboard semantics1.8 / 10Critical✓ Tool-verified

Other · Accessibility — Whether interactive behaviour is keyboard-reachable — no click handler on a non-interactive element lacking a role, tabindex and key handler, no element the repo's own CSS styles `cursor: pointer` without giving it any of the three, no unfocusable element whose only binding is a mouse enter/leave pair or a double-click, no positive tabindex, no href-less anchor, no placeholder-href (#/javascript) link acting as a button. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: click handlers on non-interactive elements lacking role+tabindex+key handler, positive tabindex values, and href-less anchors. Components skipped, spreads suppressed. Deterministic, hard fact per element.

Coverage: Population: elements that pose a keyboard-semantics question, in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) — a non-natively-interactive element carrying a click handler, a double-click or hover enter/leave binding, a pointer-only gesture on a tabindex="0" element, or `cursor: pointer` from the repo's own CSS; an href-less or placeholder-href (#, javascript:) anchor; and any element with a positive tabindex. Natively interactive elements used correctly (<button>, <a href>, form controls) are NOT in the population — there is nothing to judge — so a page of nothing but correct controls gives AC4 nothing to measure. Keyboard reachability is judged from the markup, never from a rendered page. ★ An interactive element declared in a tagged-template (html`…`) or hyperscript frontend is NOT in this population — no producer reads either — so an empty population is reported as an analyzer gap, never as "this repository has no interactive elements".

  • An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action. (×16) — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:174, src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:230, src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:7128, …

What to do

  • Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
AC5 · ARIA correctness7.6 / 10Strong✓ Tool-verified

Other · Accessibility — Whether ARIA is used correctly — valid non-abstract roles, the ARIA state a role requires, valid (non-misspelled) aria-* attribute names, in-enum values for token-typed aria-* attributes, and no aria-hidden on (or wrapping) a focusable element. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: role values checked against the WAI-ARIA role set (abstract/invalid flagged), required ARIA state for a role, and aria-hidden on a focusable element. Deterministic, role/attribute level.

Coverage: Population: elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) that carry a role or an aria-* attribute; roles and token values are checked against the ARIA enums exhaustively within that set. An expression-valued (dynamic) role or aria-* value is skipped rather than guessed, and markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • A plain <div> has the implicit role "generic", which supports no ARIA states, so this aria-expanded is dropped and assistive tech is never told the state at all. Put aria-expanded on the element that owns the behaviour (the button or control the user operates), or give this <div> a role that supports aria-expanded. (×6) — src/NuGetGallery/Views/Organizations/_OrganizationMembersListForDeletedAccount.cshtml:5, src/NuGetGallery/Views/Packages/DeleteSymbols.cshtml:49, src/NuGetGallery/Views/Shared/_AccountCertificates.cshtml:80, …

What to do

  • Use valid, non-abstract roles, supply the ARIA state each role requires, and never put aria-hidden on a focusable element.
AC6 · Visual & motion safety4.6 / 10Weak✓ Tool-verified

Other · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.

Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.

Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) — computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • `a` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. (×2) — src/NuGetGallery/App_Offline-Planned.htm:64, src/NuGetGallery/App_Offline-Unplanned.htm:64
  • `.featured div a.install` sets color: #fff on background-color: #4585aa — 4.0:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — src/NuGetGallery/Content/PageStylings.css:367
  • `.message` sets color: #52a4ca on background-color: #eff7fa — 2.6:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — src/NuGetGallery/Content/Site.css:219
  • `.warning` sets color: #ff9600 on background-color: #fff7c4 — 2.0:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — src/NuGetGallery/Content/Site.css:233
  • `button, input[type="submit"], .btn` sets color: #fff on background-color: #4585aa — 4.0:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — src/NuGetGallery/Content/Site.css:1160
  • `.sequence li.past, .sequence li.current` sets color: #fff on background-color: #4585aa — 4.0:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — src/NuGetGallery/Content/Site.css:1254
  • `div.DDNavigation a` sets color: #839ce7 on background-color: #fff — 2.7:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — src/NuGetGallery/Areas/Admin/DynamicData/Site.css:83
  • `#searchBoxInput` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — src/NuGetGallery/Content/Layout.css:195
  • `.form input:focus` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — src/NuGetGallery/Content/Site.css:1194
  • `.ui-helper-reset` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — src/NuGetGallery/Content/themes/custom/jquery-ui-1.10.3.custom.css:26
  • `.ui-dialog` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — src/NuGetGallery/Content/themes/custom/jquery-ui-1.10.3.custom.css:473
  • `.ui-menu` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — src/NuGetGallery/Content/themes/custom/jquery-ui-1.10.3.custom.css:532
  • `.btn-group.open .dropdown-toggle` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — src/Bootstrap/less/button-groups.less:90
  • `.btn.active` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — src/Bootstrap/less/buttons.less:44
  • `.carousel-control:focus` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — src/Bootstrap/less/carousel.less:125
  • `.brand-radio input[type="radio"]` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — src/Bootstrap/less/forms.less:76
  • `.brand-checkbox input[type="checkbox"]` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — src/Bootstrap/less/forms.less:208
  • `.modal` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — src/Bootstrap/less/modals.less:29
  • `.modal-content` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — src/Bootstrap/less/modals.less:60
  • `.navbar-toggle:focus` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — src/Bootstrap/less/navbar.less:211
  • `.ms-motion-scaleDownIn` moves (`animation: ms-motion-scaleDownIn 300ms cubic-bezier(0.1, 0.9, 0.2, 1) both, ms-motion-fadeIn 100ms cubic-bezier(0, 0, 1, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. (×2) — src/NuGetGallery/Content/fabric.css:139, src/NuGetGallery/Content/gallery/css/fabric.css:143
  • `.ms-motion-scaleDownOut` moves (`animation: ms-motion-scaleDownOut 300ms cubic-bezier(0.1, 0.9, 0.2, 1) both, ms-motion-fadeOut 100ms cubic-bezier(0, 0, 1, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. (×2) — src/NuGetGallery/Content/fabric.css:143, src/NuGetGallery/Content/gallery/css/fabric.css:147
  • `[dir='ltr'] .ms-motion-slideLeftOut` moves (`animation: ms-motion-slideLeftOut 100ms cubic-bezier(0.9, 0.1, 1, 0.2) both, ms-motion-fadeOut 100ms cubic-bezier(0, 0, 1, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. (×2) — src/NuGetGallery/Content/fabric.css:147, src/NuGetGallery/Content/gallery/css/fabric.css:151
  • `[dir='rtl'] .ms-motion-slideLeftOut` moves (`animation: ms-motion-slideRightOut 100ms cubic-bezier(0.9, 0.1, 1, 0.2) both, ms-motion-fadeOut 100ms cubic-bezier(0, 0, 1, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. (×2) — src/NuGetGallery/Content/fabric.css:151, src/NuGetGallery/Content/gallery/css/fabric.css:155
  • `[dir='ltr'] .ms-motion-slideRightOut` moves (`animation: ms-motion-slideRightOut 100ms cubic-bezier(0.9, 0.1, 1, 0.2) both, ms-motion-fadeOut 100ms cubic-bezier(0, 0, 1, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. (×2) — src/NuGetGallery/Content/fabric.css:155, src/NuGetGallery/Content/gallery/css/fabric.css:159
  • `[dir='rtl'] .ms-motion-slideRightOut` moves (`animation: ms-motion-slideLeftOut 100ms cubic-bezier(0.9, 0.1, 1, 0.2) both, ms-motion-fadeOut 100ms cubic-bezier(0, 0, 1, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/NuGetGallery/Content/fabric.css:159
  • `[dir='ltr'] .ms-motion-slideLeftIn` moves (`animation: ms-motion-slideLeftIn 100ms cubic-bezier(0.1, 0.9, 0.2, 1) both, ms-motion-fadeIn 100ms cubic-bezier(0, 0, 1, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/NuGetGallery/Content/fabric.css:163
  • `[dir='rtl'] .ms-motion-slideLeftIn` moves (`animation: ms-motion-slideRightIn 100ms cubic-bezier(0.1, 0.9, 0.2, 1) both, ms-motion-fadeIn 100ms cubic-bezier(0, 0, 1, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/NuGetGallery/Content/fabric.css:167
  • `[dir='ltr'] .ms-motion-slideRightIn` moves (`animation: ms-motion-slideRightIn 100ms cubic-bezier(0.1, 0.9, 0.2, 1) both, ms-motion-fadeIn 100ms cubic-bezier(0, 0, 1, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/NuGetGallery/Content/fabric.css:171
  • `[dir='rtl'] .ms-motion-slideRightIn` moves (`animation: ms-motion-slideLeftIn 100ms cubic-bezier(0.1, 0.9, 0.2, 1) both, ms-motion-fadeIn 100ms cubic-bezier(0, 0, 1, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/NuGetGallery/Content/fabric.css:175
  • `.ms-motion-slideUpOut` moves (`animation: ms-motion-slideUpOut 100ms cubic-bezier(0.9, 0.1, 1, 0.2) both, ms-motion-fadeOut 100ms cubic-bezier(0, 0, 1, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/NuGetGallery/Content/fabric.css:179
  • `.ms-motion-slideDownOut` moves (`animation: ms-motion-slideDownOut 100ms cubic-bezier(0.9, 0.1, 1, 0.2) both, ms-motion-fadeOut 100ms cubic-bezier(0, 0, 1, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/NuGetGallery/Content/fabric.css:183
  • `.ms-motion-slideUpIn` moves (`animation: ms-motion-slideUpIn 100ms cubic-bezier(0.1, 0.9, 0.2, 1) both, ms-motion-fadeIn 100ms cubic-bezier(0, 0, 1, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/NuGetGallery/Content/fabric.css:187
  • `.ms-motion-slideDownIn` moves (`animation: ms-motion-slideDownIn 100ms cubic-bezier(0.1, 0.9, 0.2, 1) both, ms-motion-fadeIn 100ms cubic-bezier(0, 0, 1, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/NuGetGallery/Content/fabric.css:191

What to do

  • Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
AX1 · Captive dependencies6.6 / 10Adequate✓ Tool-verified

Other · Architecture — Whether any singleton service captures a scoped/transient dependency — a silent lifetime/threading bug.

Method: Roslyn scan: DI registrations parsed from AddSingleton/Scoped/Transient; each singleton checked for captured shorter-lifetime dependencies. Exhaustive, deterministic.

  • `FeatureFlagCacheService` is registered as a SINGLETON but its constructor takes `IFeatureFlagTelemetryService telemetryService`, which is registered as Transient. The singleton captures one instance of the transient dependency forever — defeating its lifetime (a per-request DbContext shared across all requests is a classic data-corruption/threading bug). Make the singleton resolve `IFeatureFlagTelemetryService` per-use (inject `IServiceScopeFactory` or a factory func), or align the lifetimes. — src/NuGet.Services.FeatureFlags/FeatureFlagCacheService.cs:31
  • `SearchIndexClientWrapper` is registered as a SINGLETON but its constructor takes `SearchIndexClient inner`, which is registered as Transient. The singleton captures one instance of the transient dependency forever — defeating its lifetime (a per-request DbContext shared across all requests is a classic data-corruption/threading bug). Make the singleton resolve `SearchIndexClient` per-use (inject `IServiceScopeFactory` or a factory func), or align the lifetimes. — src/NuGet.Services.AzureSearch/Wrappers/SearchIndexClientWrapper.cs:15
  • `AuxiliaryDataCache` is registered as a SINGLETON but its constructor takes `IAzureSearchTelemetryService telemetryService`, which is registered as Transient. The singleton captures one instance of the transient dependency forever — defeating its lifetime (a per-request DbContext shared across all requests is a classic data-corruption/threading bug). Make the singleton resolve `IAzureSearchTelemetryService` per-use (inject `IServiceScopeFactory` or a factory func), or align the lifetimes. — src/NuGet.Services.AzureSearch/SearchService/AuxiliaryDataCache.cs:30

What to do

  • Don't inject scoped/transient services into singletons; resolve them per-use via IServiceScopeFactory or a factory delegate, or align the lifetimes.
AX10 · Code composition8.6 / 10Strong✓ 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.

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.

AX2 · Stateful singletons1.2 / 10Critical✓ Tool-verified

Other · Architecture — Whether singleton services avoid mutable shared instance state that concurrent callers would race on.

Method: Roslyn scan: singleton field mutations unguarded by lock or Interlocked, per type; syntax-based guard detection. Deterministic, traceable per field.

  • `FeatureFlagCacheService` is a singleton (one shared instance) but mutates instance state outside any lock (_latestFlags; e.g. `_latestFlags` at line 57). — src/NuGet.Services.FeatureFlags/FeatureFlagCacheService.cs:11
  • `SecretRefresher` is a singleton (one shared instance) but mutates instance state outside any lock (LastRefresh; e.g. `LastRefresh` at line 50). — src/NuGet.Services.AzureSearch/SearchService/SecretRefresher.cs:14
  • `StringCache` is not registered, but the singleton `AuxiliaryDataCache` creates it and keeps it in `_stringCache`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (_requestCount, _hitCount; e.g. `_requestCount` at line 73). — src/NuGet.Services.AzureSearch/AuxiliaryFiles/StringCache.cs:9
  • `SecurityPolicyResult` keeps one instance of itself in the static `SuccessResult`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_warningMessages; e.g. `_warningMessages` at line 72). — src/NuGetGallery.Services/Security/SecurityPolicyResult.cs:13
  • `GalleryMachineKeyConfigurationProvider` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (Configuration; e.g. `Configuration` at line 33). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — src/NuGetGallery/App_Start/GalleryMachineKeyConfigurationProvider.cs:12
  • `OwinStartup` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (HasRun; e.g. `HasRun` at line 222). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — src/NuGetGallery/App_Start/OwinStartup.cs:34
  • `RouteExtensions` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (ObfuscatedRouteMap; e.g. `ObfuscatedRouteMap` at line 51). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — src/NuGetGallery/Extensions/RouteExtensions.cs:13
  • `UrlHelperExtensions` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_configuration; e.g. `_configuration` at line 63). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — src/NuGetGallery/UrlHelperExtensions.cs:17
  • `LuceneCommon` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_directorySingleton; e.g. `_directorySingleton` at line 45). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — src/NuGetGallery/Infrastructure/Lucene/LuceneCommon.cs:11
  • `AppActivator` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_jobManager; e.g. `_jobManager` at line 308). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — src/NuGetGallery/App_Start/AppActivator.cs:33
  • `DynamicDataManager` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_route; e.g. `_route` at line 60). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — src/NuGetGallery/Areas/Admin/DynamicData/DynamicDataManager.cs:15
  • `ObjectMaterializedInterception` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (Interceptors; e.g. `Interceptors` at line 14). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — src/NuGetGallery.Core/Entities/Interception/ObjectMaterializedInterception.cs:8
  • `MessageQueue` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (Enabled, MaxPerQueue; e.g. `Enabled` at line 20). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — src/NuGetGallery.Core/Infrastructure/MessageQueue.cs:10
  • `AuditActor` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_localIpAddress, _localIpAddressExpiration; e.g. `_localIpAddress` at line 136). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — src/NuGetGallery.Core/Auditing/AuditActor.cs:18
  • `CookieComplianceService` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (Instance, Logger; e.g. `Instance` at line 16). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — src/NuGetGallery.Core/Cookies/CookieComplianceService.cs:9
  • `QuietLog` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (Telemetry; e.g. `Telemetry` at line 17). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — src/NuGetGallery.Services/Telemetry/QuietLog.cs:11
  • `AzureActiveDirectoryV2Authenticator` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_alternateSiteRootList; e.g. `_alternateSiteRootList` at line 92). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — src/NuGetGallery.Services/Authentication/Providers/AzureActiveDirectoryV2/AzureActiveDirectoryV2Authenticator.cs:19
  • `JobRunner` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_applicationInsightsConfiguration, _logger; e.g. `_applicationInsightsConfiguration` at line 88). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — src/NuGet.Jobs.Common/JobRunner.cs:18

What to do

  • Keep singletons stateless or back their state with thread-safe types (Concurrent*/Immutable*); otherwise concurrent callers race.
  • A `static` field is one slot for the whole process, however its type is created: back it with a thread-safe type (ConcurrentDictionary, Interlocked), take a lock around every write, or move it into a registered singleton that does.
AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

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

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

  • The namespaces NuGetGallery ↔ NuGetGallery.Areas.Admin ↔ NuGetGallery.Areas.Admin.Models ↔ NuGetGallery.Areas.Admin.Services ↔ NuGetGallery.Areas.Admin.ViewModels ↔ NuGetGallery.Auditing ↔ NuGetGallery.Authentication ↔ NuGetGallery.Authentication.Providers ↔ NuGetGallery.Configuration ↔ NuGetGallery.Diagnostics ↔ NuGetGallery.Features ↔ NuGetGallery.Helpers ↔ NuGetGallery.Infrastructure ↔ NuGetGallery.Infrastructure.Authentication ↔ NuGetGallery.Infrastructure.Lucene ↔ NuGetGallery.Infrastructure.Search ↔ NuGetGallery.Login ↔ NuGetGallery.Security ↔ NuGetGallery.Services ↔ NuGetGallery.Services.Authentication depend on each other. The lightest dependency in the cycle is NuGetGallery → NuGetGallery.Areas.Admin.Models (NuGetGallery.PackagesController → NuGetGallery.Areas.Admin.Models.Issue, 1 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface. — REDACTED:26
  • The namespaces Gallery.CredentialExpiration ↔ Gallery.CredentialExpiration.Models depend on each other. The lightest dependency in the cycle is Gallery.CredentialExpiration.Models → Gallery.CredentialExpiration (Gallery.CredentialExpiration.Models.CredentialExpirationJobMetadata → Gallery.CredentialExpiration.JobRunTimeCursor, 1 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface. — src/Gallery.CredentialExpiration/Models/CredentialExpirationJobMetadata.cs:7
  • The namespaces NuGet.Services.Metadata.Catalog ↔ NuGet.Services.Metadata.Catalog.Helpers depend on each other. The lightest dependency in the cycle is NuGet.Services.Metadata.Catalog → NuGet.Services.Metadata.Catalog.Helpers (NuGet.Services.Metadata.Catalog.IPackageCatalogItemCreator → NuGet.Services.Metadata.Catalog.Helpers.FeedPackageDetails, 5 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface. — src/Catalog/IPackageCatalogItemCreator.cs:7
  • The namespaces NuGet.Jobs.Monitoring.PackageLag ↔ NuGet.Jobs.Monitoring.PackageLag.Telemetry depend on each other. The lightest dependency in the cycle is NuGet.Jobs.Monitoring.PackageLag → NuGet.Jobs.Monitoring.PackageLag.Telemetry (NuGet.Jobs.Monitoring.PackageLag.Job → NuGet.Jobs.Monitoring.PackageLag.Telemetry.IPackageLagTelemetryService, 2 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface. — src/PackageLagMonitor/Job.cs:16
  • The namespaces NuGet.Services.AzureSearch ↔ NuGet.Services.AzureSearch.Auxiliary2AzureSearch ↔ NuGet.Services.AzureSearch.AuxiliaryFiles ↔ NuGet.Services.AzureSearch.SearchService depend on each other. The lightest dependency in the cycle is NuGet.Services.AzureSearch → NuGet.Services.AzureSearch.Auxiliary2AzureSearch (NuGet.Services.AzureSearch.DownloadTransferrer → NuGet.Services.AzureSearch.Auxiliary2AzureSearch.IDataSetComparer, 1 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface. — src/NuGet.Services.AzureSearch/DownloadTransferrer.cs:9
  • The namespaces NuGet.Services.GitHub.Authentication ↔ NuGet.Services.GitHub.Configuration depend on each other. The lightest dependency in the cycle is NuGet.Services.GitHub.Configuration → NuGet.Services.GitHub.Authentication (NuGet.Services.GitHub.Configuration.ConfigurationExtensions → NuGet.Services.GitHub.Authentication.IGitHubAuthProvider, 1 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface. — src/NuGet.Services.GitHub/Configuration/ConfigurationExtensions.cs:11
  • The namespaces StatusAggregator ↔ StatusAggregator.Collector ↔ StatusAggregator.Export ↔ StatusAggregator.Factory ↔ StatusAggregator.Messages ↔ StatusAggregator.Parse ↔ StatusAggregator.Update depend on each other. The lightest dependency in the cycle is StatusAggregator → StatusAggregator.Export (StatusAggregator.StatusAggregator → StatusAggregator.Export.IStatusExporter, 1 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface. — src/StatusAggregator/StatusAggregator.cs:9

What to do

  • Break namespace cycles inside a project by moving the shared type to a namespace both sides can use, or by inverting the back edge behind an interface.
AX5 · Architecture & structure10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether the codebase has a recognisable, scale-appropriate structure (a named architectural style, or modular enough for its size) rather than being an ad-hoc ball of mud.

Method: Roslyn plus csproj analysis: architecture style detection (DDD, clean, vertical-slice, CQRS) and structure fitness for repo size. Deterministic.

AX6 · Interface segregation9.9 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').

Method: Roslyn scan: public interface declared-member counts (accessors fold into their property/event); fat-interface threshold (over 15 declared members) flagged per type. Each finding also reports the distinct-OPERATION count — members counted by name, so an overload group counts once — which decides whether it states the caller-side ISP harm or the implementer-side burden of an overload set. TypeScript: exported interfaces that declare behaviour, counted over their REQUIRED operations (method signatures and function-typed properties with no `?`, once per signature) — data-shape interfaces and ambient .d.ts declarations are outside the population; JavaScript declares no interfaces and is not applicable. Deterministic, type-level.

  • `IPackageStagingManagementService` declares 27 members: `GetStagedPackagePage`, `GetStagedSymbolPackagePage`, `GetStagedPackage`, `GetStagedSymbolPackage`, `GetPackages`, `GetPackageStatus`, `GetStatus`, `IsEnabled`, `FindCurrentStagedPackage`, `OpenPackageContentAsync`, `UpdateListedAsync`, `DeletePackageAsync`, `GetStagedPackages`, `GetStagedPackages`, `GetStagingGroups`, `GetStagingGroups`, `FindStagingGroup`, `CreateStagingGroupAsync`, `RenameStagingGroupAsync`, `DeleteStagingGroupAsync`, `DeleteStagingGroupAsync`, `AddPackageToStagingGroupAsync`, `RemovePackageFromStagingGroupAsync`, `MovePackageIdentityAsync`, `GetStagingGroupSummaries`, `GetStagingGroupSummaryPage`, `GetStagingGroupPackagePage`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. Those 27 declarations carry 24 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 24 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — src/NuGetGallery/Services/IPackageStagingManagementService.cs:14
  • `IStatisticsService` declares 20 members: `PackageDownloadsResult`, `PackageDownloads`, `PackageDownloadsSummary`, `PackageVersionDownloadsResult`, `PackageVersionDownloads`, `PackageVersionDownloadsSummary`, `CommunityPackageDownloadsResult`, `CommunityPackageDownloads`, `CommunityPackageDownloadsSummary`, `CommunityPackageVersionDownloadsResult`, `CommunityPackageVersionDownloads`, `CommunityPackageVersionDownloadsSummary`, `NuGetClientVersionResult`, `NuGetClientVersion`, `Last6WeeksResult`, `Last6Weeks`, `LastUpdatedUtc`, `Refresh`, `GetPackageDownloadsByVersion`, `GetPackageVersionDownloadsByClient`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — src/NuGetGallery/Services/IStatisticsService.cs:10
  • `IEntitiesContext` declares 23 members: `Certificates`, `Deprecations`, `PackageRegistrations`, `PackageDependencies`, `PackageFrameworks`, `Credentials`, `Scopes`, `Users`, `UserSecurityPolicies`, `ReservedNamespaces`, `UserCertificates`, `SymbolPackages`, `StagedPackages`, `StagedSymbolPackages`, `StagedPackageIdentities`, `StagingGroups`, `Vulnerabilities`, `VulnerableRanges`, `PackageRenames`, `HasChanges`, `SaveChangesAsync`, `DeleteOnCommit`, `GetDatabase`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — src/NuGetGallery.Core/Entities/IEntitiesContext.cs:10
  • `ICoreFileStorageService` declares 17 members under just 14 distinct name(s): `DeleteFileAsync`, `FileExistsAsync`, `GetFileAsync`, `GetFileReferenceAsync`, `GetPackageStreamMetadataAsync`, `GetFileUriAsync`, `GetFileReadUriAsync`, `GetPrivilegedFileUriAsync`, `GetPrivilegedFileUriWithDelegationSasAsync`, `SaveFileAsync`, `SaveFileAsync`, `SaveFileAsync`, `CopyFileAsync`, `CopyFileAsync`, `SetMetadataAsync`, `SetPropertiesAsync`, `GetETagOrNullAsync`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. That is an OVERLOAD SET, not 17 separate responsibilities: a caller binds to 14 operation(s) and uses the overload it selected, so the Interface-Segregation harm does NOT apply on the caller's side and splitting this into role-interfaces would scatter one operation without relieving anything. The burden that does remain is the IMPLEMENTER's — all 17 signatures must be written and kept in step. Reduce it by collapsing overloads (optional or default parameters, or an options object) rather than by segregating the interface. — src/NuGetGallery.Core/Services/ICoreFileStorageService.cs:12
  • `ISimpleCloudBlob` declares 28 members: `Properties`, `Metadata`, `CopyState`, `Uri`, `Name`, `LastModifiedUtc`, `ETag`, `IsSnapshot`, `OpenReadAsync`, `OpenWriteAsync`, `DeleteIfExistsAsync`, `DownloadToStreamAsync`, `DownloadToStreamAsync`, `ExistsAsync`, `SetPropertiesAsync`, `SetPropertiesAsync`, `SetMetadataAsync`, `UploadFromStreamAsync`, `UploadFromStreamAsync`, `FetchAttributesAsync`, `StartCopyAsync`, `GetSharedAccessSignature`, `GetDelegationSasAsync`, `OpenReadStreamAsync`, `SnapshotAsync`, `DownloadTextIfExistsAsync`, `FetchAttributesIfExistsAsync`, `OpenReadIfExistsAsync`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. Those 28 declarations carry 25 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 25 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — src/NuGetGallery.Core/Services/ISimpleCloudBlob.cs:12
  • `IFeatureFlagService` declares 76 members: `IsAlternateStatisticsSourceEnabled`, `IsAsyncAccountDeleteEnabled`, `IsSelfServiceAccountDeleteEnabled`, `IsTyposquattingEnabled`, `IsTyposquattingEnabled`, `IsPackagesAtomFeedEnabled`, `IsPackagesAtomFeedCombinedAuthorsEnabled`, `IsManageDeprecationEnabled`, `IsManageDeprecationEnabled`, `IsManageDeprecationApiEnabled`, `IsDisplayVulnerabilitiesEnabled`, `IsManagePackagesVulnerabilitiesEnabled`, `IsDisplayFuGetLinksEnabled`, `IsDisplayNuGetTrendsLinksEnabled`, `IsDisplayNuGetPackageExplorerLinkEnabled`, `AreEmbeddedIconsEnabled`, `IsForceFlatContainerIconsEnabled`, `IsSearchSideBySideEnabled`, `IsGitHubUsageEnabled`, `IsAdvancedSearchEnabled`, `IsPackageDependentsEnabled`, `IsODataDatabaseReadOnlyEnabled`, `IsABTestingEnabled`, `IsPreviewHijackEnabled`, `IsGravatarProxyEnabled`, `ProxyGravatarEnSubdomain`, `AreDynamicODataCacheDurationsEnabled`, `IsShowEnable2FADialogEnabled`, `IsGet2FADismissFeedbackEnabled`, `IsPackageRenamesEnabled`, `ArePatternSetTfmHeuristicsEnabled`, `AreEmbeddedReadmesEnabled`, `IsODataV1GetAllEnabled`, `IsODataV1GetAllCountEnabled`, `IsODataV1GetSpecificNonHijackedEnabled`, `IsODataV1FindPackagesByIdNonHijackedEnabled`, `IsODataV1FindPackagesByIdCountNonHijackedEnabled`, `IsODataV1SearchNonHijackedEnabled`, `IsODataV1SearchCountNonHijackedEnabled`, `IsODataV2GetAllNonHijackedEnabled`, and 36 more. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. Those 76 declarations carry 74 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 74 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — src/NuGetGallery.Services/Configuration/IFeatureFlagService.cs:9
  • `IPackageService` declares 34 members: `GetPackageDependents`, `FindPackagesById`, `FindPackagesById`, `FindPackagesById`, `IsDeletedStagingPackage`, `FindLatestVersionsById`, `FindPackageByIdAndVersion`, `FilterExactPackage`, `FilterLatestPackage`, `FilterLatestPackageBySuffix`, `FindPackagesByOwner`, `FindPackagesByAnyMatchingOwner`, `FindPackagesForAccountDeletion`, `FindPackageRegistrationsByOwner`, `FindPackagesByProfile`, `GetAllPackageRegistrations`, `FindDependentPackages`, `CreatePackageAsync`, `EnrichPackageFromNuGetPackage`, `ReplacePackageMetadataForStagedPackage`, `GetSupportedFrameworks`, `GetSupportedFrameworks`, `PublishPackageAsync`, `PublishPackageAsync`, `AddPackageOwnerAsync`, `RemovePackageOwnerAsync`, `WillPackageBeOrphanedIfOwnerRemoved`, `SetLicenseReportVisibilityAsync`, `EnsureValid`, `IncrementDownloadCountAsync`, `UpdatePackageVerifiedStatusAsync`, `SetRequiredSignerAsync`, `SetRequiredSignerAsync`, `GetPackageStatus`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. Those 34 declarations carry 29 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 29 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — src/NuGetGallery.Services/PackageManagement/IPackageService.cs:21
  • `ITelemetryService` declares 83 members: `TrackStagingPromotionAccepted`, `TrackGetPackageDownloadCountFailed`, `TrackGetPackageRegistrationDownloadCountFailed`, `TrackDownloadJsonRefreshDuration`, `TrackDownloadJsonTotalPackageIds`, `TrackDownloadJsonTotalPackageVersions`, `TrackDownloadCountDecreasedDuringRefresh`, `TrackPackageDownloadCountDecreasedFromGallery`, `TrackPackageRegistrationDownloadCountDecreasedFromGallery`, `TrackODataQueryFilterEvent`, `TrackODataCustomQuery`, `TrackPackagePushEvent`, `TrackPackagePushFailureEvent`, `TrackPackagePushDisconnectEvent`, `TrackPackageUnlisted`, `TrackPackageListed`, `TrackPackagesUpdateListed`, `TrackPackageDelete`, `TrackDuplicatePackageDeprecations`, `TrackPackageReupload`, `TrackPackageReflow`, `TrackPackageHardDeleteReflow`, `TrackPackageRevalidate`, `TrackPackageDeprecate`, `TrackPackageReadMeChangeEvent`, `TrackCreatePackageVerificationKeyEvent`, `TrackPackagePushNamespaceConflictEvent`, `TrackPackagePushOwnerlessNamespaceConflictEvent`, `TrackVerifyPackageKeyEvent`, `TrackNewUserRegistrationEvent`, `TrackUserChangedMultiFactorAuthentication`, `TrackNewCredentialCreated`, `TrackUserLogin`, `TrackUserPackageDeleteChecked`, `TrackPackageMetadataComplianceError`, `TrackPackageMetadataComplianceWarning`, `TrackUserPackageDeleteExecuted`, `TrackCertificateAdded`, `TrackPackageOwnershipAutomaticallyAdded`, `TrackCertificateActivated`, and 43 more. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — src/NuGetGallery.Services/Telemetry/ITelemetryService.cs:13
  • `IUserService` declares 26 members: `AddMembershipRequestAsync`, `RejectMembershipRequestAsync`, `CancelMembershipRequestAsync`, `AddMemberAsync`, `UpdateMemberAsync`, `DeleteMemberAsync`, `ChangeEmailSubscriptionAsync`, `FindByEmailAddress`, `FindAllByEmailAddress`, `FindByUnconfirmedEmailAddress`, `FindByUsername`, `FindByKey`, `ConfirmEmailAddress`, `ChangeEmailAddress`, `CancelChangeEmailAddress`, `ChangeMultiFactorAuthentication`, `GetEmailAddressesForUserKeysAsync`, `CanTransformUserToOrganization`, `CanTransformUserToOrganization`, `RequestTransformToOrganizationAccount`, `TransformUserToOrganization`, `RejectTransformUserToOrganizationRequest`, `CancelTransformUserToOrganizationRequest`, `AddOrganizationAsync`, `GetSiteAdmins`, `SetIsAdministrator`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. Those 26 declarations carry 25 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 25 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — src/NuGetGallery.Services/UserManagement/IUserService.cs:10
  • `IAppConfiguration` declares 107 members: `LuceneIndexLocation`, `Environment`, `WarningBanner`, `StagingExpirationDays`, `StagingQuotaLimit`, `StagingQuotaOwnerOverrides`, `StagingGroupLimit`, `RequireSSL`, `SSLPort`, `ForceSslExclusion`, `AzureStorage_Auditing_ConnectionString`, `AzureStorage_UserCertificates_ConnectionString`, `AzureStorage_Content_ConnectionString`, `AzureStorage_Packages_ConnectionString`, `AzureStorage_FlatContainer_ConnectionString`, `AzureStorage_Statistics_ConnectionString`, `AzureStorage_Statistics_ConnectionString_Alternate`, `AzureStorage_Uploads_ConnectionString`, `AzureStorage_Revalidation_ConnectionString`, `AzureStorageReadAccessGeoRedundant`, `AzureStorageUseMsi`, `AzureStorageMsiClientId`, `FeatureFlagsRefreshInterval`, `AdminPanelEnabled`, `AdminPanelDatabaseAccessEnabled`, `AdminApiEnabled`, `AdminApiAudience`, `AdminApiAllowedCallers`, `AdminApiTestModeEnabled`, `AsynchronousPackageValidationEnabled`, `BlockingAsynchronousPackageValidationEnabled`, `AsynchronousPackageValidationDelay`, `ValidationExpectedTime`, `DeprecateNuGetPasswordLogins`, `ConfirmEmailAddresses`, `ReadOnlyMode`, `FeedOnlyMode`, `FileStorageDirectory`, `Brand`, `StorageType`, and 67 more. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — src/NuGetGallery.Services/Configuration/IAppConfiguration.cs:9
  • `IValidationEntitiesContext` declares 17 members: `PackageValidationSets`, `PackageValidations`, `PackageValidationIssues`, `ValidatorStatuses`, `PackageSigningStates`, `PackageSignatures`, `TrustedTimestamps`, `EndCertificates`, `CertificateValidations`, `CertificateChainLinks`, `ParentCertificates`, `PackageCompatibilityIssues`, `ScanOperationStates`, `PackageRevalidations`, `SymbolsServerRequests`, `ContentScanOperationState`, `SaveChangesAsync`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — src/NuGet.Services.Validation/Entities/IValidationContext.cs:10
  • `ITelemetryService` declares 22 members: `GlobalDimensions`, `TrackCatalogIndexWriteDuration`, `TrackCatalogIndexReadDuration`, `TrackIndexCommitDuration`, `TrackIndexCommitTimeout`, `TrackPackageMissingHash`, `TrackPackageHasIncorrectHash`, `TrackPackageAlreadyHasHash`, `TrackPackageHashFixed`, `TrackMetric`, `TrackDuration`, `TrackExternalIconProcessingDuration`, `TrackEmbeddedIconProcessingDuration`, `TrackIconDeletionSuccess`, `TrackIconDeletionFailure`, `TrackExternalIconIngestionSuccess`, `TrackExternalIconIngestionFailure`, `TrackIconExtractionSuccess`, `TrackIconExtractionFailure`, `TrackGetPackageDetailsQueryDuration`, `TrackGetPackageQueryDuration`, `TrackCacheControlUpdate`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — src/Catalog/Telemetry/ITelemetryService.cs:12
  • `IAzureSearchTelemetryService` declares 41 members: `TrackAuxiliaryFileDownloaded`, `TrackAuxiliaryFilesReload`, `TrackGetLatestLeaves`, `TrackGetOwnersForPackageId`, `TrackIndexPushFailure`, `TrackIndexPushSplit`, `TrackIndexPushSuccess`, `TrackUpdateOwnersCompleted`, `TrackOwnerSetComparison`, `TrackReadLatestIndexedOwners`, `TrackReadLatestOwnersFromDatabase`, `TrackPopularityTransfersSetComparison`, `TrackReadLatestIndexedPopularityTransfers`, `TrackReadLatestPopularityTransfersFromDatabase`, `TrackReadLatestVerifiedPackagesFromDatabase`, `TrackReplaceLatestIndexedOwners`, `TrackUploadOwnerChangeHistory`, `TrackReplaceLatestIndexedPopularityTransfers`, `TrackVersionListsUpdated`, `TrackCatalog2AzureSearchProcessBatch`, `TrackV2SearchQueryWithSearchIndex`, `TrackV2SearchQueryWithHijackIndex`, `TrackAutocompleteQuery`, `TrackDownloadSetComparison`, `TrackV3SearchQuery`, `TrackGetSearchServiceStatus`, `TrackDocumentCountQuery`, `TrackDownloadCountDecrease`, `TrackWarmQuery`, `TrackLastCommitTimestampQuery`, `TrackReadLatestIndexedDownloads`, `TrackReplaceLatestIndexedDownloads`, `TrackAuxiliary2AzureSearchCompleted`, `TrackV3GetDocument`, `TrackV2GetDocumentWithSearchIndex`, `TrackV2GetDocumentWithHijackIndex`, `TrackUpdateVerifiedPackagesCompleted`, `TrackReadLatestVerifiedPackages`, `TrackReplaceLatestVerifiedPackages`, `TrackAuxiliaryFilesStringCache`, and 1 more. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — src/NuGet.Services.AzureSearch/IAzureSearchTelemetryService.cs:10
  • `IBaseMetadataDocument` declares 27 members: `Authors`, `Copyright`, `Created`, `Description`, `FileSize`, `FlattenedDependencies`, `Hash`, `HashAlgorithm`, `IconUrl`, `Language`, `LastEdited`, `LicenseUrl`, `MinClientVersion`, `NormalizedVersion`, `OriginalVersion`, `PackageId`, `TokenizedPackageId`, `Prerelease`, `ProjectUrl`, `Published`, `ReleaseNotes`, `RequiresLicenseAcceptance`, `SemVerLevel`, `SortableTitle`, `Summary`, `Tags`, `Title`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — src/NuGet.Services.AzureSearch/Models/IBaseMetadataDocument.cs:11
  • `IValidationFileService` declares 18 members: `DeleteValidationPackageFileAsync`, `DeletePackageFileAsync`, `DoesPackageFileExistAsync`, `DoesValidationPackageFileExistAsync`, `DownloadPackageFileToDiskAsync`, `BackupPackageFileFromValidationSetPackageAsync`, `CopyValidationPackageForValidationSetAsync`, `CopyPackageFileForValidationSetAsync`, `CopyValidationSetPackageToPackageFileAsync`, `CopyValidationPackageToPackageFileAsync`, `CopyPackageUrlForValidationSetAsync`, `DeletePackageForValidationSetAsync`, `GetPackageForValidationSetReadUriAsync`, `DoesValidationSetPackageExistAsync`, `UpdatePackageBlobMetadataInValidationSetAsync`, `UpdatePackageBlobMetadataInValidationAsync`, `UpdatePackageBlobPropertiesAsync`, `GetPublicPackageBlobETagOrNullAsync`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — src/NuGet.Services.Validation.Orchestrator/IValidationPackageFileService.cs:12
  • `ITelemetryService` declares 24 members: `TrackDurationToValidationSetCreation`, `TrackDurationToBackupPackage`, `TrackPackageStatusChange`, `TrackTotalValidationDuration`, `TrackSentValidationTakingTooLongMessage`, `TrackValidationSetTimeout`, `TrackStagingDurationToValidationSetCreation`, `TrackStagingValidationDuration`, `TrackStagingValidationSetTimeout`, `TrackValidatorTimeout`, `TrackValidatorDuration`, `TrackValidatorStarted`, `TrackDurationToStartPackageSigningValidator`, `TrackDurationToStartPackageCertificatesValidator`, `TrackValidationIssueCount`, `TrackValidationIssue`, `TrackClientValidationIssue`, `TrackMissingPackageForValidationMessage`, `TrackMissingNupkgForAvailablePackage`, `TrackDurationToHashPackage`, `TrackSymbolsMessageEnqueued`, `TrackDurationToExtractLicenseAndReadmeFile`, `TrackDurationToDeleteLicenseFile`, `TrackDurationToDeleteReadmeFile`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — src/NuGet.Services.Validation.Orchestrator/Telemetry/ITelemetryService.cs:12

What to do

  • Split fat interfaces into focused role-interfaces so clients depend only on what they use.
  • Where the width is an overload set rather than separate responsibilities, collapse the overloads instead — segregating those relieves no caller.
AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.

Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. Deterministic.

AX9 · CQS / query purity10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.

Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.

Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.

C1 · Data Protection2.0 / 10Critical✓ Tool-verified

Other · Security — Whether sensitive data is encrypted at rest and in transit and keys are vaulted.

Method: Roslyn plus filesystem scan: encryption presence (EF ColumnEncryption, key-vault references, HTTPS enforcement) and key-derivation KDF detection. Deterministic.

  • No data-protection or encryption usage (ASP.NET Data Protection, AES, column encryption, PBKDF2) was found — sensitive data at rest may be unprotected. If TDE/KMS/vault is delegated to infrastructure, ignore.

What to do

  • Encrypt sensitive data at rest (ASP.NET Core Data Protection / column encryption) and manage keys in a vault. Skip if delegated to infra (Postgres TDE, KMS, etc.).
  • Enforce HTTPS (UseHttpsRedirection / RequireHttpsMetadata) so data in transit is always encrypted.
C2 · Access Controls7.0 / 10Strong✓ Tool-verified

Other · Security — Whether access is authorized by default — a framework authorization attribute/decorator or policy, or imperative guard methods (throw-on-violation) called from handlers.

Method: Roslyn scan: [Authorize] usage and authorization policies, plus imperative throw-on-violation guard methods detected via syntax. Deterministic.

  • Authorization IS enforced here (via [Authorize]/guards) — this is NOT a claim that endpoints are unprotected. What's missing is NAMED policies (AddAuthorization/AddPolicy, RequireRole/RequireClaim, RequireAuthorization): the access rules are implicit rather than named and testable. Recommendation, not a defect — name the rules so they're reviewable.

What to do

  • Add policy-based authorization — name the access rules (AddAuthorization(o => o.AddPolicy(…))) and apply them via [Authorize(Policy = …)] or RequireAuthorization.
C3 · Audit Trail7.5 / 10Strong✓ Tool-verified

Other · Security — Whether changes to sensitive data are recorded (who, what, when) for compliance + incident response.

Method: Roslyn scan: audit-trail mechanism graded (SaveChanges interceptor/immutable AuditLog/[Audited] strong; bare IAuditable/AddAuditing weak). Deterministic.

  • An audit mechanism is present, but the trail is not yet complete — missing: an EF SaveChanges interceptor (or equivalent write-side hook, e.g. an event-store append every change flows through), [Audited] per-entity coverage.

What to do

  • Back the audit convention with a structural mechanism: an EF SaveChanges interceptor (or equivalent) writing every sensitive change to an immutable audit log, and apply [Audited] to the entities that need a who-changed-what trail.
C4 · Data Retention9.0 / 10Exemplary✓ Tool-verified

Other · Security — Whether data has a defined lifetime — retention periods, TTLs, cleanup jobs (storage limitation).

Method: Roslyn scan: retention/TTL configuration presence in schema; CascadeDelete detected but not scored as retention control. Deterministic, gated by PII presence.

  • A retention mechanism is present, but the data-lifecycle is not yet complete — missing: a documented retention period / data-expiry.

What to do

  • Complete the data-lifecycle story: an expiry limit (a declared maximum age for the stored data — a retention-age setting, or a store-level TTL where your storage offers one), a scheduled purge/cleanup job that enforces it, and a documented retention period covering the personal data.
ED1 · Handler temporal coupling10.0 / 10Exemplary✓ Tool-verified

Other · Event-Driven — Whether event handlers stay asynchronous (no blocking remote HTTP/gRPC calls awaited inside a handler).

Method: Roslyn semantic scan (event-driven gated): event-handler bodies scanned for HTTP/gRPC invocations by resolved symbol type, not substring. Deterministic, semantic-resolved.

ED3 · Event naming7.0 / 10Strong✓ Tool-verified

Other · Event-Driven — Whether events are named in the past tense (a clarity nudge — low weight).

Method: Roslyn scan (event-driven gated): domain and integration events checked for past-tense naming (-ed/-en suffix or irregular set). Naming nudge, low-weight advisory.

  • `OnCallDailyNotification` reads as an instruction, not a fact that happened: events describe something that already occurred. Name new events for the fact that occurred (e.g. `OrderPlaced`). Do not rename this one if it is already stored or published: its type name is written with every event recorded under it, so a rename can break replay of the stored stream and every subscriber that reads it, and a clearer name does not pay for that. If it has never been written or sent, renaming it now is safe. — src/NuGet.SupportRequests.Notifications/Notifications/OnCallDailyNotification.cs:10
  • `WeeklySummaryNotification` reads as an instruction, not a fact that happened: events describe something that already occurred. Name new events for the fact that occurred (e.g. `OrderPlaced`). Do not rename this one if it is already stored or published: its type name is written with every event recorded under it, so a rename can break replay of the stored stream and every subscriber that reads it, and a clearer name does not pay for that. If it has never been written or sent, renaming it now is safe. — src/NuGet.SupportRequests.Notifications/Notifications/WeeklySummaryNotification.cs:10

What to do

  • Name new events in the past tense: they record facts that already happened. Do not rename an event that is already stored or published: its type name is written with every event recorded under it, so a rename can break replay of the stored stream and every subscriber that reads it.
ED4 · Outbox / dual-write10.0 / 10Exemplary○ Nothing flagged

Other · Event-Driven — Whether state changes and message publishes are atomic (a transactional outbox) rather than a crash-unsafe dual write.

Method: Roslyn semantic scan (event-driven gated): event-handler methods scanned for DB-save plus bus-publish without a transactional outbox reference. Deterministic, semantic-resolved.

ED5 · Idempotency10.0 / 10Exemplary○ Nothing flagged

Other · Readiness — Whether retry-prone mutations (command handlers and message or event consumers) are idempotent, so an at-least-once redelivery or a client retry does not apply the effect twice.

Method: Roslyn (any mutation, ungated): each persistent write of a command handler or message/event consumer is idempotent when a guard is visible (an exists/dedup read that gates an exit, upsert, idempotency-key/inbox used in a condition or store call, versioned or fixed-value write, dedup envelope or pipeline), at risk only on positive double-apply evidence (a fresh-identity insert, an accumulation on a loaded and saved object, a growing member list, an unkeyed POST/SMTP send/Stripe charge), and otherwise not classified. Deterministic, no model; not scored when more than half are not classified. Advisory.

Coverage: Population: retry-prone mutations — command handlers (CQRS write side) + message/event consumers (IConsumer/I*EventHandler) — that mutate persistent state; runs on any repo with mutations, not only event-driven ones. Every mutation is classified exhaustively and deterministically: guarded, at risk on positive evidence, or not classified; the score is over the classified ones and is withheld when they are fewer than half.

GD1 · Unfinished & placeholder code10.0 / 10Exemplary✓ Tool-verified

Other · Code Health — Unreviewed-generation residue: shipped members still throwing NotImplementedException, and placeholder string literals left in non-test, non-generated code. Scored as a quality signature, never as a claim about authorship.

Method: Roslyn syntax scan: NotImplementedException throws and placeholder string literals in non-test, non-generated shipped code. Deterministic, code-shape signature.

  • A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface. (×40) — src/NuGetGallery/App_Start/GalleryMachineKeyConfigurationProvider.cs:64, src/NuGetGallery/Infrastructure/Mail/Messages/ReportPackageMessageBase.cs:45, src/NuGetGallery/Infrastructure/Mail/Messages/ReportPackageMessageBase.cs:50, …

What to do

  • Finish or delete NotImplementedException stubs and replace placeholder literals before shipping.
IC1 · Incompleteness & stubs2.0 / 10Critical✓ Tool-verified

Other · Code Health — Unfinished work detected by code SHAPE, not keywords: members that only throw a "not implemented" exception, methods that take inputs and return a constant, async methods that never await, dead `if (false)` / `#if false` branches, and skeleton types most of whose members are holes. A real, objective slice of technical debt.

Method: Roslyn syntax scan: incompleteness by code shape (constant-returning methods, async-never-await, #if false branches, guards that return what the code already falls through to, tests an earlier guard already decided, comparisons against NaN, skeleton types), not keyword-gated. Deterministic, code-shape heuristic.

  • `AccountDeleteUserService` has 25 unfinished members out of 27 declared members (methods, properties, indexers and events, whether or not each carries a body) — a scaffolded type that was never implemented. — src/AccountDeleter/AccountDeleteUserService.cs:14
  • `AddMemberAsync` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — src/AccountDeleter/AccountDeleteUserService.cs:24
  • `AddMembershipRequestAsync` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — src/AccountDeleter/AccountDeleteUserService.cs:29
  • `AddOrganizationAsync` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — src/AccountDeleter/AccountDeleteUserService.cs:34
  • `CancelChangeEmailAddress` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — src/AccountDeleter/AccountDeleteUserService.cs:39
  • `CancelMembershipRequestAsync` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — src/AccountDeleter/AccountDeleteUserService.cs:44
  • `CancelTransformUserToOrganizationRequest` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — src/AccountDeleter/AccountDeleteUserService.cs:49
  • `CanTransformUserToOrganization` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. (×2) — src/AccountDeleter/AccountDeleteUserService.cs:54, src/AccountDeleter/AccountDeleteUserService.cs:59
  • `ChangeEmailAddress` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — src/AccountDeleter/AccountDeleteUserService.cs:64
  • `ChangeEmailSubscriptionAsync` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — src/AccountDeleter/AccountDeleteUserService.cs:69
  • `ChangeMultiFactorAuthentication` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — src/AccountDeleter/AccountDeleteUserService.cs:74
  • `ConfirmEmailAddress` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — src/AccountDeleter/AccountDeleteUserService.cs:79
  • `DeleteMemberAsync` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — src/AccountDeleter/AccountDeleteUserService.cs:84
  • `FindAllByEmailAddress` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — src/AccountDeleter/AccountDeleteUserService.cs:89
  • `FindByEmailAddress` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — src/AccountDeleter/AccountDeleteUserService.cs:94
  • `FindByKey` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — src/AccountDeleter/AccountDeleteUserService.cs:99
  • `FindByUnconfirmedEmailAddress` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — src/AccountDeleter/AccountDeleteUserService.cs:104
  • `GetEmailAddressesForUserKeysAsync` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — src/AccountDeleter/AccountDeleteUserService.cs:121
  • `RejectMembershipRequestAsync` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — src/AccountDeleter/AccountDeleteUserService.cs:126
  • `RejectTransformUserToOrganizationRequest` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — src/AccountDeleter/AccountDeleteUserService.cs:131
  • `RequestTransformToOrganizationAccount` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — src/AccountDeleter/AccountDeleteUserService.cs:136
  • `TransformUserToOrganization` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — src/AccountDeleter/AccountDeleteUserService.cs:141
  • `UpdateMemberAsync` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — src/AccountDeleter/AccountDeleteUserService.cs:146
  • `GetSiteAdmins` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — src/AccountDeleter/AccountDeleteUserService.cs:151
  • `SetIsAdministrator` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — src/AccountDeleter/AccountDeleteUserService.cs:156
  • `GalleryConfiguration` has 109 unfinished members out of 111 declared members (methods, properties, indexers and events, whether or not each carries a body) — a scaffolded type that was never implemented. — src/AccountDeleter/Configuration/GalleryConfiguration.cs:10
  • `LuceneIndexLocation` is a shipped property whose accessors only throw NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — src/AccountDeleter/Configuration/GalleryConfiguration.cs:22
  • `Environment` is a shipped property whose accessors only throw NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — src/AccountDeleter/Configuration/GalleryConfiguration.cs:23
  • `WarningBanner` is a shipped property whose accessors only throw NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — src/AccountDeleter/Configuration/GalleryConfiguration.cs:24
  • `StagingExpirationDays` is a shipped property whose accessors only throw NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — src/AccountDeleter/Configuration/GalleryConfiguration.cs:25
  • `StagingQuotaLimit` is a shipped property whose accessors only throw NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — src/AccountDeleter/Configuration/GalleryConfiguration.cs:26
  • `StagingQuotaOwnerOverrides` is a shipped property whose accessors only throw NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — src/AccountDeleter/Configuration/GalleryConfiguration.cs:27
  • `StagingGroupLimit` is a shipped property whose accessors only throw NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — src/AccountDeleter/Configuration/GalleryConfiguration.cs:28
  • `RequireSSL` is a shipped property whose accessors only throw NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — src/AccountDeleter/Configuration/GalleryConfiguration.cs:29
  • `SSLPort` is a shipped property whose accessors only throw NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — src/AccountDeleter/Configuration/GalleryConfiguration.cs:30
  • `ForceSslExclusion` is a shipped property whose accessors only throw NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — src/AccountDeleter/Configuration/GalleryConfiguration.cs:31
  • `AzureStorage_Auditing_ConnectionString` is a shipped property whose accessors only throw NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — src/AccountDeleter/Configuration/GalleryConfiguration.cs:32
  • `AzureStorage_UserCertificates_ConnectionString` is a shipped property whose accessors only throw NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — src/AccountDeleter/Configuration/GalleryConfiguration.cs:33
  • `AzureStorage_Content_ConnectionString` is a shipped property whose accessors only throw NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — src/AccountDeleter/Configuration/GalleryConfiguration.cs:34

What to do

  • Finish or delete the unfinished stubs (NotImplementedException / empty / constant-returning bodies) — they are dead surface that looks live.
  • Clear the softer debt: remove commented-out code and dead branches, re-enable or delete skipped tests, and replace blanket warning suppressions with targeted ones.
M1 · Documentation (README)8.7 / 10Strong✓ Tool-verified

Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.

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

What to do

  • Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
M2 · Architecture documentation3.0 / 10Weak✓ Tool-verified

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

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

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

What to do

  • Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.

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

M4 · Documentation accuracy10.0 / 10Exemplary○ Nothing flagged

Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.

Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.

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.

P2 · Observability6.5 / 10Adequate✓ Tool-verified

Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.

Method: Filesystem/Roslyn scan: structured-logging frameworks (Serilog, NLog), OpenTelemetry, and health-check endpoint patterns. Exhaustive, deterministic.

  • Only 58/69 service-like projects use logging (pure contract/DTO projects are excluded — they have nothing to log). Of those 69, 38 ship a process this repository operates; the rest are libraries their consumer hosts, where the logging decision belongs to the host.
  • `src/GalleryTools/Commands/PushPackageCommand.cs` reports through `Console.Write…` at line 37 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — src/GalleryTools/Commands/PushPackageCommand.cs:37
  • `src/GalleryTools/Commands/PushPackageCommand.cs` reports through `Console.Write…` at line 50 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — src/GalleryTools/Commands/PushPackageCommand.cs:50
  • `src/GalleryTools/Commands/PushPackageCommand.cs` reports through `Console.Write…` at line 66 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — src/GalleryTools/Commands/PushPackageCommand.cs:66
  • `src/GalleryTools/Commands/PushPackageCommand.cs` reports through `Console.Write…` at line 81 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — src/GalleryTools/Commands/PushPackageCommand.cs:81
  • `src/GalleryTools/Commands/PushPackageCommand.cs` reports through `Console.Write…` at line 111 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — src/GalleryTools/Commands/PushPackageCommand.cs:111
  • `src/GalleryTools/Commands/PushPackageCommand.cs` reports through `Console.Write…` at line 115 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — src/GalleryTools/Commands/PushPackageCommand.cs:115
  • `src/GalleryTools/Commands/SeedFunctionalTestsCommand.cs` reports through `Console.Write…` at line 43 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — src/GalleryTools/Commands/SeedFunctionalTestsCommand.cs:43
  • `src/GalleryTools/Commands/SeedFunctionalTestsCommand.cs` reports through `Console.Write…` at line 57 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — src/GalleryTools/Commands/SeedFunctionalTestsCommand.cs:57
  • `src/GalleryTools/Commands/SeedFunctionalTestsCommand.cs` reports through `Console.Write…` at line 64 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — src/GalleryTools/Commands/SeedFunctionalTestsCommand.cs:64
  • `src/GalleryTools/Commands/SeedFunctionalTestsCommand.cs` reports through `Console.Write…` at line 127 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — src/GalleryTools/Commands/SeedFunctionalTestsCommand.cs:127
  • `src/GalleryTools/Commands/SeedFunctionalTestsCommand.cs` reports through `Console.Write…` at line 152 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — src/GalleryTools/Commands/SeedFunctionalTestsCommand.cs:152
  • `src/GalleryTools/Commands/SeedFunctionalTestsCommand.cs` reports through `Console.Write…` at line 156 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — src/GalleryTools/Commands/SeedFunctionalTestsCommand.cs:156
  • `src/GalleryTools/Commands/SeedFunctionalTestsCommand.cs` reports through `Console.Write…` at line 161 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — src/GalleryTools/Commands/SeedFunctionalTestsCommand.cs:161
  • `src/GalleryTools/Commands/SeedFunctionalTestsCommand.cs` reports through `Console.Write…` at line 210 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters. — src/GalleryTools/Commands/SeedFunctionalTestsCommand.cs:210

What to do

  • Extend structured logging across the projects you operate, and give the library ones a diagnostics seam instead — an `EventSource`/`ActivitySource` the host can subscribe to, or an optional logger on your options object — rather than taking a logging dependency on your consumers' behalf.
  • Replace `Console.Write…` in service code with the project's injected `ILogger<T>` (message templates with named properties), so delivery outcomes and failures reach the log pipeline with a level and a category.
  • Add a health-check endpoint (AddHealthChecks/MapHealthChecks) so orchestrators and load balancers can probe liveness/readiness.
P3 · Security & performance tooling4.0 / 10Weak✓ Tool-verified

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

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

  • `Directory.Packages.props` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`. — Directory.Packages.props:9

What to do

  • Enable Dependabot/Renovate or a dependency-review gate.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback5.0 / 10Adequate✓ Tool-verified

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

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

What to do

  • Add an approval/environment gate (required reviewers / protection rules) before production promotion.
P6 · Release Hygiene8.0 / 10Strong✓ 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 2 versioned entries, against a bar of 3. Counted as either the distinct `x.y.z` versions it names (a link's target is not counted) or its version-shaped section headings (`## [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.
P7 · Outbound HTTP resilience3.0 / 10Weak✓ Tool-verified

Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.

Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.

  • `new HttpClient(handler)` builds an outbound HTTP client and nothing bounds it: no timeout is set on it and no retry or resilience policy wraps its calls in the type that owns it. A slow or failing dependency will hold this service's request, thread or connection — and cascade — until the call gives up on its own (100 s for HttpClient's default). (×2) — src/Catalog/Helpers/FeedHelpers.cs:20, src/NuGet.Services.Cursor/HttpReadCursor.cs:27
  • `new HttpClient()` builds an outbound HTTP client and nothing bounds it: no timeout is set on it and no retry or resilience policy wraps its calls in the type that owns it. A slow or failing dependency will hold this service's request, thread or connection — and cascade — until the call gives up on its own (100 s for HttpClient's default). (×8) — src/GalleryTools/Commands/BackfillCommand.cs:61, src/GalleryTools/Utils/ServiceDiscoveryClient.cs:25, src/GitHubVulnerabilities2Db/Job.cs:37, …
  • `new HttpClient(httpMessageHandler)` builds an outbound HTTP client and nothing bounds it: no timeout is set on it and no retry or resilience policy wraps its calls in the type that owns it. A slow or failing dependency will hold this service's request, thread or connection — and cascade — until the call gives up on its own (100 s for HttpClient's default). — src/Ng/Jobs/Catalog2IconJob.cs:56
  • `new HttpClient(p.GetRequiredService<HttpMessageHandler>())` builds an outbound HTTP client and nothing bounds it: no timeout is set on it and no retry or resilience policy wraps its calls in the type that owns it. A slow or failing dependency will hold this service's request, thread or connection — and cascade — until the call gives up on its own (100 s for HttpClient's default). — src/NuGet.Services.V3/DependencyInjectionExtensions.cs:44
  • `services.AddHttpClient()` registers an outbound HTTP client with no resilience handler, retry policy or timeout of its own in its builder chain. A slow or failing dependency will hold this service's request, thread or connection — and cascade — until the call gives up on its own (100 s for HttpClient's default). — src/NuGetGallery/App_Start/DefaultDependenciesModule.cs:584

What to do

  • Add `AddStandardResilienceHandler()` (or a Polly policy and an explicit timeout) to each client registration flagged here, so a flaky dependency can't take the app down.
PF3 · Async & latency hygiene6.0 / 10Adequate✓ Tool-verified

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

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

  • a busy-wait on `i1` in `squarifyRatio` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:11325
  • a busy-wait on `previous` in `range` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:12482
  • 29 blocking call(s) on async work (.Wait()/.GetAwaiter().GetResult()) — these waste a thread and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
  • `.Wait()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one). (×7) — src/NuGetGallery/App_Start/OwinStartup.cs:128, src/NuGetGallery/App_Start/OwinStartup.cs:163, src/NuGetGallery/App_Start/OwinStartup.cs:246, …
  • `continuation.Wait()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one). — src/NuGetGallery/Infrastructure/Jobs/NuGetJobCoordinator.cs:55
  • `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one). (×21) — src/GalleryTools/Commands/ApplyTenantPolicyCommand.cs:39, src/GalleryTools/Commands/CreateApiKeyCommand.cs:53, src/GalleryTools/Commands/CreateOrganizationCommand.cs:46, …

What to do

  • TypeScript/JavaScript: use the promise APIs (fs/promises, a promisified child_process.execFile, the async zlib/crypto functions) and await them instead of the *Sync variants.
  • Make the call chain async end-to-end and await it — never block on a Task with .Wait()/.GetAwaiter().GetResult().
R1 · Type Safety0.0 / 10Critical✓ 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.

  • 0 typed · 46 plain JS — the untyped files are src/Bootstrap/js/affix.js, src/Bootstrap/js/alert.js, src/Bootstrap/js/button.js, src/Bootstrap/js/carousel.js, src/Bootstrap/js/collapse.js, src/Bootstrap/js/dropdown.js (+40 more).

What to do

  • Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
R10 · Code Duplication5.6 / 10Adequate✓ Tool-verified

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

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

  • src/NuGetGallery/Scripts/gallery/page-api-keys.js:400 · src/NuGetGallery/Scripts/gallery/page-trusted-publishing.js:663 — the two spans are one implementation copied and then locally edited — 938 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/NuGetGallery/Scripts/gallery/page-api-keys.js:400
  • src/NuGetGallery/Scripts/gallery/page-api-keys.js:104 · src/NuGetGallery/Scripts/gallery/page-trusted-publishing.js:421 — the two spans are one implementation copied and then locally edited — 459 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/NuGetGallery/Scripts/gallery/page-api-keys.js:104
  • src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:1304 · src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:4456 — 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. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:1304
  • src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:10663 · src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:11341 — the two spans are one implementation copied and then locally edited — 223 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. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:10663
  • src/NuGetGallery/Scripts/gallery/stats-perpackagestatsgraphs.js:26 · src/NuGetGallery/Scripts/gallery/stats-perpackagestatsgraphs.js:134 — the two spans are one implementation copied and then locally edited — 247 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. — src/NuGetGallery/Scripts/gallery/stats-perpackagestatsgraphs.js:26
  • src/NuGetGallery/Scripts/gallery/page-manage-sponsorship-links.js:32 · src/NuGetGallery/Scripts/gallery/page-manage-sponsorship-links.js:79 — the two spans are one implementation copied and then locally edited — 144 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. — src/NuGetGallery/Scripts/gallery/page-manage-sponsorship-links.js:32
  • src/NuGetGallery/Scripts/gallery/page-trusted-publishing.js:140 · src/NuGetGallery/Scripts/gallery/page-trusted-publishing.js:311 — 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. — src/NuGetGallery/Scripts/gallery/page-trusted-publishing.js:140
  • src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:12323 · src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:12360 — 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. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:12323
  • src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:1267 · src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:4417 — 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. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:1267
  • src/NuGetGallery/Scripts/gallery/page-trusted-publishing.js:181 · src/NuGetGallery/Scripts/gallery/page-trusted-publishing.js:350 — 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. — src/NuGetGallery/Scripts/gallery/page-trusted-publishing.js:181
  • src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:10584 · src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:11316 — 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. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:10584
  • src/NuGetGallery/Scripts/gallery/page-signin.js:32 · src/NuGetGallery/Scripts/gallery/page-signin.js:67 — 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. — src/NuGetGallery/Scripts/gallery/page-signin.js:32
  • src/NuGetGallery/Scripts/gallery/page-api-keys.js:486 · src/NuGetGallery/Scripts/gallery/page-api-keys.js:546 — 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. — src/NuGetGallery/Scripts/gallery/page-api-keys.js:486
  • src/NuGetGallery/Scripts/gallery/page-api-keys.js:710 · src/NuGetGallery/Scripts/gallery/page-trusted-publishing.js:915 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — src/NuGetGallery/Scripts/gallery/page-api-keys.js:710
  • src/NuGetGallery/Scripts/gallery/page-trusted-publishing.js:86 · src/NuGetGallery/Scripts/gallery/page-trusted-publishing.js:263 — 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. — src/NuGetGallery/Scripts/gallery/page-trusted-publishing.js:86
  • src/Bootstrap/js/popover.js:90 · src/Bootstrap/js/tooltip.js:653 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — src/Bootstrap/js/popover.js:90
  • src/NuGetGallery/Scripts/gallery/page-api-keys.js:376 · src/NuGetGallery/Scripts/gallery/page-trusted-publishing.js:643 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — src/NuGetGallery/Scripts/gallery/page-api-keys.js:376
  • src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:1723 · src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:1908 — 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. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:1723
  • src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:11961 · src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:11986 — 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. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:11961
  • src/NuGetGallery/Scripts/gallery/page-manage-owners.js:111 · src/NuGetGallery/Scripts/gallery/page-manage-owners.js:151 — the two spans are one implementation copied and then locally edited — 65 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. — src/NuGetGallery/Scripts/gallery/page-manage-owners.js:111
  • src/NuGetGallery/Scripts/gallery/async-file-upload.js:219 · src/NuGetGallery/Scripts/gallery/certificates.js:149 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — src/NuGetGallery/Scripts/gallery/async-file-upload.js:219
  • src/NuGetGallery/Scripts/gallery/page-api-keys.js:224 · src/NuGetGallery/Scripts/gallery/page-trusted-publishing.js:37 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — src/NuGetGallery/Scripts/gallery/page-api-keys.js:224
  • src/NuGetGallery/Scripts/gallery/page-home.js:35 · src/NuGetGallery/Scripts/gallery/page-signin.js:27 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — src/NuGetGallery/Scripts/gallery/page-home.js:35
  • src/NuGetGallery/Scripts/gallery/page-manage-packages.js:153 · src/NuGetGallery/Scripts/gallery/page-manage-packages.js:283 — 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. — src/NuGetGallery/Scripts/gallery/page-manage-packages.js:153
  • src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:10489 · src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:10645 · src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:10699 · src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:11375 — 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. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:10489
  • src/NuGetGallery/Scripts/gallery/page-manage-packages.js:311 · src/NuGetGallery/Scripts/gallery/page-manage-packages.js:389 — 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. — src/NuGetGallery/Scripts/gallery/page-manage-packages.js:311
  • src/Bootstrap/js/affix.js:128 · src/Bootstrap/js/alert.js:71 · src/Bootstrap/js/button.js:87 · src/Bootstrap/js/collapse.js:191 · +3 more site(s) not listed — the 7 copies are spread across 7 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — src/Bootstrap/js/affix.js:128
  • src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:2016 · src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:2033 — 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. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:2016
  • src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:5945 · src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:5957 — 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. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:5945
  • src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:6518 · src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:14398 — 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. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:6518
  • src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:7961 · src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:7989 — 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. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:7961
  • src/NuGetGallery/Scripts/gallery/page-api-keys.js:485 · src/NuGetGallery/Scripts/gallery/page-manage-organization.js:198 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — src/NuGetGallery/Scripts/gallery/page-api-keys.js:485
  • src/Bootstrap/js/tooltip.js:253 · src/Bootstrap/js/tooltip.js:290 — 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. — src/Bootstrap/js/tooltip.js:253
  • src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:1110 · src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:3682 — 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. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:1110
  • src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:1495 · src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:4602 — 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. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:1495
  • src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:3336 · src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:3450 — 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. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:3336
  • src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:6365 · src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:14277 — 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. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:6365
  • src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:8916 · src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:8981 — 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. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:8916
  • src/NuGetGallery/Scripts/gallery/page-manage-packages.js:264 · src/NuGetGallery/Scripts/gallery/page-manage-packages.js:321 — 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. — src/NuGetGallery/Scripts/gallery/page-manage-packages.js:264
  • src/NuGetGallery/Scripts/gallery/page-staging-group.js:128 · src/NuGetGallery/Scripts/gallery/page-staging-group.js:139 — 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. — src/NuGetGallery/Scripts/gallery/page-staging-group.js:128

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 Complexity2.0 / 10Critical✓ 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.

  • _generateHTML has cyclomatic complexity 87 and cognitive complexity 206; 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. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:9184
  • _doKeyDown has cyclomatic complexity 45 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. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:8148
  • parseDate has cyclomatic complexity 42 and cognitive complexity 49; 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. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:8672
  • _mouseDrag has cyclomatic complexity 33 and cognitive complexity 54; 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. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:3784
  • drag has cyclomatic complexity 33 and cognitive complexity 43; 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. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:1819
  • intersect has cyclomatic complexity 30 and cognitive complexity 18; 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. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:2106
  • _clear has cyclomatic complexity 29 and cognitive complexity 40; 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. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:4646
  • _respectSize has cyclomatic complexity 29 and cognitive complexity 20; 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. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:2762
  • _generateMonthYearHeader has cyclomatic complexity 27 and cognitive complexity 46; 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. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:9368
  • formatDate has cyclomatic complexity 27 and cognitive complexity 42; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:8880
  • _generatePosition has cyclomatic complexity 26 and cognitive complexity 47; 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. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:4559
  • _generatePosition has cyclomatic complexity 25 and cognitive complexity 53; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:1441
  • _contactContainers has cyclomatic complexity 25 and cognitive complexity 52; 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. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:4299
  • size has cyclomatic complexity 25 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:11064
  • (anonymous) has cyclomatic complexity 24 and cognitive complexity 32; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:3395
  • (anonymous) has cyclomatic complexity 23 and cognitive complexity 36; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/NuGetGallery/Scripts/gallery/page-display-package.js:1
  • keydown has cyclomatic complexity 23 and cognitive complexity 14; 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. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:13227
  • drag has cyclomatic complexity 22 and cognitive complexity 33; 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. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:1749
  • resize has cyclomatic complexity 22 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:3010
  • _showDatepicker has cyclomatic complexity 22 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:8285
  • bounce has cyclomatic complexity 22 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:10504
  • _keydown has cyclomatic complexity 22 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. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:11582
  • show has cyclomatic complexity 21 and cognitive complexity 35; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/Bootstrap/js/tooltip.js:318
  • (anonymous) has cyclomatic complexity 21 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. (×2) — src/NuGetGallery/Scripts/gallery/page-api-keys.js:127, src/NuGetGallery/Scripts/gallery/page-trusted-publishing.js:526
  • _setOption has cyclomatic complexity 20 and cognitive complexity 24; 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. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:10180
  • _refreshValue has cyclomatic complexity 19 and cognitive complexity 34; 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. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:13169
  • _setContainment has cyclomatic complexity 19 and cognitive complexity 18; 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. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:1353
  • _optionDatepicker has cyclomatic complexity 18 and cognitive complexity 25; 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. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:8059
  • _setContainment has cyclomatic complexity 18 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:4502
  • _mouseStart has cyclomatic complexity 18 and cognitive complexity 20; 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. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:3650
  • _hideDatepicker has cyclomatic complexity 17 and cognitive complexity 33; 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. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:8450
  • canElementBeFocused has cyclomatic complexity 17 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:251
  • (anonymous) has cyclomatic complexity 17 and cognitive complexity 17; 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. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:2229
  • _eventHandler has cyclomatic complexity 17 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:14306
  • set has cyclomatic complexity 16 and cognitive complexity 24; 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. — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:5358
  • clamp has cyclomatic complexity 16 and cognitive complexity 18; 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. — src/NuGetGallery/Scripts/gallery/clamp.js:29
  • _UpdateData has cyclomatic complexity 16 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — src/NuGetGallery/Scripts/gallery/page-api-keys.js:73
  • Update has cyclomatic complexity 16 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. (×2) — src/NuGetGallery/Scripts/gallery/page-trusted-publishing.js:86, src/NuGetGallery/Scripts/gallery/page-trusted-publishing.js:263
R3 · Large Files9.1 / 10Exemplary✓ 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.

  • src/Bootstrap/js/tooltip.js has 540 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/Bootstrap/js/tooltip.js:1

What to do

  • Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
R4 · Test Coverage0.0 / 10Critical✓ 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.

  • 0% of 46 production file(s) reachable from 0 test file(s) via the import graph — 'production' here is the RESIDUE: every source file left once tests, tooling, generated output, config, declarations and declaration-only modules, fixture corpora, type fixtures, behaviour-free data modules, re-export barrels, registration/constant data modules and service workers are set aside, so the percentage is taken over a smaller denominator than the workspace's file count

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 · Tooling6.7 / 10Adequate✓ 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.

  • test ✓ · lint ✗ · typecheck ✓ — read from this repository's package.json scripts and corroborated against its CI workflows. A script counts when its name or command matches the step: `test` for the suite, `lint` or `prettier` for linting, `typecheck`/`type-check`/`tsc` for type checking. ✗ therefore means no script or CI step under those names was found, NOT that the step is absent from your pipeline — a task invoked by a runner this check does not read, or named something else entirely, is not seen and is worth confirming before acting on a cross. A ✓ means the wiring is DECLARED — a script or CI step under those names exists. It is not a statement that the step passes, or that it runs at all: nothing here installs a dependency or executes a suite.

What to do

  • Add eslint as package.json scripts and run them in CI.
R7 · Dead Code10.0 / 10Exemplary✓ Tool-verified

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

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

  • Unreachable from the 45 application, 1 tooling and 0 test entry point(s) detected in this repo. This repository declares no build, type-check or test script, so nothing here would fail on a wrong deletion — confirm by hand that nothing loads each file (including by a path built at runtime) before removing it. An undetected custom entry would make these reachable.
  • no import path from any entry point (45 application, 1 tooling, 0 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 — src/Bootstrap/package.js
R8 · Dependency Hygiene3.0 / 10Weak✓ 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.

  • Declared in src/Bootstrap/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. (×14) — src/Bootstrap/package.json:28, src/Bootstrap/package.json:30, src/Bootstrap/package.json:32, …

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.

S1 · Web-Security Posture0.0 / 10Critical✓ Tool-verified

Other · Security — Transport security, security headers, secure cookies, input validation, middleware order and crypto hygiene (presence, not runtime).

Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. On a repository with no .NET source it reads JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Elixir source itself (test, vendored, generated and minified paths not) for the arms that hold whether or not the code serves HTTP: a weak hash or cipher, key material fixed in the source, a TLS client that accepts any certificate, and (JavaScript/TypeScript, Ruby, Scala, Rust and Elixir) an obsolete TLS version; the server controls are not assessed there, and a Dart, Ruby, Scala, Rust or Elixir repository that serves no HTTP of its own is N/A on them. Deterministic.

  • Identifier 'IdAndPasswordHashedLength' looks like a password-hash field/property, but no KDF (PBKDF2 / Argon2 / BCrypt / PasswordHasher) was found anywhere in the source — so passwords aren't protected by a salted key-derivation function (whether a fast/plain hash, or a client-hashed value stored and compared verbatim). Password storage needs a salted KDF and a constant-time compare. — src/NuGetGallery.Services/Authentication/ApiKeyV3.cs:11
  • `ServerCertificateCustomValidationCallback` is assigned a callback that returns `true` unconditionally, so every TLS peer certificate is accepted — including one an attacker presents. Chain, expiry, revocation and hostname are all skipped, so an attacker on the network path can present any certificate and read or rewrite the traffic — the connection is encrypted to the attacker, not to the intended host. Delete the override and let the platform validate. If a specific self-signed or internally-issued certificate genuinely has to be trusted, pin THAT one — compare the presented certificate's public key or thumbprint against the expected value and return `false` for everything else — and scope it to the single handler that talks to that host rather than to the whole process. If the override exists only to get past a development certificate, gate it on a build configuration or an explicit opt-in setting so it cannot ship. — src/GalleryTools/Commands/GalleryOperations.cs:141
  • `SecurityProtocol` explicitly selects `SecurityProtocolType.Ssl3`, a protocol version that is broken (SSL 2.0/3.0) or withdrawn (TLS 1.0/1.1, RFC 8996). Offering an obsolete version does not merely permit it — it is what a downgrade attack negotiates, so the weakest version on the list is the one that decides the connection's strength. Stop pinning versions here: leave the protocol unset (`SecurityProtocolType.SystemDefault`, or simply do not assign it) so the connection uses the OS policy and picks up TLS 1.3 and future versions without a code change. Where a version must be named explicitly, name `Tls12` and `Tls13` only. — src/NuGetGallery/App_Start/OwinStartup.cs:48
  • Password-hash field compared with `==` — use a constant-time compare to avoid timing oracles (CryptographicOperations.FixedTimeEquals). — src/NuGetGallery.Services/Authentication/ApiKeyV3.cs:68
  • MD5/SHA1 is constructed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ for content integrity, or a KDF (PBKDF2/Argon2/BCrypt) for password storage. If it only derives a non-security identifier (a cache key, a file or mutex name), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as `System.IO.Hashing.XxHash64`/`Crc32` says it in code — since the algorithm alone cannot distinguish the two uses. — src/NuGetGallery.Core/Certificates/CertificateFile.cs:69
  • `https://wcpstatic.microsoft.com/mscc/lib/v2/wcp-consent.js` is executed by this page with no Subresource Integrity. Whoever can answer that request — the CDN, anyone who compromises it, anyone on the network path — runs arbitrary script in this page's origin, with its session. The URL also names no version, so it resolves to whatever that origin serves at fetch time — the executed bytes can change with nobody touching this repository. 2 such include(s) across the repository's markup. — REDACTED:342
  • `ValidateIssuer = false` means a token from a different issuer is accepted, provided its signing key chains — the identity provider is no longer pinned. — src/NuGetGallery.Services/Authentication/Providers/AzureActiveDirectoryV2/AzureActiveDirectoryV2Authenticator.cs:103
  • Set: X-Content-Type-Options. Missing: Content-Security-Policy, Strict-Transport-Security, X-Frame-Options — the four headers that carry the points of this card's security-headers term (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options), 0.5 each. (−1.5 on this card.) — src/Microsoft.PackageManagement.Search.Web/StartupHelper.cs:84

What to do

  • Store passwords with a salted KDF — `Microsoft.AspNetCore.Identity.PasswordHasher<T>`, `Rfc2898DeriveBytes` (PBKDF2), or BCrypt/Argon2 — and compare with `CryptographicOperations.FixedTimeEquals`. (A fast/plain hash, or a client-hashed value stored and compared verbatim, is not password storage.) Start in `src/NuGetGallery.Services/Authentication/ApiKeyV3.cs:11`.
  • Stop accepting every TLS certificate: remove the always-true validation callback so the platform verifies the chain, hostname and expiry. If one self-signed certificate must be trusted, pin it by public key or thumbprint on the single handler that needs it and reject all others — never process-wide.
  • Drop SSL 2.0/3.0 and TLS 1.0/1.1 from the enabled protocol list — prefer leaving it to the OS default (`SystemDefault`) so new versions are picked up automatically, or name `Tls12`/`Tls13` explicitly if it must be pinned.
  • Review each MD5/SHA1 use by what it protects: replace it with SHA-256+ (or a KDF for passwords) where the digest is security-relevant, and switch it to a non-cryptographic hash (`System.IO.Hashing.XxHash64`/`Crc32`) where it only derives an identifier such as a cache key or a mutex name.
  • Pin third-party scripts and verify them: name an exact version in the URL and add an `integrity="sha384-…"` hash alongside `crossorigin="anonymous"` (both are required — an integrity hash on a cross-origin script without `crossorigin` is not evaluated, it blocks the script). Where the vendor ships a continuously-updated loader and publishes no stable hash (tag managers, analytics, chat widgets), Subresource Integrity is not available: constrain it instead with a `Content-Security-Policy` that names the exact origins allowed to execute, and drop the script from the pages that do not need it. Where the page is shipped inside a package that others host, prefer vendoring the asset and serving it from the app’s own origin, so no consumer inherits a third-party dependency they did not choose.
  • Re-enable token validation — `ValidateIssuer` is set to `false`. If it was switched off because the expected value was wrong or absent, supply that value instead (`ValidAudiences`/`ValidIssuers`, or `IssuerSigningKeys`/`IssuerSigningKeyResolver` for the signature) rather than skipping the check: a disabled check accepts every token, not just the one that was failing.
  • Add Content-Security-Policy, Strict-Transport-Security, X-Frame-Options beside the headers already set; Content-Security-Policy is the one that pays for itself first, then Strict-Transport-Security, then nosniff and a frame policy.
X1 · Async correctness7.3 / 10Strong✓ Tool-verified

Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.

Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.

  • Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process. (×25) — src/NuGetGallery/App_Start/OwinStartup.cs:128, src/NuGetGallery/App_Start/OwinStartup.cs:163, src/NuGetGallery/App_Start/OwinStartup.cs:246, …
  • Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout. (×12) — src/NuGetGallery/Filters/ValidateRecaptchaResponseAttribute.cs:31, src/NuGetGallery/Areas/Admin/DynamicData/DynamicDataManager.cs:36, src/NuGetGallery/Infrastructure/Lucene/LuceneIndexingService.cs:77, …
  • `Thread.Sleep` parks the thread for the whole delay: no other work runs on it, and under load the pool must grow to make up for it. `await Task.Delay(…)` suspends only this method. — src/Ng/Jobs/Db2CatalogJob.cs:219
  • `StreamReader.ReadToEnd` blocks the thread on I/O while `StreamReader.ReadToEndAsync` exists to wait without one — inside a method that is already `async`, await the twin. (×2) — src/CopyAzureContainer/CopyAzureContainerJob.cs:167, src/CopyAzureContainer/CopyAzureContainerJob.cs:168

What to do

  • Sync-over-async (deadlock risk)
X12 · Unreachable branch10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.

Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.

X13 · Undrained process stream5.2 / 10Adequate✓ Tool-verified

Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.

Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.

  • `RedirectStandardOutput` is set here, but `StandardOutput` is not being read when the code waits for the child to exit — it is never read, read only later, or read only in part. The child blocks as soon as it fills the StandardOutput pipe (~4 KB, never more than 64 KB), so it never finishes and never exits, and the read or wait above never returns: a `WaitForExit` timeout after a read does not help: the timeout bounds the WAIT, not the read that precedes it. Drain every redirected stream before blocking on the child — read one on a background thread (`BeginOutputReadLine()` with its `DataReceived` handler, or a `Task` running `ReadToEndAsync()` started before the other read and awaited after it) — or stop redirecting the stream you do not consume. — src/CopyAzureContainer/CopyAzureContainerJob.cs:152

What to do

  • Each finding names the span that makes the branch dead and the span it is dead because of. Confirm from the two, then delete the dead arm or fix the predicate that was meant to be reachable.
X14 · Bypassable address classification3.5 / 10Weak✓ Tool-verified

Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.

Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.

  • This method unwraps IPv4-MAPPED IPv6 (`IsIPv4MappedToIPv6`, line 165) and rejects `10.0.0.0/8` on its IPv4 path, and it handles some IPv4-in-IPv6 embeddings — but not IPv4-compatible (`::a.b.c.d`) and 6to4 (`2002::/16`): either it never names it, or it names it and returns the verdict its IPv4 path gives public space. So `::10.0.0.1`, `2002:0a00:0001::` name a host inside `10.0.0.0/8`, the range this same method declares non-public, and reach the IPv6 branch at line 157 with the opposite verdict. Unwrap every embedding to its IPv4 form before classifying, or reject any IPv6 address carrying an embedded IPv4 outright. — src/Catalog/Icons/PublicExternalIconUrlPolicy.cs:157

What to do

  • Each finding names the IPv4 branch that rejects the host and the IPv6 branch that accepts the same host in another notation. Confirm from the two, then unwrap every IPv4-in-IPv6 embedding before classifying, or reject non-native IPv6 outright.
X16 · Unfloored truncation loop10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.

Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.

X17 · Uncapped recursion over a caller-supplied document3.5 / 10Weak✓ Tool-verified

Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.

Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.

  • `CreateNuspecGraph` is public, takes a document from its caller (line 274) and hands it to `NormalizeXml`, which calls itself at line 103 with a child of the node it was given — and nowhere in `NormalizeXml` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the tree it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. A document nested past the stack that remains raises `StackOverflowException`, which .NET neither lets you catch nor unwinds: the process is torn down where it stands, taking every other request in flight with it, and no `try`/`catch` around `CreateNuspecGraph` can intervene. Thread a depth argument through `NormalizeXml` and reject the document past a fixed maximum, or rewrite the descent with an explicit stack. — src/Catalog/Helpers/Utils.cs:103

What to do

  • Each finding names the externally-callable member that accepts the document and the self-call that descends, and states that no depth parameter or counter exists anywhere in the walk. Confirm from the two, then thread a depth argument through the walk and reject documents past a fixed maximum, or rewrite it with an explicit stack.
X18 · Disposal-pattern correctness5.2 / 10Adequate✓ Tool-verified

Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.

Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.

  • `PackageFile` is never created by `PreparedPackageUpload` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 889). Its declared type `Stream` is an abstract class, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed. — src/NuGetGallery/Services/PackageStagingUploadService.cs:889
  • `Stream` is never created by `CertificateFile` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 27). Its declared type `Stream` is an abstract class, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed. — src/NuGetGallery.Core/Certificates/CertificateFile.cs:27
  • `store` is a `X509Store`, which implements `IDisposable`, and it is created here (line 14). Every use of it in `FindCertificateByThumbprint` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var store = …;`), which releases it at the end of the scope on every path including a throw. — src/NuGet.Services.KeyVault/CertificateUtility.cs:14
  • `writer` is a `StreamWriter`, which implements `IDisposable`, and it is created here (line 33). Every use of it in `GetContentStream` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var writer = …;`), which releases it at the end of the scope on every path including a throw. (×2) — src/NuGet.Services.Storage/JTokenStorageContent.cs:33, src/Catalog/Persistence/JTokenStorageContent.cs:33
  • `reader` is a `StreamReader`, which implements `IDisposable`, and it is created here (line 149). Every use of it in `LoadString` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var reader = …;`), which releases it at the end of the scope on every path including a throw. — src/NuGet.Services.Storage/Storage.cs:149
  • `writer` is a `StreamWriter`, which implements `IDisposable`, and it is created here (line 32). Every use of it in `GetContentStream` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var writer = …;`), which releases it at the end of the scope on every path including a throw. — src/NuGet.Services.Storage/StringStorageContent.cs:32
  • `_processor` (line 17) holds a `ServiceBusProcessor` that `SubscriptionClientWrapper` acquires itself — every assignment to it is a call that opens or creates a new instance for the caller to own — and nothing in `SubscriptionClientWrapper` ever releases it: the type is not `IDisposable`, declares no `Dispose`, and every other mention of `_processor` only reads through it, so it is never disposed, closed, returned or handed on. Whatever it opened (a connection, a channel, a file) stays open until finalization if the type has a finalizer and until the process ends if it does not, once per instance of `SubscriptionClientWrapper`. Implement `IDisposable` and release `_processor` there, or take the instance from the caller so its owner ends it. — src/NuGet.Services.ServiceBus/SubscriptionClientWrapper.cs:17
  • `_sender` (line 14) holds a `ServiceBusSender` that `TopicClientWrapper` acquires itself — every assignment to it is a call that opens or creates a new instance for the caller to own — and nothing in `TopicClientWrapper` ever releases it: the type is not `IDisposable`, declares no `Dispose`, and every other mention of `_sender` only reads through it, so it is never disposed, closed, returned or handed on. Whatever it opened (a connection, a channel, a file) stays open until finalization if the type has a finalizer and until the process ends if it does not, once per instance of `TopicClientWrapper`. Implement `IDisposable` and release `_sender` there, or take the instance from the caller so its owner ends it. — src/NuGet.Services.ServiceBus/TopicClientWrapper.cs:14
  • `_inner` is never created by `TestDbAsyncEnumerator` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 91). Its declared type `IEnumerator` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed. — src/NuGet.Services.Testing.Entities/TestDbAsyncQueryProvider.cs:91
  • `writer` is a `AppendOnlyCatalogWriter`, which implements `IDisposable`, and it is created here (line 87). Every use of it in `WritePackageDetailsToCatalogAsync` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var writer = …;`), which releases it at the end of the scope on every path including a throw. — src/Catalog/Helpers/CatalogWriterHelper.cs:87
  • `reader` is a `StreamReader`, which implements `IDisposable`, and it is created here (line 165). Every use of it in `LoadStringStorageContentAsync` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var reader = …;`), which releases it at the end of the scope on every path including a throw. — src/Catalog/Persistence/Storage.cs:165
  • `writer` is a `StreamWriter`, which implements `IDisposable`, and it is created here (line 41). Every use of it in `GetContentStream` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var writer = …;`), which releases it at the end of the scope on every path including a throw. — src/Catalog/Persistence/StringStorageContent.cs:41
  • `cancellationTokenSource` is a `CancellationTokenSource`, which implements `IDisposable`, and it is created here (line 100). Every use of it in `MainAsync` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var cancellationTokenSource = …;`), which releases it at the end of the scope on every path including a throw. — src/Ng/Program.cs:100
  • `command` is a `SqlCommand`, which implements `IDisposable`, and it is created here (line 156). Every use of it in `ProcessBatchAsync` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var command = …;`), which releases it at the end of the scope on every path including a throw. — REDACTED:156
  • `sqlCommand` is a `SqlCommand`, which implements `IDisposable`, and it is created here (line 58). Every use of it in `GetUnresolvedIssues` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var sqlCommand = …;`), which releases it at the end of the scope on every path including a throw. — REDACTED:58
  • `sqlCommand` is a `SqlCommand`, which implements `IDisposable`, and it is created here (line 134). Every use of it in `GetTopSupportRequestReasonsLastWeek` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var sqlCommand = …;`), which releases it at the end of the scope on every path including a throw. — REDACTED:134
  • `sqlCommand` is a `SqlCommand`, which implements `IDisposable`, and it is created here (line 165). Every use of it in `ExecuteScalarQueryForReferenceTimeAsync` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var sqlCommand = …;`), which releases it at the end of the scope on every path including a throw. — REDACTED:165
  • `forceStopCts` is a `CancellationTokenSource`, which implements `IDisposable`, and it is created here (line 94). Every use of it in `Run` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var forceStopCts = …;`), which releases it at the end of the scope on every path including a throw. — src/Stats.CollectAzureChinaCDNLogs/Job.cs:94
  • `cts` is a `CancellationTokenSource`, which implements `IDisposable`, and it is created here (line 97). Every use of it in `Run` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var cts = …;`), which releases it at the end of the scope on every path including a throw. — src/Stats.CollectAzureChinaCDNLogs/Job.cs:97
  • `bulkCopy` is a `SqlBulkCopy`, which implements `IDisposable`, and it is created here (line 45). Every use of it in `AddPackageRevalidationsAsync` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var bulkCopy = …;`), which releases it at the end of the scope on every path including a throw. — src/NuGet.Services.Revalidate/Initialization/PackageRevalidationInserter.cs:45

What to do

  • Each finding names the value and the span that decides who owns it — the `new` that created it, or the constructor parameter that handed it over. Confirm ownership from that span, then make the disposal match it: release what this type created, leave what it was injected with to whoever created THAT, and drop a finalizer whose type holds nothing unmanaged to release.
X19 · Unrestored process-global state10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.

Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.

X2 · Cancellation propagation5.2 / 10Adequate✓ Tool-verified

Other · Code Health — Whether async methods accept a CancellationToken so work can be cancelled (adoption curve).

Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same question: every named async function that itself makes a request an AbortSignal can cancel (global `fetch`, axios and its file-local instances, ky, ofetch) counts, and it is compliant when its parameters or body name a signal or it hands one of its own parameters to the request as options; signatures a framework fixes (JSX event handlers, route and lifecycle exports, request-first handlers, `override`, `'use server'` modules, TanStack `mutationFn`) are exempt unless they take a signal. Deterministic, adoption percentage.

  • Only 286/1446 async methods accept a CancellationToken, so in-flight work can't be stopped early when the caller gives up — whatever ends it in your host (shutdown signal, timeout, abandoned request, user cancel). Thread a token through the call chain and honour it at each await and loop; where a method genuinely cannot be interrupted, omitting it is a deliberate choice — judge against your hosting model.
  • No CancellationToken parameter — this work can't be stopped early once started. (×39) — src/NuGetGallery/Areas/Admin/Controllers/AdminApiController.cs:126, src/NuGetGallery/Areas/Admin/Controllers/AdminApiController.cs:187, src/NuGetGallery/Areas/Admin/Controllers/AdminApiController.cs:248, …

What to do

  • Thread a CancellationToken through async methods so work stops promptly on cancellation.
X20 · Mistyped argument guard5.8 / 10Adequate✓ Tool-verified

Other · Code Health — Whether an argument guard throws the exception its own condition describes — a guard that rejects a value for being EMPTY and reports it as `ArgumentNullException` tells the caller a parameter was null when it provably was not.

Method: Roslyn syntax: `throw new ArgumentNullException(nameof(p))` statements (or a repository exception type deriving from it) controlled by an `if` — directly or through the `using`, `lock` or `try` that wraps the throw — whose condition is read for a test that is true of a NON-null `p` — an emptiness test that dereferences it (`p.Count == 0`, `!p.Any()`) or a BCL predicate documented true of the empty value (`string.IsNullOrEmpty(p)`); in the `else` branch, for a conjunct of the admitting condition that is FALSE of a non-null `p`. Range guards are read for bounds that leave nothing and for a `p > C.Count` bound whose index then reaches `C[p]`, `C.RemoveAt(p)` or a method of the same type that indexes with it. Deterministic, provable per finding. Advisory.

  • The guard on line 251 rejects `packageId` and line 253 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(packageId)` is true of a value that is NOT null: it is satisfied by an EMPTY `packageId`, and on that path `packageId` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — src/NuGetGallery/Services/PackageMetadataValidationService.cs:253
  • The guard on line 28 rejects `id` and line 30 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(id)` is true of a value that is NOT null: it is satisfied by an EMPTY `id`, and on that path `id` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — src/NuGetGallery/Queries/AutocompleteDatabasePackageVersionsQuery.cs:30
  • The guard on line 26 rejects `id` and line 28 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(id)` is true of a value that is NOT null: it is satisfied by an EMPTY `id`, and on that path `id` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — src/NuGetGallery/Queries/AutocompleteServicePackageVersionsQuery.cs:28
  • The guard on line 1243 rejects `owner` and line 1245 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(owner)` is true of a value that is NOT null: it is satisfied by an EMPTY `owner`, and on that path `owner` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — src/NuGetGallery/UrlHelperExtensions.cs:1245
  • The guard on line 1248 rejects `groupId` and line 1250 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(groupId)` is true of a value that is NOT null: it is satisfied by an EMPTY `groupId`, and on that path `groupId` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — src/NuGetGallery/UrlHelperExtensions.cs:1250
  • The guard on line 1401 rejects `id` and line 1403 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(id)` is true of a value that is NOT null: it is satisfied by an EMPTY `id`, and on that path `id` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — src/NuGetGallery/UrlHelperExtensions.cs:1403
  • The guard on line 1406 rejects `version` and line 1408 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(version)` is true of a value that is NOT null: it is satisfied by an EMPTY `version`, and on that path `version` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — src/NuGetGallery/UrlHelperExtensions.cs:1408
  • The guard on line 1439 rejects `id` and line 1441 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(id)` is true of a value that is NOT null: it is satisfied by an EMPTY `id`, and on that path `id` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — src/NuGetGallery/UrlHelperExtensions.cs:1441
  • The guard on line 1444 rejects `version` and line 1446 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(version)` is true of a value that is NOT null: it is satisfied by an EMPTY `version`, and on that path `version` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — src/NuGetGallery/UrlHelperExtensions.cs:1446
  • The guard on line 32 rejects `gravatarUrl` and line 34 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrEmpty(gravatarUrl)` is true of a value that is NOT null: it is satisfied by an EMPTY `gravatarUrl`, and on that path `gravatarUrl` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — src/NuGetGallery/ViewModels/OrganizationMemberViewModel.cs:34
  • The guard on line 48 rejects `id` and line 50 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrEmpty(id)` is true of a value that is NOT null: it is satisfied by an EMPTY `id`, and on that path `id` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — src/NuGetGallery/Services/CloudDownloadCountService.cs:50
  • The guard on line 67 rejects `id` and line 69 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrEmpty(id)` is true of a value that is NOT null: it is satisfied by an EMPTY `id`, and on that path `id` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — src/NuGetGallery/Services/CloudDownloadCountService.cs:69
  • The guard on line 72 rejects `version` and line 74 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrEmpty(version)` is true of a value that is NOT null: it is satisfied by an EMPTY `version`, and on that path `version` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — src/NuGetGallery/Services/CloudDownloadCountService.cs:74
  • The guard on line 30 rejects `folderName` and line 32 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(folderName)` is true of a value that is NOT null: it is satisfied by an EMPTY `folderName`, and on that path `folderName` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — src/NuGetGallery/Services/FileSystemFileStorageService.cs:32
  • The guard on line 35 rejects `fileName` and line 37 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(fileName)` is true of a value that is NOT null: it is satisfied by an EMPTY `fileName`, and on that path `fileName` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — src/NuGetGallery/Services/FileSystemFileStorageService.cs:37
  • The guard on line 56 rejects `folderName` and line 58 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(folderName)` is true of a value that is NOT null: it is satisfied by an EMPTY `folderName`, and on that path `folderName` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — src/NuGetGallery/Services/FileSystemFileStorageService.cs:58
  • The guard on line 61 rejects `fileName` and line 63 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(fileName)` is true of a value that is NOT null: it is satisfied by an EMPTY `fileName`, and on that path `fileName` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — src/NuGetGallery/Services/FileSystemFileStorageService.cs:63
  • The guard on line 77 rejects `folderName` and line 79 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(folderName)` is true of a value that is NOT null: it is satisfied by an EMPTY `folderName`, and on that path `folderName` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — src/NuGetGallery/Services/FileSystemFileStorageService.cs:79
  • The guard on line 82 rejects `fileName` and line 84 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(fileName)` is true of a value that is NOT null: it is satisfied by an EMPTY `fileName`, and on that path `fileName` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — src/NuGetGallery/Services/FileSystemFileStorageService.cs:84
  • The guard on line 95 rejects `folderName` and line 97 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(folderName)` is true of a value that is NOT null: it is satisfied by an EMPTY `folderName`, and on that path `folderName` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — src/NuGetGallery/Services/FileSystemFileStorageService.cs:97
  • The guard on line 100 rejects `fileName` and line 102 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(fileName)` is true of a value that is NOT null: it is satisfied by an EMPTY `fileName`, and on that path `fileName` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — src/NuGetGallery/Services/FileSystemFileStorageService.cs:102
  • The guard on line 113 rejects `folderName` and line 115 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(folderName)` is true of a value that is NOT null: it is satisfied by an EMPTY `folderName`, and on that path `folderName` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — src/NuGetGallery/Services/FileSystemFileStorageService.cs:115
  • The guard on line 118 rejects `fileName` and line 120 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(fileName)` is true of a value that is NOT null: it is satisfied by an EMPTY `fileName`, and on that path `fileName` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — src/NuGetGallery/Services/FileSystemFileStorageService.cs:120
  • The guard on line 132 rejects `folderName` and line 134 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(folderName)` is true of a value that is NOT null: it is satisfied by an EMPTY `folderName`, and on that path `folderName` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — src/NuGetGallery/Services/FileSystemFileStorageService.cs:134
  • The guard on line 137 rejects `fileName` and line 139 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(fileName)` is true of a value that is NOT null: it is satisfied by an EMPTY `fileName`, and on that path `fileName` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — src/NuGetGallery/Services/FileSystemFileStorageService.cs:139
  • The guard on line 142 rejects `expectedETag` and line 144 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(expectedETag)` is true of a value that is NOT null: it is satisfied by an EMPTY `expectedETag`, and on that path `expectedETag` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — src/NuGetGallery/Services/FileSystemFileStorageService.cs:144
  • The guard on line 158 rejects `folderName` and line 160 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(folderName)` is true of a value that is NOT null: it is satisfied by an EMPTY `folderName`, and on that path `folderName` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — src/NuGetGallery/Services/FileSystemFileStorageService.cs:160
  • The guard on line 163 rejects `fileName` and line 165 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(fileName)` is true of a value that is NOT null: it is satisfied by an EMPTY `fileName`, and on that path `fileName` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — src/NuGetGallery/Services/FileSystemFileStorageService.cs:165
  • The guard on line 94 rejects `readMeMd` and line 96 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(readMeMd)` is true of a value that is NOT null: it is satisfied by an EMPTY `readMeMd`, and on that path `readMeMd` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — src/NuGetGallery/Services/PackageFileService.cs:96
  • The guard on line 1032 rejects `id` and line 1034 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(id)` is true of a value that is NOT null: it is satisfied by an EMPTY `id`, and on that path `id` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — REDACTED:1034
  • The guard on line 1037 rejects `version` and line 1039 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(version)` is true of a value that is NOT null: it is satisfied by an EMPTY `version`, and on that path `version` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — REDACTED:1039
  • The guard on line 22 rejects `auditingPath` and line 24 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrEmpty(auditingPath)` is true of a value that is NOT null: it is satisfied by an EMPTY `auditingPath`, and on that path `auditingPath` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — src/NuGetGallery.Core/Auditing/FileSystemAuditingService.cs:24
  • The guard on line 31 rejects `username` and line 33 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrEmpty(username)` is true of a value that is NOT null: it is satisfied by an EMPTY `username`, and on that path `username` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — src/NuGetGallery.Core/Auditing/UserSecurityPolicyAuditRecord.cs:33
  • The guard on line 27 rejects `sas` and line 29 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrEmpty(sas)` is true of a value that is NOT null: it is satisfied by an EMPTY `sas`, and on that path `sas` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — src/NuGetGallery.Core/Extensions/UriExtensions.cs:29
  • The guard on line 64 rejects `folderName` and line 66 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(folderName)` is true of a value that is NOT null: it is satisfied by an EMPTY `folderName`, and on that path `folderName` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — src/NuGetGallery.Core/Services/CloudBlobCoreFileStorageService.cs:66
  • The guard on line 69 rejects `fileName` and line 71 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(fileName)` is true of a value that is NOT null: it is satisfied by an EMPTY `fileName`, and on that path `fileName` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — src/NuGetGallery.Core/Services/CloudBlobCoreFileStorageService.cs:71
  • The guard on line 79 rejects `folderName` and line 81 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(folderName)` is true of a value that is NOT null: it is satisfied by an EMPTY `folderName`, and on that path `folderName` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — src/NuGetGallery.Core/Services/CloudBlobCoreFileStorageService.cs:81
  • The guard on line 84 rejects `fileName` and line 86 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(fileName)` is true of a value that is NOT null: it is satisfied by an EMPTY `fileName`, and on that path `fileName` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — src/NuGetGallery.Core/Services/CloudBlobCoreFileStorageService.cs:86
  • The guard on line 107 rejects `folderName` and line 109 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(folderName)` is true of a value that is NOT null: it is satisfied by an EMPTY `folderName`, and on that path `folderName` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — src/NuGetGallery.Core/Services/CloudBlobCoreFileStorageService.cs:109
  • The guard on line 112 rejects `fileName` and line 114 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(fileName)` is true of a value that is NOT null: it is satisfied by an EMPTY `fileName`, and on that path `fileName` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — src/NuGetGallery.Core/Services/CloudBlobCoreFileStorageService.cs:114

What to do

  • Each finding names the throw and the test in its own condition that is true of a NON-null value. Confirm from the two, then throw the exception that describes what was actually wrong: `ArgumentException` for a value that arrived empty, or the .NET 8 helpers that spell the whole guard in one line and pick the type for you — `ArgumentException.ThrowIfNullOrEmpty(s)` / `ThrowIfNullOrWhiteSpace(s)` for strings, `ArgumentNullException.ThrowIfNull(x)` followed by `ArgumentOutOfRangeException.ThrowIfZero(x.Count)` for a collection. Splitting the two conditions is usually clearer than picking one exception for both: they are different failures and the caller may want to handle them differently.
X22 · Contradicted release guard5.7 / 10Adequate✓ Tool-verified

Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back. Also whether a `finally` that gives the primitive back unconditionally can run in a state where the method does not hold it: after a timed wait whose result was discarded, after an acquire inside the `try` that can fail, after the body already released it, or never, because a `return` left between the acquire and the `try`.

Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.

  • `_lock.ExitWriteLock()` gives `_lock` back here, and the `finally` gives it back again with `_lock.ExitUpgradeableReadLock()` on the same path — one acquire, two releases. On a semaphore the second raises the count past what was taken (or throws `SemaphoreFullException`), so a caller is admitted that the limit was there to keep out; on a lock it throws from the `finally`. Release once, in the `finally`. — src/Catalog/StringInterner.cs:34

What to do

  • Each finding names the return, the `finally` guard it disagrees with, and the flag state the method's own assignments put it in at that point. Confirm from the three, then make the two statements of ownership agree: the flag and the returned value both say whether the caller now owns the primitive, so a return reporting success must leave the guard skipping the release, and a return reporting failure must leave it performing one. Setting the flag immediately before the return that reports success — never after it, and never on a path that goes on to report failure — is what keeps the pair readable.
X23 · Unguarded diagnostic materialisation10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.

Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.

X24 · Document value interpolated into markup unescaped3.3 / 10Weak✓ Tool-verified

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

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

  • `message.HtmlBody` is text this program did not author, and it is written into the text of an element through an HTML e-mail body with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — src/NuGet.Services.Messaging/ServiceBusMessageSerializer.cs:41
  • `content.Trim()` is text this program did not author, and it is written into the text of an element through `new HtmlString(…)` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — src/NuGetGallery.Services/Storage/ContentService.cs:158
  • `ContentDropDownId` is text this program did not author, and it is written into a quoted attribute value through `new HtmlString(…)` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. (×2) — src/NuGetGallery/Helpers/AccordeonHelper.cs:43, src/NuGetGallery/Helpers/AccordeonHelper.cs:58
  • `(Expanded ? closedTitle : expandedTitle)` is text this program did not author, and it is written into a quoted attribute value through `new HtmlString(…)` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. (×2) — src/NuGetGallery/Helpers/AccordeonHelper.cs:45, src/NuGetGallery/Helpers/AccordeonHelper.cs:60
  • `CollapseButtonId` is text this program did not author, and it is written into a quoted attribute value through `new HtmlString(…)` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. (×2) — src/NuGetGallery/Helpers/AccordeonHelper.cs:47, src/NuGetGallery/Helpers/AccordeonHelper.cs:62
  • `(Expanded ? expandedTitle : closedTitle)` is text this program did not author, and it is written into the text of an element through `new HtmlString(…)` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. (×2) — src/NuGetGallery/Helpers/AccordeonHelper.cs:50, src/NuGetGallery/Helpers/AccordeonHelper.cs:65
  • `cspNonce` is text this program did not author, and it is written into the text of an element through `new HtmlString(…)` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — src/NuGetGallery/Helpers/CSPHelper.cs:24
  • `url.Avatar(username, imageSize)` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through `new HtmlString(…)` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path. — REDACTED:82
  • `username` is text this program did not author, and it is written into a quoted attribute value through `new HtmlString(…)` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. (×2) — REDACTED:86, REDACTED:87
  • `gravatarHtml.ToHtmlString().Replace(UnsecureGravatarUrl, SecureGravatarUrl)` is text this program did not author, and it is written into the text of an element through `new HtmlString(…)` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — REDACTED:112
  • `output.ToString()` is text this program did not author, and it is written into the text of an element through `Html.Raw` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — src/NuGetGallery/Helpers/HtmlExtensions.cs:161
  • `json` is text this program did not author, and it is written into the text of an element through `Html.Raw` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — src/NuGetGallery/Helpers/HtmlExtensions.cs:207
  • `Subtext` is text this program did not author, and it is written into the text of an element through `new HtmlString(…)` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — src/NuGetGallery/Infrastructure/SubtextAttribute.cs:34
  • `Strings.SigninAssistance_InvalidUser` is text this program did not author, and it is written into the text of an element through Razor's `Html.Raw` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — src/NuGetGallery/Views/Authentication/SignIn.cshtml:83
  • `@Url.Absolute("~/Content/gallery/img/default-package-icon-256x256.png")` is text this program did not author, and it is written into the text of an element through Razor's `Html.Raw` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — src/NuGetGallery/Views/Organizations/Add.cshtml:82
  • `@GalleryConstants.EmailValidationRegex` is text this program did not author, and it is written into the text of an element through Razor's `Html.Raw` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — src/NuGetGallery/Views/Organizations/Add.cshtml:83
  • `packageManager.AlertMessage` is text this program did not author, and it is written into the text of an element through Razor's `Html.Raw` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. (×2) — REDACTED:390, REDACTED:396
  • `Model.ReadMeHtml` is text this program did not author, and it is written into the text of an element through Razor's `Html.Raw` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — REDACTED:851
  • `Model.LicenseFileContentsHtml.Content` is text this program did not author, and it is written into the text of an element through Razor's `Html.Raw` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — REDACTED:83
  • `Strings.ManagePackageOwners_Error` is text this program did not author, and it is written into the text of an element through Razor's `Html.Raw` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — src/NuGetGallery/Views/Packages/Manage.cshtml:92
  • `Strings.ManagePackageOwners_InvalidUsername` is text this program did not author, and it is written into the text of an element through Razor's `Html.Raw` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — src/NuGetGallery/Views/Packages/Manage.cshtml:93
  • `Strings.ManagePackageOwners_AlreadyPending` is text this program did not author, and it is written into the text of an element through Razor's `Html.Raw` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — src/NuGetGallery/Views/Packages/Manage.cshtml:94
  • `Strings.ManagePackageOwners_RemovingOwnership` is text this program did not author, and it is written into the text of an element through Razor's `Html.Raw` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — src/NuGetGallery/Views/Packages/Manage.cshtml:95
  • `Strings.ManagePackageOwners_RemovingOrganization` is text this program did not author, and it is written into the text of an element through Razor's `Html.Raw` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — src/NuGetGallery/Views/Packages/Manage.cshtml:96
  • `Strings.ManagePackageOwners_RemovingSelf` is text this program did not author, and it is written into the text of an element through Razor's `Html.Raw` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — src/NuGetGallery/Views/Packages/Manage.cshtml:97
  • `@rawErrorMessage` is text this program did not author, and it is written into the text of an element through Razor's `Html.Raw` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — REDACTED:233
  • `ViewBag.EmailAllowedDescription` is text this program did not author, and it is written into the text of an element through Razor's `Html.Raw` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — src/NuGetGallery/Views/Shared/_AccountChangeNotifications.cshtml:66
  • `string.Format(@ViewBag.GravatarProfileMessage, GravatarLink("gravatar.com"))` is text this program did not author, and it is written into the text of an element through Razor's `Html.Raw` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — src/NuGetGallery/Views/Shared/_AccountProfilePicture.cshtml:40
  • `Strings.RequiredSigner_ThisAction` is text this program did not author, and it is written into the text of an element through Razor's `Html.Raw` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — src/NuGetGallery/Views/Users/Packages.cshtml:582
  • `Strings.RequiredSigner_OwnerHasNoCertificate` is text this program did not author, and it is written into the text of an element through Razor's `Html.Raw` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — src/NuGetGallery/Views/Users/Packages.cshtml:583
  • `Strings.RequiredSigner_OwnerHasAtLeastOneCertificate` is text this program did not author, and it is written into the text of an element through Razor's `Html.Raw` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — src/NuGetGallery/Views/Users/Packages.cshtml:584
  • `Strings.RequiredSigner_AnyWithUnsignedResult` is text this program did not author, and it is written into the text of an element through Razor's `Html.Raw` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — src/NuGetGallery/Views/Users/Packages.cshtml:585
  • `Strings.RequiredSigner_AnyWithMixedResult` is text this program did not author, and it is written into the text of an element through Razor's `Html.Raw` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — src/NuGetGallery/Views/Users/Packages.cshtml:586
  • `Strings.RequiredSigner_AnyWithSignedResult` is text this program did not author, and it is written into the text of an element through Razor's `Html.Raw` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — src/NuGetGallery/Views/Users/Packages.cshtml:587

What to do

  • Each finding names the expression, the attribute it lands in and the line. Confirm the value's origin from the read this analyzer traced, then escape it at the sink or validate it against the shape the attribute accepts before interpolating.
X25 · Inert configuration knob10.0 / 10Exemplary○ Nothing flagged

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

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

X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a `foreach` leaves the collection it is walking alone — a body that adds to or removes from the very collection the loop is enumerating invalidates the enumerator it is holding, so the next `MoveNext` throws `InvalidOperationException` and the remaining items are never seen.

Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.

X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.

Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.

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

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

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

X3 · Exception handling6.6 / 10Adequate✓ Tool-verified

Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.

Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.

  • `leakedApiKeyInfo` is used without ever being checked for null, but `JsonConvert` returns null for the document `null` — and no catch clause around it catches NullReferenceException, so that one input throws past every handler here and out of the method. The try already answers unreadable files and malformed JSON; answer the empty document too, by testing the result before using it (or by rejecting null where the value is produced) rather than by widening the catch to swallow the deref. — src/NuGetGallery/Areas/Admin/Controllers/ApiKeysController.cs:64
  • `catch (EntityException)` does nothing with the exception it caught — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch. Log it through whatever this codebase already uses to report problems, or let it propagate; if one specific failure genuinely cannot matter, catch exactly that exception type and say why in a comment on the catch. — REDACTED:191
  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×24) — src/NuGetGallery/App_Start/OwinStartup.cs:214, src/NuGetGallery/App_Start/OwinStartup.cs:248, src/NuGetGallery/Infrastructure/Mail/BackgroundMarkdownMessageService.cs:56, …
  • `catch (FileNotFoundException)` does nothing with the exception it caught — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch. Log it through whatever this codebase already uses to report problems, or let it propagate; if one specific failure genuinely cannot matter, catch exactly that exception type and say why in a comment on the catch. — src/NuGetGallery/Areas/Admin/Controllers/LuceneController.cs:47
  • `catch` does nothing with the exception it caught — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch. Log it through whatever this codebase already uses to report problems, or let it propagate; if one specific failure genuinely cannot matter, catch exactly that exception type and say why in a comment on the catch. — src/NuGetGallery.Core/Services/CloudBlobWrapper.cs:305
  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. On a teardown path letting it propagate is not an option (throwing out of `Dispose()` masks the failure already in flight and abandons the rest of the cleanup), so make the swallow deliberate instead: record it through whatever this codebase already uses to report problems — or, if one specific failure truly cannot matter, catch exactly that exception type and say why in a comment on the catch (a comment on a catch-all still swallows everything else). — src/Validation.Common.Job/TempFiles/TempFile.cs:66
  • `data` is used without ever being checked for null, but `JsonConvert` returns null for the document `null` — and no catch clause around it catches NullReferenceException, so that one input throws past every handler here and out of the method. The try already answers unreadable files and malformed JSON; answer the empty document too, by testing the result before using it (or by rejecting null where the value is produced) rather than by widening the catch to swallow the deref. — src/NuGet.Protocol.Catalog/FileCursor.cs:33

What to do

  • Unguarded deserialized result under a catch list that cannot catch it
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.

Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.

X4 · Structured logging7.7 / 10Strong✓ Tool-verified

Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.

Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `package.json` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.

  • Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it. (×17) — src/NuGetGallery.Services/Authentication/Federated/FederatedCredentialPolicyEvaluator.cs:102, src/NuGet.Jobs.Common/Configuration/JobConfigurationManager.cs:138, src/NuGet.Jobs.Common/Extensions/LoggerExtensions.cs:40, …

What to do

  • Interpolated log message defeats structured logging
X5 · Nullable reference types4.5 / 10Weak✓ Tool-verified

Other · Code Health — Whether nullable reference types are enabled and not undermined by heavy `!` suppression.

Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.

  • This method contradicts itself about `controller`: line 24 assigns it with `as AppController`, which hands back null rather than throwing when the value is not a `AppController`, but line 25 then dereferences it directly as `controller.NuGetContext` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `controller` once before the first use and handle the null case, or cast with `(AppController)` so the failure is reported where it happens — rather than leaving the two readings side by side. — src/NuGetGallery/Filters/ValidateRecaptchaResponseAttribute.cs:25
  • This method contradicts itself about `readMeRequest`: line 52 writes `readMeRequest?.SourceType`, which says `readMeRequest` can be null, but line 57 then dereferences it directly as `readMeRequest.SourceText` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `readMeRequest` truly cannot be null here, the `?.` is misleading. Settle it one way — test `readMeRequest` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side. — src/NuGetGallery/Services/ReadMeService.cs:57
  • This method contradicts itself about `edit`: line 186 writes `edit?.ReadMe`, which says `edit` can be null, but line 194 then dereferences it directly as `edit.ReadMeState` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `edit` truly cannot be null here, the `?.` is misleading. Settle it one way — test `edit` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side. — src/NuGetGallery/Services/ReadMeService.cs:194
  • This method contradicts itself about `readMeRequest`: line 232 writes `readMeRequest?.SourceType`, which says `readMeRequest` can be null, but line 240 then dereferences it directly as `readMeRequest.SourceText` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `readMeRequest` truly cannot be null here, the `?.` is misleading. Settle it one way — test `readMeRequest` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side. — src/NuGetGallery/Services/ReadMeService.cs:240
  • This method contradicts itself about `lambda`: line 157 assigns it with `as LambdaExpression`, which hands back null rather than throwing when the value is not a `LambdaExpression`, but line 158 then dereferences it directly as `lambda.Body` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `lambda` once before the first use and handle the null case, or cast with `(LambdaExpression)` so the failure is reported where it happens — rather than leaving the two readings side by side. — src/NuGetGallery/OData/SearchService/SearchHijacker.cs:158
  • This method contradicts itself about `binExpr`: line 160 assigns it with `as BinaryExpression`, which hands back null rather than throwing when the value is not a `BinaryExpression`, but line 162 then dereferences it directly as `binExpr.Left` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `binExpr` once before the first use and handle the null case, or cast with `(BinaryExpression)` so the failure is reported where it happens — rather than leaving the two readings side by side. — src/NuGetGallery/OData/SearchService/SearchHijacker.cs:162
  • This method contradicts itself about `membership`: line 12 writes `membership?.Member`, which says `membership` can be null, but line 14 then dereferences it directly as `membership.IsAdmin` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `membership` truly cannot be null here, the `?.` is misleading. Settle it one way — test `membership` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side. — src/NuGetGallery/ViewModels/OrganizationMemberViewModel.cs:14
  • This method contradicts itself about `request`: line 19 writes `request?.NewMember`, which says `request` can be null, but line 21 then dereferences it directly as `request.IsAdmin` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `request` truly cannot be null here, the `?.` is misleading. Settle it one way — test `request` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side. — src/NuGetGallery/ViewModels/OrganizationMemberViewModel.cs:21
  • This method contradicts itself about `loginUserDetails`: line 187 writes `loginUserDetails?.AuthenticatedUser`, which says `loginUserDetails` can be null, but line 193 then dereferences it directly as `loginUserDetails.UsedMultiFactorAuthentication` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `loginUserDetails` truly cannot be null here, the `?.` is misleading. Settle it one way — test `loginUserDetails` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side. — REDACTED:193
  • This method contradicts itself about `identity`: line 59 writes `identity?.StagingGroup`, which says `identity` can be null, but line 61 then dereferences it directly as `identity.StagingGroupKey` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `identity` truly cannot be null here, the `?.` is misleading. Settle it one way — test `identity` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side. — src/NuGetGallery.Core/Services/StagingGroupPromotionService.cs:61
  • This method contradicts itself about `app`: line 29 assigns it with `as HttpApplication`, which hands back null rather than throwing when the value is not a `HttpApplication`, but line 31 then dereferences it directly as `app.Context` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `app` once before the first use and handle the null case, or cast with `(HttpApplication)` so the failure is reported where it happens — rather than leaving the two readings side by side. — src/NuGetGallery.Services/Authentication/AsyncFileUpload/AsyncFileUploadModule.cs:31
  • This method contradicts itself about `claimsIdentity`: line 219 assigns it with `as ClaimsIdentity`, which hands back null rather than throwing when the value is not a `ClaimsIdentity`, but line 223 then dereferences it directly as `claimsIdentity.TryRemoveClaim` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `claimsIdentity` once before the first use and handle the null case, or cast with `(ClaimsIdentity)` so the failure is reported where it happens — rather than leaving the two readings side by side. — src/NuGetGallery.Services/Extensions/PrincipalExtensions.cs:223
  • This method contradicts itself about `claimsIdentity`: line 249 assigns it with `as ClaimsIdentity`, which hands back null rather than throwing when the value is not a `ClaimsIdentity`, but line 257 then dereferences it directly as `claimsIdentity.AddClaim` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `claimsIdentity` once before the first use and handle the null case, or cast with `(ClaimsIdentity)` so the failure is reported where it happens — rather than leaving the two readings side by side. — src/NuGetGallery.Services/Extensions/PrincipalExtensions.cs:257
  • This method contradicts itself about `claimsIdentity`: line 53 assigns it with `as ClaimsIdentity`, which hands back null rather than throwing when the value is not a `ClaimsIdentity`, but line 54 then dereferences it directly as `claimsIdentity.GetClaimOrDefault` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `claimsIdentity` once before the first use and handle the null case, or cast with `(ClaimsIdentity)` so the failure is reported where it happens — rather than leaving the two readings side by side. — src/NuGetGallery.Services/Extensions/UserExtensions.cs:54
  • This method contradicts itself about `wrapper`: line 79 assigns it with `as ServiceBusMessageWrapper`, which hands back null rather than throwing when the value is not a `ServiceBusMessageWrapper`, but line 83 then dereferences it directly as `wrapper.ServiceBusMessage` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `wrapper` once before the first use and handle the null case, or cast with `(ServiceBusMessageWrapper)` so the failure is reported where it happens — rather than leaving the two readings side by side. — src/NuGet.Services.ServiceBus/TopicClientWrapper.cs:83
  • This method contradicts itself about `other`: line 26 assigns it with `as CatalogCommit`, which hands back null rather than throwing when the value is not a `CatalogCommit`, but line 35 then dereferences it directly as `other.CommitTimeStamp` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `other` once before the first use and handle the null case, or cast with `(CatalogCommit)` so the failure is reported where it happens — rather than leaving the two readings side by side. — src/Catalog/CatalogCommit.cs:35
  • This method contradicts itself about `other`: line 70 assigns it with `as CatalogCommitItem`, which hands back null rather than throwing when the value is not a `CatalogCommitItem`, but line 79 then dereferences it directly as `other.CommitTimeStamp` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `other` once before the first use and handle the null case, or cast with `(CatalogCommitItem)` so the failure is reported where it happens — rather than leaving the two readings side by side. — src/Catalog/CatalogCommitItem.cs:79
  • This method contradicts itself about `types`: line 49 assigns it with `as IEnumerable<string>`, which hands back null rather than throwing when the value is not a `IEnumerable<string>`, but line 50 then dereferences it directly as `types.First` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `types` once before the first use and handle the null case, or cast with `(IEnumerable<string>)` so the failure is reported where it happens — rather than leaving the two readings side by side. — src/Catalog/CatalogTypeConverter.cs:50
  • 2/5 NRT-eligible project(s) enable <Nullable>enable</Nullable> (projects targeting a pre-C#-8 framework are excluded — NRTs aren't available there). NRTs catch a whole class of null-deref bugs at compile time.
  • ~1.7 `!` suppressions per 1k syntax nodes — 47 suppression(s) across the 27770 syntax node(s) in code where nullable warnings are ENABLED, which is the only code a `!` can suppress anything in (a `!` under `#nullable disable` is inert and is not counted, and its file's nodes are not in the denominator). Each one tells the compiler to trust you about null, suppressing the very safety NRTs provide. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.

What to do

  • Where a method uses `?.` on a symbol and then dereferences it directly, settle the question once: test it before the first use and handle null, or drop the `?.`.
  • Enable <Nullable>enable</Nullable> across all projects and resolve warnings rather than suppressing with `!`.

WCAG coverage — what static analysis assessed

Statically assessed 15 of 55 WCAG 2.2 Level A/AA success criteria (27%; ≈30% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 40 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).

DimensionWCAG 2.2 A/AA criteriaCoverage
AC1 · Text alternatives1.1.1, 1.2.2, 1.2.5Partial signal
AC2 · Forms & labels1.3.1, 3.3.2, 4.1.2Partial signal
AC3 · Page structure1.4.4, 2.2.1, 2.4.1, 2.4.2, 3.1.1, 4.1.2Partial signal
AC4 · Keyboard semantics2.1.1, 2.4.3Partial signal
AC5 · ARIA correctness4.1.2Partial signal
AC6 · Visual & motion safety1.4.3, 2.4.7Partial — literal CSS only

Not statically assessed — these 40 Level A/AA criteria need runtime or manual evaluation (WCAG-EM): 1.2.1, 1.2.3, 1.2.4, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.4.1, 1.4.2, 1.4.5, 1.4.10, 1.4.11, 1.4.12, 1.4.13, 2.1.2, 2.1.4, 2.2.2, 2.3.1, 2.4.4, 2.4.5, 2.4.6, 2.4.11, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.5.7, 2.5.8, 3.1.2, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.6, 3.3.1, 3.3.3, 3.3.4, 3.3.7, 3.3.8, 4.1.3.

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 Health31.3Weak — gated by R1, R2, IC1Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture66.6Adequate — gated by AX2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity73.6Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness34.8Weak — gated by R4, R8, P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security35.8Weak — gated by D29, D36, C1, S1Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Event-Driven100.0ExemplaryStrongest area.
Accessibility43.5Weak — gated by AC4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance60.0AdequateAcceptable, with room to improve.
Unscored — 4 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 — 2 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.
  • X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 27 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X9 Subsumed condition operand — 2 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 2 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.

  • C5 Data-Subject Rights — Repo shows no corroborated data-subject-rights mechanism (erasure / export-portability / consent) tied to a subject id or GDPR vocabulary — absence of evidence is not evidence of a working control. A delete/anonymise identifier was seen but did not co-occur with GDPR vocabulary or a subject-id shape, so it was not credited (e.g. a save-slot DeleteAccount()). Implement erasure, data export/portability and consent tracking over the subject's records.
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 32 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.

  • AX4 Dependency direction — not applicable to a CQRS architecture (the inward-dependency rule is for layered/clean styles)
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility — the Aspire AppHost did not expose a crawlable HTTP endpoint in time (or only the dashboard) — no runtime evidence This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
  • D11 Test Reliability — Test reliability not measured — no test run produced results
  • D12 Dependency Hygiene — Dependency hygiene not measured — pkgs.dev.azure.com could not be reached
  • D21 Naming Consistency — Naming Consistency not included (check did not complete)
  • D22 Internal API Consistency — N/A — too few peer members to establish a convention across 13 exposed C# types.
  • D23 Boundary Type-Coupling — Cross-context type coupling could not be assessed — this codebase's bounded contexts are neither declared nor inferable.
  • D25 ADR Conformance — no ADRs to check
  • D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
  • D32 Data Compliance (PII/GDPR) — 2 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • D34 Knowledge Freshness — knowledge concentrated in recent work — freshness signal contradicted by repo activity
  • 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.
  • D7 Architectural Integrity — no checkable ADRs and no dependency cycles — architectural integrity not assessed
  • D8 Code Coverage — Coverage not measured — pkgs.dev.azure.com could not be reached
  • DM1 Domain Modelling — applicable but not scored (2 of 3 signals for this style — below the bar we score at): 5 value object(s); 2 domain event(s); its domain events are published by services or handlers — no domain entity raises one
  • ED2 Event/command shape — no command-shaped messages detected — single-handler-per-command check not applicable
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • P8 Schema migrations — no EF Core usage detected
  • P9 Domain vs controller coverage — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
  • PF1 Benchmark discipline — Performance is assessed only for perf-relevant repos — a packaged library, one that ships benchmarks, or one already using allocation-aware APIs. This repo isn't one, so the Performance lens is not applicable and is excluded from the score.
  • PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X21 Side-effecting pattern guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X32 Type resolved by simple name across every loaded assembly — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

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

Critical — 171 finding(s)
D17 · Explicit Debt · WriteOnlyPrivateField · ×49
  • WriteOnlyPrivateField src/AccountDeleter/GalleryAccountManager.cs:14 — private IOptionsSnapshot<AccountDeleteConfiguration> _accountDeleteConfigurationAccessor — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField src/AccountDeleter/GalleryAccountManager.cs:17 — private IAccountDeleteTelemetryService _telemetryService — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField src/AccountDeleter/Messaging/EmailBuilderFactory.cs:14 — private ILogger<EmailBuilderFactory> _logger — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField src/Catalog/CatalogIndexReader.cs:22 — private JObject _context — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField src/Catalog/Persistence/AzureStorage.cs:31 — private bool _useServerSideCopy — assigned 2 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField src/NuGet.Jobs.Common/JobBase.cs:24 — private EventSource _jobEventSource — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField src/NuGet.Services.Metadata.Catalog.Monitoring/Resources/PackageTimestampMetadataResourceDatabase.cs:15 — private ILogger<PackageTimestampMetadataResourceDatabase> _logger — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField src/NuGet.Services.Revalidate/Job.cs:37 — private TimeSpan RetryLaterSleepDuration — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField src/NuGet.Services.Validation.Orchestrator/ContentScan/ContentScanValidator.cs:18 — private IValidationEntitiesContext _validationContext — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField src/NuGet.Services.Validation.Orchestrator/Symbols/SymbolScanValidator.cs:24 — private IValidationEntitiesContext _validationContext — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField src/NuGet.Services.Validation.Orchestrator/ContentScan/ContentScanValidator.cs:21 — private ContentScanConfiguration _configuration — assigned 2 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField src/NuGet.Services.Validation.Orchestrator/OrchestrationRunner.cs:20 — private TimeSpan ShutdownLoopSleepTime — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField src/NuGet.Services.Validation.Orchestrator/PackageSigning/ProcessSignature/PackageSignatureProcessor.cs:19 — private IValidatorStateService _validatorStateService — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField src/NuGet.Services.Validation.Orchestrator/PackageSigning/ProcessSignature/PackageSignatureValidator.cs:24 — private IValidatorStateService _validatorStateService — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField src/NuGet.Services.Validation.Orchestrator/PackageSigning/ProcessSignature/PackageSignatureProcessor.cs:20 — private IProcessSignatureEnqueuer _signatureVerificationEnqueuer — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField src/NuGet.Services.Validation.Orchestrator/PackageSigning/ProcessSignature/PackageSignatureValidator.cs:25 — private IProcessSignatureEnqueuer _signatureVerificationEnqueuer — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField src/NuGet.Services.Validation.Orchestrator/PackageSigning/ProcessSignature/PackageSignatureProcessor.cs:21 — private ISimpleCloudBlobProvider _blobProvider — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField src/NuGet.Services.Validation.Orchestrator/PackageSigning/ProcessSignature/PackageSignatureValidator.cs:26 — private ISimpleCloudBlobProvider _blobProvider — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField src/NuGet.Services.Validation.Orchestrator/PackageSigning/ProcessSignature/PackageSignatureProcessor.cs:22 — private ITelemetryService _telemetryService — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField src/NuGet.Services.Validation.Orchestrator/PackageSigning/ProcessSignature/PackageSignatureValidator.cs:29 — private ITelemetryService _telemetryService — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField src/NuGet.Services.Validation.Orchestrator/PackageSigning/ProcessSignature/PackageSignatureProcessor.cs:23 — private ILogger<PackageSignatureProcessor> _logger — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField src/NuGet.Services.Validation.Orchestrator/PackageSigning/ProcessSignature/PackageSignatureValidator.cs:27 — private ICorePackageService _packages — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField src/NuGetGallery.Services/Authentication/Federated/GitHubTokenPolicyValidator.cs:46 — private IFeatureFlagService _featureFlagService — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField src/NuGetGallery.Services/Diagnostics/TraceDiagnosticsSource.cs:20 — private string _name — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField src/NuGetGallery/Services/SqlAggregateStatsService.cs:13 — private IAppConfiguration _configuration — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • + 24 more in this group — see findings.md.
D17 · Explicit Debt · EmptyCatchBlock · ×25
  • EmptyCatchBlock src/GalleryTools/Commands/BackfillTfmMetadataCommand.cs:56 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock src/GalleryTools/Commands/BackfillTfmMetadataCommand.cs:89 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock REDACTED:95 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock REDACTED:101 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock src/NuGet.Services.FeatureFlags/FeatureFlagClient.cs:117 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock src/NuGet.Services.Logging/TelemetryClientWrapper.cs:29 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock src/NuGet.Services.Logging/TelemetryClientWrapper.cs:44 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock src/NuGet.Services.Logging/TelemetryClientWrapper.cs:75 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock src/NuGet.Services.Logging/TelemetryInitializers/TelemetryContextInitializer.cs:43 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock src/NuGetGallery.AppHost.Tools/V3CatalogIndexAvailable.cs:33 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock src/NuGetGallery.Services/Providers/RuntimeServiceProvider.cs:102 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock src/NuGetGallery.Services/Telemetry/QuietLog.cs:55 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock src/NuGetGallery.Services/Telemetry/TelemetryClientWrapper.cs:42 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock src/NuGetGallery.Services/Telemetry/TelemetryClientWrapper.cs:54 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock src/NuGetGallery.Services/Telemetry/TelemetryClientWrapper.cs:67 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock src/NuGetGallery.Services/Telemetry/TelemetryClientWrapper.cs:93 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock src/NuGetGallery.Services/Telemetry/TelemetryClientWrapper.cs:116 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock src/NuGetGallery/App_Start/OwinStartup.cs:214 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock src/NuGetGallery/App_Start/OwinStartup.cs:248 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock src/NuGetGallery/Extensions/HttpRequestExtensions.cs:50 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock src/NuGetGallery/Extensions/HttpRequestExtensions.cs:66 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock src/NuGetGallery/Infrastructure/CookieTempDataProvider.cs:92 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock src/NuGetGallery/Infrastructure/Mail/BackgroundMarkdownMessageService.cs:56 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock src/NuGetGallery/Services/PackageDeleteService.cs:680 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock src/Validation.Common.Job/TempFiles/TempFile.cs:66 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC2 · Forms & labels · <input> without a programmatic label · ×13
  • <input> without a programmatic label src/NuGetGallery/Areas/Admin/Views/ChangeUsername/Index.cshtml:15 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label src/NuGetGallery/Areas/Admin/Views/ChangeUsername/Index.cshtml:63 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label src/NuGetGallery/Areas/Admin/Views/ChangeUsername/Index.cshtml:85 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label src/NuGetGallery/Areas/Admin/Views/ChangeUsername/Index.cshtml:86 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label src/NuGetGallery/Areas/Admin/Views/PasswordAuthentication/Index.cshtml:32 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label src/NuGetGallery/Areas/Admin/Views/ReservedNamespace/Index.cshtml:18 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label src/NuGetGallery/Areas/Admin/Views/ReservedNamespace/Index.cshtml:84 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label src/NuGetGallery/Areas/Admin/Views/ReservedNamespace/Index.cshtml:103 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label src/NuGetGallery/Areas/Admin/Views/ReservedNamespace/Index.cshtml:152 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label src/NuGetGallery/Areas/Admin/Views/SecurityPolicy/Index.cshtml:37 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label src/NuGetGallery/Areas/Admin/Views/SecurityPolicy/Index.cshtml:46 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label src/NuGetGallery/Areas/Admin/Views/SiteAdmins/Index.cshtml:37 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label src/NuGetGallery/Scripts/gallery/jquery-3.4.1.js:2747 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
AC2 · Forms & labels · <label> that labels no control · ×10
  • <label> that labels no control src/NuGetGallery/Areas/Admin/Views/DeleteAccount/_DeleteUserAccountForm.cshtml:18 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control src/NuGetGallery/Areas/Admin/Views/Features/_AddFlight.cshtml:26 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control src/NuGetGallery/Areas/Admin/Views/Features/_AddFlight.cshtml:35 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control src/NuGetGallery/Areas/Admin/Views/Features/_EditFlight.cshtml:42 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control src/NuGetGallery/Areas/Admin/Views/Features/_EditFlight.cshtml:51 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control REDACTED:42 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control REDACTED:48 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control REDACTED:54 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control REDACTED:60 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control REDACTED:78 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
AC2 · Forms & labels · <textarea> without a programmatic label · ×8
  • <textarea> without a programmatic label src/NuGetGallery/Areas/Admin/Views/ApiKeys/Index.cshtml:15 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <textarea> without a programmatic label src/NuGetGallery/Areas/Admin/Views/DeleteAccount/Index.cshtml:10 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <textarea> without a programmatic label src/NuGetGallery/Areas/Admin/Views/FederatedCredentials/Index.cshtml:44 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <textarea> without a programmatic label src/NuGetGallery/Areas/Admin/Views/PasswordAuthentication/Index.cshtml:40 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <textarea> without a programmatic label src/NuGetGallery/Areas/Admin/Views/SecurityPolicy/Index.cshtml:17 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <textarea> without a programmatic label src/NuGetGallery/Areas/Admin/Views/Shared/LockIndex.cshtml:11 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <textarea> without a programmatic label src/NuGetGallery/Areas/Admin/Views/UpdateListed/Index.cshtml:9 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <textarea> without a programmatic label src/NuGetGallery/Areas/Admin/Views/Validation/Index.cshtml:55 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
AX3 · Project dependency cycles · Namespace dependency cycle · ×7
  • Namespace dependency cycle REDACTED:26 — The namespaces NuGetGallery ↔ NuGetGallery.Areas.Admin ↔ NuGetGallery.Areas.Admin.Models ↔ NuGetGallery.Areas.Admin.Services ↔ NuGetGallery.Areas.Admin.ViewModels ↔ NuGetGallery.Auditing ↔ NuGetGallery.Authentication ↔ NuGetGallery.Authentication.Providers ↔ NuGetGallery.Configuration ↔ NuGetGallery.Diagnostics ↔ NuGetGallery.Features ↔ NuGetGallery.Helpers ↔ NuGetGallery.Infrastructure ↔ NuGetGallery.Infrastructure.Authentication ↔ NuGetGallery.Infrastructure.Lucene ↔ NuGetGallery.Infrastructure.Search ↔ NuGetGallery.Login ↔ NuGetGallery.Security ↔ NuGetGallery.Services ↔ NuGetGallery.Services.Authentication depend on each other. The lightest dependency in the cycle is NuGetGallery → NuGetGallery.Areas.Admin.Models (NuGetGallery.PackagesController → NuGetGallery.Areas.Admin.Models.Issue, 1 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface.
  • Namespace dependency cycle src/Gallery.CredentialExpiration/Models/CredentialExpirationJobMetadata.cs:7 — The namespaces Gallery.CredentialExpiration ↔ Gallery.CredentialExpiration.Models depend on each other. The lightest dependency in the cycle is Gallery.CredentialExpiration.Models → Gallery.CredentialExpiration (Gallery.CredentialExpiration.Models.CredentialExpirationJobMetadata → Gallery.CredentialExpiration.JobRunTimeCursor, 1 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface.
  • Namespace dependency cycle src/Catalog/IPackageCatalogItemCreator.cs:7 — The namespaces NuGet.Services.Metadata.Catalog ↔ NuGet.Services.Metadata.Catalog.Helpers depend on each other. The lightest dependency in the cycle is NuGet.Services.Metadata.Catalog → NuGet.Services.Metadata.Catalog.Helpers (NuGet.Services.Metadata.Catalog.IPackageCatalogItemCreator → NuGet.Services.Metadata.Catalog.Helpers.FeedPackageDetails, 5 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface.
  • Namespace dependency cycle src/PackageLagMonitor/Job.cs:16 — The namespaces NuGet.Jobs.Monitoring.PackageLag ↔ NuGet.Jobs.Monitoring.PackageLag.Telemetry depend on each other. The lightest dependency in the cycle is NuGet.Jobs.Monitoring.PackageLag → NuGet.Jobs.Monitoring.PackageLag.Telemetry (NuGet.Jobs.Monitoring.PackageLag.Job → NuGet.Jobs.Monitoring.PackageLag.Telemetry.IPackageLagTelemetryService, 2 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface.
  • Namespace dependency cycle src/NuGet.Services.AzureSearch/DownloadTransferrer.cs:9 — The namespaces NuGet.Services.AzureSearch ↔ NuGet.Services.AzureSearch.Auxiliary2AzureSearch ↔ NuGet.Services.AzureSearch.AuxiliaryFiles ↔ NuGet.Services.AzureSearch.SearchService depend on each other. The lightest dependency in the cycle is NuGet.Services.AzureSearch → NuGet.Services.AzureSearch.Auxiliary2AzureSearch (NuGet.Services.AzureSearch.DownloadTransferrer → NuGet.Services.AzureSearch.Auxiliary2AzureSearch.IDataSetComparer, 1 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface.
  • Namespace dependency cycle src/NuGet.Services.GitHub/Configuration/ConfigurationExtensions.cs:11 — The namespaces NuGet.Services.GitHub.Authentication ↔ NuGet.Services.GitHub.Configuration depend on each other. The lightest dependency in the cycle is NuGet.Services.GitHub.Configuration → NuGet.Services.GitHub.Authentication (NuGet.Services.GitHub.Configuration.ConfigurationExtensions → NuGet.Services.GitHub.Authentication.IGitHubAuthProvider, 1 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface.
  • Namespace dependency cycle src/StatusAggregator/StatusAggregator.cs:9 — The namespaces StatusAggregator ↔ StatusAggregator.Collector ↔ StatusAggregator.Export ↔ StatusAggregator.Factory ↔ StatusAggregator.Messages ↔ StatusAggregator.Parse ↔ StatusAggregator.Update depend on each other. The lightest dependency in the cycle is StatusAggregator → StatusAggregator.Export (StatusAggregator.StatusAggregator → StatusAggregator.Export.IStatusExporter, 1 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface.
AC2 · Forms & labels · <select> without a programmatic label · ×6
  • <select> without a programmatic label src/NuGetGallery/Areas/Admin/Views/SupportRequest/Index.cshtml:94 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <select> without a programmatic label src/NuGetGallery/Areas/Admin/Views/SupportRequest/Index.cshtml:103 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <select> without a programmatic label src/NuGetGallery/Areas/Admin/Views/SupportRequest/Index.cshtml:113 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <select> without a programmatic label src/NuGetGallery/Scripts/gallery/jquery-3.4.1.js:1270 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <select> without a programmatic label src/NuGetGallery/Scripts/gallery/jquery-3.4.1.js:1309 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <select> without a programmatic label src/NuGetGallery/Scripts/gallery/jquery-3.4.1.js:4727 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
AC5 · ARIA correctness · aria-expanded on a <div> with no role to carry it · ×6
  • aria-expanded on a <div> with no role to carry it src/NuGetGallery/Views/Organizations/_OrganizationMembersListForDeletedAccount.cshtml:5 — A plain <div> has the implicit role "generic", which supports no ARIA states, so this aria-expanded is dropped and assistive tech is never told the state at all. Put aria-expanded on the element that owns the behaviour (the button or control the user operates), or give this <div> a role that supports aria-expanded.
  • aria-expanded on a <div> with no role to carry it src/NuGetGallery/Views/Packages/DeleteSymbols.cshtml:49 — A plain <div> has the implicit role "generic", which supports no ARIA states, so this aria-expanded is dropped and assistive tech is never told the state at all. Put aria-expanded on the element that owns the behaviour (the button or control the user operates), or give this <div> a role that supports aria-expanded.
  • aria-expanded on a <div> with no role to carry it src/NuGetGallery/Views/Shared/_AccountCertificates.cshtml:80 — A plain <div> has the implicit role "generic", which supports no ARIA states, so this aria-expanded is dropped and assistive tech is never told the state at all. Put aria-expanded on the element that owns the behaviour (the button or control the user operates), or give this <div> a role that supports aria-expanded.
  • aria-expanded on a <div> with no role to carry it src/NuGetGallery/Views/Shared/_AccountCertificates.cshtml:129 — A plain <div> has the implicit role "generic", which supports no ARIA states, so this aria-expanded is dropped and assistive tech is never told the state at all. Put aria-expanded on the element that owns the behaviour (the button or control the user operates), or give this <div> a role that supports aria-expanded.
  • aria-expanded on a <div> with no role to carry it src/NuGetGallery/Views/Users/_UserOrganizationsListForDeletedAccount.cshtml:12 — A plain <div> has the implicit role "generic", which supports no ARIA states, so this aria-expanded is dropped and assistive tech is never told the state at all. Put aria-expanded on the element that owns the behaviour (the button or control the user operates), or give this <div> a role that supports aria-expanded.
  • aria-expanded on a <div> with no role to carry it src/NuGetGallery/Views/Users/_UserPackagesListForDeletedAccount.cshtml:17 — A plain <div> has the implicit role "generic", which supports no ARIA states, so this aria-expanded is dropped and assistive tech is never told the state at all. Put aria-expanded on the element that owns the behaviour (the button or control the user operates), or give this <div> a role that supports aria-expanded.
D30 · Dependency Vulnerabilities · High CVE · ×6
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC1 · Text alternatives · <img> without a text alternative · ×3
  • <img> without a text alternative src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:7816 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:7819 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative src/NuGetGallery/Views/Packages/_ManageOwners.cshtml:22 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
AX1 · Captive dependencies · Captive dependency · ×3
  • Captive dependency: singleton FeatureFlagCacheService captures transient IFeatureFlagTelemetryService src/NuGet.Services.FeatureFlags/FeatureFlagCacheService.cs:31 — `FeatureFlagCacheService` is registered as a SINGLETON but its constructor takes `IFeatureFlagTelemetryService telemetryService`, which is registered as Transient. The singleton captures one instance of the transient dependency forever — defeating its lifetime (a per-request DbContext shared across all requests is a classic data-corruption/threading bug). Make the singleton resolve `IFeatureFlagTelemetryService` per-use (inject `IServiceScopeFactory` or a factory func), or align the lifetimes.
  • Captive dependency: singleton SearchIndexClientWrapper captures transient SearchIndexClient src/NuGet.Services.AzureSearch/Wrappers/SearchIndexClientWrapper.cs:15 — `SearchIndexClientWrapper` is registered as a SINGLETON but its constructor takes `SearchIndexClient inner`, which is registered as Transient. The singleton captures one instance of the transient dependency forever — defeating its lifetime (a per-request DbContext shared across all requests is a classic data-corruption/threading bug). Make the singleton resolve `SearchIndexClient` per-use (inject `IServiceScopeFactory` or a factory func), or align the lifetimes.
  • Captive dependency: singleton AuxiliaryDataCache captures transient IAzureSearchTelemetryService src/NuGet.Services.AzureSearch/SearchService/AuxiliaryDataCache.cs:30 — `AuxiliaryDataCache` is registered as a SINGLETON but its constructor takes `IAzureSearchTelemetryService telemetryService`, which is registered as Transient. The singleton captures one instance of the transient dependency forever — defeating its lifetime (a per-request DbContext shared across all requests is a classic data-corruption/threading bug). Make the singleton resolve `IAzureSearchTelemetryService` per-use (inject `IServiceScopeFactory` or a factory func), or align the lifetimes.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC2 · Forms & labels · Link with no accessible name · ×2
  • Link with no accessible name src/NuGetGallery/Scripts/gallery/jquery-3.4.1.js:1308 — A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
  • Link with no accessible name src/NuGetGallery/Scripts/gallery/jquery-3.4.1.js:2734 — A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
AC3 · Page structure · Document <title> is empty · ×2
  • Document <title> is empty src/NuGet.SupportRequests.Notifications/Templates/OnCallSummary.html:1 — An empty <title> gives no page name in the tab, history or screen-reader page list. Put descriptive text in the <title>.
  • Document <title> is empty src/NuGet.SupportRequests.Notifications/Templates/WeeklySummary.html:1 — An empty <title> gives no page name in the tab, history or screen-reader page list. Put descriptive text in the <title>.
AC3 · Page structure · <html> without a lang · ×1
  • <html> without a lang src/NuGetCDNRedirect/Views/Shared/Error.cshtml:2 — The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
D13 · REDACTED Scanning · Leaked secret · ×1
  • REDACTED
D17 · Explicit Debt · FileScopedPragmaDisable · ×1
  • FileScopedPragmaDisable src/NuGetGallery/Areas/Admin/Controllers/AdminApiController.cs:4 — #pragma warning disable CA3147 // No need to validate Antiforgery Token with API request — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
D28 · Secrets (history) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D35 · Change Coupling · Boundary-crossing change coupling · ×1
  • Boundary-crossing change coupling: FakeFeatureFlagService.cs ↔ REDACTED src/GitHubVulnerabilities2Db/Fakes/FakeFeatureFlagService.cs:1 — `src/GitHubVulnerabilities2Db/Fakes/FakeFeatureFlagService.cs` (context GitHubVulnerabilities2Db) and `REDACTED` (context NuGetGallery) sit in DIFFERENT parts of the tree yet change together 50% of the time (19 of the 38 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 19 shared commits counted here, the most recent 3 are `2f271fb8` Only allow the package Id with alphanumeric characters, periods, hyph…; `98d7c35b` Feature flag to show reduced version list on package details page (#1…; `69bb54bc` Revert "[HotFix] Temporary limit to ascii only (#10409)" (#10485) — run `git show` on any of them.
S1 · Web-Security Posture · Password hashing without a KDF · ×1
  • Password hashing without a KDF src/NuGetGallery.Services/Authentication/ApiKeyV3.cs:11 — Identifier 'IdAndPasswordHashedLength' looks like a password-hash field/property, but no KDF (PBKDF2 / Argon2 / BCrypt / PasswordHasher) was found anywhere in the source — so passwords aren't protected by a salted key-derivation function (whether a fast/plain hash, or a client-hashed value stored and compared verbatim). Password storage needs a salted KDF and a constant-time compare.
S1 · Web-Security Posture · TLS certificate validation disabled · ×1
  • TLS certificate validation disabled src/GalleryTools/Commands/GalleryOperations.cs:141 — `ServerCertificateCustomValidationCallback` is assigned a callback that returns `true` unconditionally, so every TLS peer certificate is accepted — including one an attacker presents. Chain, expiry, revocation and hostname are all skipped, so an attacker on the network path can present any certificate and read or rewrite the traffic — the connection is encrypted to the attacker, not to the intended host. Delete the override and let the platform validate. If a specific self-signed or internally-issued certificate genuinely has to be trusted, pin THAT one — compare the presented certificate's public key or thumbprint against the expected value and return `false` for everything else — and scope it to the single handler that talks to that host rather than to the whole process. If the override exists only to get past a development certificate, gate it on a build configuration or an explicit opt-in setting so it cannot ship.
Serious — 1538 finding(s)
D29 · Static Analysis (SAST) · REDACTED · ×52
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 27 more in this group — see findings.md.
GD1 · Unfinished & placeholder code · Unfinished stub · ×40
  • Unfinished stub — throws NotImplementedException src/NuGetGallery/App_Start/GalleryMachineKeyConfigurationProvider.cs:64 — A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/NuGetGallery/Infrastructure/Mail/Messages/ReportPackageMessageBase.cs:45 — A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/NuGetGallery/Infrastructure/Mail/Messages/ReportPackageMessageBase.cs:50 — A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/NuGetGallery/Services/FileSystemFileStorageService.cs:205 — A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/NuGetGallery/Services/FileSystemFileStorageService.cs:261 — A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/NuGetGallery/Services/FileSystemFileStorageService.cs:267 — A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/NuGetGallery/Services/FileSystemFileStorageService.cs:279 — A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/NuGetGallery/Services/FileSystemFileStorageService.cs:285 — A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/VerifyMicrosoftPackage/Fakes/FakeAuditingService.cs:12 — A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/VerifyMicrosoftPackage/Fakes/FakeContentObjectService.cs:14 — A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/VerifyMicrosoftPackage/Fakes/FakeContentObjectService.cs:16 — A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/VerifyMicrosoftPackage/Fakes/FakeContentObjectService.cs:18 — A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/VerifyMicrosoftPackage/Fakes/FakeContentObjectService.cs:20 — A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/VerifyMicrosoftPackage/Fakes/FakeContentObjectService.cs:22 — A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/VerifyMicrosoftPackage/Fakes/FakeContentObjectService.cs:24 — A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/VerifyMicrosoftPackage/Fakes/FakeContentObjectService.cs:26 — A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/VerifyMicrosoftPackage/Fakes/FakeContentObjectService.cs:28 — A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/VerifyMicrosoftPackage/Fakes/FakeContentObjectService.cs:30 — A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/VerifyMicrosoftPackage/Fakes/FakeContentObjectService.cs:32 — A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/VerifyMicrosoftPackage/Fakes/FakeContentObjectService.cs:34 — A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/VerifyMicrosoftPackage/Fakes/FakeEntitiesContext.cs:14 — A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/VerifyMicrosoftPackage/Fakes/FakeEntitiesContext.cs:15 — A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/VerifyMicrosoftPackage/Fakes/FakeEntitiesContext.cs:16 — A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/VerifyMicrosoftPackage/Fakes/FakeEntitiesContext.cs:17 — A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/VerifyMicrosoftPackage/Fakes/FakeEntitiesContext.cs:18 — A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • + 15 more in this group — see findings.md.
X20 · Mistyped argument guard · Argument guard throws the exception its own condition disproves · ×40
  • Argument guard throws the exception its own condition disproves src/NuGetGallery/Services/PackageMetadataValidationService.cs:253 — The guard on line 251 rejects `packageId` and line 253 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(packageId)` is true of a value that is NOT null: it is satisfied by an EMPTY `packageId`, and on that path `packageId` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition.
  • Argument guard throws the exception its own condition disproves src/NuGetGallery/Queries/AutocompleteDatabasePackageVersionsQuery.cs:30 — The guard on line 28 rejects `id` and line 30 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(id)` is true of a value that is NOT null: it is satisfied by an EMPTY `id`, and on that path `id` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition.
  • Argument guard throws the exception its own condition disproves src/NuGetGallery/Queries/AutocompleteServicePackageVersionsQuery.cs:28 — The guard on line 26 rejects `id` and line 28 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(id)` is true of a value that is NOT null: it is satisfied by an EMPTY `id`, and on that path `id` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition.
  • Argument guard throws the exception its own condition disproves src/NuGetGallery/UrlHelperExtensions.cs:1245 — The guard on line 1243 rejects `owner` and line 1245 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(owner)` is true of a value that is NOT null: it is satisfied by an EMPTY `owner`, and on that path `owner` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition.
  • Argument guard throws the exception its own condition disproves src/NuGetGallery/UrlHelperExtensions.cs:1250 — The guard on line 1248 rejects `groupId` and line 1250 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(groupId)` is true of a value that is NOT null: it is satisfied by an EMPTY `groupId`, and on that path `groupId` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition.
  • Argument guard throws the exception its own condition disproves src/NuGetGallery/UrlHelperExtensions.cs:1403 — The guard on line 1401 rejects `id` and line 1403 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(id)` is true of a value that is NOT null: it is satisfied by an EMPTY `id`, and on that path `id` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition.
  • Argument guard throws the exception its own condition disproves src/NuGetGallery/UrlHelperExtensions.cs:1408 — The guard on line 1406 rejects `version` and line 1408 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(version)` is true of a value that is NOT null: it is satisfied by an EMPTY `version`, and on that path `version` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition.
  • Argument guard throws the exception its own condition disproves src/NuGetGallery/UrlHelperExtensions.cs:1441 — The guard on line 1439 rejects `id` and line 1441 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(id)` is true of a value that is NOT null: it is satisfied by an EMPTY `id`, and on that path `id` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition.
  • Argument guard throws the exception its own condition disproves src/NuGetGallery/UrlHelperExtensions.cs:1446 — The guard on line 1444 rejects `version` and line 1446 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(version)` is true of a value that is NOT null: it is satisfied by an EMPTY `version`, and on that path `version` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition.
  • Argument guard throws the exception its own condition disproves src/NuGetGallery/ViewModels/OrganizationMemberViewModel.cs:34 — The guard on line 32 rejects `gravatarUrl` and line 34 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrEmpty(gravatarUrl)` is true of a value that is NOT null: it is satisfied by an EMPTY `gravatarUrl`, and on that path `gravatarUrl` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition.
  • Argument guard throws the exception its own condition disproves src/NuGetGallery/Services/CloudDownloadCountService.cs:50 — The guard on line 48 rejects `id` and line 50 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrEmpty(id)` is true of a value that is NOT null: it is satisfied by an EMPTY `id`, and on that path `id` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition.
  • Argument guard throws the exception its own condition disproves src/NuGetGallery/Services/CloudDownloadCountService.cs:69 — The guard on line 67 rejects `id` and line 69 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrEmpty(id)` is true of a value that is NOT null: it is satisfied by an EMPTY `id`, and on that path `id` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition.
  • Argument guard throws the exception its own condition disproves src/NuGetGallery/Services/CloudDownloadCountService.cs:74 — The guard on line 72 rejects `version` and line 74 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrEmpty(version)` is true of a value that is NOT null: it is satisfied by an EMPTY `version`, and on that path `version` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition.
  • Argument guard throws the exception its own condition disproves src/NuGetGallery/Services/FileSystemFileStorageService.cs:32 — The guard on line 30 rejects `folderName` and line 32 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(folderName)` is true of a value that is NOT null: it is satisfied by an EMPTY `folderName`, and on that path `folderName` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition.
  • Argument guard throws the exception its own condition disproves src/NuGetGallery/Services/FileSystemFileStorageService.cs:37 — The guard on line 35 rejects `fileName` and line 37 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(fileName)` is true of a value that is NOT null: it is satisfied by an EMPTY `fileName`, and on that path `fileName` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition.
  • Argument guard throws the exception its own condition disproves src/NuGetGallery/Services/FileSystemFileStorageService.cs:58 — The guard on line 56 rejects `folderName` and line 58 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(folderName)` is true of a value that is NOT null: it is satisfied by an EMPTY `folderName`, and on that path `folderName` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition.
  • Argument guard throws the exception its own condition disproves src/NuGetGallery/Services/FileSystemFileStorageService.cs:63 — The guard on line 61 rejects `fileName` and line 63 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(fileName)` is true of a value that is NOT null: it is satisfied by an EMPTY `fileName`, and on that path `fileName` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition.
  • Argument guard throws the exception its own condition disproves src/NuGetGallery/Services/FileSystemFileStorageService.cs:79 — The guard on line 77 rejects `folderName` and line 79 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(folderName)` is true of a value that is NOT null: it is satisfied by an EMPTY `folderName`, and on that path `folderName` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition.
  • Argument guard throws the exception its own condition disproves src/NuGetGallery/Services/FileSystemFileStorageService.cs:84 — The guard on line 82 rejects `fileName` and line 84 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(fileName)` is true of a value that is NOT null: it is satisfied by an EMPTY `fileName`, and on that path `fileName` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition.
  • Argument guard throws the exception its own condition disproves src/NuGetGallery/Services/FileSystemFileStorageService.cs:97 — The guard on line 95 rejects `folderName` and line 97 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(folderName)` is true of a value that is NOT null: it is satisfied by an EMPTY `folderName`, and on that path `folderName` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition.
  • Argument guard throws the exception its own condition disproves src/NuGetGallery/Services/FileSystemFileStorageService.cs:102 — The guard on line 100 rejects `fileName` and line 102 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(fileName)` is true of a value that is NOT null: it is satisfied by an EMPTY `fileName`, and on that path `fileName` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition.
  • Argument guard throws the exception its own condition disproves src/NuGetGallery/Services/FileSystemFileStorageService.cs:115 — The guard on line 113 rejects `folderName` and line 115 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(folderName)` is true of a value that is NOT null: it is satisfied by an EMPTY `folderName`, and on that path `folderName` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition.
  • Argument guard throws the exception its own condition disproves src/NuGetGallery/Services/FileSystemFileStorageService.cs:120 — The guard on line 118 rejects `fileName` and line 120 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(fileName)` is true of a value that is NOT null: it is satisfied by an EMPTY `fileName`, and on that path `fileName` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition.
  • Argument guard throws the exception its own condition disproves src/NuGetGallery/Services/FileSystemFileStorageService.cs:134 — The guard on line 132 rejects `folderName` and line 134 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(folderName)` is true of a value that is NOT null: it is satisfied by an EMPTY `folderName`, and on that path `folderName` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition.
  • Argument guard throws the exception its own condition disproves src/NuGetGallery/Services/FileSystemFileStorageService.cs:139 — The guard on line 137 rejects `fileName` and line 139 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrWhiteSpace(fileName)` is true of a value that is NOT null: it is satisfied by an EMPTY `fileName`, and on that path `fileName` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition.
  • + 15 more in this group — see findings.md.
X24 · Document value interpolated into markup unescaped · Untrusted text written into markup unescaped · ×40
  • Untrusted text written into markup unescaped src/NuGet.Services.Messaging/ServiceBusMessageSerializer.cs:41 — `message.HtmlBody` is text this program did not author, and it is written into the text of an element through an HTML e-mail body with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped src/NuGetGallery.Services/Storage/ContentService.cs:158 — `content.Trim()` is text this program did not author, and it is written into the text of an element through `new HtmlString(…)` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped src/NuGetGallery/Helpers/AccordeonHelper.cs:43 — `ContentDropDownId` is text this program did not author, and it is written into a quoted attribute value through `new HtmlString(…)` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped src/NuGetGallery/Helpers/AccordeonHelper.cs:45 — `(Expanded ? closedTitle : expandedTitle)` is text this program did not author, and it is written into a quoted attribute value through `new HtmlString(…)` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped src/NuGetGallery/Helpers/AccordeonHelper.cs:47 — `CollapseButtonId` is text this program did not author, and it is written into a quoted attribute value through `new HtmlString(…)` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped src/NuGetGallery/Helpers/AccordeonHelper.cs:50 — `(Expanded ? expandedTitle : closedTitle)` is text this program did not author, and it is written into the text of an element through `new HtmlString(…)` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped src/NuGetGallery/Helpers/AccordeonHelper.cs:58 — `ContentDropDownId` is text this program did not author, and it is written into a quoted attribute value through `new HtmlString(…)` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped src/NuGetGallery/Helpers/AccordeonHelper.cs:60 — `(Expanded ? closedTitle : expandedTitle)` is text this program did not author, and it is written into a quoted attribute value through `new HtmlString(…)` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped src/NuGetGallery/Helpers/AccordeonHelper.cs:62 — `CollapseButtonId` is text this program did not author, and it is written into a quoted attribute value through `new HtmlString(…)` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped src/NuGetGallery/Helpers/AccordeonHelper.cs:65 — `(Expanded ? expandedTitle : closedTitle)` is text this program did not author, and it is written into the text of an element through `new HtmlString(…)` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped src/NuGetGallery/Helpers/CSPHelper.cs:24 — `cspNonce` is text this program did not author, and it is written into the text of an element through `new HtmlString(…)` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped REDACTED:82 — `url.Avatar(username, imageSize)` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through `new HtmlString(…)` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path.
  • Untrusted text written into markup unescaped REDACTED:86 — `username` is text this program did not author, and it is written into a quoted attribute value through `new HtmlString(…)` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped REDACTED:87 — `username` is text this program did not author, and it is written into a quoted attribute value through `new HtmlString(…)` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped REDACTED:112 — `gravatarHtml.ToHtmlString().Replace(UnsecureGravatarUrl, SecureGravatarUrl)` is text this program did not author, and it is written into the text of an element through `new HtmlString(…)` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped src/NuGetGallery/Helpers/HtmlExtensions.cs:161 — `output.ToString()` is text this program did not author, and it is written into the text of an element through `Html.Raw` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped src/NuGetGallery/Helpers/HtmlExtensions.cs:207 — `json` is text this program did not author, and it is written into the text of an element through `Html.Raw` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped src/NuGetGallery/Infrastructure/SubtextAttribute.cs:34 — `Subtext` is text this program did not author, and it is written into the text of an element through `new HtmlString(…)` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped src/NuGetGallery/Views/Authentication/SignIn.cshtml:83 — `Strings.SigninAssistance_InvalidUser` is text this program did not author, and it is written into the text of an element through Razor's `Html.Raw` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped src/NuGetGallery/Views/Organizations/Add.cshtml:82 — `@Url.Absolute("~/Content/gallery/img/default-package-icon-256x256.png")` is text this program did not author, and it is written into the text of an element through Razor's `Html.Raw` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped src/NuGetGallery/Views/Organizations/Add.cshtml:83 — `@GalleryConstants.EmailValidationRegex` is text this program did not author, and it is written into the text of an element through Razor's `Html.Raw` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped REDACTED:390 — `packageManager.AlertMessage` is text this program did not author, and it is written into the text of an element through Razor's `Html.Raw` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped REDACTED:396 — `packageManager.AlertMessage` is text this program did not author, and it is written into the text of an element through Razor's `Html.Raw` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped REDACTED:851 — `Model.ReadMeHtml` is text this program did not author, and it is written into the text of an element through Razor's `Html.Raw` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped REDACTED:83 — `Model.LicenseFileContentsHtml.Content` is text this program did not author, and it is written into the text of an element through Razor's `Html.Raw` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • + 15 more in this group — see findings.md.
X2 · Cancellation propagation · Async method without CancellationToken · ×39
  • Async method without CancellationToken: LockPackageAsync src/NuGetGallery/Areas/Admin/Controllers/AdminApiController.cs:126 — No CancellationToken parameter — this work can't be stopped early once started.
  • Async method without CancellationToken: LockUserAsync src/NuGetGallery/Areas/Admin/Controllers/AdminApiController.cs:187 — No CancellationToken parameter — this work can't be stopped early once started.
  • Async method without CancellationToken: SoftDeletePackageAsync src/NuGetGallery/Areas/Admin/Controllers/AdminApiController.cs:248 — No CancellationToken parameter — this work can't be stopped early once started.
  • Async method without CancellationToken: RevalidatePackageAsync src/NuGetGallery/Areas/Admin/Controllers/AdminApiController.cs:488 — No CancellationToken parameter — this work can't be stopped early once started.
  • Async method without CancellationToken: Revoke src/NuGetGallery/Areas/Admin/Controllers/ApiKeysController.cs:106 — No CancellationToken parameter — this work can't be stopped early once started.
  • Async method without CancellationToken: Undo src/NuGetGallery/Areas/Admin/Controllers/DeleteController.cs:68 — No CancellationToken parameter — this work can't be stopped early once started.
  • Async method without CancellationToken: ReflowBulkConfirm src/NuGetGallery/Areas/Admin/Controllers/DeleteController.cs:164 — No CancellationToken parameter — this work can't be stopped early once started.
  • Async method without CancellationToken: Index src/NuGetGallery/Areas/Admin/Controllers/FeaturesController.cs:37 — No CancellationToken parameter — this work can't be stopped early once started.
  • Async method without CancellationToken: MergeChangesAndTrySave src/NuGetGallery/Areas/Admin/Controllers/FeaturesController.cs:96 — No CancellationToken parameter — this work can't be stopped early once started.
  • Async method without CancellationToken: TrySaveFlags src/NuGetGallery/Areas/Admin/Controllers/FeaturesController.cs:190 — No CancellationToken parameter — this work can't be stopped early once started.
  • Async method without CancellationToken: GetModel src/NuGetGallery/Areas/Admin/Controllers/FeaturesController.cs:223 — No CancellationToken parameter — this work can't be stopped early once started.
  • Async method without CancellationToken: ReflowPackages src/NuGetGallery/Areas/Admin/Controllers/CorrectIsLatestController.cs:67 — No CancellationToken parameter — this work can't be stopped early once started.
  • Async method without CancellationToken: DeletePolicy src/NuGetGallery/Areas/Admin/Controllers/FederatedCredentialsController.cs:165 — No CancellationToken parameter — this work can't be stopped early once started.
  • Async method without CancellationToken: CreatePolicy src/NuGetGallery/Areas/Admin/Controllers/FederatedCredentialsController.cs:184 — No CancellationToken parameter — this work can't be stopped early once started.
  • Async method without CancellationToken: Update src/NuGetGallery/Areas/Admin/Controllers/LockUserController.cs:54 — No CancellationToken parameter — this work can't be stopped early once started.
  • Async method without CancellationToken: Update src/NuGetGallery/Areas/Admin/Controllers/LockPackageController.cs:54 — No CancellationToken parameter — this work can't be stopped early once started.
  • Async method without CancellationToken: AddUrl src/NuGetGallery/Areas/Admin/Controllers/PackageSponsorshipController.cs:65 — No CancellationToken parameter — this work can't be stopped early once started.
  • Async method without CancellationToken: RemoveUrl src/NuGetGallery/Areas/Admin/Controllers/PackageSponsorshipController.cs:89 — No CancellationToken parameter — this work can't be stopped early once started.
  • Async method without CancellationToken: Index src/NuGetGallery/Areas/Admin/Controllers/PasswordAuthenticationController.cs:30 — No CancellationToken parameter — this work can't be stopped early once started.
  • Async method without CancellationToken: AddEmailAddress src/NuGetGallery/Areas/Admin/Controllers/PasswordAuthenticationController.cs:81 — No CancellationToken parameter — this work can't be stopped early once started.
  • Async method without CancellationToken: RemoveEmailAddress src/NuGetGallery/Areas/Admin/Controllers/PasswordAuthenticationController.cs:88 — No CancellationToken parameter — this work can't be stopped early once started.
  • Async method without CancellationToken: AddOrRemoveEmailAddress src/NuGetGallery/Areas/Admin/Controllers/PasswordAuthenticationController.cs:92 — No CancellationToken parameter — this work can't be stopped early once started.
  • Async method without CancellationToken: GetContentIdBeforeChange src/NuGetGallery/Areas/Admin/Controllers/PasswordAuthenticationController.cs:120 — No CancellationToken parameter — this work can't be stopped early once started.
  • Async method without CancellationToken: TrySaveEmailAddress src/NuGetGallery/Areas/Admin/Controllers/PasswordAuthenticationController.cs:126 — No CancellationToken parameter — this work can't be stopped early once started.
  • Async method without CancellationToken: ExecutePopularityTransfer src/NuGetGallery/Areas/Admin/Controllers/PopularityTransferController.cs:158 — No CancellationToken parameter — this work can't be stopped early once started.
  • + 14 more in this group — see findings.md.
IC1 · Incompleteness & stubs · Unfinished stub · ×38
  • Unfinished stub — throws NotImplementedException src/AccountDeleter/AccountDeleteUserService.cs:24 — `AddMemberAsync` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/AccountDeleter/AccountDeleteUserService.cs:29 — `AddMembershipRequestAsync` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/AccountDeleter/AccountDeleteUserService.cs:34 — `AddOrganizationAsync` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/AccountDeleter/AccountDeleteUserService.cs:39 — `CancelChangeEmailAddress` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/AccountDeleter/AccountDeleteUserService.cs:44 — `CancelMembershipRequestAsync` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/AccountDeleter/AccountDeleteUserService.cs:49 — `CancelTransformUserToOrganizationRequest` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/AccountDeleter/AccountDeleteUserService.cs:54 — `CanTransformUserToOrganization` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/AccountDeleter/AccountDeleteUserService.cs:59 — `CanTransformUserToOrganization` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/AccountDeleter/AccountDeleteUserService.cs:64 — `ChangeEmailAddress` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/AccountDeleter/AccountDeleteUserService.cs:69 — `ChangeEmailSubscriptionAsync` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/AccountDeleter/AccountDeleteUserService.cs:74 — `ChangeMultiFactorAuthentication` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/AccountDeleter/AccountDeleteUserService.cs:79 — `ConfirmEmailAddress` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/AccountDeleter/AccountDeleteUserService.cs:84 — `DeleteMemberAsync` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/AccountDeleter/AccountDeleteUserService.cs:89 — `FindAllByEmailAddress` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/AccountDeleter/AccountDeleteUserService.cs:94 — `FindByEmailAddress` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/AccountDeleter/AccountDeleteUserService.cs:99 — `FindByKey` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/AccountDeleter/AccountDeleteUserService.cs:104 — `FindByUnconfirmedEmailAddress` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/AccountDeleter/AccountDeleteUserService.cs:121 — `GetEmailAddressesForUserKeysAsync` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/AccountDeleter/AccountDeleteUserService.cs:126 — `RejectMembershipRequestAsync` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/AccountDeleter/AccountDeleteUserService.cs:131 — `RejectTransformUserToOrganizationRequest` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/AccountDeleter/AccountDeleteUserService.cs:136 — `RequestTransformToOrganizationAccount` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/AccountDeleter/AccountDeleteUserService.cs:141 — `TransformUserToOrganization` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/AccountDeleter/AccountDeleteUserService.cs:146 — `UpdateMemberAsync` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/AccountDeleter/AccountDeleteUserService.cs:151 — `GetSiteAdmins` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException src/AccountDeleter/AccountDeleteUserService.cs:156 — `SetIsAdministrator` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
  • + 13 more in this group — see findings.md.
PF3 · Async & latency hygiene · Sync-over-async blocking · ×32
  • Sync-over-async blocking REDACTED:11325 — a busy-wait on `i1` in `squarifyRatio` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking REDACTED:12482 — a busy-wait on `previous` in `range` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking — 29 blocking call(s) on async work (.Wait()/.GetAwaiter().GetResult()) — these waste a thread and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
  • Sync-over-async blocking src/NuGetGallery/App_Start/OwinStartup.cs:128 — `.Wait()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
  • Sync-over-async blocking src/NuGetGallery/App_Start/OwinStartup.cs:163 — `.Wait()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
  • Sync-over-async blocking src/NuGetGallery/App_Start/OwinStartup.cs:246 — `.Wait()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
  • Sync-over-async blocking src/NuGetGallery/Infrastructure/Jobs/NuGetJobCoordinator.cs:55 — `continuation.Wait()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
  • Sync-over-async blocking src/GalleryTools/Commands/ApplyTenantPolicyCommand.cs:39 — `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
  • Sync-over-async blocking src/GalleryTools/Commands/CreateApiKeyCommand.cs:53 — `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
  • Sync-over-async blocking src/GalleryTools/Commands/CreateOrganizationCommand.cs:46 — `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
  • Sync-over-async blocking src/GalleryTools/Commands/CreateUserCommand.cs:47 — `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
  • Sync-over-async blocking src/GalleryTools/Commands/HashCommand.cs:36 — `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
  • Sync-over-async blocking src/GalleryTools/Commands/PushPackageCommand.cs:42 — `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
  • Sync-over-async blocking src/GalleryTools/Commands/ReflowCommand.cs:45 — `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
  • Sync-over-async blocking src/GalleryTools/Commands/ReserveNamespacesCommand.cs:44 — `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
  • Sync-over-async blocking src/GalleryTools/Commands/SeedFunctionalTestsCommand.cs:49 — `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
  • Sync-over-async blocking src/GalleryTools/Commands/SeedSinglePackageCommand.cs:66 — `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
  • Sync-over-async blocking src/AccountDeleter/Job.cs:130 — `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
  • Sync-over-async blocking src/AccountDeleter/Job.cs:167 — `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
  • Sync-over-async blocking src/NuGet.Jobs.Common/JobBase.cs:170 — `.Wait()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
  • Sync-over-async blocking src/Validation.Common.Job/ValidationJobBase.cs:125 — `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
  • Sync-over-async blocking src/Validation.Common.Job/ValidationJobBase.cs:133 — `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
  • Sync-over-async blocking src/NuGet.Services.Configuration/KeyVaultInjectingConfigurationProvider.cs:56 — `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
  • Sync-over-async blocking src/Ng/Jobs/LightningJob.cs:477 — `.Wait()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
  • Sync-over-async blocking src/Stats.AzureCdnLogs.Common/Collect/AzureStatsLogSource.cs:323 — `.Wait()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
  • + 7 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED · ×27
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 2 more in this group — see findings.md.
D17 · Explicit Debt · TodoComment · ×26
  • TodoComment src/ArchivePackages/ArchivePackages.Job.cs:95 — // todo: consider reusing package query for primary and secondary archives — 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 src/Catalog/Dnx/DnxMaker.cs:384 — // TODO: align the mime type determination with Gallery https://github.com/nuget/nugetgallery/issues/7061
  • TodoComment src/Catalog/MemoryCursor.cs:25 — // TODO: Complete member initialization — 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 src/NuGet.Services.Cursor/MemoryCursor.cs:24 — // TODO: Complete member initialization — 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 src/GalleryTools/Commands/BackfillRepositoryMetadataCommand.cs:48 — // TODO: Log error. — 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 src/NuGet.Services.Revalidate/Services/SingletonService.cs:12 — // TODO — 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 src/NuGet.Services.Validation.Orchestrator/BaseValidationMessageHandler.cs:123 — // TODO: Add support for the "generic" validating type.
  • TodoComment src/NuGetGallery.Core/Services/CorePackageService.cs:123 — // TODO: improve setting the latest bit; this is horrible. Trigger maybe? — 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 src/NuGetGallery.Services/Configuration/IFeatureFlagService.cs:397 — // TODO: https://github.com/NuGet/Engineering/issues/6446
  • TodoComment src/NuGetGallery.Services/PackageManagement/PackageHelper.cs:85 — // TODO: Change this to use DataAnnotations — 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 src/NuGetGallery.Services/Permissions/ActionRequiringEntityPermissions.cs:99 — // TODO: Entity Framework performs n+1 SQL queries, where n is the number of organizations the user is in.
  • TodoComment src/NuGetGallery.Services/Security/MicrosoftTeamSubscription.cs:50 — // Todo: — 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 src/NuGetGallery.Services/Security/RequirePackageMetadataComplianceUtility.cs:24 — // TODO: what if there are multiple? — 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 src/NuGetGallery/App_Start/Routes.cs:811 — // TODO : Most of the routes are essentially of the format api/v{x}/*. We should refactor the code to vary them by the version. — 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 src/NuGetGallery/Areas/Admin/Controllers/ValidationController.cs:100 — // TODO: Add generic validation sets.
  • TodoComment src/NuGetGallery/Areas/Admin/Services/ValidationAdminService.cs:87 — // TODO: Add generic validation sets.
  • TodoComment REDACTED:316 — // todo: search hijack should take queryOptions instead of manually parsing query options — 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 REDACTED:487 — // todo: search hijack should take options instead of manually parsing query options — 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 REDACTED:113 — // TODO: add support for URL-based package submission — 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 REDACTED:114 — // TODO: add support for uploading logos and screenshots — 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 REDACTED:115 — // TODO: improve validation summary emphasis — 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 REDACTED:1160 — // TODO Make cache time configurable / slidy
  • TodoComment src/NuGetGallery/WebApi/QueryResult.cs:75 — // todo: if we decide to no longer support projections — 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 src/Validation.Common.Job/Validation/ValidationRequest.cs:8 — // TODO: Finalize this class.
  • TodoComment src/Validation.PackageSigning.ProcessSignature/ISignatureFormatValidator.cs:51 — // TODO: Remove parameter once this is fixed: https://github.com/NuGet/Home/issues/7042
  • + 1 more in this group — see findings.md.
X1 · Async correctness · Sync-over-async (deadlock risk) · ×25
  • Sync-over-async (deadlock risk) src/NuGetGallery/App_Start/OwinStartup.cs:128 — Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
  • Sync-over-async (deadlock risk) src/NuGetGallery/App_Start/OwinStartup.cs:163 — Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
  • Sync-over-async (deadlock risk) src/NuGetGallery/App_Start/OwinStartup.cs:246 — Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
  • Sync-over-async (deadlock risk) src/NuGetGallery/Infrastructure/Jobs/NuGetJobCoordinator.cs:55 — Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
  • Sync-over-async (deadlock risk) src/GalleryTools/Commands/ApplyTenantPolicyCommand.cs:39 — Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
  • Sync-over-async (deadlock risk) src/GalleryTools/Commands/CreateApiKeyCommand.cs:49 — Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
  • Sync-over-async (deadlock risk) src/GalleryTools/Commands/CreateOrganizationCommand.cs:43 — Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
  • Sync-over-async (deadlock risk) src/GalleryTools/Commands/CreateUserCommand.cs:47 — Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
  • Sync-over-async (deadlock risk) src/GalleryTools/Commands/HashCommand.cs:36 — Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
  • Sync-over-async (deadlock risk) src/GalleryTools/Commands/PushPackageCommand.cs:42 — Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
  • Sync-over-async (deadlock risk) src/GalleryTools/Commands/ReflowCommand.cs:45 — Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
  • Sync-over-async (deadlock risk) src/GalleryTools/Commands/ReserveNamespacesCommand.cs:44 — Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
  • Sync-over-async (deadlock risk) src/GalleryTools/Commands/SeedFunctionalTestsCommand.cs:49 — Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
  • Sync-over-async (deadlock risk) src/GalleryTools/Commands/SeedSinglePackageCommand.cs:63 — Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
  • Sync-over-async (deadlock risk) src/AccountDeleter/Job.cs:130 — Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
  • Sync-over-async (deadlock risk) src/AccountDeleter/Job.cs:167 — Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
  • Sync-over-async (deadlock risk) src/NuGet.Jobs.Common/JobBase.cs:170 — Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
  • Sync-over-async (deadlock risk) src/Validation.Common.Job/ValidationJobBase.cs:125 — Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
  • Sync-over-async (deadlock risk) src/Validation.Common.Job/ValidationJobBase.cs:133 — Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
  • Sync-over-async (deadlock risk) src/NuGet.Services.Configuration/KeyVaultInjectingConfigurationProvider.cs:56 — Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
  • Sync-over-async (deadlock risk) src/Ng/Jobs/LightningJob.cs:477 — Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
  • Sync-over-async (deadlock risk) src/Stats.AzureCdnLogs.Common/Collect/AzureStatsLogSource.cs:323 — Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
  • Sync-over-async (deadlock risk) src/Stats.AzureCdnLogs.Common/Collect/TaskExtensions.cs:30 — Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
  • Sync-over-async (deadlock risk) src/NuGet.Services.Validation.Orchestrator/Job.cs:147 — Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
  • Sync-over-async (deadlock risk) src/NuGet.Services.Validation.Orchestrator/Job.cs:155 — Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
X3 · Exception handling · Swallowed exception (empty catch) · ×25
  • Swallowed exception (empty catch) src/NuGetGallery/App_Start/OwinStartup.cs:214 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/NuGetGallery/App_Start/OwinStartup.cs:248 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/NuGetGallery/Infrastructure/Mail/BackgroundMarkdownMessageService.cs:56 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/NuGetGallery/Services/PackageDeleteService.cs:680 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/NuGetGallery/Extensions/HttpRequestExtensions.cs:50 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/NuGetGallery/Extensions/HttpRequestExtensions.cs:66 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/NuGetGallery/Infrastructure/CookieTempDataProvider.cs:92 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/GalleryTools/Commands/BackfillTfmMetadataCommand.cs:56 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/GalleryTools/Commands/BackfillTfmMetadataCommand.cs:89 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/NuGetGallery.Services/Providers/RuntimeServiceProvider.cs:102 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/NuGetGallery.Services/Telemetry/QuietLog.cs:55 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/NuGetGallery.Services/Telemetry/TelemetryClientWrapper.cs:42 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/NuGetGallery.Services/Telemetry/TelemetryClientWrapper.cs:54 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/NuGetGallery.Services/Telemetry/TelemetryClientWrapper.cs:67 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/NuGetGallery.Services/Telemetry/TelemetryClientWrapper.cs:93 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/NuGetGallery.Services/Telemetry/TelemetryClientWrapper.cs:116 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/Validation.Common.Job/TempFiles/TempFile.cs:66 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. On a teardown path letting it propagate is not an option (throwing out of `Dispose()` masks the failure already in flight and abandons the rest of the cleanup), so make the swallow deliberate instead: record it through whatever this codebase already uses to report problems — or, if one specific failure truly cannot matter, catch exactly that exception type and say why in a comment on the catch (a comment on a catch-all still swallows everything else).
  • Swallowed exception (empty catch) src/NuGet.Services.Logging/TelemetryClientWrapper.cs:29 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/NuGet.Services.Logging/TelemetryClientWrapper.cs:44 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/NuGet.Services.Logging/TelemetryClientWrapper.cs:75 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/NuGet.Services.Logging/TelemetryInitializers/TelemetryContextInitializer.cs:43 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/NuGet.Services.FeatureFlags/FeatureFlagClient.cs:117 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) REDACTED:95 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) REDACTED:101 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/NuGetGallery.AppHost.Tools/V3CatalogIndexAvailable.cs:33 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
D3 · God Classes · FileTooLong · ×22
  • FileTooLong: REDACTED REDACTED — FileTooLong — 12049 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 11549 over it, 24.10× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: gallery/jquery-ui-1.10.3.js src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js — FileTooLong — 9256 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 8756 over it, 18.51× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 1992 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1492 over it, 3.98× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: gallery/bootstrap.js src/NuGetGallery/Scripts/gallery/bootstrap.js — FileTooLong — 1506 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1006 over it, 3.01× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: App_Start/DefaultDependenciesModule.cs src/NuGetGallery/App_Start/DefaultDependenciesModule.cs — FileTooLong — 1322 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 822 over it, 2.64× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: NuGetGallery/UrlHelperExtensions.cs src/NuGetGallery/UrlHelperExtensions.cs — FileTooLong — 1203 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 703 over it, 2.41× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 1066 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 566 over it, 2.13× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: gallery/jquery.validate-1.16.0.js src/NuGetGallery/Scripts/gallery/jquery.validate-1.16.0.js — FileTooLong — 891 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 391 over it, 1.78× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: App_Start/Routes.cs src/NuGetGallery/App_Start/Routes.cs — FileTooLong — 886 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 386 over it, 1.77× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 841 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 341 over it, 1.68× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 782 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 282 over it, 1.56× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: Telemetry/TelemetryService.cs src/NuGetGallery.Services/Telemetry/TelemetryService.cs — FileTooLong — 749 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 249 over it, 1.50× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: PackageManagement/PackageService.cs src/NuGetGallery.Services/PackageManagement/PackageService.cs — FileTooLong — 720 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 220 over it, 1.44× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 715 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 215 over it, 1.43× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: Entities/ValidationEntitiesContext.cs src/NuGet.Services.Validation/Entities/ValidationEntitiesContext.cs — FileTooLong — 583 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 83 over it, 1.17× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: Validation.PackageSigning.ProcessSignature/SignatureValidator.cs src/Validation.PackageSigning.ProcessSignature/SignatureValidator.cs — FileTooLong — 583 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 83 over it, 1.17× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: Authentication/AuthenticationService.cs src/NuGetGallery.Services/Authentication/AuthenticationService.cs — FileTooLong — 571 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 71 over it, 1.14× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: Services/PackageStagingManagementService.cs src/NuGetGallery/Services/PackageStagingManagementService.cs — FileTooLong — 561 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 61 over it, 1.12× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: Services/PackageMetadataValidationService.cs src/NuGetGallery/Services/PackageMetadataValidationService.cs — FileTooLong — 552 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 52 over it, 1.10× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: Entities/EntitiesContext.cs src/NuGetGallery.Core/Entities/EntitiesContext.cs — FileTooLong — 544 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 44 over it, 1.09× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: Services/PackageStagingUploadService.cs src/NuGetGallery/Services/PackageStagingUploadService.cs — FileTooLong — 541 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 41 over it, 1.08× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 507 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 7 over it, 1.01× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
AC6 · Visual & motion safety · Animation without a prefers-reduced-motion guard · ×19
  • Animation without a prefers-reduced-motion guard src/NuGetGallery/Content/fabric.css:139 — `.ms-motion-scaleDownIn` moves (`animation: ms-motion-scaleDownIn 300ms cubic-bezier(0.1, 0.9, 0.2, 1) both, ms-motion-fadeIn 100ms cubic-bezier(0, 0, 1, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard src/NuGetGallery/Content/fabric.css:143 — `.ms-motion-scaleDownOut` moves (`animation: ms-motion-scaleDownOut 300ms cubic-bezier(0.1, 0.9, 0.2, 1) both, ms-motion-fadeOut 100ms cubic-bezier(0, 0, 1, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard src/NuGetGallery/Content/fabric.css:147 — `[dir='ltr'] .ms-motion-slideLeftOut` moves (`animation: ms-motion-slideLeftOut 100ms cubic-bezier(0.9, 0.1, 1, 0.2) both, ms-motion-fadeOut 100ms cubic-bezier(0, 0, 1, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard src/NuGetGallery/Content/fabric.css:151 — `[dir='rtl'] .ms-motion-slideLeftOut` moves (`animation: ms-motion-slideRightOut 100ms cubic-bezier(0.9, 0.1, 1, 0.2) both, ms-motion-fadeOut 100ms cubic-bezier(0, 0, 1, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard src/NuGetGallery/Content/fabric.css:155 — `[dir='ltr'] .ms-motion-slideRightOut` moves (`animation: ms-motion-slideRightOut 100ms cubic-bezier(0.9, 0.1, 1, 0.2) both, ms-motion-fadeOut 100ms cubic-bezier(0, 0, 1, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard src/NuGetGallery/Content/fabric.css:159 — `[dir='rtl'] .ms-motion-slideRightOut` moves (`animation: ms-motion-slideLeftOut 100ms cubic-bezier(0.9, 0.1, 1, 0.2) both, ms-motion-fadeOut 100ms cubic-bezier(0, 0, 1, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard src/NuGetGallery/Content/fabric.css:163 — `[dir='ltr'] .ms-motion-slideLeftIn` moves (`animation: ms-motion-slideLeftIn 100ms cubic-bezier(0.1, 0.9, 0.2, 1) both, ms-motion-fadeIn 100ms cubic-bezier(0, 0, 1, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard src/NuGetGallery/Content/fabric.css:167 — `[dir='rtl'] .ms-motion-slideLeftIn` moves (`animation: ms-motion-slideRightIn 100ms cubic-bezier(0.1, 0.9, 0.2, 1) both, ms-motion-fadeIn 100ms cubic-bezier(0, 0, 1, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard src/NuGetGallery/Content/fabric.css:171 — `[dir='ltr'] .ms-motion-slideRightIn` moves (`animation: ms-motion-slideRightIn 100ms cubic-bezier(0.1, 0.9, 0.2, 1) both, ms-motion-fadeIn 100ms cubic-bezier(0, 0, 1, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard src/NuGetGallery/Content/fabric.css:175 — `[dir='rtl'] .ms-motion-slideRightIn` moves (`animation: ms-motion-slideLeftIn 100ms cubic-bezier(0.1, 0.9, 0.2, 1) both, ms-motion-fadeIn 100ms cubic-bezier(0, 0, 1, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard src/NuGetGallery/Content/fabric.css:179 — `.ms-motion-slideUpOut` moves (`animation: ms-motion-slideUpOut 100ms cubic-bezier(0.9, 0.1, 1, 0.2) both, ms-motion-fadeOut 100ms cubic-bezier(0, 0, 1, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard src/NuGetGallery/Content/fabric.css:183 — `.ms-motion-slideDownOut` moves (`animation: ms-motion-slideDownOut 100ms cubic-bezier(0.9, 0.1, 1, 0.2) both, ms-motion-fadeOut 100ms cubic-bezier(0, 0, 1, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard src/NuGetGallery/Content/fabric.css:187 — `.ms-motion-slideUpIn` moves (`animation: ms-motion-slideUpIn 100ms cubic-bezier(0.1, 0.9, 0.2, 1) both, ms-motion-fadeIn 100ms cubic-bezier(0, 0, 1, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard src/NuGetGallery/Content/fabric.css:191 — `.ms-motion-slideDownIn` moves (`animation: ms-motion-slideDownIn 100ms cubic-bezier(0.1, 0.9, 0.2, 1) both, ms-motion-fadeIn 100ms cubic-bezier(0, 0, 1, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard src/NuGetGallery/Content/gallery/css/fabric.css:143 — `.ms-motion-scaleDownIn` moves (`animation: ms-motion-scaleDownIn 300ms cubic-bezier(0.1, 0.9, 0.2, 1) both, ms-motion-fadeIn 100ms cubic-bezier(0, 0, 1, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard src/NuGetGallery/Content/gallery/css/fabric.css:147 — `.ms-motion-scaleDownOut` moves (`animation: ms-motion-scaleDownOut 300ms cubic-bezier(0.1, 0.9, 0.2, 1) both, ms-motion-fadeOut 100ms cubic-bezier(0, 0, 1, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard src/NuGetGallery/Content/gallery/css/fabric.css:151 — `[dir='ltr'] .ms-motion-slideLeftOut` moves (`animation: ms-motion-slideLeftOut 100ms cubic-bezier(0.9, 0.1, 1, 0.2) both, ms-motion-fadeOut 100ms cubic-bezier(0, 0, 1, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard src/NuGetGallery/Content/gallery/css/fabric.css:155 — `[dir='rtl'] .ms-motion-slideLeftOut` moves (`animation: ms-motion-slideRightOut 100ms cubic-bezier(0.9, 0.1, 1, 0.2) both, ms-motion-fadeOut 100ms cubic-bezier(0, 0, 1, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard src/NuGetGallery/Content/gallery/css/fabric.css:159 — `[dir='ltr'] .ms-motion-slideRightOut` moves (`animation: ms-motion-slideRightOut 100ms cubic-bezier(0.9, 0.1, 1, 0.2) both, ms-motion-fadeOut 100ms cubic-bezier(0, 0, 1, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
X5 · Nullable reference types · Symbol treated as nullable, then dereferenced unguarded · ×18
  • Symbol treated as nullable, then dereferenced unguarded src/NuGetGallery/Filters/ValidateRecaptchaResponseAttribute.cs:25 — This method contradicts itself about `controller`: line 24 assigns it with `as AppController`, which hands back null rather than throwing when the value is not a `AppController`, but line 25 then dereferences it directly as `controller.NuGetContext` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `controller` once before the first use and handle the null case, or cast with `(AppController)` so the failure is reported where it happens — rather than leaving the two readings side by side.
  • Symbol treated as nullable, then dereferenced unguarded src/NuGetGallery/Services/ReadMeService.cs:57 — This method contradicts itself about `readMeRequest`: line 52 writes `readMeRequest?.SourceType`, which says `readMeRequest` can be null, but line 57 then dereferences it directly as `readMeRequest.SourceText` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `readMeRequest` truly cannot be null here, the `?.` is misleading. Settle it one way — test `readMeRequest` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side.
  • Symbol treated as nullable, then dereferenced unguarded src/NuGetGallery/Services/ReadMeService.cs:194 — This method contradicts itself about `edit`: line 186 writes `edit?.ReadMe`, which says `edit` can be null, but line 194 then dereferences it directly as `edit.ReadMeState` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `edit` truly cannot be null here, the `?.` is misleading. Settle it one way — test `edit` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side.
  • Symbol treated as nullable, then dereferenced unguarded src/NuGetGallery/Services/ReadMeService.cs:240 — This method contradicts itself about `readMeRequest`: line 232 writes `readMeRequest?.SourceType`, which says `readMeRequest` can be null, but line 240 then dereferences it directly as `readMeRequest.SourceText` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `readMeRequest` truly cannot be null here, the `?.` is misleading. Settle it one way — test `readMeRequest` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side.
  • Symbol treated as nullable, then dereferenced unguarded src/NuGetGallery/OData/SearchService/SearchHijacker.cs:158 — This method contradicts itself about `lambda`: line 157 assigns it with `as LambdaExpression`, which hands back null rather than throwing when the value is not a `LambdaExpression`, but line 158 then dereferences it directly as `lambda.Body` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `lambda` once before the first use and handle the null case, or cast with `(LambdaExpression)` so the failure is reported where it happens — rather than leaving the two readings side by side.
  • Symbol treated as nullable, then dereferenced unguarded src/NuGetGallery/OData/SearchService/SearchHijacker.cs:162 — This method contradicts itself about `binExpr`: line 160 assigns it with `as BinaryExpression`, which hands back null rather than throwing when the value is not a `BinaryExpression`, but line 162 then dereferences it directly as `binExpr.Left` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `binExpr` once before the first use and handle the null case, or cast with `(BinaryExpression)` so the failure is reported where it happens — rather than leaving the two readings side by side.
  • Symbol treated as nullable, then dereferenced unguarded src/NuGetGallery/ViewModels/OrganizationMemberViewModel.cs:14 — This method contradicts itself about `membership`: line 12 writes `membership?.Member`, which says `membership` can be null, but line 14 then dereferences it directly as `membership.IsAdmin` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `membership` truly cannot be null here, the `?.` is misleading. Settle it one way — test `membership` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side.
  • Symbol treated as nullable, then dereferenced unguarded src/NuGetGallery/ViewModels/OrganizationMemberViewModel.cs:21 — This method contradicts itself about `request`: line 19 writes `request?.NewMember`, which says `request` can be null, but line 21 then dereferences it directly as `request.IsAdmin` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `request` truly cannot be null here, the `?.` is misleading. Settle it one way — test `request` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side.
  • Symbol treated as nullable, then dereferenced unguarded REDACTED:193 — This method contradicts itself about `loginUserDetails`: line 187 writes `loginUserDetails?.AuthenticatedUser`, which says `loginUserDetails` can be null, but line 193 then dereferences it directly as `loginUserDetails.UsedMultiFactorAuthentication` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `loginUserDetails` truly cannot be null here, the `?.` is misleading. Settle it one way — test `loginUserDetails` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side.
  • Symbol treated as nullable, then dereferenced unguarded src/NuGetGallery.Core/Services/StagingGroupPromotionService.cs:61 — This method contradicts itself about `identity`: line 59 writes `identity?.StagingGroup`, which says `identity` can be null, but line 61 then dereferences it directly as `identity.StagingGroupKey` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `identity` truly cannot be null here, the `?.` is misleading. Settle it one way — test `identity` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side.
  • Symbol treated as nullable, then dereferenced unguarded src/NuGetGallery.Services/Authentication/AsyncFileUpload/AsyncFileUploadModule.cs:31 — This method contradicts itself about `app`: line 29 assigns it with `as HttpApplication`, which hands back null rather than throwing when the value is not a `HttpApplication`, but line 31 then dereferences it directly as `app.Context` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `app` once before the first use and handle the null case, or cast with `(HttpApplication)` so the failure is reported where it happens — rather than leaving the two readings side by side.
  • Symbol treated as nullable, then dereferenced unguarded src/NuGetGallery.Services/Extensions/PrincipalExtensions.cs:223 — This method contradicts itself about `claimsIdentity`: line 219 assigns it with `as ClaimsIdentity`, which hands back null rather than throwing when the value is not a `ClaimsIdentity`, but line 223 then dereferences it directly as `claimsIdentity.TryRemoveClaim` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `claimsIdentity` once before the first use and handle the null case, or cast with `(ClaimsIdentity)` so the failure is reported where it happens — rather than leaving the two readings side by side.
  • Symbol treated as nullable, then dereferenced unguarded src/NuGetGallery.Services/Extensions/PrincipalExtensions.cs:257 — This method contradicts itself about `claimsIdentity`: line 249 assigns it with `as ClaimsIdentity`, which hands back null rather than throwing when the value is not a `ClaimsIdentity`, but line 257 then dereferences it directly as `claimsIdentity.AddClaim` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `claimsIdentity` once before the first use and handle the null case, or cast with `(ClaimsIdentity)` so the failure is reported where it happens — rather than leaving the two readings side by side.
  • Symbol treated as nullable, then dereferenced unguarded src/NuGetGallery.Services/Extensions/UserExtensions.cs:54 — This method contradicts itself about `claimsIdentity`: line 53 assigns it with `as ClaimsIdentity`, which hands back null rather than throwing when the value is not a `ClaimsIdentity`, but line 54 then dereferences it directly as `claimsIdentity.GetClaimOrDefault` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `claimsIdentity` once before the first use and handle the null case, or cast with `(ClaimsIdentity)` so the failure is reported where it happens — rather than leaving the two readings side by side.
  • Symbol treated as nullable, then dereferenced unguarded src/NuGet.Services.ServiceBus/TopicClientWrapper.cs:83 — This method contradicts itself about `wrapper`: line 79 assigns it with `as ServiceBusMessageWrapper`, which hands back null rather than throwing when the value is not a `ServiceBusMessageWrapper`, but line 83 then dereferences it directly as `wrapper.ServiceBusMessage` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `wrapper` once before the first use and handle the null case, or cast with `(ServiceBusMessageWrapper)` so the failure is reported where it happens — rather than leaving the two readings side by side.
  • Symbol treated as nullable, then dereferenced unguarded src/Catalog/CatalogCommit.cs:35 — This method contradicts itself about `other`: line 26 assigns it with `as CatalogCommit`, which hands back null rather than throwing when the value is not a `CatalogCommit`, but line 35 then dereferences it directly as `other.CommitTimeStamp` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `other` once before the first use and handle the null case, or cast with `(CatalogCommit)` so the failure is reported where it happens — rather than leaving the two readings side by side.
  • Symbol treated as nullable, then dereferenced unguarded src/Catalog/CatalogCommitItem.cs:79 — This method contradicts itself about `other`: line 70 assigns it with `as CatalogCommitItem`, which hands back null rather than throwing when the value is not a `CatalogCommitItem`, but line 79 then dereferences it directly as `other.CommitTimeStamp` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `other` once before the first use and handle the null case, or cast with `(CatalogCommitItem)` so the failure is reported where it happens — rather than leaving the two readings side by side.
  • Symbol treated as nullable, then dereferenced unguarded src/Catalog/CatalogTypeConverter.cs:50 — This method contradicts itself about `types`: line 49 assigns it with `as IEnumerable<string>`, which hands back null rather than throwing when the value is not a `IEnumerable<string>`, but line 50 then dereferences it directly as `types.First` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `types` once before the first use and handle the null case, or cast with `(IEnumerable<string>)` so the failure is reported where it happens — rather than leaving the two readings side by side.
AC4 · Keyboard semantics · Anchor without href · ×16
  • Anchor without href src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:174 — An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
  • Anchor without href src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:230 — An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
  • Anchor without href src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:7128 — An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
  • Anchor without href src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:9234 — An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
  • Anchor without href src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:9236 — An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
  • Anchor without href src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:9244 — An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
  • Anchor without href src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:9246 — An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
  • Anchor without href src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:13542 — An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
  • Anchor without href src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:13545 — An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
  • Anchor without href src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:14659 — An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
  • Anchor without href src/NuGetGallery/Views/Packages/_ManageOwners.cshtml:28 — An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
  • Anchor without href src/NuGetGallery/Views/Packages/_ManageSponsorshipLinks.cshtml:18 — An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
  • Anchor without href src/NuGetGallery/Views/Staging/Group.cshtml:326 — An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
  • Anchor without href src/NuGetGallery/Views/Staging/Group.cshtml:340 — An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
  • Anchor without href src/NuGetGallery/Views/Users/Packages.cshtml:77 — An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
  • Anchor without href src/NuGetGallery/Views/Users/Packages.cshtml:86 — An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
D29 · Static Analysis (SAST) · REDACTED · ×16
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×16
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
X18 · Disposal-pattern correctness · Disposable created and abandoned in the method that made it · ×16
  • Disposable created and abandoned in the method that made it src/NuGet.Services.KeyVault/CertificateUtility.cs:14 — `store` is a `X509Store`, which implements `IDisposable`, and it is created here (line 14). Every use of it in `FindCertificateByThumbprint` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var store = …;`), which releases it at the end of the scope on every path including a throw.
  • Disposable created and abandoned in the method that made it src/NuGet.Services.Storage/JTokenStorageContent.cs:33 — `writer` is a `StreamWriter`, which implements `IDisposable`, and it is created here (line 33). Every use of it in `GetContentStream` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var writer = …;`), which releases it at the end of the scope on every path including a throw.
  • Disposable created and abandoned in the method that made it src/NuGet.Services.Storage/Storage.cs:149 — `reader` is a `StreamReader`, which implements `IDisposable`, and it is created here (line 149). Every use of it in `LoadString` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var reader = …;`), which releases it at the end of the scope on every path including a throw.
  • Disposable created and abandoned in the method that made it src/NuGet.Services.Storage/StringStorageContent.cs:32 — `writer` is a `StreamWriter`, which implements `IDisposable`, and it is created here (line 32). Every use of it in `GetContentStream` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var writer = …;`), which releases it at the end of the scope on every path including a throw.
  • Disposable created and abandoned in the method that made it src/Catalog/Helpers/CatalogWriterHelper.cs:87 — `writer` is a `AppendOnlyCatalogWriter`, which implements `IDisposable`, and it is created here (line 87). Every use of it in `WritePackageDetailsToCatalogAsync` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var writer = …;`), which releases it at the end of the scope on every path including a throw.
  • Disposable created and abandoned in the method that made it src/Catalog/Persistence/JTokenStorageContent.cs:33 — `writer` is a `StreamWriter`, which implements `IDisposable`, and it is created here (line 33). Every use of it in `GetContentStream` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var writer = …;`), which releases it at the end of the scope on every path including a throw.
  • Disposable created and abandoned in the method that made it src/Catalog/Persistence/Storage.cs:165 — `reader` is a `StreamReader`, which implements `IDisposable`, and it is created here (line 165). Every use of it in `LoadStringStorageContentAsync` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var reader = …;`), which releases it at the end of the scope on every path including a throw.
  • Disposable created and abandoned in the method that made it src/Catalog/Persistence/StringStorageContent.cs:41 — `writer` is a `StreamWriter`, which implements `IDisposable`, and it is created here (line 41). Every use of it in `GetContentStream` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var writer = …;`), which releases it at the end of the scope on every path including a throw.
  • Disposable created and abandoned in the method that made it src/Ng/Program.cs:100 — `cancellationTokenSource` is a `CancellationTokenSource`, which implements `IDisposable`, and it is created here (line 100). Every use of it in `MainAsync` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var cancellationTokenSource = …;`), which releases it at the end of the scope on every path including a throw.
  • Disposable created and abandoned in the method that made it REDACTED:156 — `command` is a `SqlCommand`, which implements `IDisposable`, and it is created here (line 156). Every use of it in `ProcessBatchAsync` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var command = …;`), which releases it at the end of the scope on every path including a throw.
  • Disposable created and abandoned in the method that made it REDACTED:58 — `sqlCommand` is a `SqlCommand`, which implements `IDisposable`, and it is created here (line 58). Every use of it in `GetUnresolvedIssues` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var sqlCommand = …;`), which releases it at the end of the scope on every path including a throw.
  • Disposable created and abandoned in the method that made it REDACTED:134 — `sqlCommand` is a `SqlCommand`, which implements `IDisposable`, and it is created here (line 134). Every use of it in `GetTopSupportRequestReasonsLastWeek` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var sqlCommand = …;`), which releases it at the end of the scope on every path including a throw.
  • Disposable created and abandoned in the method that made it REDACTED:165 — `sqlCommand` is a `SqlCommand`, which implements `IDisposable`, and it is created here (line 165). Every use of it in `ExecuteScalarQueryForReferenceTimeAsync` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var sqlCommand = …;`), which releases it at the end of the scope on every path including a throw.
  • Disposable created and abandoned in the method that made it src/Stats.CollectAzureChinaCDNLogs/Job.cs:94 — `forceStopCts` is a `CancellationTokenSource`, which implements `IDisposable`, and it is created here (line 94). Every use of it in `Run` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var forceStopCts = …;`), which releases it at the end of the scope on every path including a throw.
  • Disposable created and abandoned in the method that made it src/Stats.CollectAzureChinaCDNLogs/Job.cs:97 — `cts` is a `CancellationTokenSource`, which implements `IDisposable`, and it is created here (line 97). Every use of it in `Run` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var cts = …;`), which releases it at the end of the scope on every path including a throw.
  • Disposable created and abandoned in the method that made it src/NuGet.Services.Revalidate/Initialization/PackageRevalidationInserter.cs:45 — `bulkCopy` is a `SqlBulkCopy`, which implements `IDisposable`, and it is created here (line 45). Every use of it in `AddPackageRevalidationsAsync` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var bulkCopy = …;`), which releases it at the end of the scope on every path including a throw.
AC6 · Visual & motion safety · Focus outline removed in CSS without a · ×15
  • Focus outline removed in CSS without a :focus replacement src/NuGetGallery/App_Offline-Planned.htm:64 — `a` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement src/NuGetGallery/App_Offline-Unplanned.htm:64 — `a` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement src/NuGetGallery/Content/Layout.css:195 — `#searchBoxInput` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement src/NuGetGallery/Content/Site.css:1194 — `.form input:focus` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement src/NuGetGallery/Content/themes/custom/jquery-ui-1.10.3.custom.css:26 — `.ui-helper-reset` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement src/NuGetGallery/Content/themes/custom/jquery-ui-1.10.3.custom.css:473 — `.ui-dialog` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement src/NuGetGallery/Content/themes/custom/jquery-ui-1.10.3.custom.css:532 — `.ui-menu` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement src/Bootstrap/less/button-groups.less:90 — `.btn-group.open .dropdown-toggle` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement src/Bootstrap/less/buttons.less:44 — `.btn.active` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement src/Bootstrap/less/carousel.less:125 — `.carousel-control:focus` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement src/Bootstrap/less/forms.less:76 — `.brand-radio input[type="radio"]` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement src/Bootstrap/less/forms.less:208 — `.brand-checkbox input[type="checkbox"]` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement src/Bootstrap/less/modals.less:29 — `.modal` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement src/Bootstrap/less/modals.less:60 — `.modal-content` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement src/Bootstrap/less/navbar.less:211 — `.navbar-toggle:focus` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
AX2 · Stateful singletons · Process-global static state · ×14
  • Process-global static state: GalleryMachineKeyConfigurationProvider src/NuGetGallery/App_Start/GalleryMachineKeyConfigurationProvider.cs:12 — `GalleryMachineKeyConfigurationProvider` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (Configuration; e.g. `Configuration` at line 33). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
  • Process-global static state: OwinStartup src/NuGetGallery/App_Start/OwinStartup.cs:34 — `OwinStartup` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (HasRun; e.g. `HasRun` at line 222). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
  • Process-global static state: RouteExtensions src/NuGetGallery/Extensions/RouteExtensions.cs:13 — `RouteExtensions` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (ObfuscatedRouteMap; e.g. `ObfuscatedRouteMap` at line 51). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
  • Process-global static state: UrlHelperExtensions src/NuGetGallery/UrlHelperExtensions.cs:17 — `UrlHelperExtensions` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_configuration; e.g. `_configuration` at line 63). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
  • Process-global static state: LuceneCommon src/NuGetGallery/Infrastructure/Lucene/LuceneCommon.cs:11 — `LuceneCommon` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_directorySingleton; e.g. `_directorySingleton` at line 45). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
  • Process-global static state: AppActivator src/NuGetGallery/App_Start/AppActivator.cs:33 — `AppActivator` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_jobManager; e.g. `_jobManager` at line 308). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
  • Process-global static state: DynamicDataManager src/NuGetGallery/Areas/Admin/DynamicData/DynamicDataManager.cs:15 — `DynamicDataManager` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_route; e.g. `_route` at line 60). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
  • Process-global static state: ObjectMaterializedInterception src/NuGetGallery.Core/Entities/Interception/ObjectMaterializedInterception.cs:8 — `ObjectMaterializedInterception` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (Interceptors; e.g. `Interceptors` at line 14). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
  • Process-global static state: MessageQueue src/NuGetGallery.Core/Infrastructure/MessageQueue.cs:10 — `MessageQueue` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (Enabled, MaxPerQueue; e.g. `Enabled` at line 20). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
  • Process-global static state: AuditActor src/NuGetGallery.Core/Auditing/AuditActor.cs:18 — `AuditActor` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_localIpAddress, _localIpAddressExpiration; e.g. `_localIpAddress` at line 136). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
  • Process-global static state: CookieComplianceService src/NuGetGallery.Core/Cookies/CookieComplianceService.cs:9 — `CookieComplianceService` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (Instance, Logger; e.g. `Instance` at line 16). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
  • Process-global static state: QuietLog src/NuGetGallery.Services/Telemetry/QuietLog.cs:11 — `QuietLog` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (Telemetry; e.g. `Telemetry` at line 17). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
  • Process-global static state: AzureActiveDirectoryV2Authenticator src/NuGetGallery.Services/Authentication/Providers/AzureActiveDirectoryV2/AzureActiveDirectoryV2Authenticator.cs:19 — `AzureActiveDirectoryV2Authenticator` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_alternateSiteRootList; e.g. `_alternateSiteRootList` at line 92). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
  • Process-global static state: JobRunner src/NuGet.Jobs.Common/JobRunner.cs:18 — `JobRunner` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_applicationInsightsConfiguration, _logger; e.g. `_applicationInsightsConfiguration` at line 88). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
D3 · God Classes · MethodTooLong · ×14
  • MethodTooLong: Routes.RegisterUIRoutes src/NuGetGallery/App_Start/Routes.cs:39 — MethodTooLong — RegisterUIRoutes runs 662 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 562 over it, 6.62× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Program.Main REDACTED:41 — MethodTooLong — Main runs 561 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 461 over it, 5.61× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: EntitiesContext.OnModelCreating src/NuGetGallery.Core/Entities/EntitiesContext.cs:149 — MethodTooLong — OnModelCreating runs 459 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 359 over it, 4.59× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: DefaultDependenciesModule.Load src/NuGetGallery/App_Start/DefaultDependenciesModule.cs:96 — MethodTooLong — Load runs 410 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 310 over it, 4.10× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ValidationEntitiesContext.RegisterPackageSigningEntities src/NuGet.Services.Validation/Entities/ValidationEntitiesContext.cs:345 — MethodTooLong — RegisterPackageSigningEntities runs 194 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 94 over it, 1.94× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ApiController.CreatePackageInternal REDACTED:533 — MethodTooLong — CreatePackageInternal runs 177 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 77 over it, 1.77× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ValidationEntitiesContext.OnModelCreating src/NuGet.Services.Validation/Entities/ValidationEntitiesContext.cs:138 — MethodTooLong — OnModelCreating runs 152 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 52 over it, 1.52× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: PackagesController.DisplayPackage REDACTED:902 — MethodTooLong — DisplayPackage runs 141 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 41 over it, 1.41× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: PackagesController.VerifyPackageInternal REDACTED:2821 — MethodTooLong — VerifyPackageInternal runs 139 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 39 over it, 1.39× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: SymbolPackageStagingUploadService.ProcessUploadAsync src/NuGetGallery/Services/SymbolPackageStagingUploadService.cs:111 — MethodTooLong — ProcessUploadAsync runs 134 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 34 over it, 1.34× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: AppActivator.BundlingPostStart src/NuGetGallery/App_Start/AppActivator.cs:98 — MethodTooLong — BundlingPostStart runs 115 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 15 over it, 1.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: SeedFunctionalTestsCommand.ExecuteAsync src/GalleryTools/Commands/SeedFunctionalTestsCommand.cs:53 — MethodTooLong — ExecuteAsync runs 114 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 14 over it, 1.14× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: PackageStagingUploadService.ProcessUploadAsync src/NuGetGallery/Services/PackageStagingUploadService.cs:439 — MethodTooLong — ProcessUploadAsync runs 112 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 12 over it, 1.12× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: PackagesController.ListPackages REDACTED:1320 — MethodTooLong — ListPackages runs 106 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 6 over it, 1.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D3 · God Classes · TooManyMethods · ×14
  • TooManyMethods: TelemetryService src/NuGetGallery.Services/Telemetry/TelemetryService.cs — TooManyMethods — 654 significant lines (blank, comment-only and punctuation-only lines excluded), 104 methods. The bar is 30 methods; this is 74 over it, 3.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PackagesController REDACTED — TooManyMethods — 1918 significant lines (blank, comment-only and punctuation-only lines excluded), 71 methods. The bar is 30 methods; this is 41 over it, 2.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: UsersController REDACTED — TooManyMethods — 1041 significant lines (blank, comment-only and punctuation-only lines excluded), 71 methods. The bar is 30 methods; this is 41 over it, 2.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PackageService src/NuGetGallery.Services/PackageManagement/PackageService.cs — TooManyMethods — 698 significant lines (blank, comment-only and punctuation-only lines excluded), 52 methods. The bar is 30 methods; this is 22 over it, 1.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AuthenticationService src/NuGetGallery.Services/Authentication/AuthenticationService.cs — TooManyMethods — 552 significant lines (blank, comment-only and punctuation-only lines excluded), 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PackageStagingManagementService src/NuGetGallery/Services/PackageStagingManagementService.cs — TooManyMethods — 550 significant lines (blank, comment-only and punctuation-only lines excluded), 41 methods. The bar is 30 methods; this is 11 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: StagingController REDACTED — TooManyMethods — 704 significant lines (blank, comment-only and punctuation-only lines excluded), 38 methods. The bar is 30 methods; this is 8 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: CloudBlobWrapper src/NuGetGallery.Core/Services/CloudBlobWrapper.cs — TooManyMethods — 275 significant lines (blank, comment-only and punctuation-only lines excluded), 38 methods. The bar is 30 methods; this is 8 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AuthenticationController REDACTED — TooManyMethods — 483 significant lines (blank, comment-only and punctuation-only lines excluded), 37 methods. The bar is 30 methods; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ApiController REDACTED — TooManyMethods — 754 significant lines (blank, comment-only and punctuation-only lines excluded), 35 methods. The bar is 30 methods; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: DefaultDependenciesModule src/NuGetGallery/App_Start/DefaultDependenciesModule.cs — TooManyMethods — 1244 significant lines (blank, comment-only and punctuation-only lines excluded), 34 methods. The bar is 30 methods; this is 4 over it, 1.13× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
  • TooManyMethods: UserService src/NuGetGallery.Services/UserManagement/UserService.cs — TooManyMethods — 371 significant lines (blank, comment-only and punctuation-only lines excluded), 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: SearchDocumentBuilder src/NuGet.Services.AzureSearch/SearchDocumentBuilder.cs — TooManyMethods — 394 significant lines (blank, comment-only and punctuation-only lines excluded), 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: TelemetryService src/NuGet.Services.Validation.Orchestrator/Telemetry/TelemetryService.cs — TooManyMethods — 286 significant lines (blank, comment-only and punctuation-only lines excluded), 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication · Edited copy of a member (6 corresponding lines) · ×14
  • Edited copy of a member (6 corresponding lines) src/GitHubVulnerabilities2Db/Job.cs:211 — src/GitHubVulnerabilities2Db/Job.cs:211-216 | src/GitHubVulnerabilities2v3/Job.cs:181-186 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) src/NuGet.Services.AzureSearch/SearchService/AuxiliaryFileReloader.cs:25 — src/NuGet.Services.AzureSearch/SearchService/AuxiliaryFileReloader.cs:25-30 | src/NuGet.Services.AzureSearch/SearchService/SecretRefresher.cs:26-31 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) python/StatsLogParser/loginterpretation/nugetversion.py:11 — python/StatsLogParser/loginterpretation/nugetversion.py:11-16 | python/StatsLogParser/loginterpretation/semanticversion.py:54-59 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) src/NuGet.Protocol.Catalog/CatalogProcessor.cs:26 — src/NuGet.Protocol.Catalog/CatalogProcessor.cs:26-47 | src/NuGet.Services.GitHub/GraphQL/QueryService.cs:31-36 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) src/NuGetGallery.Services/PackageManagement/PackageUpdateService.cs:27 — src/NuGetGallery.Services/PackageManagement/PackageUpdateService.cs:27-33 | src/NuGetGallery/Services/PackageDeprecationService.cs:26-31 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) src/NuGetGallery/Services/GravatarProxyService.cs:31 — src/NuGetGallery/Services/GravatarProxyService.cs:31-36 | src/NuGet.Services.AzureSearch/SearchService/IndexOperationBuilder.cs:30-35 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) src/NuGet.Protocol.Catalog/ResponseAndResult.cs:19 — src/NuGet.Protocol.Catalog/ResponseAndResult.cs:19-26 | src/NuGet.Protocol.Catalog/SimpleHttpClientException.cs:18-23 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) src/NuGet.Services.Validation.Orchestrator/StagedPackageValidationSetProvider.cs:74 — src/NuGet.Services.Validation.Orchestrator/StagedPackageValidationSetProvider.cs:74-81 | src/NuGet.Services.Validation.Orchestrator/StagedSymbolPackageValidationSetProvider.cs:126-131 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) src/NuGetGallery/Infrastructure/Mail/ConfirmationEmailBuilder.cs:21 — src/NuGetGallery/Infrastructure/Mail/ConfirmationEmailBuilder.cs:21-27 | src/NuGetGallery/Infrastructure/Mail/Messages/PasswordResetInstructionsMessage.cs:21-26 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) src/NuGetGallery.Services/Security/RequireMinProtocolVersionForPushPolicy.cs:51 — src/NuGetGallery.Services/Security/RequireMinProtocolVersionForPushPolicy.cs:51-56 | src/NuGetGallery.Services/Security/RequirePackageMetadataComplianceUtility.cs:19-26 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) src/NuGet.Services.Storage/FileStorageFactory.cs:22 — src/NuGet.Services.Storage/FileStorageFactory.cs:22-27 | src/Catalog/Persistence/FileStorageFactory.cs:21-26 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) src/NuGet.Services.Status/ComponentWrapper.cs:25 — src/NuGet.Services.Status/ComponentWrapper.cs:25-30 | src/NuGet.Services.Status/ReadOnlyComponentWrapper.cs:29-34 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) src/NuGetGallery/Filters/ApiScopeRequiredAttribute.cs:35 — src/NuGetGallery/Filters/ApiScopeRequiredAttribute.cs:35-40 | src/NuGetGallery/Filters/ApiAuthorizeAttribute.cs:64-69 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) src/NuGet.Services.Status.Table/Manual/AddStatusEventManualChangeEntity.cs:17 — src/NuGet.Services.Status.Table/Manual/AddStatusEventManualChangeEntity.cs:17-22 | src/NuGet.Services.Status.Table/Manual/AddStatusMessageManualChangeEntity.cs:17-22 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D17 · Explicit Debt · BarePragmaDisable · ×13
  • BarePragmaDisable src/NuGet.Jobs.Common/JobRunner.cs:145 — #pragma warning disable 618 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
  • BarePragmaDisable src/NuGet.Services.Validation.Issues/ObsoleteTestingIssue.cs:21 — #pragma warning disable 618 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
  • BarePragmaDisable src/NuGet.Services.Validation.Issues/ValidationIssue.cs:34 — #pragma warning disable 618 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
  • BarePragmaDisable src/NuGetGallery.Services/PackageManagement/PackageService.cs:1044 — #pragma warning disable 618 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
  • BarePragmaDisable src/NuGetGallery/Services/ReflowPackageService.cs:128 — #pragma warning disable 618 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
  • BarePragmaDisable tests/NuGet.Services.Contracts.Tests/Validation/ValidationErrorCodeFacts.cs:31 — #pragma warning disable 618 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
  • BarePragmaDisable tests/NuGet.Services.Validation.Issues.Tests/ValidationIssuesFacts.cs:53 — #pragma warning disable 618 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
  • BarePragmaDisable tests/NuGet.Services.Validation.Issues.Tests/ValidationIssuesFacts.cs:176 — #pragma warning disable 618 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
  • BarePragmaDisable tests/NuGet.Services.Validation.Issues.Tests/ValidationIssuesFacts.cs:185 — #pragma warning disable 618 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
  • BarePragmaDisable src/NuGetGallery.Core/Services/CloudWrapperHelpers.cs:97 — #pragma warning disable CS0612 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
  • BarePragmaDisable src/NuGetGallery.Core/Services/CloudWrapperHelpers.cs:103 — #pragma warning disable CS0612 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
  • BarePragmaDisable REDACTED:4 — #pragma warning disable CA3147 // No need to validate Antiforgery Token with API request — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
  • BarePragmaDisable tests/NuGetGallery.Core.Facts/Auditing/CloudAuditingServiceTests.cs:82 — #pragma warning disable CS0618 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
D3 · God Classes · FunctionTooLong · ×13
  • FunctionTooLong: d3.brush$1 REDACTED:4318 — FunctionTooLong — brush$1 runs 305 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 205 over it, 3.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: d3.zoom REDACTED:16971 — FunctionTooLong — zoom runs 263 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 163 over it, 2.63× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: d3.formatLocale$1 REDACTED:12774 — FunctionTooLong — formatLocale$1 runs 244 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 144 over it, 2.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: page-manage-deprecation.ManageDeprecationViewModel src/NuGetGallery/Scripts/gallery/page-manage-deprecation.js:3 — FunctionTooLong — ManageDeprecationViewModel runs 209 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 109 over it, 2.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: md5.MD5 src/NuGetGallery/Scripts/gallery/md5.js:11 — FunctionTooLong — MD5 runs 182 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 82 over it, 1.82× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: jquery-ui-1.10.3.$.effects.effect.size src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:11064 — FunctionTooLong — $.effects.effect.size runs 124 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 24 over it, 1.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: jquery-ui-1.10.3.$.fn.position src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:12138 — FunctionTooLong — $.fn.position runs 123 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 23 over it, 1.23× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: d3.contours REDACTED:5339 — FunctionTooLong — contours runs 120 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 20 over it, 1.20× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: clamp.clamp src/NuGetGallery/Scripts/gallery/clamp.js:29 — FunctionTooLong — clamp runs 120 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 20 over it, 1.20× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: d3.clipCircle REDACTED:8398 — FunctionTooLong — clipCircle runs 118 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 18 over it, 1.18× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: d3.arc REDACTED:14094 — FunctionTooLong — arc runs 112 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 12 over it, 1.12× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: d3.clipRectangle REDACTED:8640 — FunctionTooLong — clipRectangle runs 109 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 9 over it, 1.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: page-staging-group.StagedPackageViewModel src/NuGetGallery/Scripts/gallery/page-staging-group.js:26 — FunctionTooLong — StagedPackageViewModel runs 108 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 8 over it, 1.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D4 · Code Duplication · Edited copy of a member (4 corresponding lines) · ×13
  • Edited copy of a member (4 corresponding lines) src/NuGet.Services.Cursor/AggregateCursor.cs:30 — src/NuGet.Services.Cursor/AggregateCursor.cs:30-33 | src/Catalog/AggregateCursor.cs:30-33 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) src/Catalog/Icons/IconProcessor.cs:29 — src/Catalog/Icons/IconProcessor.cs:29-32 | src/NuGet.Services.AzureSearch/Auxiliary2AzureSearch/DataSetComparer.cs:23-26 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) src/Catalog/PackageDownloader.cs:23 — src/Catalog/PackageDownloader.cs:23-26 | src/NuGet.Protocol.Catalog/SimpleHttpClient.cs:21-24 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) src/NuGet.Services.Staging/StagingPromotionMessageEnqueuer.cs:40 — src/NuGet.Services.Staging/StagingPromotionMessageEnqueuer.cs:40-43 | src/Validation.PackageSigning.RevalidateCertificate/ValidateCertificateEnqueuer.cs:20-23 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) src/NuGetGallery.Core/Services/CoreLicenseFileService.cs:21 — src/NuGetGallery.Core/Services/CoreLicenseFileService.cs:21-24 | src/NuGetGallery.Core/Services/CoreReadmeFileService.cs:21-24 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) src/NuGetGallery/Areas/Admin/Controllers/LockPackageController.cs:24 — src/NuGetGallery/Areas/Admin/Controllers/LockPackageController.cs:24-27 | src/NuGetGallery/Services/LockPackageService.cs:20-23 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) src/NuGetGallery/Areas/Admin/Controllers/LockUserController.cs:24 — src/NuGetGallery/Areas/Admin/Controllers/LockUserController.cs:24-27 | src/NuGetGallery/Services/LockUserService.cs:20-23 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) src/StatusAggregator/Collector/Cursor.cs:20 — src/StatusAggregator/Collector/Cursor.cs:20-23 | src/StatusAggregator/Export/EventExporter.cs:21-24 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) src/NuGet.Services.Metadata.Catalog.Monitoring/Providers/PackageTimestampMetadataResourceDatabaseProvider.cs:22 — src/NuGet.Services.Metadata.Catalog.Monitoring/Providers/PackageTimestampMetadataResourceDatabaseProvider.cs:22-25 | src/NuGet.Jobs.GitHubIndexer/RepoFetcher.cs:15-18 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) src/NuGet.Services.Storage/StorageQueue.cs:25 — src/NuGet.Services.Storage/StorageQueue.cs:25-28 | src/NuGet.Services.Storage/TypedMessageSerializer.cs:23-27 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) src/NuGetGallery/Infrastructure/Lucene/ResilientSearchHttpClient.cs:21 — src/NuGetGallery/Infrastructure/Lucene/ResilientSearchHttpClient.cs:21-24 | src/NuGetGallery/Services/DownloadCountObjectMaterializedInterceptor.cs:16-19 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) src/NuGetGallery/Infrastructure/Mail/Messages/AccountDeleteNoticeMessage.cs:19 — src/NuGetGallery/Infrastructure/Mail/Messages/AccountDeleteNoticeMessage.cs:19-22 | src/NuGetGallery.Services/Security/UserSecurityPolicySubscriptionContext.cs:19-22 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) src/NuGetGallery/Helpers/ViewModelExtensions/DisplayPackageViewModelFactory.cs:35 — src/NuGetGallery/Helpers/ViewModelExtensions/DisplayPackageViewModelFactory.cs:35-46 | src/NuGetGallery/Helpers/ViewModelExtensions/ManagePackageViewModelFactory.cs:34-37 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×13
  • Outbound HTTP without resilience src/Catalog/Helpers/FeedHelpers.cs:20 — `new HttpClient(handler)` builds an outbound HTTP client and nothing bounds it: no timeout is set on it and no retry or resilience policy wraps its calls in the type that owns it. A slow or failing dependency will hold this service's request, thread or connection — and cascade — until the call gives up on its own (100 s for HttpClient's default).
  • Outbound HTTP without resilience src/GalleryTools/Commands/BackfillCommand.cs:61 — `new HttpClient()` builds an outbound HTTP client and nothing bounds it: no timeout is set on it and no retry or resilience policy wraps its calls in the type that owns it. A slow or failing dependency will hold this service's request, thread or connection — and cascade — until the call gives up on its own (100 s for HttpClient's default).
  • Outbound HTTP without resilience src/GalleryTools/Utils/ServiceDiscoveryClient.cs:25 — `new HttpClient()` builds an outbound HTTP client and nothing bounds it: no timeout is set on it and no retry or resilience policy wraps its calls in the type that owns it. A slow or failing dependency will hold this service's request, thread or connection — and cascade — until the call gives up on its own (100 s for HttpClient's default).
  • Outbound HTTP without resilience src/GitHubVulnerabilities2Db/Job.cs:37 — `new HttpClient()` builds an outbound HTTP client and nothing bounds it: no timeout is set on it and no retry or resilience policy wraps its calls in the type that owns it. A slow or failing dependency will hold this service's request, thread or connection — and cascade — until the call gives up on its own (100 s for HttpClient's default).
  • Outbound HTTP without resilience src/GitHubVulnerabilities2v3/Job.cs:33 — `new HttpClient()` builds an outbound HTTP client and nothing bounds it: no timeout is set on it and no retry or resilience policy wraps its calls in the type that owns it. A slow or failing dependency will hold this service's request, thread or connection — and cascade — until the call gives up on its own (100 s for HttpClient's default).
  • Outbound HTTP without resilience src/Ng/Jobs/Catalog2IconJob.cs:56 — `new HttpClient(httpMessageHandler)` builds an outbound HTTP client and nothing bounds it: no timeout is set on it and no retry or resilience policy wraps its calls in the type that owns it. A slow or failing dependency will hold this service's request, thread or connection — and cascade — until the call gives up on its own (100 s for HttpClient's default).
  • Outbound HTTP without resilience src/NuGet.Services.Cursor/HttpReadCursor.cs:27 — `new HttpClient(handler)` builds an outbound HTTP client and nothing bounds it: no timeout is set on it and no retry or resilience policy wraps its calls in the type that owns it. A slow or failing dependency will hold this service's request, thread or connection — and cascade — until the call gives up on its own (100 s for HttpClient's default).
  • Outbound HTTP without resilience src/NuGet.Services.V3/DependencyInjectionExtensions.cs:44 — `new HttpClient(p.GetRequiredService<HttpMessageHandler>())` builds an outbound HTTP client and nothing bounds it: no timeout is set on it and no retry or resilience policy wraps its calls in the type that owns it. A slow or failing dependency will hold this service's request, thread or connection — and cascade — until the call gives up on its own (100 s for HttpClient's default).
  • Outbound HTTP without resilience src/NuGetGallery.AppHost.Tools/V3CatalogIndexAvailable.cs:19 — `new HttpClient()` builds an outbound HTTP client and nothing bounds it: no timeout is set on it and no retry or resilience policy wraps its calls in the type that owns it. A slow or failing dependency will hold this service's request, thread or connection — and cascade — until the call gives up on its own (100 s for HttpClient's default).
  • Outbound HTTP without resilience src/NuGetGallery/App_Start/DefaultDependenciesModule.cs:584 — `services.AddHttpClient()` registers an outbound HTTP client with no resilience handler, retry policy or timeout of its own in its builder chain. A slow or failing dependency will hold this service's request, thread or connection — and cascade — until the call gives up on its own (100 s for HttpClient's default).
  • Outbound HTTP without resilience src/NuGetGallery/Services/StatusService.cs:20 — `new HttpClient()` builds an outbound HTTP client and nothing bounds it: no timeout is set on it and no retry or resilience policy wraps its calls in the type that owns it. A slow or failing dependency will hold this service's request, thread or connection — and cascade — until the call gives up on its own (100 s for HttpClient's default).
  • Outbound HTTP without resilience src/PackageLagMonitor/Job.cs:50 — `new HttpClient()` builds an outbound HTTP client and nothing bounds it: no timeout is set on it and no retry or resilience policy wraps its calls in the type that owns it. A slow or failing dependency will hold this service's request, thread or connection — and cascade — until the call gives up on its own (100 s for HttpClient's default).
  • Outbound HTTP without resilience src/VerifyGitHubVulnerabilities/Job.cs:115 — `new HttpClient()` builds an outbound HTTP client and nothing bounds it: no timeout is set on it and no retry or resilience policy wraps its calls in the type that owns it. A slow or failing dependency will hold this service's request, thread or connection — and cascade — until the call gives up on its own (100 s for HttpClient's default).
D3 · God Classes · ClassTooLong · ×12
  • ClassTooLong: Routes src/NuGetGallery/App_Start/Routes.cs — ClassTooLong — 880 significant lines (blank, comment-only and punctuation-only lines excluded), 5 methods. The bar is 400 significant lines; this is 480 over it, 2.20× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
  • ClassTooLong: Program REDACTED — ClassTooLong — 833 significant lines (blank, comment-only and punctuation-only lines excluded), 10 methods. The bar is 400 significant lines; this is 433 over it, 2.08× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
  • ClassTooLong: ValidationEntitiesContext src/NuGet.Services.Validation/Entities/ValidationEntitiesContext.cs — ClassTooLong — 570 significant lines (blank, comment-only and punctuation-only lines excluded), 10 methods. The bar is 400 significant lines; this is 170 over it, 1.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: SignatureValidator src/Validation.PackageSigning.ProcessSignature/SignatureValidator.cs — ClassTooLong — 530 significant lines (blank, comment-only and punctuation-only lines excluded), 16 methods. The bar is 400 significant lines; this is 130 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: PackageMetadataValidationService src/NuGetGallery/Services/PackageMetadataValidationService.cs — ClassTooLong — 525 significant lines (blank, comment-only and punctuation-only lines excluded), 29 methods. The bar is 400 significant lines; this is 125 over it, 1.31× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: EntitiesContext src/NuGetGallery.Core/Entities/EntitiesContext.cs — ClassTooLong — 522 significant lines (blank, comment-only and punctuation-only lines excluded), 13 methods. The bar is 400 significant lines; this is 122 over it, 1.31× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: PackageStagingUploadService src/NuGetGallery/Services/PackageStagingUploadService.cs — ClassTooLong — 492 significant lines (blank, comment-only and punctuation-only lines excluded), 23 methods. The bar is 400 significant lines; this is 92 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Job src/NuGet.Services.Validation.Orchestrator/Job.cs — ClassTooLong — 455 significant lines (blank, comment-only and punctuation-only lines excluded), 18 methods. The bar is 400 significant lines; this is 55 over it, 1.14× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ODataV2FeedController REDACTED — ClassTooLong — 455 significant lines (blank, comment-only and punctuation-only lines excluded), 17 methods. The bar is 400 significant lines; this is 55 over it, 1.14× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: NewPackageRegistrationFromKustoProducer src/NuGet.Services.AzureSearch/Db2AzureSearch/NewPackageRegistrationFromKustoProducer.cs — ClassTooLong — 444 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods. The bar is 400 significant lines; this is 44 over it, 1.11× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: SignaturePartsExtractor src/Validation.PackageSigning.ProcessSignature/SignaturePartsExtractor.cs — ClassTooLong — 430 significant lines (blank, comment-only and punctuation-only lines excluded), 23 methods. The bar is 400 significant lines; this is 30 over it, 1.08× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: SearchResponseBuilder src/NuGet.Services.AzureSearch/SearchService/SearchResponseBuilder.cs — ClassTooLong — 407 significant lines (blank, comment-only and punctuation-only lines excluded), 28 methods. The bar is 400 significant lines; this is 7 over it, 1.02× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
X1 · Async correctness · Sync-over-async (deadlock risk) through `.Result` · ×12
  • Sync-over-async (deadlock risk) through `.Result` src/NuGetGallery/Filters/ValidateRecaptchaResponseAttribute.cs:31 — Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout.
  • Sync-over-async (deadlock risk) through `.Result` src/NuGetGallery/Areas/Admin/DynamicData/DynamicDataManager.cs:36 — Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout.
  • Sync-over-async (deadlock risk) through `.Result` src/NuGetGallery/Infrastructure/Lucene/LuceneIndexingService.cs:77 — Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout.
  • Sync-over-async (deadlock risk) through `.Result` src/NuGetGallery/App_Start/DefaultDependenciesModule.cs:1202 — Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout.
  • Sync-over-async (deadlock risk) through `.Result` REDACTED:68 — Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout.
  • Sync-over-async (deadlock risk) through `.Result` REDACTED:69 — Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout.
  • Sync-over-async (deadlock risk) through `.Result` REDACTED:70 — Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout.
  • Sync-over-async (deadlock risk) through `.Result` REDACTED:71 — Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout.
  • Sync-over-async (deadlock risk) through `.Result` REDACTED:72 — Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout.
  • Sync-over-async (deadlock risk) through `.Result` src/NuGet.Jobs.Common/JobBase.cs:212 — Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout.
  • Sync-over-async (deadlock risk) through `.Result` src/NuGet.Services.Configuration/SecretConfigurationReader.cs:33 — Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout.
  • Sync-over-async (deadlock risk) through `.Result` src/Stats.AzureCdnLogs.Common/Collect/Collector.cs:88 — Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout.
D17 · Explicit Debt · DeadPreprocessorBranch · ×11
  • DeadPreprocessorBranch src/Catalog/Properties/AssemblyInfo.cs:6 — #if SIGNED_BUILD — no definition of that symbol was found anywhere this analysis looks: not in a <DefineConstants> in any project file, props or targets under any condition, not on a build script's command line, not in a #define, and not in a project-template manifest; nor is it one the compiler or SDK defines itself. On that evidence the condition is decided the same way in every configuration this repository can build, and the code on the dead side of it never compiles — including the part a reader will assume is what ships. Either define the symbol in the configuration that is supposed to have it, or delete the branch and keep the behaviour you are actually shipping. If some other mechanism binds it, that mechanism is outside the list above and this row is a gap in what we read, not a fact about your code.
  • DeadPreprocessorBranch src/Gallery.Maintenance/Properties/AssemblyInfo.cs:6 — #if SIGNED_BUILD — no definition of that symbol was found anywhere this analysis looks: not in a <DefineConstants> in any project file, props or targets under any condition, not on a build script's command line, not in a #define, and not in a project-template manifest; nor is it one the compiler or SDK defines itself. On that evidence the condition is decided the same way in every configuration this repository can build, and the code on the dead side of it never compiles — including the part a reader will assume is what ships. Either define the symbol in the configuration that is supposed to have it, or delete the branch and keep the behaviour you are actually shipping. If some other mechanism binds it, that mechanism is outside the list above and this row is a gap in what we read, not a fact about your code.
  • DeadPreprocessorBranch src/NuGet.Protocol.Catalog/Properties/AssemblyInfo.cs:6 — #if SIGNED_BUILD — no definition of that symbol was found anywhere this analysis looks: not in a <DefineConstants> in any project file, props or targets under any condition, not on a build script's command line, not in a #define, and not in a project-template manifest; nor is it one the compiler or SDK defines itself. On that evidence the condition is decided the same way in every configuration this repository can build, and the code on the dead side of it never compiles — including the part a reader will assume is what ships. Either define the symbol in the configuration that is supposed to have it, or delete the branch and keep the behaviour you are actually shipping. If some other mechanism binds it, that mechanism is outside the list above and this row is a gap in what we read, not a fact about your code.
  • DeadPreprocessorBranch src/NuGet.Services.AzureSearch/Properties/AssemblyInfo.cs:6 — #if SIGNED_BUILD — no definition of that symbol was found anywhere this analysis looks: not in a <DefineConstants> in any project file, props or targets under any condition, not on a build script's command line, not in a #define, and not in a project-template manifest; nor is it one the compiler or SDK defines itself. On that evidence the condition is decided the same way in every configuration this repository can build, and the code on the dead side of it never compiles — including the part a reader will assume is what ships. Either define the symbol in the configuration that is supposed to have it, or delete the branch and keep the behaviour you are actually shipping. If some other mechanism binds it, that mechanism is outside the list above and this row is a gap in what we read, not a fact about your code.
  • DeadPreprocessorBranch src/NuGet.Services.KeyVault/Properties/AssemblyInfo.cs:6 — #if SIGNED_BUILD — no definition of that symbol was found anywhere this analysis looks: not in a <DefineConstants> in any project file, props or targets under any condition, not on a build script's command line, not in a #define, and not in a project-template manifest; nor is it one the compiler or SDK defines itself. On that evidence the condition is decided the same way in every configuration this repository can build, and the code on the dead side of it never compiles — including the part a reader will assume is what ships. Either define the symbol in the configuration that is supposed to have it, or delete the branch and keep the behaviour you are actually shipping. If some other mechanism binds it, that mechanism is outside the list above and this row is a gap in what we read, not a fact about your code.
  • DeadPreprocessorBranch src/NuGet.Services.ServiceBus/Properties/AssemblyInfo.cs:6 — #if SIGNED_BUILD — no definition of that symbol was found anywhere this analysis looks: not in a <DefineConstants> in any project file, props or targets under any condition, not on a build script's command line, not in a #define, and not in a project-template manifest; nor is it one the compiler or SDK defines itself. On that evidence the condition is decided the same way in every configuration this repository can build, and the code on the dead side of it never compiles — including the part a reader will assume is what ships. Either define the symbol in the configuration that is supposed to have it, or delete the branch and keep the behaviour you are actually shipping. If some other mechanism binds it, that mechanism is outside the list above and this row is a gap in what we read, not a fact about your code.
  • DeadPreprocessorBranch src/NuGet.Services.Sql/Properties/AssemblyInfo.cs:6 — #if SIGNED_BUILD — no definition of that symbol was found anywhere this analysis looks: not in a <DefineConstants> in any project file, props or targets under any condition, not on a build script's command line, not in a #define, and not in a project-template manifest; nor is it one the compiler or SDK defines itself. On that evidence the condition is decided the same way in every configuration this repository can build, and the code on the dead side of it never compiles — including the part a reader will assume is what ships. Either define the symbol in the configuration that is supposed to have it, or delete the branch and keep the behaviour you are actually shipping. If some other mechanism binds it, that mechanism is outside the list above and this row is a gap in what we read, not a fact about your code.
  • DeadPreprocessorBranch src/NuGet.Services.Validation.Issues/Properties/AssemblyInfo.cs:6 — #if SIGNED_BUILD — no definition of that symbol was found anywhere this analysis looks: not in a <DefineConstants> in any project file, props or targets under any condition, not on a build script's command line, not in a #define, and not in a project-template manifest; nor is it one the compiler or SDK defines itself. On that evidence the condition is decided the same way in every configuration this repository can build, and the code on the dead side of it never compiles — including the part a reader will assume is what ships. Either define the symbol in the configuration that is supposed to have it, or delete the branch and keep the behaviour you are actually shipping. If some other mechanism binds it, that mechanism is outside the list above and this row is a gap in what we read, not a fact about your code.
  • DeadPreprocessorBranch src/NuGetGallery.Services/Properties/AssemblyInfo.cs:6 — #if SIGNED_BUILD — no definition of that symbol was found anywhere this analysis looks: not in a <DefineConstants> in any project file, props or targets under any condition, not on a build script's command line, not in a #define, and not in a project-template manifest; nor is it one the compiler or SDK defines itself. On that evidence the condition is decided the same way in every configuration this repository can build, and the code on the dead side of it never compiles — including the part a reader will assume is what ships. Either define the symbol in the configuration that is supposed to have it, or delete the branch and keep the behaviour you are actually shipping. If some other mechanism binds it, that mechanism is outside the list above and this row is a gap in what we read, not a fact about your code.
  • DeadPreprocessorBranch src/NuGetGallery/Properties/AssemblyInfo.cs:17 — #if SIGNED_BUILD — no definition of that symbol was found anywhere this analysis looks: not in a <DefineConstants> in any project file, props or targets under any condition, not on a build script's command line, not in a #define, and not in a project-template manifest; nor is it one the compiler or SDK defines itself. On that evidence the condition is decided the same way in every configuration this repository can build, and the code on the dead side of it never compiles — including the part a reader will assume is what ships. Either define the symbol in the configuration that is supposed to have it, or delete the branch and keep the behaviour you are actually shipping. If some other mechanism binds it, that mechanism is outside the list above and this row is a gap in what we read, not a fact about your code.
  • DeadPreprocessorBranch src/Validation.PackageSigning.ProcessSignature/Properties/AssemblyInfo.cs:6 — #if SIGNED_BUILD — no definition of that symbol was found anywhere this analysis looks: not in a <DefineConstants> in any project file, props or targets under any condition, not on a build script's command line, not in a #define, and not in a project-template manifest; nor is it one the compiler or SDK defines itself. On that evidence the condition is decided the same way in every configuration this repository can build, and the code on the dead side of it never compiles — including the part a reader will assume is what ships. Either define the symbol in the configuration that is supposed to have it, or delete the branch and keep the behaviour you are actually shipping. If some other mechanism binds it, that mechanism is outside the list above and this row is a gap in what we read, not a fact about your code.
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×11
  • Edited copy of a member (13 corresponding lines) src/NuGetGallery.Core/Services/StagedSymbolPackagePromotionService.cs:44 — src/NuGetGallery.Core/Services/StagedSymbolPackagePromotionService.cs:44-56 | src/NuGet.Services.Validation.Orchestrator/StagedSymbolPackagePromotionValidationMessageHandler.cs:48-65 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) src/NuGetGallery/Infrastructure/Mail/Messages/OrganizationMembershipRequestMessage.cs:25 — src/NuGetGallery/Infrastructure/Mail/Messages/OrganizationMembershipRequestMessage.cs:25-37 | src/NuGetGallery.Services/Mail/Messages/PackageOwnershipRequestMessage.cs:27-41 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) src/NuGet.Services.Validation.Orchestrator/ValidationSetProcessor.cs:33 — src/NuGet.Services.Validation.Orchestrator/ValidationSetProcessor.cs:33-45 | src/NuGet.Services.Validation.Orchestrator/ValidationSetProvider.cs:33-45 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) src/NuGet.Services.AzureSearch/SearchService/SearchTextBuilder.cs:333 — src/NuGet.Services.AzureSearch/SearchService/SearchTextBuilder.cs:333-345 | src/NuGet.Services.AzureSearch/SearchService/SearchTextBuilder.cs:355-367 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) src/StatusAggregator/Manual/DeleteStatusMessageManualChangeHandler.cs:23 — src/StatusAggregator/Manual/DeleteStatusMessageManualChangeHandler.cs:23-35 | src/StatusAggregator/Manual/EditStatusMessageManualChangeHandler.cs:23-41 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) src/NuGetGallery.AppHost.Tools/SeedBlobs.cs:197 — src/NuGetGallery.AppHost.Tools/SeedBlobs.cs:197-209 | src/NuGetGallery.AppHost.Tools/SeedBlobs.cs:213-226 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) src/NuGet.Services.Metadata.Catalog.Monitoring/Resources/PackageRegistrationMetadataResourceV3.cs:30 — src/NuGet.Services.Metadata.Catalog.Monitoring/Resources/PackageRegistrationMetadataResourceV3.cs:30-42 | src/NuGet.Services.Metadata.Catalog.Monitoring/Resources/PackageRegistrationMetadataResourceV3.cs:45-57 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) src/NuGet.Services.AzureSearch/Auxiliary2AzureSearch/UpdateDownloadsCommand.cs:95 — src/NuGet.Services.AzureSearch/Auxiliary2AzureSearch/UpdateDownloadsCommand.cs:95-107 | src/NuGet.Services.AzureSearch/Auxiliary2AzureSearch/UpdateVerifiedPackagesCommand.cs:36-48 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) REDACTED:104 — REDACTED:104-116 | REDACTED:426-439 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) src/NuGetGallery.Core/Packaging/PackageMetadata.cs:197 — src/NuGetGallery.Core/Packaging/PackageMetadata.cs:197-209 | REDACTED:42-54 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) src/NuGetGallery/App_Start/DefaultDependenciesModule.cs:1775 — src/NuGetGallery/App_Start/DefaultDependenciesModule.cs:1775-1787 | src/AccountDeleter/Job.cs:279-291 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (5 corresponding lines) · ×11
  • Edited copy of a member (5 corresponding lines) src/NuGet.Services.Messaging/EmailMessageEnqueuer.cs:21 — src/NuGet.Services.Messaging/EmailMessageEnqueuer.cs:21-25 | src/Validation.ScanAndSign.Core/ScanAndSignEnqueuer.cs:25-39 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) src/NuGet.Services.V3/CommitCollectorUtility.cs:28 — src/NuGet.Services.V3/CommitCollectorUtility.cs:28-40 | src/NuGet.Services.AzureSearch/Auxiliary2AzureSearch/DownloadSetComparer.cs:23-27 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) src/NuGet.Jobs.Catalog2Registration/RegistrationCollectorLogic.cs:29 — src/NuGet.Jobs.Catalog2Registration/RegistrationCollectorLogic.cs:29-41 | src/StatusAggregator/Update/ActiveEventEntityUpdater.cs:24-28 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) src/NuGet.Services.Messaging.Email/AsynchronousEmailMessageService.cs:23 — src/NuGet.Services.Messaging.Email/AsynchronousEmailMessageService.cs:23-27 | src/NuGet.Jobs.GitHubIndexer/GitRepoSearchers/GitHub/GitHubSearcher.cs:30-35 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) src/NuGetGallery/Infrastructure/Mail/Messages/OrganizationMemberRemovedMessage.cs:20 — src/NuGetGallery/Infrastructure/Mail/Messages/OrganizationMemberRemovedMessage.cs:20-24 | src/NuGetGallery/Infrastructure/Mail/Messages/OrganizationMemberUpdatedMessage.cs:20-24 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) src/NuGetGallery/Areas/Admin/Controllers/FeaturesController.cs:29 — src/NuGetGallery/Areas/Admin/Controllers/FeaturesController.cs:29-34 | src/NuGet.Services.KeyVault/RefreshableSecretReader.cs:29-33 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) src/NuGetGallery/Areas/Admin/Controllers/FederatedCredentialsController.cs:71 — src/NuGetGallery/Areas/Admin/Controllers/FederatedCredentialsController.cs:71-75 | src/NuGetGallery/Areas/Admin/Controllers/PackageOwnershipController.cs:27-32 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) src/NuGetGallery/Areas/Admin/Controllers/ReservedNamespaceController.cs:166 — src/NuGetGallery/Areas/Admin/Controllers/ReservedNamespaceController.cs:166-172 | src/NuGetGallery/Areas/Admin/Controllers/SecurityPolicyController.cs:121-125 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) src/NuGet.Services.Storage/FileStorageFactory.cs:15 — src/NuGet.Services.Storage/FileStorageFactory.cs:15-19 | src/Catalog/Persistence/FileStorageFactory.cs:13-18 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) src/NuGetGallery.Core/Auditing/AuditedEntities/AuditedFeatureFlagFeature.cs:16 — src/NuGetGallery.Core/Auditing/AuditedEntities/AuditedFeatureFlagFeature.cs:16-20 | src/NuGetGallery.Core/Auditing/AuditedEntities/AuditedFeatureFlagFlight.cs:19-23 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) src/NuGetGallery/Controllers/TokenApiController.cs:43 — src/NuGetGallery/Controllers/TokenApiController.cs:43-47 | src/PackageHash/BatchProcessor.cs:25-29 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×11
  • Duplicated block (6 lines × 2) src/NuGetGallery/Services/PackageMetadataValidationService.cs:480 — src/NuGetGallery/Services/PackageMetadataValidationService.cs:480-485 | src/NuGetGallery/Services/PackageMetadataValidationService.cs:655-660 — 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 `src/NuGetGallery/Services/PackageMetadataValidationService.cs:480` 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) src/NuGetGallery/OData/V1FeedPackage.cs:20 — src/NuGetGallery/OData/V1FeedPackage.cs:20-25 | src/NuGetGallery/OData/V2FeedPackage.cs:21-26 — 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 (6 lines × 2) src/NuGetGallery/Controllers/StagingApiController.cs:112 — src/NuGetGallery/Controllers/StagingApiController.cs:112-117 | src/NuGetGallery/Controllers/StagingApiController.cs:167-172 — 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 `src/NuGetGallery/Controllers/StagingApiController.cs:112` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `request` to `StagePackageRequest` in one and `StageSymbolPackageRequest` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (6 lines × 2) src/NuGetGallery/App_Start/NuGetODataV1FeedConfig.cs:60 — src/NuGetGallery/App_Start/NuGetODataV1FeedConfig.cs:60-65 | src/NuGetGallery/App_Start/NuGetODataV2FeedConfig.cs:59-64 — 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 (6 lines × 2) REDACTED:41 — REDACTED:41-46 | REDACTED:47-52 — 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. 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 (6 lines × 2) src/NuGetGallery.Core/Infrastructure/Mail/Messages/PackageAddedMessage.cs:33 — src/NuGetGallery.Core/Infrastructure/Mail/Messages/PackageAddedMessage.cs:33-38 | src/NuGetGallery.Core/Infrastructure/Mail/Messages/SymbolPackageAddedMessage.cs:34-39 — before extracting anything, compare `src/NuGetGallery.Core/Infrastructure/Mail/Messages/PackageAddedMessage.cs` and `src/NuGetGallery.Core/Infrastructure/Mail/Messages/SymbolPackageAddedMessage.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 51 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 `src/NuGetGallery.Core/Infrastructure/Mail/Messages/PackageAddedMessage.cs:33` 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 (6 lines × 2) src/NuGetGallery/Services/PackageStagingPromotionService.cs:441 — src/NuGetGallery/Services/PackageStagingPromotionService.cs:441-446 | src/NuGetGallery/Services/PackageStagingPromotionService.cs:448-453 — 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 `src/NuGetGallery/Services/PackageStagingPromotionService.cs:441` 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) src/NuGetGallery/Controllers/StagingApiController.cs:403 — src/NuGetGallery/Controllers/StagingApiController.cs:403-408 | REDACTED:387-394 — 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 `REDACTED:387` 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) src/NuGetGallery.Core/SemVerLevelKey.cs:25 — src/NuGetGallery.Core/SemVerLevelKey.cs:25-30 | src/NuGetGallery.Core/SemVerLevelKey.cs:36-44 — 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 `src/NuGetGallery.Core/SemVerLevelKey.cs:25` 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, `src/NuGetGallery.Core/SemVerLevelKey.cs:44` calls `Or` and `src/NuGetGallery.Core/SemVerLevelKey.cs: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 (6 lines × 2) src/NuGetGallery/Infrastructure/Mail/Messages/OrganizationMemberRemovedMessage.cs:34 — src/NuGetGallery/Infrastructure/Mail/Messages/OrganizationMemberRemovedMessage.cs:34-39 | src/NuGetGallery/Infrastructure/Mail/Messages/OrganizationMemberUpdatedMessage.cs:34-39 — 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. 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 (6 lines × 2) src/NuGetGallery/Infrastructure/Mail/Messages/OrganizationTransformAcceptedMessage.cs:32 — src/NuGetGallery/Infrastructure/Mail/Messages/OrganizationTransformAcceptedMessage.cs:32-37 | src/NuGetGallery/Infrastructure/Mail/Messages/OrganizationTransformInitiatedMessage.cs:38-43 — 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. 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 · Edited copy of a member (11 corresponding lines) · ×10
  • Edited copy of a member (11 corresponding lines) src/NuGet.Services.AzureSearch/SearchDocumentBuilder.cs:439 — src/NuGet.Services.AzureSearch/SearchDocumentBuilder.cs:439-449 | src/NuGet.Services.AzureSearch/SearchDocumentBuilder.cs:481-491 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) src/NuGetGallery/Areas/Admin/DynamicData/FieldTemplates/Enumeration_Edit.ascx.cs:14 — src/NuGetGallery/Areas/Admin/DynamicData/FieldTemplates/Enumeration_Edit.ascx.cs:14-26 | src/NuGetGallery/Areas/Admin/DynamicData/FieldTemplates/ForeignKey_Edit.ascx.cs:9-19 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) src/NuGet.Services.Validation.Orchestrator/Services/StagedSymbolPackageMessageService.cs:28 — src/NuGet.Services.Validation.Orchestrator/Services/StagedSymbolPackageMessageService.cs:28-38 | src/NuGet.Services.Validation.Orchestrator/Services/StagedSymbolPackageMessageService.cs:41-52 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) src/NuGetGallery/Infrastructure/CookieTempDataProvider.cs:111 — src/NuGetGallery/Infrastructure/CookieTempDataProvider.cs:111-128 | src/NuGetGallery.Services/Extensions/HttpContextBaseExtensions.cs:22-32 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) REDACTED:836 — REDACTED:836-846 | REDACTED:3155-3165 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) src/Validation.Symbols.Core/SymbolsIngesterMessageSerializer.cs:17 — src/Validation.Symbols.Core/SymbolsIngesterMessageSerializer.cs:17-27 | src/Validation.Symbols.Core/SymbolsValidatorMessageSerializer.cs:17-27 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) src/NuGet.Services.AzureSearch/IndexBuilder.cs:111 — src/NuGet.Services.AzureSearch/IndexBuilder.cs:111-121 | src/UpdateBlobProperties/Updater.cs:84-95 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) src/NuGetGallery/Filters/AdminActionAttribute.cs:12 — src/NuGetGallery/Filters/AdminActionAttribute.cs:12-22 | src/NuGetGallery/Filters/ElevatedAdminActionAttribute.cs:12-22 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) src/NuGet.Services.AzureSearch/IndexBuilder.cs:111 — src/NuGet.Services.AzureSearch/IndexBuilder.cs:111-121 | src/NuGetGallery.AppHost.Tools/BootstrapSearch.cs:63-73 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) src/NuGet.Services.Storage/FileStorage.cs:21 — src/NuGet.Services.Storage/FileStorage.cs:21-31 | src/Catalog/Persistence/FileStorage.cs:22-32 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D10 · Test Quality · Races the wall clock · ×9
  • Races the wall clock: SetsEnqueueTime tests/Validation.PackageSigning.ScanAndSign.Tests/ScanAndSignEnqueuerFacts.cs:118 — This test reads `DateTimeOffset.UtcNow` and compares it against the value the code under test computed from its own clock read, compared exactly in `Assert.Equal(messageDelayDays, (_serializedMessage.ScheduledEnqueueTimeUtc - DateTimeOffset.UtcNow).TotalDays, 0)`. Those are two independent clock reads, so the test passes only while no boundary falls between them — a second ticking over between the code's read and the test's, or, for a date, a day that differs between the machine's local zone and UTC. It passes or fails on the time of day and the build agent's time zone, and re-running the suite on one machine cannot reveal it. Read the clock once: give the code under test a clock the test controls (a fake time provider, fake timers with a fixed system time) and build the expectation from that same instant, or assert a range rather than an exact value.
  • Races the wall clock: SetsEnqueueTimeWhenOverriden tests/Validation.PackageSigning.ScanAndSign.Tests/ScanAndSignEnqueuerFacts.cs:129 — This test reads `DateTimeOffset.UtcNow` and compares it against the value the code under test computed from its own clock read, compared exactly in `Assert.Equal(expectedDelayDays, (_serializedMessage.ScheduledEnqueueTimeUtc - DateTimeOffset.UtcNow).TotalDays, 0)`. Those are two independent clock reads, so the test passes only while no boundary falls between them — a second ticking over between the code's read and the test's, or, for a date, a day that differs between the machine's local zone and UTC. It passes or fails on the time of day and the build agent's time zone, and re-running the suite on one machine cannot reveal it. Read the clock once: give the code under test a clock the test controls (a fake time provider, fake timers with a fixed system time) and build the expectation from that same instant, or assert a range rather than an exact value.
  • Races the wall clock: SetsEnqueueTime tests/Validation.PackageSigning.ScanAndSign.Tests/ScanAndSignEnqueuerFacts.cs:192 — This test reads `DateTimeOffset.UtcNow` and compares it against the value the code under test computed from its own clock read, compared exactly in `Assert.Equal(messageDelayDays, (_serializedMessage.ScheduledEnqueueTimeUtc - DateTimeOffset.UtcNow).TotalDays, 0)`. Those are two independent clock reads, so the test passes only while no boundary falls between them — a second ticking over between the code's read and the test's, or, for a date, a day that differs between the machine's local zone and UTC. It passes or fails on the time of day and the build agent's time zone, and re-running the suite on one machine cannot reveal it. Read the clock once: give the code under test a clock the test controls (a fake time provider, fake timers with a fixed system time) and build the expectation from that same instant, or assert a range rather than an exact value.
  • Races the wall clock: SetsEnqueueTimeWhenOverriden tests/Validation.PackageSigning.ScanAndSign.Tests/ScanAndSignEnqueuerFacts.cs:203 — This test reads `DateTimeOffset.UtcNow` and compares it against the value the code under test computed from its own clock read, compared exactly in `Assert.Equal(expectedDelayDays, (_serializedMessage.ScheduledEnqueueTimeUtc - DateTimeOffset.UtcNow).TotalDays, 0)`. Those are two independent clock reads, so the test passes only while no boundary falls between them — a second ticking over between the code's read and the test's, or, for a date, a day that differs between the machine's local zone and UTC. It passes or fails on the time of day and the build agent's time zone, and re-running the suite on one machine cannot reveal it. Read the clock once: give the code under test a clock the test controls (a fake time provider, fake timers with a fixed system time) and build the expectation from that same instant, or assert a range rather than an exact value.
  • Races the wall clock: TryUpdateSymbolsServerRequestAsyncUpdateRequestIfInDatabase tests/Validation.Symbols.Core.Tests/SymbolsValidationEntitiesServiceFacts.cs:151 — This test reads `DateTime.UtcNow` and compares it against the value the code under test computed from its own clock read, compared exactly in `Assert.Equal(DateTime.UtcNow.Year, request.LastUpdated.Year)`. Those are two independent clock reads, so the test passes only while no boundary falls between them — a second ticking over between the code's read and the test's, or, for a date, a day that differs between the machine's local zone and UTC. It passes or fails on the time of day and the build agent's time zone, and re-running the suite on one machine cannot reveal it. Read the clock once: give the code under test a clock the test controls (a fake time provider, fake timers with a fixed system time) and build the expectation from that same instant, or assert a range rather than an exact value.
  • Races the wall clock: SetsEnqueueTime tests/Validation.ContentScan.tests/ContentScanEnqueuerFacts.cs:106 — This test reads `DateTimeOffset.UtcNow` and compares it against the value the code under test computed from its own clock read, compared exactly in `Assert.Equal(messageDelayDays, (_serializedMessage.ScheduledEnqueueTimeUtc - DateTimeOffset.UtcNow).TotalDays, 0)`. Those are two independent clock reads, so the test passes only while no boundary falls between them — a second ticking over between the code's read and the test's, or, for a date, a day that differs between the machine's local zone and UTC. It passes or fails on the time of day and the build agent's time zone, and re-running the suite on one machine cannot reveal it. Read the clock once: give the code under test a clock the test controls (a fake time provider, fake timers with a fixed system time) and build the expectation from that same instant, or assert a range rather than an exact value.
  • Races the wall clock: SetsEnqueueTimeWhenOverriden tests/Validation.ContentScan.tests/ContentScanEnqueuerFacts.cs:117 — This test reads `DateTimeOffset.UtcNow` and compares it against the value the code under test computed from its own clock read, compared exactly in `Assert.Equal(expectedDelayDays, (_serializedMessage.ScheduledEnqueueTimeUtc - DateTimeOffset.UtcNow).TotalDays, 0)`. Those are two independent clock reads, so the test passes only while no boundary falls between them — a second ticking over between the code's read and the test's, or, for a date, a day that differs between the machine's local zone and UTC. It passes or fails on the time of day and the build agent's time zone, and re-running the suite on one machine cannot reveal it. Read the clock once: give the code under test a clock the test controls (a fake time provider, fake timers with a fixed system time) and build the expectation from that same instant, or assert a range rather than an exact value.
  • Races the wall clock: SetsEnqueueTime tests/Validation.ContentScan.tests/ContentScanEnqueuerFacts.cs:156 — This test reads `DateTimeOffset.UtcNow` and compares it against the value the code under test computed from its own clock read, compared exactly in `Assert.Equal(messageDelayDays, (_serializedMessage.ScheduledEnqueueTimeUtc - DateTimeOffset.UtcNow).TotalDays, 0)`. Those are two independent clock reads, so the test passes only while no boundary falls between them — a second ticking over between the code's read and the test's, or, for a date, a day that differs between the machine's local zone and UTC. It passes or fails on the time of day and the build agent's time zone, and re-running the suite on one machine cannot reveal it. Read the clock once: give the code under test a clock the test controls (a fake time provider, fake timers with a fixed system time) and build the expectation from that same instant, or assert a range rather than an exact value.
  • Races the wall clock: SetsEnqueueTimeWhenOverriden tests/Validation.ContentScan.tests/ContentScanEnqueuerFacts.cs:167 — This test reads `DateTimeOffset.UtcNow` and compares it against the value the code under test computed from its own clock read, compared exactly in `Assert.Equal(expectedDelayDays, (_serializedMessage.ScheduledEnqueueTimeUtc - DateTimeOffset.UtcNow).TotalDays, 0)`. Those are two independent clock reads, so the test passes only while no boundary falls between them — a second ticking over between the code's read and the test's, or, for a date, a day that differs between the machine's local zone and UTC. It passes or fails on the time of day and the build agent's time zone, and re-running the suite on one machine cannot reveal it. Read the clock once: give the code under test a clock the test controls (a fake time provider, fake timers with a fixed system time) and build the expectation from that same instant, or assert a range rather than an exact value.
D29 · Static Analysis (SAST) · REDACTED · ×9
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (8 corresponding lines) · ×9
  • Edited copy of a member (8 corresponding lines) src/NuGet.Jobs.Catalog2Registration/Catalog2RegistrationCommand.cs:38 — src/NuGet.Jobs.Catalog2Registration/Catalog2RegistrationCommand.cs:38-45 | src/NuGet.Services.AzureSearch/Catalog2AzureSearch/Catalog2AzureSearchCommand.cs:38-46 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) src/Catalog/Icons/CatalogLeafDataProcessor.cs:40 — src/Catalog/Icons/CatalogLeafDataProcessor.cs:40-48 | src/Catalog/Icons/IconsCollector.cs:39-46 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) src/NuGetGallery.Core/Services/StagingDeletionService.cs:34 — src/NuGetGallery.Core/Services/StagingDeletionService.cs:34-42 | src/NuGetGallery.Core/Services/StagingGroupPromotionService.cs:41-48 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) src/NuGet.Jobs.Catalog2Registration/Schema/EntityBuilder.cs:219 — src/NuGet.Jobs.Catalog2Registration/Schema/EntityBuilder.cs:219-226 | src/NuGet.Jobs.Catalog2Registration/Schema/EntityBuilder.cs:238-245 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) src/NuGetGallery/Infrastructure/Mail/Messages/ContactOwnersMessage.cs:23 — src/NuGetGallery/Infrastructure/Mail/Messages/ContactOwnersMessage.cs:23-30 | src/NuGetGallery/Infrastructure/Mail/Messages/ContactSupportMessage.cs:23-30 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) src/NuGet.Services.Storage/FileStorage.cs:45 — src/NuGet.Services.Storage/FileStorage.cs:45-52 | src/Catalog/Persistence/FileStorage.cs:41-48 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) src/NuGet.Services.Validation.Orchestrator/Services/PackageEntityService.cs:35 — src/NuGet.Services.Validation.Orchestrator/Services/PackageEntityService.cs:35-44 | src/NuGet.Services.Validation.Orchestrator/Services/SymbolEntityService.cs:44-51 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) src/NuGet.Services.Entities/SymbolPackage.cs:84 — src/NuGet.Services.Entities/SymbolPackage.cs:84-91 | src/NuGet.Services.Entities/User.cs:218-225 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) src/NuGetGallery.Core/Infrastructure/Mail/Messages/PackageAddedMessage.cs:112 — src/NuGetGallery.Core/Infrastructure/Mail/Messages/PackageAddedMessage.cs:112-119 | src/NuGetGallery.Core/Infrastructure/Mail/Messages/SymbolPackageAddedMessage.cs:107-114 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (14 corresponding lines) · ×9
  • Edited copy of a member (14 corresponding lines) src/NuGetGallery/App_Start/DefaultDependenciesModule.cs:1374 — src/NuGetGallery/App_Start/DefaultDependenciesModule.cs:1374-1387 | src/NuGetGallery/App_Start/DefaultDependenciesModule.cs:1390-1403 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) src/NuGet.Services.Validation.Orchestrator/ContentScan/ContentScanValidator.cs:30 — src/NuGet.Services.Validation.Orchestrator/ContentScan/ContentScanValidator.cs:30-55 | src/NuGet.Services.Validation.Orchestrator/PackageSigning/ValidateCertificate/PackageCertificatesValidator.cs:45-58 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) src/Catalog/Helpers/Retry.cs:29 — src/Catalog/Helpers/Retry.cs:29-42 | src/Catalog/Helpers/Retry.cs:63-82 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) src/NuGetGallery/Areas/Admin/Services/ValidationAdminService.cs:234 — src/NuGetGallery/Areas/Admin/Services/ValidationAdminService.cs:234-247 | src/NuGetGallery/Areas/Admin/Services/ValidationAdminService.cs:266-279 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) src/NuGetGallery.Core/Auditing/FederatedCredentialPolicyAuditRecord.cs:228 — src/NuGetGallery.Core/Auditing/FederatedCredentialPolicyAuditRecord.cs:228-241 | src/NuGetGallery.Core/Auditing/FederatedCredentialPolicyAuditRecord.cs:245-258 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) src/Validation.Common.Job/Leases/CloudBlobLeaseService.cs:96 — src/Validation.Common.Job/Leases/CloudBlobLeaseService.cs:96-119 | src/NuGet.Services.Storage/BlobLeaseService.cs:115-128 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) src/NuGet.Services.Validation.Orchestrator/PackageSigning/ProcessSignature/ProcessSignatureEnqueuer.cs:32 — src/NuGet.Services.Validation.Orchestrator/PackageSigning/ProcessSignature/ProcessSignatureEnqueuer.cs:32-45 | src/NuGet.Services.Validation.Orchestrator/PackageSigning/ValidateCertificate/ValidateCertificateEnqueuer.cs:29-42 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) src/NuGetGallery.Services/Authentication/Federated/GitHubCriteria.cs:109 — src/NuGetGallery.Services/Authentication/Federated/GitHubCriteria.cs:109-122 | src/NuGetGallery.Services/Authentication/Federated/GitLabCriteria.cs:110-123 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) src/NuGet.Services.AzureSearch/HijackDocumentBuilder.cs:36 — src/NuGet.Services.AzureSearch/HijackDocumentBuilder.cs:36-49 | src/NuGet.Services.AzureSearch/SearchDocumentBuilder.cs:117-132 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (7 corresponding lines) · ×9
  • Edited copy of a member (7 corresponding lines) src/NuGetGallery/Services/StagingQuotaService.cs:91 — src/NuGetGallery/Services/StagingQuotaService.cs:91-97 | src/NuGetGallery/Services/StagingQuotaService.cs:100-106 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) src/NuGet.Jobs.Catalog2Registration/Hives/HiveStorage.cs:40 — src/NuGet.Jobs.Catalog2Registration/Hives/HiveStorage.cs:40-47 | src/NuGet.Jobs.Catalog2Registration/Hives/HiveUpdater.cs:35-41 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) src/NuGetGallery/Areas/Admin/Controllers/ChangeUsernameController.cs:32 — src/NuGetGallery/Areas/Admin/Controllers/ChangeUsernameController.cs:32-38 | src/NuGetGallery.Services/Authentication/Federated/FederatedCredentialPolicyEvaluator.cs:57-63 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) src/NuGetGallery/Infrastructure/HijackSearchServiceFactory.cs:32 — src/NuGetGallery/Infrastructure/HijackSearchServiceFactory.cs:32-38 | src/NuGet.Services.AzureSearch/Catalog2AzureSearch/CatalogIndexActionBuilder.cs:35-42 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) src/NuGet.Services.AzureSearch/Auxiliary2AzureSearch/UpdateVerifiedPackagesCommand.cs:27 — src/NuGet.Services.AzureSearch/Auxiliary2AzureSearch/UpdateVerifiedPackagesCommand.cs:27-33 | src/NuGet.Services.AzureSearch/SearchService/AuxiliaryDataCache.cs:32-39 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) src/NuGet.Services.ServiceBus/SubscriptionProcessor.cs:45 — src/NuGet.Services.ServiceBus/SubscriptionProcessor.cs:45-54 | src/StatusAggregator/Collector/ManualStatusChangeCollectorProcessor.cs:30-36 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) src/NuGetGallery/Services/PackageStagingManagementService.cs:1023 — src/NuGetGallery/Services/PackageStagingManagementService.cs:1023-1030 | src/NuGetGallery/Services/PackageStagingUploadService.cs:663-669 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) src/GalleryTools/Commands/ReserveNamespacesCommand.cs:166 — src/GalleryTools/Commands/ReserveNamespacesCommand.cs:166-172 | src/GalleryTools/Commands/ReflowCommand.cs:160-166 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) src/NuGetGallery.Core/Features/FeatureFlagFileStorageService.cs:48 — src/NuGetGallery.Core/Features/FeatureFlagFileStorageService.cs:48-54 | src/NuGetGallery.Core/Login/LoginDiscontinuationFileStorageService.cs:45-51 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D10 · Test Quality · No assertions · ×8
  • No assertions: NullTelemetryItemDoesNotThrow tests/NuGetGallery.Facts/Telemetry/ClientTelemetryPIIProcessorTests.cs:30 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: NullRequestTelemetryUrlDoesNotThrow tests/NuGetGallery.Facts/Telemetry/ClientTelemetryPIIProcessorTests.cs:40 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: IgnoresOutcomeForNonCurrentAttempt tests/NuGet.Services.Validation.Orchestrator.Tests/StagedPackageStatusProcessorFacts.cs:112 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: TestHomePageLinks tests/NuGetGallery.FunctionalTests/WebPages/LinksTests.cs:24 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: TestPackagesPageLinks tests/NuGetGallery.FunctionalTests/WebPages/LinksTests.cs:33 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: TestPackageDetailsPageLinks tests/NuGetGallery.FunctionalTests/WebPages/LinksTests.cs:42 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: TestStatisticsPageLinks tests/NuGetGallery.FunctionalTests/WebPages/LinksTests.cs:52 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: TestAboutGalleryPageLinks tests/NuGetGallery.FunctionalTests/WebPages/LinksTests.cs:61 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×8
  • Duplicated block (11 lines × 2) src/NuGet.Services.V3/Registration/Models/RegistrationLeafItem.cs:14 — src/NuGet.Services.V3/Registration/Models/RegistrationLeafItem.cs:14-24 | src/NuGet.Services.V3/Registration/Models/RegistrationPage.cs:18-28 — 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 (11 lines × 2) src/NuGetGallery/Infrastructure/Mail/Messages/ReportAbuseMessage.cs:27 — src/NuGetGallery/Infrastructure/Mail/Messages/ReportAbuseMessage.cs:27-37 | src/NuGetGallery/Infrastructure/Mail/Messages/ReportMyPackageMessage.cs:25-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.
  • Duplicated block (11 lines × 2) src/NuGet.Services.Entities/StagedPackage.cs:13 — src/NuGet.Services.Entities/StagedPackage.cs:13-23 | src/NuGet.Services.Entities/StagedSymbolPackage.cs:20-30 — 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 (11 lines × 2) src/Catalog/Persistence/AzureStorage.cs:299 — src/Catalog/Persistence/AzureStorage.cs:299-309 | src/NuGet.Services.Storage/AzureStorage.cs:322-332 — 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 `src/Catalog/Persistence/AzureStorage.cs:299` 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) src/NuGet.Services.AzureSearch/AuxiliaryFiles/PopularityTransferDataClient.cs:94 — src/NuGet.Services.AzureSearch/AuxiliaryFiles/PopularityTransferDataClient.cs:94-104 | src/NuGet.Services.AzureSearch/AuxiliaryFiles/VerifiedPackagesDataClient.cs:95-105 — before extracting anything, compare `src/NuGet.Services.AzureSearch/AuxiliaryFiles/PopularityTransferDataClient.cs` and `src/NuGet.Services.AzureSearch/AuxiliaryFiles/VerifiedPackagesDataClient.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 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 `src/NuGet.Services.AzureSearch/AuxiliaryFiles/PopularityTransferDataClient.cs:94` 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 first that the copies are not typed on the same thing: the declarations holding them bind `newData` to `PopularityTransferData` in one and `HashSet<string>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (11 lines × 2) src/AccountDeleter/Job.cs:235 — src/AccountDeleter/Job.cs:235-245 | src/NuGetGallery/App_Start/DefaultDependenciesModule.cs:275-285 — 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 `src/AccountDeleter/Job.cs:235` 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) src/NuGetGallery.Core/Services/CloudBlobWrapper.cs:262 — src/NuGetGallery.Core/Services/CloudBlobWrapper.cs:262-272 | src/NuGetGallery.Core/Services/CloudBlobWrapper.cs:276-286 — 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 (11 lines × 2) REDACTED:962 — REDACTED:962-972 | REDACTED:2479-2489 — 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, `REDACTED:960` calls `GetReadMeHtmlAsync` and `REDACTED:2477` 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.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×8
  • Duplicated block (9 lines × 2) src/NuGetGallery.Services/PackageManagement/PackageService.cs:343 — src/NuGetGallery.Services/PackageManagement/PackageService.cs:343-351 | src/NuGetGallery.Services/PackageManagement/PackageService.cs:379-387 — 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 `src/NuGetGallery.Services/PackageManagement/PackageService.cs:343` 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 (9 lines × 2) src/NuGetGallery/Services/PackageStagingManagementService.cs:800 — src/NuGetGallery/Services/PackageStagingManagementService.cs:800-808 | src/NuGetGallery/Services/PackageStagingManagementService.cs:833-841 — 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) src/Ng/Jobs/Catalog2DnxJob.cs:42 — src/Ng/Jobs/Catalog2DnxJob.cs:42-50 | src/Ng/Jobs/Db2CatalogJob.cs:60-68 — 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 (9 lines × 2) src/GalleryTools/Commands/CreateOrganizationCommand.cs:53 — src/GalleryTools/Commands/CreateOrganizationCommand.cs:53-61 | src/GalleryTools/Commands/SeedFunctionalTestsCommand.cs:68-92 — 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. 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 (9 lines × 2) src/AccountDeleter/AccountDeleteUserService.cs:111 — src/AccountDeleter/AccountDeleteUserService.cs:111-119 | src/NuGetGallery.Services/UserManagement/UserService.cs:374-382 — 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 (9 lines × 2) REDACTED:165 — REDACTED:165-173 | REDACTED:190-198 — 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) src/NuGetGallery/Areas/Admin/Controllers/DeleteController.cs:55 — src/NuGetGallery/Areas/Admin/Controllers/DeleteController.cs:55-63 | src/NuGetGallery/Areas/Admin/Controllers/UpdateListedController.cs:35-43 — 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. 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 (9 lines × 2) src/Catalog/Persistence/Storage.cs:205 — src/Catalog/Persistence/Storage.cs:205-213 | src/NuGet.Services.Storage/Storage.cs:302-310 — 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.
R10 · Code Duplication · Duplicated block (10 lines × 2 locations) · ×8
  • Duplicated block (10 lines × 2 locations) src/Bootstrap/js/tooltip.js:253 — src/Bootstrap/js/tooltip.js:253 · src/Bootstrap/js/tooltip.js:290 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (10 lines × 2 locations) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:1110 — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:1110 · src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:3682 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (10 lines × 2 locations) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:1495 — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:1495 · src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:4602 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (10 lines × 2 locations) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:3336 — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:3336 · src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:3450 — 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 locations) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:6365 — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:6365 · src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:14277 — 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 locations) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:8916 — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:8916 · src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:8981 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (10 lines × 2 locations) src/NuGetGallery/Scripts/gallery/page-manage-packages.js:264 — src/NuGetGallery/Scripts/gallery/page-manage-packages.js:264 · src/NuGetGallery/Scripts/gallery/page-manage-packages.js:321 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (10 lines × 2 locations) src/NuGetGallery/Scripts/gallery/page-staging-group.js:128 — src/NuGetGallery/Scripts/gallery/page-staging-group.js:128 · src/NuGetGallery/Scripts/gallery/page-staging-group.js:139 — 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 · Edited copy of a member (16 corresponding lines) · ×7
  • Edited copy of a member (16 corresponding lines) src/NuGet.Services.AzureSearch/Auxiliary2AzureSearch/UpdateOwnersCommand.cs:39 — src/NuGet.Services.AzureSearch/Auxiliary2AzureSearch/UpdateOwnersCommand.cs:39-56 | src/NuGet.Services.AzureSearch/Catalog2AzureSearch/AzureSearchCollectorLogic.cs:35-50 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) src/NuGetGallery/Extensions/SimulatedErrorTypeExtensions.cs:16 — src/NuGetGallery/Extensions/SimulatedErrorTypeExtensions.cs:16-43 | src/NuGetGallery/Extensions/SimulatedErrorTypeExtensions.cs:46-61 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) src/NuGetGallery.Services/Authentication/ApiKeyV3.cs:67 — src/NuGetGallery.Services/Authentication/ApiKeyV3.cs:67-82 | src/NuGetGallery.Services/Authentication/ApiKeyV4.cs:67-83 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) REDACTED:764 — REDACTED:764-780 | REDACTED:1062-1077 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) src/NuGetGallery/ExtensionMethods.cs:366 — src/NuGetGallery/ExtensionMethods.cs:366-381 | src/NuGetGallery/ExtensionMethods.cs:388-403 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) REDACTED:176 — REDACTED:176-191 | REDACTED:219-234 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) src/NuGet.Services.AzureSearch/HijackDocumentBuilder.cs:55 — src/NuGet.Services.AzureSearch/HijackDocumentBuilder.cs:55-70 | src/NuGet.Services.AzureSearch/HijackDocumentBuilder.cs:76-91 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×7
  • Edited copy of a member (9 corresponding lines) src/NuGet.Services.Validation.Orchestrator/StagedSymbolPackageValidationOutcomeProcessor.cs:36 — src/NuGet.Services.Validation.Orchestrator/StagedSymbolPackageValidationOutcomeProcessor.cs:36-44 | src/NuGet.Jobs.GitHubIndexer/ReposIndexer.cs:50-67 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) src/NuGetGallery/Services/CertificateService.cs:33 — src/NuGetGallery/Services/CertificateService.cs:33-41 | src/NuGetGallery.Services/Security/SecurityPolicyService.cs:62-78 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) src/NuGetGallery.AppHost.Tools/ConfigureValidation.cs:59 — src/NuGetGallery.AppHost.Tools/ConfigureValidation.cs:59-72 | src/NuGetGallery.AppHost.Tools/ConfigureValidation.cs:75-83 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) src/GitHubVulnerabilities2v3/Extensions/BlobStorageVulnerabilityWriter.cs:370 — src/GitHubVulnerabilities2v3/Extensions/BlobStorageVulnerabilityWriter.cs:370-378 | src/GitHubVulnerabilities2v3/Extensions/BlobStorageVulnerabilityWriter.cs:381-390 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) src/NuGetGallery/Areas/Admin/DynamicData/PageTemplates/ListDetails.aspx.cs:58 — src/NuGetGallery/Areas/Admin/DynamicData/PageTemplates/ListDetails.aspx.cs:58-66 | src/NuGetGallery/Areas/Admin/DynamicData/PageTemplates/List.aspx.cs:53-61 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) src/NuGet.Services.KeyVault/CachingSecretReader.cs:105 — src/NuGet.Services.KeyVault/CachingSecretReader.cs:105-113 | src/NuGet.Services.KeyVault/RefreshableSecretReader.cs:109-118 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) src/NuGetGallery.Core/NuGetVersionExtensions.cs:13 — src/NuGetGallery.Core/NuGetVersionExtensions.cs:13-21 | src/Catalog/Helpers/NuGetVersionUtility.cs:34-42 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×7
  • Duplicated block (5 lines × 2) src/NuGetGallery.Core/Infrastructure/Mail/Messages/PackageValidationFailedMessage.cs:35 — src/NuGetGallery.Core/Infrastructure/Mail/Messages/PackageValidationFailedMessage.cs:35-39 | src/NuGetGallery.Core/Infrastructure/Mail/Messages/SymbolPackageValidationFailedMessage.cs:35-39 — 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) src/NuGet.Services.Validation.Orchestrator/PackageSigning/ProcessSignature/BaseSignatureProcessor.cs:27 — src/NuGet.Services.Validation.Orchestrator/PackageSigning/ProcessSignature/BaseSignatureProcessor.cs:27-31 | src/NuGet.Services.Validation.Orchestrator/PackageSigning/ProcessSignature/PackageSignatureProcessor.cs:33-37 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/NuGet.Services.Validation.Orchestrator/PackageSigning/ProcessSignature/PackageSignatureProcessor.cs:31` calls `base` and `src/NuGet.Services.Validation.Orchestrator/PackageSigning/ProcessSignature/BaseSignatureProcessor.cs:25` 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) src/NuGetGallery/Services/PackageStagingManagementService.cs:1016 — src/NuGetGallery/Services/PackageStagingManagementService.cs:1016-1020 | src/NuGetGallery/Services/SymbolPackageStagingManagementService.cs:172-176 — 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 `src/NuGetGallery/Services/PackageStagingManagementService.cs:1016` 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, `src/NuGetGallery/Services/PackageStagingManagementService.cs:1014` calls `Where`, `Contains` and `src/NuGetGallery/Services/SymbolPackageStagingManagementService.cs:170` 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) src/NuGetGallery/Controllers/StagingApiController.cs:348 — src/NuGetGallery/Controllers/StagingApiController.cs:348-352 | src/NuGetGallery/Controllers/StagingApiController.cs:378-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 `src/NuGetGallery/Controllers/StagingApiController.cs:348` 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 (5 lines × 2) src/NuGetGallery/Areas/Admin/Models/AdminReflowPackageRequest.cs:55 — src/NuGetGallery/Areas/Admin/Models/AdminReflowPackageRequest.cs:55-59 | src/NuGetGallery/Areas/Admin/Models/AdminUpdateListedPackageRequest.cs:58-62 — 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. 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 (5 lines × 2) src/NuGetGallery/Infrastructure/Mail/Messages/OrganizationMembershipRequestCanceledMessage.cs:20 — src/NuGetGallery/Infrastructure/Mail/Messages/OrganizationMembershipRequestCanceledMessage.cs:20-24 | src/NuGetGallery/Infrastructure/Mail/Messages/OrganizationMembershipRequestDeclinedMessage.cs:20-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.
  • Duplicated block (5 lines × 2) src/NuGetGallery.Services/Mail/Messages/PackageOwnershipRequestCanceledMessage.cs:22 — src/NuGetGallery.Services/Mail/Messages/PackageOwnershipRequestCanceledMessage.cs:22-26 | src/NuGetGallery.Services/Mail/Messages/PackageOwnershipRequestDeclinedMessage.cs:22-26 — 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. 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.
D6 · Cohesion (LCOM4) · Low cohesion · ×7
  • Low cohesion: ApiController (LCOM4 6) REDACTED:35 — ApiController's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Job (LCOM4 4) src/Gallery.Maintenance/Job.cs:25 — Job's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: LoginDiscontinuation (LCOM4 4) src/NuGetGallery.Core/Login/LoginDiscontinuation.cs:11 — LoginDiscontinuation's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: AppController (LCOM4 4) src/NuGetGallery/Controllers/AppController.cs:15 — AppController's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: PagesController (LCOM4 4) REDACTED:19 — PagesController's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: NuGetODataController (LCOM4 4) src/NuGetGallery/OData/NuGetODataController.cs:20 — NuGetODataController's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: DisplayPackageViewModel (LCOM4 4) src/NuGetGallery/ViewModels/DisplayPackageViewModel.cs:16 — DisplayPackageViewModel's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
AC3 · Page structure · Page without a main landmark · ×6
  • Page without a main landmark src/NuGet.SupportRequests.Notifications/Templates/OnCallSummary.html:1 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
  • Page without a main landmark src/NuGet.SupportRequests.Notifications/Templates/WeeklySummary.html:1 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
  • Page without a main landmark src/NuGetCDNRedirect/Views/Shared/Error.cshtml:2 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
  • Page without a main landmark src/NuGetGallery/App_Offline-Planned.htm:2 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
  • Page without a main landmark src/NuGetGallery/App_Offline-Unplanned.htm:2 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
  • Page without a main landmark src/NuGetGallery/Views/Shared/Gallery/Layout.cshtml:2 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
D35 · Change Coupling · Change coupling · ×6
  • Change coupling: REDACTED ↔ PackageListViewModel.cs REDACTED:1 — `REDACTED` and `src/NuGetGallery/ViewModels/PackageListViewModel.cs` change together 77% of the time (10 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — 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). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `4b17d97f` [Search-by-TFM] New Framework Filter Options UI (#9782); `91115026` Search page A11y fixes (#9387); `20c3ac21` Add sorting and filtering UI to Gallery (#8105) — run `git show` on any of them.
  • Change coupling: ICoreFileStorageService.cs ↔ ISimpleCloudBlob.cs src/NuGetGallery.Core/Services/ICoreFileStorageService.cs:1 — `src/NuGetGallery.Core/Services/ICoreFileStorageService.cs` and `src/NuGetGallery.Core/Services/ISimpleCloudBlob.cs` change together 64% of the time (7 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — 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). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `4c6725a5` Introduce delegation SAS (#10159); `36acf289` Add update blob properties support to cloud storage (#6640); `04f2f6e4` [Revalidation] Add Admin Panel (#6172) — run `git show` on any of them.
  • Change coupling: CloudBlobWrapper.cs ↔ ICoreFileStorageService.cs src/NuGetGallery.Core/Services/CloudBlobWrapper.cs:1 — `src/NuGetGallery.Core/Services/CloudBlobWrapper.cs` and `src/NuGetGallery.Core/Services/ICoreFileStorageService.cs` change together 64% of the time (7 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — 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). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `4c6725a5` Introduce delegation SAS (#10159); `36acf289` Add update blob properties support to cloud storage (#6640); `04f2f6e4` [Revalidation] Add Admin Panel (#6172) — run `git show` on any of them.
  • Change coupling: REDACTED ↔ DisplayPackageViewModel.cs REDACTED:1 — `REDACTED` and `src/NuGetGallery/ViewModels/DisplayPackageViewModel.cs` change together 56% of the time (46 of the 82 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — 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). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 46 shared commits counted here, the most recent 3 are `08de4c10` Better handling of version list when short version list is displayed.…; `011771dc` Exclude the source repo as dependent repo (#10347); `b6e8d973` link to nugettrends.com (#9737) — run `git show` on any of them.
  • Change coupling: SearchAdaptor.cs ↔ PackageListViewModel.cs src/NuGetGallery/OData/SearchService/SearchAdaptor.cs:1 — `src/NuGetGallery/OData/SearchService/SearchAdaptor.cs` and `src/NuGetGallery/ViewModels/PackageListViewModel.cs` change together 54% of the time (7 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — 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). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `4b17d97f` [Search-by-TFM] New Framework Filter Options UI (#9782); `20c3ac21` Add sorting and filtering UI to Gallery (#8105); `5738a83c` Add sorting and filtering in gallery (without UI) (#8089) — run `git show` on any of them.
  • Change coupling: UpdateDownloadsCommand.cs ↔ NewPackageRegistrationFromDbProducer.cs src/NuGet.Services.AzureSearch/Auxiliary2AzureSearch/UpdateDownloadsCommand.cs:1 — `src/NuGet.Services.AzureSearch/Auxiliary2AzureSearch/UpdateDownloadsCommand.cs` and `src/NuGet.Services.AzureSearch/Db2AzureSearch/NewPackageRegistrationFromDbProducer.cs` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — 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). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `022bc10a` Use auth for downloads.v1.json in stats and search jobs (#10137); `0c66f443` Clean up unused Azure Search configuration and fix docs (#1055) (at that commit the file was still `src/NuGet.Services.AzureSearch/Db2AzureSearch/NewPackageRegistrationProducer.cs`); `3a54e765` [Popularity transfers] Disable download overrides if popularity trans… (at that commit the file was still `src/NuGet.Services.AzureSearch/Db2AzureSearch/NewPackageRegistrationProducer.cs`) — run `git show` on any of them.
D4 · Code Duplication · Edited copy of a member (31 corresponding lines) · ×6
  • Edited copy of a member (31 corresponding lines) src/NuGetGallery.Core/Services/CloudWrapperHelpers.cs:117 — src/NuGetGallery.Core/Services/CloudWrapperHelpers.cs:117-150 | src/NuGetGallery.Core/Services/CloudWrapperHelpers.cs:153-186 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) src/NuGetGallery/App_Start/NuGetODataV2FeedConfig.cs:50 — src/NuGetGallery/App_Start/NuGetODataV2FeedConfig.cs:50-89 | src/NuGetGallery/App_Start/NuGetODataV1FeedConfig.cs:51-81 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) src/NuGetGallery/ViewModels/GitHubPolicyDetailsViewModel.cs:123 — src/NuGetGallery/ViewModels/GitHubPolicyDetailsViewModel.cs:123-153 | src/NuGetGallery/ViewModels/GitLabPolicyDetailsViewModel.cs:84-119 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) src/NuGetGallery.Core/Infrastructure/Mail/Messages/PackageValidationFailedMessage.cs:54 — src/NuGetGallery.Core/Infrastructure/Mail/Messages/PackageValidationFailedMessage.cs:54-84 | src/NuGetGallery.Core/Infrastructure/Mail/Messages/SymbolPackageValidationFailedMessage.cs:54-84 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) src/NuGetGallery/Services/ImageDomainValidator.cs:21 — src/NuGetGallery/Services/ImageDomainValidator.cs:21-52 | src/NuGetGallery.Services/PackageManagement/PackageHelper.cs:46-76 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) src/NuGetGallery.Services/Authentication/Providers/AzureActiveDirectory/AzureActiveDirectoryAuthenticatorConfiguration.cs:25 — src/NuGetGallery.Services/Authentication/Providers/AzureActiveDirectory/AzureActiveDirectoryAuthenticatorConfiguration.cs:25-67 | src/NuGetGallery.Services/Authentication/Providers/AzureActiveDirectoryV2/AzureActiveDirectoryV2AuthenticatorConfiguration.cs:23-53 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (29 corresponding lines) · ×6
  • Edited copy of a member (29 corresponding lines) src/NuGetGallery/Services/PackageStagingManagementService.cs:792 — src/NuGetGallery/Services/PackageStagingManagementService.cs:792-820 | src/NuGetGallery/Services/PackageStagingManagementService.cs:824-853 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) src/Ng/CommandHelpers.cs:438 — src/Ng/CommandHelpers.cs:438-474 | src/Ng/CommandHelpers.cs:479-507 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) src/NuGet.Services.Validation.Orchestrator/PackageSigning/ScanAndSign/ScanAndSignProcessor.cs:44 — src/NuGet.Services.Validation.Orchestrator/PackageSigning/ScanAndSign/ScanAndSignProcessor.cs:44-72 | src/NuGet.Services.Validation.Orchestrator/Symbols/SymbolScanValidator.cs:44-73 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) REDACTED:200 — REDACTED:200-229 | REDACTED:247-275 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) src/NuGetGallery.Services/Authentication/ApiKeyV5.cs:366 — src/NuGetGallery.Services/Authentication/ApiKeyV5.cs:366-394 | src/NuGetGallery.Services/Authentication/ApiKeyV5.cs:397-427 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) src/NuGetGallery/Services/SymbolPackageService.cs:51 — src/NuGetGallery/Services/SymbolPackageService.cs:51-86 | src/NuGetGallery.Services/PackageManagement/PackageService.cs:70-98 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×6
  • Edited copy of a member (15 corresponding lines) src/NuGetGallery/Services/PackageStagingManagementService.cs:1006 — src/NuGetGallery/Services/PackageStagingManagementService.cs:1006-1020 | src/NuGetGallery/Services/SymbolPackageStagingManagementService.cs:162-176 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) REDACTED:85 — REDACTED:85-99 | src/NuGetGallery.Services/Authentication/AuthenticationService.cs:53-67 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) src/NuGetGallery/Controllers/StagingApiController.cs:385 — src/NuGetGallery/Controllers/StagingApiController.cs:385-399 | src/NuGetGallery/Controllers/StagingApiController.cs:402-416 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) src/NuGet.Services.Validation.Orchestrator/ValidationPackageFileService.cs:267 — src/NuGet.Services.Validation.Orchestrator/ValidationPackageFileService.cs:267-288 | src/NuGet.Services.Staging.Promotion/StagedPackagePromotionMessageHandler.cs:295-309 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) src/NuGet.Services.AzureSearch/SearchService/IndexOperationBuilder.cs:118 — src/NuGet.Services.AzureSearch/SearchService/IndexOperationBuilder.cs:118-132 | src/NuGet.Services.AzureSearch/SearchService/IndexOperationBuilder.cs:138-152 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) src/NuGetGallery.Services/Configuration/CertificatesConfiguration.cs:30 — src/NuGetGallery.Services/Configuration/CertificatesConfiguration.cs:30-44 | src/NuGetGallery.Services/Configuration/SymbolsConfiguration.cs:30-44 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 5+ corresponding lines) · ×6
  • Edited copies of one member (3 members, 5+ corresponding lines) src/StatusAggregator/Export/EventsExporter.cs:28 — src/StatusAggregator/Export/EventsExporter.cs:28-33 | src/StatusAggregator/Messages/IncidentGroupMessageFilter.cs:27-31 | src/StatusAggregator/Update/AggregationEntityUpdater.cs:33-40 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 5+ corresponding lines) src/NuGet.Services.Messaging/EmailMessageEnqueuer.cs:21 — src/NuGet.Services.Messaging/EmailMessageEnqueuer.cs:21-25 | src/Validation.ContentScan.Core/ContentScanEnqueuer.cs:24-38 | src/Validation.ScanAndSign.Core/ScanAndSignEnqueuer.cs:25-39 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 5+ corresponding lines) src/StatusAggregator/Factory/EventFactory.cs:24 — src/StatusAggregator/Factory/EventFactory.cs:24-28 | src/StatusAggregator/Factory/IncidentFactory.cs:27-32 | src/StatusAggregator/Factory/IncidentGroupFactory.cs:27-32 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 5+ corresponding lines) src/NuGet.Services.Revalidate/Initialization/PackageFinder.cs:44 — src/NuGet.Services.Revalidate/Initialization/PackageFinder.cs:44-49 | src/NuGet.Services.Revalidate/Services/HealthService.cs:24-28 | src/NuGet.Services.Revalidate/Services/RevalidationJobStateService.cs:21-25 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 5+ corresponding lines) src/NuGet.Services.Messaging.Email/AsynchronousEmailMessageService.cs:23 — src/NuGet.Services.Messaging.Email/AsynchronousEmailMessageService.cs:23-27 | src/NuGet.Services.Validation.Orchestrator/PackageSigning/ProcessSignature/ProcessSignatureEnqueuer.cs:25-29 | src/NuGet.Services.Validation.Orchestrator/PackageSigning/ValidateCertificate/ValidateCertificateEnqueuer.cs:22-26 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 5+ corresponding lines) src/NuGetGallery.Core/Infrastructure/Mail/Messages/PackageValidationTakingTooLongMessage.cs:22 — src/NuGetGallery.Core/Infrastructure/Mail/Messages/PackageValidationTakingTooLongMessage.cs:22-26 | src/NuGetGallery.Core/Infrastructure/Mail/Messages/SymbolPackageValidationTakingTooLongMessage.cs:22-26 | src/NuGetGallery/Infrastructure/Mail/Messages/PackageDeletedNoticeMessage.cs:23-28 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×6
  • Duplicated block (17 lines × 2) REDACTED:480 — REDACTED:480-496 | REDACTED:538-554 — 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 (17 lines × 2) REDACTED:533 — REDACTED:533-549 | REDACTED:607-623 — 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 (17 lines × 2) src/NuGetGallery/Areas/Admin/DynamicData/Filters/Boolean.ascx.cs:53 — src/NuGetGallery/Areas/Admin/DynamicData/Filters/Boolean.ascx.cs:53-69 | src/NuGetGallery/Areas/Admin/DynamicData/Filters/Enumeration.ascx.cs:40-56 — 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. 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 (17 lines × 2) REDACTED:117 — REDACTED:117-133 | REDACTED:142-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. 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) src/NuGetGallery/Areas/Admin/Models/AdminLockPackageRequest.cs:21 — src/NuGetGallery/Areas/Admin/Models/AdminLockPackageRequest.cs:21-37 | src/NuGetGallery/Areas/Admin/Models/AdminSoftDeletePackageRequest.cs:23-39 — 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 (17 lines × 2) src/NuGetGallery.Services/PackageManagement/PackageService.cs:259 — src/NuGetGallery.Services/PackageManagement/PackageService.cs:259-275 | src/NuGetGallery.Services/PackageManagement/PackageService.cs:310-331 — 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 `src/NuGetGallery.Services/PackageManagement/PackageService.cs:259` 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 (10 lines × 2) · ×6
  • Duplicated block (10 lines × 2) src/NuGetGallery/Infrastructure/Mail/Messages/ReportAbuseMessage.cs:45 — src/NuGetGallery/Infrastructure/Mail/Messages/ReportAbuseMessage.cs:45-54 | src/NuGetGallery/Infrastructure/Mail/Messages/ReportMyPackageMessage.cs:37-46 — 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 (10 lines × 2) src/NuGet.Services.AzureSearch/Db2AzureSearch/NewPackageRegistrationFromKustoProducer.cs:297 — src/NuGet.Services.AzureSearch/Db2AzureSearch/NewPackageRegistrationFromKustoProducer.cs:297-306 | src/NuGet.Services.AzureSearch/Db2AzureSearch/NewPackageRegistrationFromKustoProducer.cs:434-443 — 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 `src/NuGet.Services.AzureSearch/Db2AzureSearch/NewPackageRegistrationFromKustoProducer.cs:297` 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) src/NuGetGallery/Controllers/StagingApiController.cs:148 — src/NuGetGallery/Controllers/StagingApiController.cs:148-157 | src/NuGetGallery/Controllers/StagingApiController.cs:203-212 — 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 `src/NuGetGallery/Controllers/StagingApiController.cs:148` 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) src/NuGet.Services.AzureSearch/AuxiliaryFiles/DownloadDataClient.cs:101 — src/NuGet.Services.AzureSearch/AuxiliaryFiles/DownloadDataClient.cs:101-110 | src/NuGet.Services.AzureSearch/AuxiliaryFiles/OwnerDataClient.cs:110-119 — before extracting anything, compare `src/NuGet.Services.AzureSearch/AuxiliaryFiles/DownloadDataClient.cs` and `src/NuGet.Services.AzureSearch/AuxiliaryFiles/OwnerDataClient.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 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 `src/NuGet.Services.AzureSearch/AuxiliaryFiles/DownloadDataClient.cs:101` 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 first that the copies are not typed on the same thing: the declarations holding them bind `newData` to `DownloadData` in one and `SortedDictionary<string, SortedSet<string>>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (10 lines × 2) src/NuGetGallery/Services/StagedPackageValidationMessageEmitter.cs:47 — src/NuGetGallery/Services/StagedPackageValidationMessageEmitter.cs:47-56 | src/NuGetGallery/Services/StagedSymbolPackageValidationMessageEmitter.cs:51-60 — 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 `src/NuGetGallery/Services/StagedPackageValidationMessageEmitter.cs:47` 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) src/NuGetGallery/Areas/Admin/DynamicData/PageTemplates/Details.aspx.cs:14 — src/NuGetGallery/Areas/Admin/DynamicData/PageTemplates/Details.aspx.cs:14-23 | src/NuGetGallery/Areas/Admin/DynamicData/PageTemplates/Edit.aspx.cs:14-23 — 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. 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 (13 lines × 2) · ×6
  • Duplicated block (13 lines × 2) src/NuGetGallery/Controllers/StagingApiController.cs:125 — src/NuGetGallery/Controllers/StagingApiController.cs:125-137 | src/NuGetGallery/Controllers/StagingApiController.cs:180-192 — 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 first that the copies are not typed on the same thing: the declarations holding them bind `request` to `StagePackageRequest` in one and `StageSymbolPackageRequest` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (13 lines × 2) REDACTED:499 — REDACTED:499-511 | REDACTED:520-532 — 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 (13 lines × 2) REDACTED:1383 — REDACTED:1383-1395 | REDACTED:1409-1421 — 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 (13 lines × 2) src/GalleryTools/Commands/ReflowCommand.cs:172 — src/GalleryTools/Commands/ReflowCommand.cs:172-184 | src/GalleryTools/Commands/ReserveNamespacesCommand.cs:178-190 — 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 `src/GalleryTools/Commands/ReflowCommand.cs:172` 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 (13 lines × 2) REDACTED:946 — REDACTED:946-958 | REDACTED:2465-2477 — 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, `REDACTED:960` calls `GetReadMeHtmlAsync` and `REDACTED:2479` 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) src/NuGet.Services.V3/Registration/Models/RegistrationIndex.cs:19 — src/NuGet.Services.V3/Registration/Models/RegistrationIndex.cs:19-31 | src/NuGet.Services.V3/Registration/Models/RegistrationPage.cs:22-39 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/NuGet.Services.V3/Registration/Models/RegistrationIndex.cs:18` calls `JsonProperty` and `src/NuGet.Services.V3/Registration/Models/RegistrationPage.cs:22` 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 · Edited copy of a member (20 corresponding lines) · ×5
  • Edited copy of a member (20 corresponding lines) src/NuGetGallery/Controllers/StagingApiController.cs:486 — src/NuGetGallery/Controllers/StagingApiController.cs:486-505 | src/NuGetGallery/Controllers/StagingApiController.cs:567-591 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) REDACTED:1382 — REDACTED:1382-1402 | REDACTED:1408-1427 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) src/NuGetGallery/Areas/Admin/Controllers/PackageSponsorshipController.cs:66 — src/NuGetGallery/Areas/Admin/Controllers/PackageSponsorshipController.cs:66-85 | src/NuGetGallery/Areas/Admin/Controllers/PackageSponsorshipController.cs:90-109 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) src/Catalog/FlatContainerPackagePathProvider.cs:19 — src/Catalog/FlatContainerPackagePathProvider.cs:19-38 | src/Catalog/FlatContainerPackagePathProvider.cs:46-73 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) src/NuGetGallery/Services/PackageFileService.cs:112 — src/NuGetGallery/Services/PackageFileService.cs:112-133 | src/NuGetGallery.Core/Services/CoreReadmeFileService.cs:91-110 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (25 corresponding lines) · ×5
  • Edited copy of a member (25 corresponding lines) src/NuGet.Services.AzureSearch/SearchService/Models/ParameterUtilities.cs:77 — src/NuGet.Services.AzureSearch/SearchService/Models/ParameterUtilities.cs:77-101 | src/NuGet.Services.AzureSearch/SearchService/Models/ParameterUtilities.cs:104-129 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) src/NuGetGallery.Core/Services/GalleryCloudBlobContainerInformationProvider.cs:32 — src/NuGetGallery.Core/Services/GalleryCloudBlobContainerInformationProvider.cs:32-56 | src/NuGetGallery.Core/Services/GalleryCloudBlobContainerInformationProvider.cs:59-89 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) src/NuGetGallery/App_Start/LatestVersionRouteConstraint.cs:17 — src/NuGetGallery/App_Start/LatestVersionRouteConstraint.cs:17-41 | src/NuGetGallery/App_Start/VersionRouteConstraint.cs:16-45 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) src/NuGet.Services.Storage/AzureStorageFactory.cs:75 — src/NuGet.Services.Storage/AzureStorageFactory.cs:75-99 | src/Catalog/Persistence/AzureStorageFactory.cs:85-109 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) REDACTED:2004 — REDACTED:2004-2028 | REDACTED:2035-2064 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (18 corresponding lines) · ×5
  • Edited copy of a member (18 corresponding lines) src/NuGet.Jobs.Db2AzureSearch/Job.cs:19 — src/NuGet.Jobs.Db2AzureSearch/Job.cs:19-41 | src/NuGet.Jobs.Auxiliary2AzureSearch/Job.cs:17-34 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) src/NuGet.Services.Validation.Orchestrator/Services/StagedPackageEntityService.cs:53 — src/NuGet.Services.Validation.Orchestrator/Services/StagedPackageEntityService.cs:53-70 | src/NuGet.Services.Validation.Orchestrator/Services/StagedSymbolPackageEntityService.cs:42-64 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) src/NuGet.Jobs.Common/StorageAccountExtensions.cs:110 — src/NuGet.Jobs.Common/StorageAccountExtensions.cs:110-132 | src/NuGet.Jobs.Common/StorageAccountExtensions.cs:155-172 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) src/NuGet.Services.AzureSearch/Auxiliary2AzureSearch/UpdateDownloadsCommand.cs:177 — src/NuGet.Services.AzureSearch/Auxiliary2AzureSearch/UpdateDownloadsCommand.cs:177-194 | src/NuGet.Services.AzureSearch/Db2AzureSearch/NewPackageRegistrationFromDbProducer.cs:191-208 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) src/NuGet.Services.AzureSearch/Db2AzureSearch/NewPackageRegistrationFromDbProducer.cs:316 — src/NuGet.Services.AzureSearch/Db2AzureSearch/NewPackageRegistrationFromDbProducer.cs:316-333 | src/NuGet.Services.AzureSearch/Db2AzureSearch/NewPackageRegistrationFromKustoProducer.cs:829-846 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 7+ corresponding lines) · ×5
  • Edited copies of one member (3 members, 7+ corresponding lines) src/NuGet.Services.Validation.Orchestrator/PackageSigning/ProcessSignature/BaseSignatureProcessor.cs:26 — src/NuGet.Services.Validation.Orchestrator/PackageSigning/ProcessSignature/BaseSignatureProcessor.cs:26-32 | src/NuGet.Services.Validation.Orchestrator/PackageSigning/ProcessSignature/PackageSignatureProcessor.cs:32-38 | src/NuGet.Services.Validation.Orchestrator/PackageSigning/ProcessSignature/PackageSignatureValidator.cs:41-55 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 7+ corresponding lines) src/NuGet.Services.Validation.Orchestrator/EntityStatusProcessor.cs:29 — src/NuGet.Services.Validation.Orchestrator/EntityStatusProcessor.cs:29-35 | src/NuGet.Services.Validation.Orchestrator/ValidationStorageService.cs:33-39 | src/NuGetGallery/Services/ReflowPackageService.cs:28-34 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 7+ corresponding lines) src/NuGet.Services.Validation.Orchestrator/SymbolValidationMessageHandlerRouter.cs:32 — src/NuGet.Services.Validation.Orchestrator/SymbolValidationMessageHandlerRouter.cs:32-39 | src/NuGet.Services.Validation.Orchestrator/Symbols/SymbolsIngester.cs:34-41 | src/NuGet.Services.Validation.Orchestrator/Symbols/SymbolsValidator.cs:30-36 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 7+ corresponding lines) src/NuGetGallery.Services/PackageManagement/PackageService.cs:51 — src/NuGetGallery.Services/PackageManagement/PackageService.cs:51-58 | REDACTED:40-46 | REDACTED:46-52 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 7+ corresponding lines) src/NuGet.Services.ServiceBus/SubscriptionProcessor.cs:45 — src/NuGet.Services.ServiceBus/SubscriptionProcessor.cs:45-54 | src/NuGet.Services.Validation.Orchestrator/Symbols/SymbolsMessageEnqueuer.cs:33-46 | src/StatusAggregator/Export/StatusExporter.cs:27-33 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×5
  • Edited copy of a member (12 corresponding lines) src/NuGetGallery.Services/Authentication/Federated/GitHubCriteria.cs:170 — src/NuGetGallery.Services/Authentication/Federated/GitHubCriteria.cs:170-184 | src/NuGetGallery.Services/Authentication/Federated/GitLabCriteria.cs:166-177 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) src/NuGetGallery.Core/Infrastructure/Mail/Messages/StagingExpirationMessage.cs:28 — src/NuGetGallery.Core/Infrastructure/Mail/Messages/StagingExpirationMessage.cs:28-41 | src/NuGetGallery.Core/Services/StagingPromotionNotificationService.cs:25-36 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) src/NuGet.Services.Metadata.Catalog.Monitoring/Utility/ILoggerFactoryExtensions.cs:16 — src/NuGet.Services.Metadata.Catalog.Monitoring/Utility/ILoggerFactoryExtensions.cs:16-27 | src/Gallery.Maintenance/Job.cs:73-84 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) src/NuGet.Services.Storage/BlobLeaseService.cs:48 — src/NuGet.Services.Storage/BlobLeaseService.cs:48-64 | src/Validation.Common.Job/Leases/CloudBlobLeaseService.cs:38-49 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) src/NuGetGallery/Areas/Admin/DynamicData/FieldTemplates/Children.ascx.cs:32 — src/NuGetGallery/Areas/Admin/DynamicData/FieldTemplates/Children.ascx.cs:32-43 | src/NuGetGallery/Areas/Admin/DynamicData/FieldTemplates/ForeignKey.ascx.cs:33-44 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (10 corresponding lines) · ×5
  • Edited copy of a member (10 corresponding lines) src/Validation.PackageSigning.ProcessSignature/Job.cs:99 — src/Validation.PackageSigning.ProcessSignature/Job.cs:99-108 | src/Validation.Symbols/Job.cs:50-59 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) src/Validation.ContentScan.Core/ContentScanEnqueuer.cs:96 — src/Validation.ContentScan.Core/ContentScanEnqueuer.cs:96-105 | src/Validation.ScanAndSign.Core/ScanAndSignEnqueuer.cs:160-169 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) REDACTED:241 — REDACTED:241-250 | REDACTED:402-411 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) src/NuGet.Services.Metadata.Catalog.Monitoring/Providers/PackageRegistrationMetadataResourceDatabaseProvider.cs:26 — src/NuGet.Services.Metadata.Catalog.Monitoring/Providers/PackageRegistrationMetadataResourceDatabaseProvider.cs:26-35 | src/NuGet.Services.Metadata.Catalog.Monitoring/Providers/PackageTimestampMetadataResourceDatabaseProvider.cs:30-41 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) src/NuGetGallery/Areas/Admin/DynamicData/FieldTemplates/Enumeration_Edit.ascx.cs:28 — src/NuGetGallery/Areas/Admin/DynamicData/FieldTemplates/Enumeration_Edit.ascx.cs:28-38 | src/NuGetGallery/Areas/Admin/DynamicData/FieldTemplates/ForeignKey_Edit.ascx.cs:21-30 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 4+ corresponding lines) · ×5
  • Edited copies of one member (3 members, 4+ corresponding lines) src/NuGet.Services.Validation.Orchestrator/Services/PackageMessageService.cs:24 — src/NuGet.Services.Validation.Orchestrator/Services/PackageMessageService.cs:24-28 | src/NuGet.Services.Validation.Orchestrator/Services/SymbolsMessageService.cs:24-28 | src/NuGet.SupportRequests.Notifications/Services/MessagingService.cs:17-20 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 4+ corresponding lines) src/NuGetGallery.Core/Services/CoreLicenseFileService.cs:21 — src/NuGetGallery.Core/Services/CoreLicenseFileService.cs:21-24 | src/NuGetGallery.Core/Services/CorePackageFileService.cs:22-25 | src/NuGetGallery.Core/Services/CoreReadmeFileService.cs:21-24 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 4+ corresponding lines) src/NuGet.Jobs.Common/LoggerDiagnosticsService.cs:17 — src/NuGet.Jobs.Common/LoggerDiagnosticsService.cs:17-20 | src/NuGet.Services.Logging/TelemetryProcessors/ExceptionTelemetryProcessor.cs:34-37 | src/NuGetGallery.Services/Diagnostics/TraceDiagnosticsSource.cs:23-26 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 4+ corresponding lines) src/NuGet.Services.Configuration/KeyVaultEnvironmentVariableInjectingConfigurationSource.cs:17 — src/NuGet.Services.Configuration/KeyVaultEnvironmentVariableInjectingConfigurationSource.cs:17-20 | src/NuGet.Services.Configuration/KeyVaultInMemoryCollectionInjectingConfigurationSource.cs:21-24 | src/NuGet.Services.Configuration/KeyVaultInjectingConfigurationProvider.cs:33-36 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 4+ corresponding lines) src/NuGet.Services.Cursor/DurableCursor.cs:19 — src/NuGet.Services.Cursor/DurableCursor.cs:19-23 | src/NuGetGallery/Areas/Admin/Controllers/PasswordAuthenticationController.cs:24-27 | src/UpdateBlobProperties/Cursor.cs:20-24 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×5
  • Duplicated block (14 lines × 2) REDACTED:128 — REDACTED:128-141 | REDACTED:509-522 — 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 `REDACTED:128` 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 (14 lines × 2) src/NuGet.Services.AzureSearch/Db2AzureSearch/NewPackageRegistrationFromKustoProducer.cs:249 — src/NuGet.Services.AzureSearch/Db2AzureSearch/NewPackageRegistrationFromKustoProducer.cs:249-262 | src/NuGet.Services.AzureSearch/Db2AzureSearch/NewPackageRegistrationFromKustoProducer.cs:384-397 — 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 `src/NuGet.Services.AzureSearch/Db2AzureSearch/NewPackageRegistrationFromKustoProducer.cs:249` 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 (14 lines × 2) src/Catalog/Persistence/JTokenStorageContent.cs:26 — src/Catalog/Persistence/JTokenStorageContent.cs:26-39 | src/NuGet.Services.Storage/JTokenStorageContent.cs:26-39 — before extracting anything, compare `src/Catalog/Persistence/JTokenStorageContent.cs` and `src/NuGet.Services.Storage/JTokenStorageContent.cs` as WHOLE FILES: 95% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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) src/Catalog/Persistence/StringStorageContent.cs:34 — src/Catalog/Persistence/StringStorageContent.cs:34-47 | src/NuGet.Services.Storage/StringStorageContent.cs:25-38 — 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) src/Ng/CommandHelpers.cs:450 — src/Ng/CommandHelpers.cs:450-463 | src/Ng/CommandHelpers.cs:480-493 — 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 `src/Ng/CommandHelpers.cs:450` 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 (12 lines × 2) · ×5
  • Duplicated block (12 lines × 2) REDACTED:193 — REDACTED:193-204 | REDACTED:239-250 — 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 (12 lines × 2) REDACTED:786 — REDACTED:786-797 | REDACTED:837-848 — 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) src/NuGetGallery.Services/Helpers/McpHelper.cs:200 — src/NuGetGallery.Services/Helpers/McpHelper.cs:200-211 | src/NuGetGallery.Services/Helpers/McpHelper.cs:242-253 — 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 `src/NuGetGallery.Services/Helpers/McpHelper.cs:242` 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, `src/NuGetGallery.Services/Helpers/McpHelper.cs:198` calls `IsNullOrWhiteSpace` and `src/NuGetGallery.Services/Helpers/McpHelper.cs:241` 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) src/NuGetGallery/Controllers/StagingApiController.cs:488 — src/NuGetGallery/Controllers/StagingApiController.cs:488-499 | src/NuGetGallery/Controllers/StagingApiController.cs:517-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. 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) src/NuGetGallery/Areas/Admin/DynamicData/FieldTemplates/Boolean.ascx.cs:7 — src/NuGetGallery/Areas/Admin/DynamicData/FieldTemplates/Boolean.ascx.cs:7-18 | src/NuGetGallery/Areas/Admin/DynamicData/FieldTemplates/Boolean_Edit.ascx.cs:8-23 — 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 `src/NuGetGallery/Areas/Admin/DynamicData/FieldTemplates/Boolean.ascx.cs:7` 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 (8 lines × 2) · ×5
  • Duplicated block (8 lines × 2) REDACTED:198 — REDACTED:198-205 | REDACTED:339-346 — 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 `REDACTED:198` 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 (8 lines × 2) src/Catalog/Dnx/DnxMaker.cs:376 — src/Catalog/Dnx/DnxMaker.cs:376-383 | src/Catalog/Icons/IconProcessor.cs:109-116 — 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 `src/Catalog/Dnx/DnxMaker.cs:376` 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) src/NuGet.Services.AzureSearch/AuxiliaryFiles/OwnerDataClient.cs:139 — src/NuGet.Services.AzureSearch/AuxiliaryFiles/OwnerDataClient.cs:139-146 | src/NuGet.Services.AzureSearch/AuxiliaryFiles/PopularityTransferDataClient.cs:130-137 — 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 `src/NuGet.Services.AzureSearch/AuxiliaryFiles/OwnerDataClient.cs:139` 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) src/NuGetGallery/Areas/Admin/DynamicData/PageTemplates/List.aspx.cs:54 — src/NuGetGallery/Areas/Admin/DynamicData/PageTemplates/List.aspx.cs:54-61 | src/NuGetGallery/Areas/Admin/DynamicData/PageTemplates/ListDetails.aspx.cs:59-66 — 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. 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 (8 lines × 2) src/NuGetGallery.Core/Auditing/CloudAuditingService.cs:35 — src/NuGetGallery.Core/Auditing/CloudAuditingService.cs:35-42 | src/NuGetGallery.Core/Auditing/FileSystemAuditingService.cs:37-46 — 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.
R10 · Code Duplication · Duplicated block (11 lines × 2 locations) · ×5
  • Duplicated block (11 lines × 2 locations) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:2016 — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:2016 · src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:2033 — 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) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:5945 — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:5945 · src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:5957 — 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) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:6518 — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:6518 · src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:14398 — 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) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:7961 — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:7961 · src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:7989 — 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) src/NuGetGallery/Scripts/gallery/page-api-keys.js:485 — src/NuGetGallery/Scripts/gallery/page-api-keys.js:485 · src/NuGetGallery/Scripts/gallery/page-manage-organization.js:198 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
D29 · Static Analysis (SAST) · REDACTED · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×4
  • Members sharing a duplicated core (4 members, 50+ identical tokens) REDACTED:474 — REDACTED:474-525 | REDACTED:532-559 | REDACTED:564-601 | REDACTED:606-649 — 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) src/NuGetGallery/Controllers/StagingApiController.cs:216 — src/NuGetGallery/Controllers/StagingApiController.cs:216-246 | src/NuGetGallery/Controllers/StagingApiController.cs:250-291 | src/NuGetGallery/Controllers/StagingApiController.cs:332-352 | src/NuGetGallery/Controllers/StagingApiController.cs:362-382 — 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) src/GalleryTools/Commands/CreateApiKeyCommand.cs:59 — src/GalleryTools/Commands/CreateApiKeyCommand.cs:59-101 | src/GalleryTools/Commands/CreateOrganizationCommand.cs:52-82 | src/GalleryTools/Commands/SeedFunctionalTestsCommand.cs:54-213 | src/GalleryTools/Commands/SeedSinglePackageCommand.cs:73-107 — 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) src/Ng/Jobs/Catalog2DnxJob.cs:33 — src/Ng/Jobs/Catalog2DnxJob.cs:33-61 | src/Ng/Jobs/Db2CatalogJob.cs:50-90 | src/Ng/Jobs/FixCatalogCachingJob.cs:42-58 | src/Ng/Jobs/NgJob.cs:50-57 — 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 · Edited copy of a member (30 corresponding lines) · ×4
  • Edited copy of a member (30 corresponding lines) src/NuGetGallery.Services/Security/SecurityPolicyService.cs:195 — src/NuGetGallery.Services/Security/SecurityPolicyService.cs:195-248 | src/NuGetGallery.Services/Security/SecurityPolicyService.cs:274-303 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) src/NuGetGallery.Services/Authentication/Federated/GitHubTokenPolicyValidator.cs:66 — src/NuGetGallery.Services/Authentication/Federated/GitHubTokenPolicyValidator.cs:66-106 | src/NuGetGallery.Services/Authentication/Federated/GitLabTokenPolicyValidator.cs:58-87 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) src/NuGet.Services.Validation.Orchestrator/Symbols/SymbolScanValidator.cs:88 — src/NuGet.Services.Validation.Orchestrator/Symbols/SymbolScanValidator.cs:88-119 | src/NuGet.Services.Validation.Orchestrator/Symbols/SymbolsValidator.cs:68-97 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) src/NuGetGallery.Core/Services/CloudBlobCoreFileStorageService.cs:481 — src/NuGetGallery.Core/Services/CloudBlobCoreFileStorageService.cs:481-510 | src/NuGetGallery.Core/Services/CloudBlobCoreFileStorageService.cs:524-553 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (22 corresponding lines) · ×4
  • Edited copy of a member (22 corresponding lines) src/NuGet.Services.AzureSearch/Auxiliary2AzureSearch/UpdateDownloadsCommand.cs:62 — src/NuGet.Services.AzureSearch/Auxiliary2AzureSearch/UpdateDownloadsCommand.cs:62-92 | src/NuGet.Services.AzureSearch/Db2AzureSearch/Db2AzureSearchCommand.cs:50-71 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) src/Catalog/Dnx/DnxMaker.cs:375 — src/Catalog/Dnx/DnxMaker.cs:375-396 | src/Catalog/Icons/IconProcessor.cs:108-135 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) src/Catalog/DeleteCatalogItem.cs:78 — src/Catalog/DeleteCatalogItem.cs:78-99 | src/Catalog/PackageCatalogItem.cs:250-271 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) REDACTED:1234 — REDACTED:1234-1257 | REDACTED:3131-3152 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (26 corresponding lines) · ×4
  • Edited copy of a member (26 corresponding lines) src/NuGet.Services.Validation.Orchestrator/Job.cs:447 — src/NuGet.Services.Validation.Orchestrator/Job.cs:447-472 | src/NuGet.Services.Validation.Orchestrator/Job.cs:475-500 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) REDACTED:785 — REDACTED:785-815 | REDACTED:1082-1107 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) src/GalleryTools/Commands/GalleryOperations.cs:38 — src/GalleryTools/Commands/GalleryOperations.cs:38-63 | src/GalleryTools/Commands/GalleryOperations.cs:70-108 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) src/NuGetGallery.Services/UserManagement/UserService.cs:255 — src/NuGetGallery.Services/UserManagement/UserService.cs:255-281 | src/NuGetGallery.Services/UserManagement/UserService.cs:284-309 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×4
  • Duplicated block (16 lines × 2) src/NuGetGallery/App_Start/LatestVersionRouteConstraint.cs:18 — src/NuGetGallery/App_Start/LatestVersionRouteConstraint.cs:18-33 | src/NuGetGallery/App_Start/VersionRouteConstraint.cs:22-37 — 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.
  • Duplicated block (16 lines × 2) REDACTED:138 — REDACTED:138-153 | REDACTED:314-329 — 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 `REDACTED:138` 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) src/NuGetGallery/Areas/Admin/Models/AdminReflowPackageRequest.cs:20 — src/NuGetGallery/Areas/Admin/Models/AdminReflowPackageRequest.cs:20-35 | src/NuGetGallery/Areas/Admin/Models/AdminRevalidatePackageRequest.cs:21-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.
  • Duplicated block (16 lines × 2) src/Catalog/Persistence/Storage.cs:59 — src/Catalog/Persistence/Storage.cs:59-74 | src/NuGet.Services.Storage/Storage.cs:50-65 — 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 (15 lines × 2) · ×4
  • Duplicated block (15 lines × 2) src/NuGetGallery/Areas/Admin/DynamicData/Filters/Enumeration.ascx.cs:22 — src/NuGetGallery/Areas/Admin/DynamicData/Filters/Enumeration.ascx.cs:22-36 | src/NuGetGallery/Areas/Admin/DynamicData/Filters/ForeignKey.ascx.cs:29-43 — 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. 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 (15 lines × 2) REDACTED:1199 — REDACTED:1199-1213 | REDACTED:1579-1593 — 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) src/Validation.PackageSigning.ProcessSignature/SignaturePartsExtractor.cs:196 — src/Validation.PackageSigning.ProcessSignature/SignaturePartsExtractor.cs:196-210 | src/Validation.PackageSigning.ProcessSignature/SignaturePartsExtractor.cs:219-233 — 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 `src/Validation.PackageSigning.ProcessSignature/SignaturePartsExtractor.cs:196` 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 (15 lines × 2) src/Catalog/Icons/IconProcessor.cs:265 — src/Catalog/Icons/IconProcessor.cs:265-279 | src/NuGetGallery/Extensions/ImageExtensions.cs:51-65 — 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 (7 lines × 2) · ×4
  • Duplicated block (7 lines × 2) src/NuGetGallery.Core/Login/EditableLoginConfigurationFileStorageService.cs:111 — src/NuGetGallery.Core/Login/EditableLoginConfigurationFileStorageService.cs:111-117 | src/NuGetGallery.Core/Services/RevalidationStateService.cs:61-67 — 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 `src/NuGetGallery.Core/Login/EditableLoginConfigurationFileStorageService.cs:111` 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, `src/NuGetGallery.Core/Services/RevalidationStateService.cs:59` calls `GenerateIfMatchCondition` and `src/NuGetGallery.Core/Login/EditableLoginConfigurationFileStorageService.cs:110` 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) src/NuGetGallery.Services/Authentication/LegacyHasher.cs:24 — src/NuGetGallery.Services/Authentication/LegacyHasher.cs:24-30 | src/NuGetGallery.Services/Authentication/LegacyHasher.cs:51-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.
  • Duplicated block (7 lines × 2) src/Catalog/Icons/PublicExternalIconUrlPolicy.cs:132 — src/Catalog/Icons/PublicExternalIconUrlPolicy.cs:132-138 | src/Catalog/Icons/PublicExternalIconUrlPolicy.cs:140-146 — 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 (7 lines × 2) src/NuGetGallery.Core/Infrastructure/Mail/Messages/PackageAddedMessage.cs:113 — src/NuGetGallery.Core/Infrastructure/Mail/Messages/PackageAddedMessage.cs:113-119 | src/NuGetGallery.Core/Infrastructure/Mail/Messages/SymbolPackageAddedMessage.cs:108-114 — before extracting anything, compare `src/NuGetGallery.Core/Infrastructure/Mail/Messages/PackageAddedMessage.cs` and `src/NuGetGallery.Core/Infrastructure/Mail/Messages/SymbolPackageAddedMessage.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 51 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. 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.
AC3 · Page structure · Data table has no header cells · ×3
  • Data table has no header cells src/NuGet.SupportRequests.Notifications/Templates/OnCallSummary.html:22 — A <table> with data cells but no <th> gives assistive technology no way to associate cells with their headers. Mark the header row/column cells as <th> (with a scope).
  • Data table has no header cells src/NuGet.SupportRequests.Notifications/Templates/WeeklySummary.html:22 — A <table> with data cells but no <th> gives assistive technology no way to associate cells with their headers. Mark the header row/column cells as <th> (with a scope).
  • Data table has no header cells src/NuGetGallery/Areas/Admin/Views/ReservedNamespace/Index.cshtml:28 — A <table> with data cells but no <th> gives assistive technology no way to associate cells with their headers. Mark the header row/column cells as <th> (with a scope).
AC6 · Visual & motion safety · Low contrast colour pair in CSS (4.0 · ×3
  • Low contrast colour pair in CSS (4.0:1) src/NuGetGallery/Content/PageStylings.css:367 — `.featured div a.install` sets color: #fff on background-color: #4585aa — 4.0:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
  • Low contrast colour pair in CSS (4.0:1) src/NuGetGallery/Content/Site.css:1160 — `button, input[type="submit"], .btn` sets color: #fff on background-color: #4585aa — 4.0:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
  • Low contrast colour pair in CSS (4.0:1) src/NuGetGallery/Content/Site.css:1254 — `.sequence li.past, .sequence li.current` sets color: #fff on background-color: #4585aa — 4.0:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
D1 · Cyclomatic Complexity · d3.brush$1 · ×3
  • d3.brush$1::started::move (cyclomatic 24) REDACTED:4554 — d3.brush$1::started::move has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 2 other methods here (d3.brush$1::started, d3.brush$1::started::keyupped) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared. This is NOT this file's highest cyclomatic complexity: d3.log$1 (cyclomatic 25) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score. This file is where this pass's cyclomatic complexity CONCENTRATES: REDACTED holds 31 of the 99 methods over the threshold — including the worst — and 308 of the 911 points over it (34%), 4.9× the next-largest file (src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js at 63). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
  • d3.brush$1::started (cyclomatic 18) REDACTED:4473 — d3.brush$1::started has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 2 other methods here (d3.brush$1::started::move, d3.brush$1::started::keyupped) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared. This is NOT this file's highest cyclomatic complexity: d3.log$1 (cyclomatic 25) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score. This file is where this pass's cyclomatic complexity CONCENTRATES: REDACTED holds 31 of the 99 methods over the threshold — including the worst — and 308 of the 911 points over it (34%), 4.9× the next-largest file (src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js at 63). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
  • d3.brush$1::started::keyupped (cyclomatic 18) REDACTED:4657 — d3.brush$1::started::keyupped has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 2 other methods here (d3.brush$1::started, d3.brush$1::started::move) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared. This is NOT this file's highest cyclomatic complexity: d3.log$1 (cyclomatic 25) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score. This file is where this pass's cyclomatic complexity CONCENTRATES: REDACTED holds 31 of the 99 methods over the threshold — including the worst — and 308 of the 911 points over it (34%), 4.9× the next-largest file (src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js at 63). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D2 · Cognitive Complexity · d3.brush$1 · ×3
  • d3.brush$1::started::keyupped (cognitive 37) REDACTED:4657 — d3.brush$1::started::keyupped has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (36 pts), match/switch 1 (nesting depth added 21). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident. This shape REPEATS in the file: 2 other methods here (d3.brush$1::started::move, d3.brush$1::started::keydowned) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • d3.brush$1::started::move (cognitive 26) REDACTED:4554 — d3.brush$1::started::move has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (24 pts), boolean chains 1, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (d3.brush$1::started::keydowned, d3.brush$1::started::keyupped) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • d3.brush$1::started::keydowned (cognitive 21) REDACTED:4627 — d3.brush$1::started::keydowned has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 2, match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident. This shape REPEATS in the file: 2 other methods here (d3.brush$1::started::move, d3.brush$1::started::keyupped) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D4 · Code Duplication · Edited copy of a member (17 corresponding lines) · ×3
  • Edited copy of a member (17 corresponding lines) src/NuGetGallery/Services/PackageStagingUploadService.cs:79 — src/NuGetGallery/Services/PackageStagingUploadService.cs:79-96 | src/NuGet.Services.Staging.Promotion/StagedPackagePromotionMessageHandler.cs:72-88 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) src/NuGet.Services.KeyVault/SecretInjector.cs:46 — src/NuGet.Services.KeyVault/SecretInjector.cs:46-62 | src/NuGet.Services.KeyVault/SecretInjector.cs:70-86 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) REDACTED:116 — REDACTED:116-136 | REDACTED:498-514 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (36 corresponding lines) · ×3
  • Edited copy of a member (36 corresponding lines) REDACTED:192 — REDACTED:192-230 | REDACTED:238-273 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) src/NuGetGallery.Services/Helpers/StreamHelper.cs:23 — src/NuGetGallery.Services/Helpers/StreamHelper.cs:23-58 | src/NuGetGallery.Services/Helpers/StreamHelper.cs:67-102 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) src/NuGet.Jobs.Common/StorageAccountExtensions.cs:206 — src/NuGet.Jobs.Common/StorageAccountExtensions.cs:206-250 | src/NuGet.Jobs.Common/StorageAccountExtensions.cs:255-290 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (35 corresponding lines) · ×3
  • Edited copy of a member (35 corresponding lines) src/NuGet.Services.Storage/FileStorage.cs:83 — src/NuGet.Services.Storage/FileStorage.cs:83-121 | src/Catalog/Persistence/FileStorage.cs:67-101 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) src/NuGetGallery/OData/Serializers/V1FeedPackageAnnotationStrategy.cs:20 — src/NuGetGallery/OData/Serializers/V1FeedPackageAnnotationStrategy.cs:20-54 | src/NuGetGallery/OData/Serializers/V2FeedPackageAnnotationStrategy.cs:20-58 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) src/NuGetGallery.Services/PackageManagement/PackageUpdateService.cs:91 — src/NuGetGallery.Services/PackageManagement/PackageUpdateService.cs:91-132 | src/NuGetGallery.Services/PackageManagement/PackageUpdateService.cs:135-169 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (27 corresponding lines) · ×3
  • Edited copy of a member (27 corresponding lines) src/NuGetGallery/Controllers/StagingApiController.cs:295 — src/NuGetGallery/Controllers/StagingApiController.cs:295-322 | src/NuGetGallery/Controllers/StagingApiController.cs:632-658 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) src/NuGet.Services.AzureSearch/DatabaseAuxiliaryDataFetcher.cs:107 — src/NuGet.Services.AzureSearch/DatabaseAuxiliaryDataFetcher.cs:107-133 | src/NuGet.Services.AzureSearch/DatabaseAuxiliaryDataFetcher.cs:136-165 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) src/GitHubVulnerabilities2Db/Job.cs:146 — src/GitHubVulnerabilities2Db/Job.cs:146-172 | src/GitHubVulnerabilities2v3/Job.cs:102-129 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (19 corresponding lines) · ×3
  • Edited copy of a member (19 corresponding lines) src/Catalog/Helpers/Utils.cs:299 — src/Catalog/Helpers/Utils.cs:299-317 | src/Catalog/Helpers/Utils.cs:320-340 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) src/NuGet.Services.AzureSearch/SearchService/IndexOperationBuilder.cs:38 — src/NuGet.Services.AzureSearch/SearchService/IndexOperationBuilder.cs:38-56 | src/NuGet.Services.AzureSearch/SearchService/IndexOperationBuilder.cs:59-80 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) REDACTED:220 — REDACTED:220-239 | REDACTED:306-324 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 11+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 11+ corresponding lines) src/NuGet.Services.Revalidate/Services/RevalidationStarter.cs:32 — src/NuGet.Services.Revalidate/Services/RevalidationStarter.cs:32-42 | src/NuGet.Services.Validation.Orchestrator/BaseValidationMessageHandler.cs:46-77 | src/NuGet.Services.Validation.Orchestrator/ValidationOutcomeProcessor.cs:36-53 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 11+ corresponding lines) src/Validation.PackageSigning.ValidateCertificate/CertificateValidationService.cs:118 — src/Validation.PackageSigning.ValidateCertificate/CertificateValidationService.cs:118-129 | src/Validation.PackageSigning.ValidateCertificate/CertificateValidationService.cs:162-172 | src/Validation.PackageSigning.ValidateCertificate/CertificateValidationService.cs:185-195 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 11+ corresponding lines) src/NuGetGallery.Core/Login/LoginDiscontinuation.cs:37 — src/NuGetGallery.Core/Login/LoginDiscontinuation.cs:37-47 | src/NuGetGallery.Services/Configuration/CertificatesConfiguration.cs:47-58 | src/NuGetGallery.Services/Configuration/SymbolsConfiguration.cs:47-58 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (21 corresponding lines) · ×3
  • Edited copy of a member (21 corresponding lines) src/NuGetGallery/OData/Conventions/ActionCountRoutingConvention.cs:35 — src/NuGetGallery/OData/Conventions/ActionCountRoutingConvention.cs:35-56 | src/NuGetGallery/OData/Conventions/MethodNameActionRoutingConvention.cs:35-55 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) src/NuGetGallery/Controllers/JsonApiController.cs:216 — src/NuGetGallery/Controllers/JsonApiController.cs:216-244 | src/NuGetGallery/Controllers/JsonApiController.cs:250-270 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) src/AccountDeleter/Configuration/CoreMessageServiceConfiguration.cs:14 — src/AccountDeleter/Configuration/CoreMessageServiceConfiguration.cs:14-35 | src/NuGet.Services.Validation.Orchestrator/Configuration/CoreMessageServiceConfiguration.cs:14-34 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 8+ corresponding lines) · ×3
  • Edited copies of one member (4 members, 8+ corresponding lines) src/NuGet.Services.Staging.Promotion/StagingGroupPromotionMessageHandler.cs:42 — src/NuGet.Services.Staging.Promotion/StagingGroupPromotionMessageHandler.cs:42-49 | src/NuGetGallery.Core/Services/StagingGroupPromotionService.cs:41-48 | src/NuGetGallery/Services/PackageStagingPromotionService.cs:47-54 | src/NuGetGallery/Services/SymbolPackageStagingManagementService.cs:35-42 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 8+ corresponding lines) src/NuGet.Services.Validation.Orchestrator/Services/StagedPackageMessageService.cs:28 — src/NuGet.Services.Validation.Orchestrator/Services/StagedPackageMessageService.cs:28-35 | src/NuGet.Services.Validation.Orchestrator/Services/StagedPackageMessageService.cs:38-46 | src/NuGet.Services.Validation.Orchestrator/Services/StagedPackageMessageService.cs:49-57 | src/NuGet.Services.Validation.Orchestrator/Services/StagedSymbolPackageMessageService.cs:55-66 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 8+ corresponding lines) src/NuGetGallery.Core/Infrastructure/Mail/Messages/StagedPackageMessage.cs:54 — src/NuGetGallery.Core/Infrastructure/Mail/Messages/StagedPackageMessage.cs:54-61 | src/NuGetGallery.Core/Infrastructure/Mail/Messages/StagedPackageValidationFailedMessage.cs:33-40 | src/NuGetGallery.Core/Infrastructure/Mail/Messages/StagingExpirationMessage.cs:46-53 | src/NuGetGallery.Core/Infrastructure/Mail/Messages/StagingPromotionCompletedMessage.cs:39-46 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×3
  • Duplicated block (23 lines × 2) src/NuGetGallery.Core/Infrastructure/Mail/Messages/PackageAddedMessage.cs:87 — src/NuGetGallery.Core/Infrastructure/Mail/Messages/PackageAddedMessage.cs:87-109 | src/NuGetGallery.Core/Infrastructure/Mail/Messages/SymbolPackageAddedMessage.cs:82-104 — before extracting anything, compare `src/NuGetGallery.Core/Infrastructure/Mail/Messages/PackageAddedMessage.cs` and `src/NuGetGallery.Core/Infrastructure/Mail/Messages/SymbolPackageAddedMessage.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 51 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 `src/NuGetGallery.Core/Infrastructure/Mail/Messages/PackageAddedMessage.cs:87` 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 (23 lines × 2) REDACTED:565 — REDACTED:565-587 | REDACTED:612-634 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:635` calls `Where` and `REDACTED:588` 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 (23 lines × 2) REDACTED:2757 — REDACTED:2757-2779 | REDACTED:2882-2904 — 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 (18 lines × 2) · ×3
  • Duplicated block (18 lines × 2) src/NuGet.Services.AzureSearch/Db2AzureSearch/NewPackageRegistrationFromDbProducer.cs:214 — src/NuGet.Services.AzureSearch/Db2AzureSearch/NewPackageRegistrationFromDbProducer.cs:214-231 | src/NuGet.Services.AzureSearch/Db2AzureSearch/NewPackageRegistrationFromKustoProducer.cs:809-826 — 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. 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 (18 lines × 2) src/Catalog/Persistence/FileStorage.cs:115 — src/Catalog/Persistence/FileStorage.cs:115-132 | src/NuGet.Services.Storage/FileStorage.cs:137-154 — 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 `src/Catalog/Persistence/FileStorage.cs:115` 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 (18 lines × 2) src/NuGetGallery/Areas/Admin/DynamicData/FieldTemplates/Decimal_Edit.ascx.cs:8 — src/NuGetGallery/Areas/Admin/DynamicData/FieldTemplates/Decimal_Edit.ascx.cs:8-25 | src/NuGetGallery/Areas/Admin/DynamicData/FieldTemplates/Integer_Edit.ascx.cs:8-25 — before extracting anything, compare `src/NuGetGallery/Areas/Admin/DynamicData/FieldTemplates/Decimal_Edit.ascx.cs` and `src/NuGetGallery/Areas/Admin/DynamicData/FieldTemplates/Integer_Edit.ascx.cs` as WHOLE FILES: 94% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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 `src/NuGetGallery/Areas/Admin/DynamicData/FieldTemplates/Decimal_Edit.ascx.cs:8` 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.
R10 · Code Duplication · Duplicated block (21 lines × 2 locations) · ×3
  • Duplicated block (21 lines × 2 locations) src/NuGetGallery/Scripts/gallery/page-api-keys.js:486 — src/NuGetGallery/Scripts/gallery/page-api-keys.js:486 · src/NuGetGallery/Scripts/gallery/page-api-keys.js:546 — 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 (21 lines × 2 locations) src/NuGetGallery/Scripts/gallery/page-api-keys.js:710 — src/NuGetGallery/Scripts/gallery/page-api-keys.js:710 · src/NuGetGallery/Scripts/gallery/page-trusted-publishing.js:915 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (21 lines × 2 locations) src/NuGetGallery/Scripts/gallery/page-trusted-publishing.js:86 — src/NuGetGallery/Scripts/gallery/page-trusted-publishing.js:86 · src/NuGetGallery/Scripts/gallery/page-trusted-publishing.js:263 — 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.
X18 · Disposal-pattern correctness · Disposes a dependency it does not own · ×3
  • Disposes a dependency it does not own src/NuGetGallery/Services/PackageStagingUploadService.cs:889 — `PackageFile` is never created by `PreparedPackageUpload` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 889). Its declared type `Stream` is an abstract class, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed.
  • Disposes a dependency it does not own src/NuGetGallery.Core/Certificates/CertificateFile.cs:27 — `Stream` is never created by `CertificateFile` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 27). Its declared type `Stream` is an abstract class, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed.
  • Disposes a dependency it does not own src/NuGet.Services.Testing.Entities/TestDbAsyncQueryProvider.cs:91 — `_inner` is never created by `TestDbAsyncEnumerator` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 91). Its declared type `IEnumerator` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×3
  • Swallowed exception (caught, then discarded) REDACTED:191 — `catch (EntityException)` does nothing with the exception it caught — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch. Log it through whatever this codebase already uses to report problems, or let it propagate; if one specific failure genuinely cannot matter, catch exactly that exception type and say why in a comment on the catch.
  • Swallowed exception (caught, then discarded) src/NuGetGallery/Areas/Admin/Controllers/LuceneController.cs:47 — `catch (FileNotFoundException)` does nothing with the exception it caught — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch. Log it through whatever this codebase already uses to report problems, or let it propagate; if one specific failure genuinely cannot matter, catch exactly that exception type and say why in a comment on the catch.
  • Swallowed exception (caught, then discarded) src/NuGetGallery.Core/Services/CloudBlobWrapper.cs:305 — `catch` does nothing with the exception it caught — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch. Log it through whatever this codebase already uses to report problems, or let it propagate; if one specific failure genuinely cannot matter, catch exactly that exception type and say why in a comment on the catch.
AC3 · Page structure · Heading level jumps from h1 to h4 · ×2
  • Heading level jumps from h1 to h4 REDACTED:1305 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h1 to h4 src/NuGetGallery/Views/Staging/Group.cshtml:420 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
AX2 · Stateful singletons · Stateful singleton · ×2
  • Stateful singleton: FeatureFlagCacheService src/NuGet.Services.FeatureFlags/FeatureFlagCacheService.cs:11 — `FeatureFlagCacheService` is a singleton (one shared instance) but mutates instance state outside any lock (_latestFlags; e.g. `_latestFlags` at line 57).
  • Stateful singleton: SecretRefresher src/NuGet.Services.AzureSearch/SearchService/SecretRefresher.cs:14 — `SecretRefresher` is a singleton (one shared instance) but mutates instance state outside any lock (LastRefresh; e.g. `LastRefresh` at line 50).
AX2 · Stateful singletons · Stateful shared instance · ×2
  • Stateful shared instance: StringCache src/NuGet.Services.AzureSearch/AuxiliaryFiles/StringCache.cs:9 — `StringCache` is not registered, but the singleton `AuxiliaryDataCache` creates it and keeps it in `_stringCache`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (_requestCount, _hitCount; e.g. `_requestCount` at line 73).
  • Stateful shared instance: SecurityPolicyResult src/NuGetGallery.Services/Security/SecurityPolicyResult.cs:13 — `SecurityPolicyResult` keeps one instance of itself in the static `SuccessResult`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_warningMessages; e.g. `_warningMessages` at line 72).
D18 · Solution Shape · Solution references a project that does not exist · ×2
  • Solution references a project that does not exist NuGetGallery.sln — `NuGetGallery.sln` declares 1 project file(s) that are missing from the tree (`src/NuGet.Services.Github/NuGet.Services.GitHub.csproj`). A solution-level restore or build fails on a dangling reference, so anyone building the solution rather than an individual project is blocked. Delete the stale entry from the solution, or restore the missing project file.
  • Solution references a project that does not exist NuGet.Jobs.sln — `NuGet.Jobs.sln` declares 1 project file(s) that are missing from the tree (`tests/Validation.ContentScan.Tests/Validation.ContentScan.Tests.csproj`). A solution-level restore or build fails on a dangling reference, so anyone building the solution rather than an individual project is blocked. Delete the stale entry from the solution, or restore the missing project file.
D2 · Cognitive Complexity · d3.clipRectangle.<returned closure> · ×2
  • d3.clipRectangle.<returned closure>::linePoint (cognitive 21) REDACTED:8761 — d3.clipRectangle.<returned closure>::linePoint has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (d3.clipRectangle.<returned closure>::polygonInside) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • d3.clipRectangle.<returned closure>::polygonInside (cognitive 17) REDACTED:8702 — d3.clipRectangle.<returned closure>::polygonInside has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (d3.clipRectangle.<returned closure>::linePoint) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Medium CVE · ×2
  • REDACTED
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (5 members, 50+ identical tokens) src/NuGetGallery/Areas/Admin/Models/AdminLockPackageRequest.cs:20 — src/NuGetGallery/Areas/Admin/Models/AdminLockPackageRequest.cs:20-44 | src/NuGetGallery/Areas/Admin/Models/AdminReflowPackageRequest.cs:19-42 | src/NuGetGallery/Areas/Admin/Models/AdminRevalidatePackageRequest.cs:20-43 | src/NuGetGallery/Areas/Admin/Models/AdminSoftDeletePackageRequest.cs:17-46 | src/NuGetGallery/Areas/Admin/Models/AdminUpdateListedPackageRequest.cs:22-45 — 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) src/NuGet.Services.AzureSearch/AuxiliaryFiles/AuxiliaryFileClient.cs:30 — src/NuGet.Services.AzureSearch/AuxiliaryFiles/AuxiliaryFileClient.cs:30-38 | src/NuGet.Services.AzureSearch/AuxiliaryFiles/DownloadDataClient.cs:30-38 | src/NuGet.Services.AzureSearch/AuxiliaryFiles/OwnerDataClient.cs:31-39 | src/NuGet.Services.AzureSearch/AuxiliaryFiles/PopularityTransferDataClient.cs:30-38 | src/NuGet.Services.AzureSearch/AuxiliaryFiles/VerifiedPackagesDataClient.cs:31-39 — 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.
D4 · Code Duplication · Edited copy of a member (37 corresponding lines) · ×2
  • Edited copy of a member (37 corresponding lines) src/NuGetGallery/Areas/Admin/Controllers/LockUserController.cs:55 — src/NuGetGallery/Areas/Admin/Controllers/LockUserController.cs:55-91 | src/NuGetGallery/Areas/Admin/Controllers/LockPackageController.cs:55-93 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (37 corresponding lines) src/PackageLagMonitor/SearchServiceClient.cs:62 — src/PackageLagMonitor/SearchServiceClient.cs:62-103 | src/PackageLagMonitor/SearchServiceClient.cs:117-153 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (23 corresponding lines) · ×2
  • Edited copy of a member (23 corresponding lines) src/NuGetGallery/Services/PackageStagingManagementService.cs:248 — src/NuGetGallery/Services/PackageStagingManagementService.cs:248-270 | src/NuGetGallery/Services/SymbolPackageStagingManagementService.cs:55-78 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) src/NuGetGallery.Core/Features/EditableFeatureFlagFileStorageService.cs:101 — src/NuGetGallery.Core/Features/EditableFeatureFlagFileStorageService.cs:101-123 | src/NuGetGallery.Core/Login/EditableLoginConfigurationFileStorageService.cs:106-128 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 17+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 17+ corresponding lines) src/NuGetGallery/Controllers/StagingApiController.cs:515 — src/NuGetGallery/Controllers/StagingApiController.cs:515-531 | src/NuGetGallery/Controllers/StagingApiController.cs:541-557 | src/NuGetGallery/Controllers/StagingApiController.cs:601-622 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 17+ corresponding lines) src/GitHubVulnerabilities2Db/Job.cs:69 — src/GitHubVulnerabilities2Db/Job.cs:69-87 | src/GitHubVulnerabilities2v3/Job.cs:83-99 | src/VerifyGitHubVulnerabilities/Job.cs:75-95 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (24 corresponding lines) · ×2
  • Edited copy of a member (24 corresponding lines) src/NuGetGallery.Core/Services/CloudBlobCoreFileStorageService.cs:349 — src/NuGetGallery.Core/Services/CloudBlobCoreFileStorageService.cs:349-376 | src/NuGetGallery.Core/Services/CloudBlobCoreFileStorageService.cs:379-402 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) src/NuGetGallery/Telemetry/KnownOperationNameEnricher.cs:28 — src/NuGetGallery/Telemetry/KnownOperationNameEnricher.cs:28-51 | src/NuGet.Services.Logging/TelemetryInitializers/KnownOperationNameEnricher.cs:35-58 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 8+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 8+ corresponding lines) src/NuGet.Services.Staging.Promotion/StagingPromotionMessageHandler.cs:47 — src/NuGet.Services.Staging.Promotion/StagingPromotionMessageHandler.cs:47-55 | src/NuGetGallery.Core/Services/StagingDeletionService.cs:34-42 | src/NuGetGallery/Areas/Admin/Services/ValidationAdminService.cs:36-43 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 8+ corresponding lines) src/Catalog/Persistence/OptimisticConcurrencyControlToken.cs:56 — src/Catalog/Persistence/OptimisticConcurrencyControlToken.cs:56-63 | src/NuGet.Services.Entities/SymbolPackage.cs:94-101 | src/NuGet.Services.Entities/User.cs:228-235 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 7+ corresponding lines) · ×2
  • Edited copies of one member (5 members, 7+ corresponding lines) src/NuGetGallery.Core/Infrastructure/Mail/Messages/PackageAddedMessage.cs:30 — src/NuGetGallery.Core/Infrastructure/Mail/Messages/PackageAddedMessage.cs:30-38 | src/NuGetGallery.Core/Infrastructure/Mail/Messages/PackageValidationFailedMessage.cs:32-40 | src/NuGetGallery.Core/Infrastructure/Mail/Messages/SymbolPackageAddedMessage.cs:31-39 | src/NuGetGallery.Core/Infrastructure/Mail/Messages/SymbolPackageValidationFailedMessage.cs:32-40 | src/NuGetGallery/Infrastructure/Mail/Messages/PackageAddedWithWarningsMessage.cs:26-32 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
  • Edited copies of one member (5 members, 7+ corresponding lines) src/NuGet.Services.Revalidate/Initialization/InitializationManager.cs:33 — src/NuGet.Services.Revalidate/Initialization/InitializationManager.cs:33-40 | src/NuGet.Services.Revalidate/Services/RevalidationQueue.cs:33-39 | src/NuGet.Services.Revalidate/Services/RevalidationService.cs:28-35 | src/NuGet.Services.Revalidate/Services/RevalidationThrottler.cs:26-32 | src/NuGetGallery/Services/PackageMetadataValidationService.cs:88-99 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 11+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 11+ corresponding lines) src/NuGetGallery.Services/Telemetry/TelemetryService.cs:703 — src/NuGetGallery.Services/Telemetry/TelemetryService.cs:703-717 | src/NuGetGallery.Services/Telemetry/TelemetryService.cs:793-803 | src/NuGetGallery.Services/Telemetry/TelemetryService.cs:861-871 | src/NuGetGallery.Services/Telemetry/TelemetryService.cs:895-905 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 11+ corresponding lines) src/NuGetGallery/Areas/Admin/Controllers/ReservedNamespaceController.cs:107 — src/NuGetGallery/Areas/Admin/Controllers/ReservedNamespaceController.cs:107-117 | src/NuGetGallery/Areas/Admin/Controllers/ReservedNamespaceController.cs:122-133 | src/NuGetGallery/Areas/Admin/Controllers/ReservedNamespaceController.cs:138-148 | src/NuGetGallery/Areas/Admin/Controllers/ReservedNamespaceController.cs:153-163 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 6+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 6+ corresponding lines) src/NuGetGallery/Services/AsynchronousValidationMessageEmitter.cs:28 — src/NuGetGallery/Services/AsynchronousValidationMessageEmitter.cs:28-38 | src/NuGetGallery/Services/StagedPackageValidationMessageEmitter.cs:23-28 | src/NuGetGallery/Services/StagedSymbolPackageValidationMessageEmitter.cs:26-31 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 6+ corresponding lines) src/NuGetGallery/Areas/Admin/Models/AdminReflowPackageRequest.cs:54 — src/NuGetGallery/Areas/Admin/Models/AdminReflowPackageRequest.cs:54-59 | src/NuGetGallery/Areas/Admin/Models/AdminSoftDeletePackageRequest.cs:58-63 | src/NuGetGallery/Areas/Admin/Models/AdminUpdateListedPackageRequest.cs:57-62 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×2
  • Duplicated block (21 lines × 2) src/NuGetGallery/Services/PackageStagingUploadService.cs:145 — src/NuGetGallery/Services/PackageStagingUploadService.cs:145-165 | src/NuGetGallery/Services/SymbolPackageStagingUploadService.cs:329-349 — 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 `src/NuGetGallery/Services/PackageStagingUploadService.cs:145` 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 (21 lines × 2) src/NuGetGallery.Core/Services/CloudBlobCoreFileStorageService.cs:482 — src/NuGetGallery.Core/Services/CloudBlobCoreFileStorageService.cs:482-502 | src/NuGetGallery.Core/Services/CloudBlobCoreFileStorageService.cs:525-545 — 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 (20 lines × 2) · ×2
  • Duplicated block (20 lines × 2) REDACTED:291 — REDACTED:291-310 | REDACTED:462-481 — 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 (20 lines × 2) REDACTED:1908 — REDACTED:1908-1928 | REDACTED:1954-1973 — 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 `REDACTED:1908` 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.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×2
  • Duplicated block (15 lines × 3) src/NuGetGallery/Services/PackageStagingUploadService.cs:145 — src/NuGetGallery/Services/PackageStagingUploadService.cs:145-159 | src/NuGetGallery/Services/PackageStagingUploadService.cs:196-210 | src/NuGetGallery/Services/SymbolPackageStagingUploadService.cs:329-343 — 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 `src/NuGetGallery/Services/PackageStagingUploadService.cs:145` 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 (15 lines × 3) src/GitHubVulnerabilities2Db/Job.cs:158 — src/GitHubVulnerabilities2Db/Job.cs:158-172 | src/GitHubVulnerabilities2v3/Job.cs:115-129 | src/VerifyGitHubVulnerabilities/Job.cs:128-142 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/GitHubVulnerabilities2Db/Job.cs:158` 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 × 3) · ×2
  • Duplicated block (11 lines × 3) REDACTED:131 — REDACTED:131-141 | REDACTED:333-343 | REDACTED:512-522 — 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 `REDACTED:131` 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 (11 lines × 3) src/NuGet.Services.AzureSearch/Db2AzureSearch/NewPackageRegistrationFromKustoProducer.cs:59 — src/NuGet.Services.AzureSearch/Db2AzureSearch/NewPackageRegistrationFromKustoProducer.cs:59-69 | src/NuGet.Services.AzureSearch/Db2AzureSearch/NewPackageRegistrationFromKustoProducer.cs:249-259 | src/NuGet.Services.AzureSearch/Db2AzureSearch/NewPackageRegistrationFromKustoProducer.cs:384-394 — 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 `src/NuGet.Services.AzureSearch/Db2AzureSearch/NewPackageRegistrationFromKustoProducer.cs:59` 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.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×2
  • Duplicated block (12–13 lines × 2) src/NuGetGallery/Helpers/ViewModelExtensions/DisplayLicenseViewModelFactory.cs:53 — src/NuGetGallery/Helpers/ViewModelExtensions/DisplayLicenseViewModelFactory.cs:53-64 | src/NuGetGallery/Helpers/ViewModelExtensions/DisplayPackageViewModelFactory.cs:199-211 — 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 (12–13 lines × 2) src/GalleryTools/Commands/CreateApiKeyCommand.cs:59 — src/GalleryTools/Commands/CreateApiKeyCommand.cs:59-70 | src/GalleryTools/Commands/CreateOrganizationCommand.cs:52-64 — 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 `src/GalleryTools/Commands/CreateApiKeyCommand.cs:59` 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) · ×2
  • Duplicated block (7 lines × 3) src/NuGetGallery/Controllers/StagingApiController.cs:487 — src/NuGetGallery/Controllers/StagingApiController.cs:487-493 | src/NuGetGallery/Controllers/StagingApiController.cs:516-522 | src/NuGetGallery/Controllers/StagingApiController.cs:633-639 — 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.
  • Duplicated block (7 lines × 3) src/Ng/Jobs/Catalog2DnxJob.cs:43 — src/Ng/Jobs/Catalog2DnxJob.cs:43-49 | src/Ng/Jobs/Db2CatalogJob.cs:61-67 | src/Ng/Jobs/FixCatalogCachingJob.cs:50-56 — 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.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×2
  • Duplicated block (5 lines × 3) src/NuGetGallery/Controllers/StagingApiController.cs:386 — src/NuGetGallery/Controllers/StagingApiController.cs:386-390 | src/NuGetGallery/Controllers/StagingApiController.cs:403-407 | REDACTED:387-393 — 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 `src/NuGetGallery/Controllers/StagingApiController.cs:386` 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) src/NuGetGallery/Infrastructure/Mail/Messages/ApiKeyRevokedMessage.cs:21 — src/NuGetGallery/Infrastructure/Mail/Messages/ApiKeyRevokedMessage.cs:21-26 | src/NuGetGallery/Infrastructure/Mail/Messages/CredentialAddedMessage.cs:21-25 | src/NuGetGallery/Infrastructure/Mail/Messages/CredentialRemovedMessage.cs:21-25 — 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.
D5 · Coupling · Off the main sequence · ×2
  • Off the main sequence: NuGet.Services.Entities(net472) src/NuGet.Services.Entities/NuGet.Services.Entities.csproj:1 — NuGet.Services.Entities(net472): abstractness 0.07, instability 0.00, distance 0.93 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
  • Off the main sequence: NuGet.Services.Storage(net472) src/NuGet.Services.Storage/NuGet.Services.Storage.csproj:1 — NuGet.Services.Storage(net472): abstractness 0.29, instability 0.00, distance 0.71 — zone of pain — concrete and depended on by 6 project(s), so it's rigid to change.
IC1 · Incompleteness & stubs · Skeleton type · ×2
  • Skeleton type — most members are unfinished src/AccountDeleter/AccountDeleteUserService.cs:14 — `AccountDeleteUserService` has 25 unfinished members out of 27 declared members (methods, properties, indexers and events, whether or not each carries a body) — a scaffolded type that was never implemented.
  • Skeleton type — most members are unfinished src/AccountDeleter/Configuration/GalleryConfiguration.cs:10 — `GalleryConfiguration` has 109 unfinished members out of 111 declared members (methods, properties, indexers and events, whether or not each carries a body) — a scaffolded type that was never implemented.
R10 · Code Duplication · Duplicated block with local edits (31 matched lines × 2 locations) · ×2
  • Duplicated block with local edits (31 matched lines × 2 locations) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:10663 — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:10663 · src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:11341 — the two spans are one implementation copied and then locally edited — 223 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
  • Duplicated block with local edits (31 matched lines × 2 locations) src/NuGetGallery/Scripts/gallery/stats-perpackagestatsgraphs.js:26 — src/NuGetGallery/Scripts/gallery/stats-perpackagestatsgraphs.js:26 · src/NuGetGallery/Scripts/gallery/stats-perpackagestatsgraphs.js:134 — the two spans are one implementation copied and then locally edited — 247 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 (22 lines × 2 locations) · ×2
  • Duplicated block (22 lines × 2 locations) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:10584 — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:10584 · src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:11316 — 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 (22 lines × 2 locations) src/NuGetGallery/Scripts/gallery/page-signin.js:32 — src/NuGetGallery/Scripts/gallery/page-signin.js:32 · src/NuGetGallery/Scripts/gallery/page-signin.js:67 — 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 (15 lines × 2 locations) · ×2
  • Duplicated block (15 lines × 2 locations) src/NuGetGallery/Scripts/gallery/async-file-upload.js:219 — src/NuGetGallery/Scripts/gallery/async-file-upload.js:219 · src/NuGetGallery/Scripts/gallery/certificates.js:149 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
  • Duplicated block (15 lines × 2 locations) src/NuGetGallery/Scripts/gallery/page-api-keys.js:224 — src/NuGetGallery/Scripts/gallery/page-api-keys.js:224 · src/NuGetGallery/Scripts/gallery/page-trusted-publishing.js:37 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (14 lines × 2 locations) · ×2
  • Duplicated block (14 lines × 2 locations) src/NuGetGallery/Scripts/gallery/page-home.js:35 — src/NuGetGallery/Scripts/gallery/page-home.js:35 · src/NuGetGallery/Scripts/gallery/page-signin.js:27 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (14 lines × 2 locations) src/NuGetGallery/Scripts/gallery/page-manage-packages.js:153 — src/NuGetGallery/Scripts/gallery/page-manage-packages.js:153 · src/NuGetGallery/Scripts/gallery/page-manage-packages.js:283 — 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 (anonymous) (cyclomatic 21, cognitive 21) · ×2
  • Complex function (anonymous) (cyclomatic 21, cognitive 21) src/NuGetGallery/Scripts/gallery/page-api-keys.js:127 — (anonymous) has cyclomatic complexity 21 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
  • Complex function (anonymous) (cyclomatic 21, cognitive 21) src/NuGetGallery/Scripts/gallery/page-trusted-publishing.js:526 — (anonymous) has cyclomatic complexity 21 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function Update (cyclomatic 16, cognitive 16) · ×2
  • Complex function Update (cyclomatic 16, cognitive 16) src/NuGetGallery/Scripts/gallery/page-trusted-publishing.js:86 — Update has cyclomatic complexity 16 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
  • Complex function Update (cyclomatic 16, cognitive 16) src/NuGetGallery/Scripts/gallery/page-trusted-publishing.js:263 — Update has cyclomatic complexity 16 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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.
X1 · Async correctness · Blocking `StreamReader.ReadToEnd` inside an `async` method · ×2
  • Blocking `StreamReader.ReadToEnd` inside an `async` method src/CopyAzureContainer/CopyAzureContainerJob.cs:167 — `StreamReader.ReadToEnd` blocks the thread on I/O while `StreamReader.ReadToEndAsync` exists to wait without one — inside a method that is already `async`, await the twin.
  • Blocking `StreamReader.ReadToEnd` inside an `async` method src/CopyAzureContainer/CopyAzureContainerJob.cs:168 — `StreamReader.ReadToEnd` blocks the thread on I/O while `StreamReader.ReadToEndAsync` exists to wait without one — inside a method that is already `async`, await the twin.
X18 · Disposal-pattern correctness · Disposable acquired into a field and never released · ×2
  • Disposable acquired into a field and never released src/NuGet.Services.ServiceBus/SubscriptionClientWrapper.cs:17 — `_processor` (line 17) holds a `ServiceBusProcessor` that `SubscriptionClientWrapper` acquires itself — every assignment to it is a call that opens or creates a new instance for the caller to own — and nothing in `SubscriptionClientWrapper` ever releases it: the type is not `IDisposable`, declares no `Dispose`, and every other mention of `_processor` only reads through it, so it is never disposed, closed, returned or handed on. Whatever it opened (a connection, a channel, a file) stays open until finalization if the type has a finalizer and until the process ends if it does not, once per instance of `SubscriptionClientWrapper`. Implement `IDisposable` and release `_processor` there, or take the instance from the caller so its owner ends it.
  • Disposable acquired into a field and never released src/NuGet.Services.ServiceBus/TopicClientWrapper.cs:14 — `_sender` (line 14) holds a `ServiceBusSender` that `TopicClientWrapper` acquires itself — every assignment to it is a call that opens or creates a new instance for the caller to own — and nothing in `TopicClientWrapper` ever releases it: the type is not `IDisposable`, declares no `Dispose`, and every other mention of `_sender` only reads through it, so it is never disposed, closed, returned or handed on. Whatever it opened (a connection, a channel, a file) stays open until finalization if the type has a finalizer and until the process ends if it does not, once per instance of `TopicClientWrapper`. Implement `IDisposable` and release `_sender` there, or take the instance from the caller so its owner ends it.
X3 · Exception handling · Unguarded deserialized result under a catch list that cannot catch it · ×2
  • Unguarded deserialized result under a catch list that cannot catch it src/NuGetGallery/Areas/Admin/Controllers/ApiKeysController.cs:64 — `leakedApiKeyInfo` is used without ever being checked for null, but `JsonConvert` returns null for the document `null` — and no catch clause around it catches NullReferenceException, so that one input throws past every handler here and out of the method. The try already answers unreadable files and malformed JSON; answer the empty document too, by testing the result before using it (or by rejecting null where the value is produced) rather than by widening the catch to swallow the deref.
  • Unguarded deserialized result under a catch list that cannot catch it src/NuGet.Protocol.Catalog/FileCursor.cs:33 — `data` is used without ever being checked for null, but `JsonConvert` returns null for the document `null` — and no catch clause around it catches NullReferenceException, so that one input throws past every handler here and out of the method. The try already answers unreadable files and malformed JSON; answer the empty document too, by testing the result before using it (or by rejecting null where the value is produced) rather than by widening the catch to swallow the deref.
AC2 · Forms & labels · <fieldset> without a <legend> · ×1
  • <fieldset> without a <legend> src/NuGetGallery/Areas/Admin/Views/Lucene/Index.cshtml:41 — A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one.
AC3 · Page structure · Heading level jumps from h2 to h4 · ×1
  • Heading level jumps from h2 to h4 src/NuGetGallery/Areas/Admin/Views/FederatedCredentials/Index.cshtml:230 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
AC3 · Page structure · Heading level jumps from h1 to h3 · ×1
  • Heading level jumps from h1 to h3 REDACTED:39 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
AC3 · Page structure · Empty <h3> heading · ×1
  • Empty <h3> heading src/NuGetGallery/Scripts/gallery/bootstrap.js:2012 — An empty heading appears in the document outline announced with no text. Give the heading text, or remove it if it's decorative.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (2.6 · ×1
  • Low contrast colour pair in CSS (2.6:1) src/NuGetGallery/Content/Site.css:219 — `.message` sets color: #52a4ca on background-color: #eff7fa — 2.6:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (2.0 · ×1
  • Low contrast colour pair in CSS (2.0:1) src/NuGetGallery/Content/Site.css:233 — `.warning` sets color: #ff9600 on background-color: #fff7c4 — 2.0:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (2.7 · ×1
  • Low contrast colour pair in CSS (2.7:1) src/NuGetGallery/Areas/Admin/DynamicData/Site.css:83 — `div.DDNavigation a` sets color: #839ce7 on background-color: #fff — 2.7:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
C1 · Data Protection · No data-protection/encryption · ×1
  • No data-protection/encryption — No data-protection or encryption usage (ASP.NET Data Protection, AES, column encryption, PBKDF2) was found — sensitive data at rest may be unprotected. If TDE/KMS/vault is delegated to infrastructure, ignore.
D1 · Cyclomatic Complexity · d3.zoom (cyclomatic 77) · ×1
  • d3.zoom (cyclomatic 77) REDACTED:16971 — d3.zoom has cyclomatic complexity 77 (threshold 15). Most of this is not in the body itself: 4 of the 77 points are its own statements and the rest belongs to 32 function items inside it that branch (touchended, touchstarted, touchmoved, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest. This file is where this pass's cyclomatic complexity CONCENTRATES: REDACTED holds 31 of the 99 methods over the threshold — including the worst — and 308 of the 911 points over it (34%), 4.9× the next-largest file (src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js at 63). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · page-manage-deprecation.ManageDeprecationViewModel (cyclomatic 55) · ×1
  • page-manage-deprecation.ManageDeprecationViewModel (cyclomatic 55) src/NuGetGallery/Scripts/gallery/page-manage-deprecation.js:3 — page-manage-deprecation.ManageDeprecationViewModel has cyclomatic complexity 55 (threshold 15). Most of this is not in the body itself: 12 of the 55 points are its own statements and the rest belongs to 17 function items inside it that branch (a function literal at line 18, checkDeprecationState, a function literal at line 134, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · PublicExternalIconUrlPolicy.IsRestrictedAddress (cyclomatic 50) · ×1
  • PublicExternalIconUrlPolicy.IsRestrictedAddress (cyclomatic 50) src/Catalog/Icons/PublicExternalIconUrlPolicy.cs:105 — PublicExternalIconUrlPolicy.IsRestrictedAddress has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · d3.clipCircle (cyclomatic 44) · ×1
  • d3.clipCircle (cyclomatic 44) REDACTED:8398 — d3.clipCircle has cyclomatic complexity 44 (threshold 15). Most of this is not in the body itself: 2 of the 44 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 8427, intersect, code, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest. This file is where this pass's cyclomatic complexity CONCENTRATES: REDACTED holds 31 of the 99 methods over the threshold — including the worst — and 308 of the 911 points over it (34%), 4.9× the next-largest file (src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js at 63). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · clamp.clamp (cyclomatic 41) · ×1
  • clamp.clamp (cyclomatic 41) src/NuGetGallery/Scripts/gallery/clamp.js:29 — clamp.clamp has cyclomatic complexity 41 (threshold 15). Of this number, 16 points are the body's own statements and 25 belong to 6 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SymbolPackageStagingUploadService.ProcessUploadAsync (cyclomatic 40) · ×1
  • SymbolPackageStagingUploadService.ProcessUploadAsync (cyclomatic 40) src/NuGetGallery/Services/SymbolPackageStagingUploadService.cs:111 — SymbolPackageStagingUploadService.ProcessUploadAsync has cyclomatic complexity 40 (threshold 15). Of this number, 36 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PackageHelper.ValidateNuGetPackageMetadata (cyclomatic 40) · ×1
  • PackageHelper.ValidateNuGetPackageMetadata (cyclomatic 40) src/NuGetGallery.Services/PackageManagement/PackageHelper.cs:83 — PackageHelper.ValidateNuGetPackageMetadata has cyclomatic complexity 40 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · d3.clipEdge (cyclomatic 37) · ×1
  • d3.clipEdge (cyclomatic 37) REDACTED:16152 — d3.clipEdge has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: REDACTED holds 31 of the 99 methods over the threshold — including the worst — and 308 of the 911 points over it (34%), 4.9× the next-largest file (src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js at 63). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · d3.clipLine (cyclomatic 35) · ×1
  • d3.clipLine (cyclomatic 35) REDACTED:8575 — d3.clipLine has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: REDACTED holds 31 of the 99 methods over the threshold — including the worst — and 308 of the 911 points over it (34%), 4.9× the next-largest file (src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js at 63). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · jquery-ui-1.10.3.$.effects.effect.size (cyclomatic 35) · ×1
  • jquery-ui-1.10.3.$.effects.effect.size (cyclomatic 35) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:11064 — jquery-ui-1.10.3.$.effects.effect.size has cyclomatic complexity 35 (threshold 15). Of this number, 25 points are the body's own statements and 10 belong to 4 function literals inside it that branch. This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D1 · Cyclomatic Complexity · QueryResult.GetInnerResult (cyclomatic 34) · ×1
  • QueryResult.GetInnerResult (cyclomatic 34) src/NuGetGallery/WebApi/QueryResult.cs:116 — QueryResult.GetInnerResult has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ApiController.CreatePackageInternal (cyclomatic 34) · ×1
  • ApiController.CreatePackageInternal (cyclomatic 34) REDACTED:533 — ApiController.CreatePackageInternal has cyclomatic complexity 34 (threshold 15). Of this number, 32 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · jquery-ui-1.10.3.$.fn.position (cyclomatic 34) · ×1
  • jquery-ui-1.10.3.$.fn.position (cyclomatic 34) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:12138 — jquery-ui-1.10.3.$.fn.position has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 10 of the 34 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 12166, 12217, 12276, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · PackagesController.DisplayPackage (cyclomatic 33) · ×1
  • PackagesController.DisplayPackage (cyclomatic 33) REDACTED:902 — PackagesController.DisplayPackage has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PackageMetadataValidationService.CheckLicenseMetadataAsync (cyclomatic 31) · ×1
  • PackageMetadataValidationService.CheckLicenseMetadataAsync (cyclomatic 31) src/NuGetGallery/Services/PackageMetadataValidationService.cs:322 — PackageMetadataValidationService.CheckLicenseMetadataAsync has cyclomatic complexity 31 (threshold 15). Of this number, 30 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · StagingController.AddSymbolPackages (cyclomatic 31) · ×1
  • StagingController.AddSymbolPackages (cyclomatic 31) REDACTED:383 — StagingController.AddSymbolPackages has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 12 of the 31 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 396, 464). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · StagingGroupPromotionService.TryFinalizeAsync (cyclomatic 30) · ×1
  • StagingGroupPromotionService.TryFinalizeAsync (cyclomatic 30) src/NuGetGallery.Core/Services/StagingGroupPromotionService.cs:77 — StagingGroupPromotionService.TryFinalizeAsync has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 6 of the 30 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 93, 117, 120, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · d3.drag (cyclomatic 30) · ×1
  • d3.drag (cyclomatic 30) REDACTED:1861 — d3.drag has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 1 of the 30 points is its own statement and the rest belongs to 14 function items inside it that branch (mousedowned, touchstarted, touchended, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest. This file is where this pass's cyclomatic complexity CONCENTRATES: REDACTED holds 31 of the 99 methods over the threshold — including the worst — and 308 of the 911 points over it (34%), 4.9× the next-largest file (src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js at 63). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · d3.tree_remove (cyclomatic 30) · ×1
  • d3.tree_remove (cyclomatic 30) REDACTED:6183 — d3.tree_remove has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: REDACTED holds 31 of the 99 methods over the threshold — including the worst — and 308 of the 911 points over it (34%), 4.9× the next-largest file (src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js at 63). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · jquery-ui-1.10.3.$.ui.intersect (cyclomatic 30) · ×1
  • jquery-ui-1.10.3.$.ui.intersect (cyclomatic 30) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:2106 — jquery-ui-1.10.3.$.ui.intersect has cyclomatic complexity 30 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D1 · Cyclomatic Complexity · GitHubTokenPolicyValidator.EvaluatePolicyAsync (cyclomatic 29) · ×1
  • GitHubTokenPolicyValidator.EvaluatePolicyAsync (cyclomatic 29) src/NuGetGallery.Services/Authentication/Federated/GitHubTokenPolicyValidator.cs:175 — GitHubTokenPolicyValidator.EvaluatePolicyAsync has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · d3.clipCells (cyclomatic 29) · ×1
  • d3.clipCells (cyclomatic 29) REDACTED:16327 — d3.clipCells has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: REDACTED holds 31 of the 99 methods over the threshold — including the worst — and 308 of the 911 points over it (34%), 4.9× the next-largest file (src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js at 63). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · PackagesController.VerifyPackageInternal (cyclomatic 28) · ×1
  • PackagesController.VerifyPackageInternal (cyclomatic 28) REDACTED:2821 — PackagesController.VerifyPackageInternal has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · d3.contours (cyclomatic 28) · ×1
  • d3.contours (cyclomatic 28) REDACTED:5339 — d3.contours has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 2 of the 28 points are its own statements and the rest belongs to 8 function items inside it that branch (isorings::stitch, a function literal at line 5478, isorings, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest. This file is where this pass's cyclomatic complexity CONCENTRATES: REDACTED holds 31 of the 99 methods over the threshold — including the worst — and 308 of the 911 points over it (34%), 4.9× the next-largest file (src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js at 63). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · d3.clipRectangle.<returned closure> (cyclomatic 28) · ×1
  • d3.clipRectangle.<returned closure> (cyclomatic 28) REDACTED:8679 — d3.clipRectangle.<returned closure> has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 1 of the 28 points is its own statement and the rest belongs to 6 function items inside it that branch (linePoint, polygonInside, polygonEnd, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest. This file is where this pass's cyclomatic complexity CONCENTRATES: REDACTED holds 31 of the 99 methods over the threshold — including the worst — and 308 of the 911 points over it (34%), 4.9× the next-largest file (src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js at 63). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · PackageDeprecationService.UpdateDeprecation (cyclomatic 27) · ×1
  • PackageDeprecationService.UpdateDeprecation (cyclomatic 27) src/NuGetGallery/Services/PackageDeprecationService.cs:33 — PackageDeprecationService.UpdateDeprecation has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · StagedSymbolPackagePromotionService.CompleteAsync (cyclomatic 27) · ×1
  • StagedSymbolPackagePromotionService.CompleteAsync (cyclomatic 27) src/NuGetGallery.Core/Services/StagedSymbolPackagePromotionService.cs:58 — StagedSymbolPackagePromotionService.CompleteAsync has cyclomatic complexity 27 (threshold 15). Of this number, 20 points are the body's own statements and 7 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SearchTextBuilder.Build (cyclomatic 27) · ×1
  • SearchTextBuilder.Build (cyclomatic 27) src/NuGet.Services.AzureSearch/SearchService/SearchTextBuilder.cs:140 — SearchTextBuilder.Build has cyclomatic complexity 27 (threshold 15). Of this number, 26 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PackageMetadataValidationService.CheckPackageIdForBannedCharacters (cyclomatic 26) · ×1
  • PackageMetadataValidationService.CheckPackageIdForBannedCharacters (cyclomatic 26) src/NuGetGallery/Services/PackageMetadataValidationService.cs:246 — PackageMetadataValidationService.CheckPackageIdForBannedCharacters has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AuthenticationController.LinkExternalAccount (cyclomatic 26) · ×1
  • AuthenticationController.LinkExternalAccount (cyclomatic 26) REDACTED:596 — AuthenticationController.LinkExternalAccount has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ManifestValidator.ValidateCore (cyclomatic 26) · ×1
  • ManifestValidator.ValidateCore (cyclomatic 26) src/NuGetGallery.Core/Packaging/ManifestValidator.cs:41 — ManifestValidator.ValidateCore has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · d3.formatLocale.format.format (cyclomatic 26) · ×1
  • d3.formatLocale.format.format (cyclomatic 26) REDACTED:7155 — d3.formatLocale.format.format has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: REDACTED holds 31 of the 99 methods over the threshold — including the worst — and 308 of the 911 points over it (34%), 4.9× the next-largest file (src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js at 63). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · ODataV2FeedController.GetCoreAsync (cyclomatic 25) · ×1
  • ODataV2FeedController.GetCoreAsync (cyclomatic 25) REDACTED:271 — ODataV2FeedController.GetCoreAsync has cyclomatic complexity 25 (threshold 15). Of this number, 24 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · StagingDeletionService.DeleteGroupAsync (cyclomatic 25) · ×1
  • StagingDeletionService.DeleteGroupAsync (cyclomatic 25) src/NuGetGallery.Core/Services/StagingDeletionService.cs:135 — StagingDeletionService.DeleteGroupAsync has cyclomatic complexity 25 (threshold 15). Of this number, 17 points are the body's own statements and 8 belong to 6 function literals inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
D1 · Cyclomatic Complexity · d3.arc.arc (cyclomatic 25) · ×1
  • d3.arc.arc (cyclomatic 25) REDACTED:14104 — d3.arc.arc has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: REDACTED holds 31 of the 99 methods over the threshold — including the worst — and 308 of the 911 points over it (34%), 4.9× the next-largest file (src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js at 63). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · SymbolPackageStagingUploadService.ValidateTarget (cyclomatic 24) · ×1
  • SymbolPackageStagingUploadService.ValidateTarget (cyclomatic 24) src/NuGetGallery/Services/SymbolPackageStagingUploadService.cs:414 — SymbolPackageStagingUploadService.ValidateTarget has cyclomatic complexity 24 (threshold 15). Of this number, 23 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · SearchAdaptor.TryReadSearchFilter (cyclomatic 24) · ×1
  • SearchAdaptor.TryReadSearchFilter (cyclomatic 24) src/NuGetGallery/OData/SearchService/SearchAdaptor.cs:219 — SearchAdaptor.TryReadSearchFilter has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · d3.simulation (cyclomatic 24) · ×1
  • d3.simulation (cyclomatic 24) REDACTED:6589 — d3.simulation has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 2 of the 24 points are its own statements and the rest belongs to 13 function items inside it that branch (initializeNodes, tick, a function literal at line 6689, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest. This is NOT this file's highest cyclomatic complexity: d3.log$1 (cyclomatic 25) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score. This file is where this pass's cyclomatic complexity CONCENTRATES: REDACTED holds 31 of the 99 methods over the threshold — including the worst — and 308 of the 911 points over it (34%), 4.9× the next-largest file (src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js at 63). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · PackageStagingPromotionService.PromoteGroupAsync (cyclomatic 23) · ×1
  • PackageStagingPromotionService.PromoteGroupAsync (cyclomatic 23) src/NuGetGallery/Services/PackageStagingPromotionService.cs:270 — PackageStagingPromotionService.PromoteGroupAsync has cyclomatic complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PackageStagingUploadService.ProcessUploadAsync (cyclomatic 23) · ×1
  • PackageStagingUploadService.ProcessUploadAsync (cyclomatic 23) src/NuGetGallery/Services/PackageStagingUploadService.cs:439 — PackageStagingUploadService.ProcessUploadAsync has cyclomatic complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PackagesController.ListPackages (cyclomatic 23) · ×1
  • PackagesController.ListPackages (cyclomatic 23) REDACTED:1320 — PackagesController.ListPackages has cyclomatic complexity 23 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · d3.linePoint (cyclomatic 23) · ×1
  • d3.linePoint (cyclomatic 23) REDACTED:7554 — d3.linePoint has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: d3.log$1 (cyclomatic 25) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score. This file is where this pass's cyclomatic complexity CONCENTRATES: REDACTED holds 31 of the 99 methods over the threshold — including the worst — and 308 of the 911 points over it (34%), 4.9× the next-largest file (src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js at 63). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · jquery-ui-1.10.3.$.effects.effect.bounce (cyclomatic 23) · ×1
  • jquery-ui-1.10.3.$.effects.effect.bounce (cyclomatic 23) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:10504 — jquery-ui-1.10.3.$.effects.effect.bounce has cyclomatic complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D1 · Cyclomatic Complexity · CorePackageService.UpdateIsLatestAsync (cyclomatic 22) · ×1
  • CorePackageService.UpdateIsLatestAsync (cyclomatic 22) src/NuGetGallery.Core/Services/CorePackageService.cs:116 — CorePackageService.UpdateIsLatestAsync has cyclomatic complexity 22 (threshold 15). Of this number, 13 points are the body's own statements and 9 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Program.Main (cyclomatic 22) · ×1
  • Program.Main (cyclomatic 22) REDACTED:41 — Program.Main has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 9 of the 22 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 684, 763). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · d3.tree_cover (cyclomatic 22) · ×1
  • d3.tree_cover (cyclomatic 22) REDACTED:6033 — d3.tree_cover has cyclomatic complexity 22 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This is NOT this file's highest cyclomatic complexity: d3.log$1 (cyclomatic 25) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score. This file is where this pass's cyclomatic complexity CONCENTRATES: REDACTED holds 31 of the 99 methods over the threshold — including the worst — and 308 of the 911 points over it (34%), 4.9× the next-largest file (src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js at 63). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · d3.clipRectangle (cyclomatic 22) · ×1
  • d3.clipRectangle (cyclomatic 22) REDACTED:8640 — d3.clipRectangle has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 1 of the 22 points is its own statement and the rest belongs to 4 function items inside it that branch (interpolate, corner, comparePoint, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest. This is NOT this file's highest cyclomatic complexity: d3.log$1 (cyclomatic 25) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score. This file is where this pass's cyclomatic complexity CONCENTRATES: REDACTED holds 31 of the 99 methods over the threshold — including the worst — and 308 of the 911 points over it (34%), 4.9× the next-largest file (src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js at 63). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · d3.connectEdge (cyclomatic 22) · ×1
  • d3.connectEdge (cyclomatic 22) REDACTED:16216 — d3.connectEdge has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: d3.log$1 (cyclomatic 25) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score. This file is where this pass's cyclomatic complexity CONCENTRATES: REDACTED holds 31 of the 99 methods over the threshold — including the worst — and 308 of the 911 points over it (34%), 4.9× the next-largest file (src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js at 63). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · bootstrap.Tooltip.show (cyclomatic 22) · ×1
  • bootstrap.Tooltip.show (cyclomatic 22) src/NuGetGallery/Scripts/gallery/bootstrap.js:1616 — bootstrap.Tooltip.show has cyclomatic complexity 22 (threshold 15). Of this number, 21 points are the body's own statements and 1 belongs to one function item inside it that branches. This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D1 · Cyclomatic Complexity · PackageStagingManagementService.GetStagingGroupPackagePage (cyclomatic 21) · ×1
  • PackageStagingManagementService.GetStagingGroupPackagePage (cyclomatic 21) src/NuGetGallery/Services/PackageStagingManagementService.cs:697 — PackageStagingManagementService.GetStagingGroupPackagePage has cyclomatic complexity 21 (threshold 15). Of this number, 16 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · PackageDeprecationManagementService.UpdateDeprecation (cyclomatic 21) · ×1
  • PackageDeprecationManagementService.UpdateDeprecation (cyclomatic 21) src/NuGetGallery/Services/PackageDeprecationManagementService.cs:42 — PackageDeprecationManagementService.UpdateDeprecation has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · JsonSort.Compare (cyclomatic 21) · ×1
  • JsonSort.Compare (cyclomatic 21) src/Catalog/Helpers/JsonSort.cs:34 — JsonSort.Compare has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · JsonLdReader.Load (cyclomatic 21) · ×1
  • JsonLdReader.Load (cyclomatic 21) REDACTED:27 — JsonLdReader.Load has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · d3.formatLocale$1.newParse.<returned closure> (cyclomatic 21) · ×1
  • d3.formatLocale$1.newParse.<returned closure> (cyclomatic 21) REDACTED:12928 — d3.formatLocale$1.newParse.<returned closure> has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: d3.log$1 (cyclomatic 25) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score. This file is where this pass's cyclomatic complexity CONCENTRATES: REDACTED holds 31 of the 99 methods over the threshold — including the worst — and 308 of the 911 points over it (34%), 4.9× the next-largest file (src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js at 63). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · SearchAdaptor.GetNextLink (cyclomatic 20) · ×1
  • SearchAdaptor.GetNextLink (cyclomatic 20) src/NuGetGallery/OData/SearchService/SearchAdaptor.cs:358 — SearchAdaptor.GetNextLink has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CloudBlobCoreFileStorageService.CopyFileAsync (cyclomatic 20) · ×1
  • CloudBlobCoreFileStorageService.CopyFileAsync (cyclomatic 20) src/NuGetGallery.Core/Services/CloudBlobCoreFileStorageService.cs:187 — CloudBlobCoreFileStorageService.CopyFileAsync has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · d3.link (cyclomatic 20) · ×1
  • d3.link (cyclomatic 20) REDACTED:6475 — d3.link has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 2 of the 20 points are its own statements and the rest belongs to 8 function items inside it that branch (initialize, initializeStrength, initializeDistance, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest. This is NOT this file's highest cyclomatic complexity: d3.log$1 (cyclomatic 25) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score. This file is where this pass's cyclomatic complexity CONCENTRATES: REDACTED holds 31 of the 99 methods over the threshold — including the worst — and 308 of the 911 points over it (34%), 4.9× the next-largest file (src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js at 63). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · d3.calendar (cyclomatic 20) · ×1
  • d3.calendar (cyclomatic 20) REDACTED:13437 — d3.calendar has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to 6 function items inside it that branch (tickFormat, tickInterval, a function literal at line 13515, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest. This is NOT this file's highest cyclomatic complexity: d3.log$1 (cyclomatic 25) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score. This file is where this pass's cyclomatic complexity CONCENTRATES: REDACTED holds 31 of the 99 methods over the threshold — including the worst — and 308 of the 911 points over it (34%), 4.9× the next-largest file (src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js at 63). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · MarkdownService.GetHtmlFromMarkdownCommonMark (cyclomatic 19) · ×1
  • MarkdownService.GetHtmlFromMarkdownCommonMark (cyclomatic 19) src/NuGetGallery/Services/MarkdownService.cs:102 — MarkdownService.GetHtmlFromMarkdownCommonMark has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PackageStagingManagementService.MovePackageIdentityAsync (cyclomatic 19) · ×1
  • PackageStagingManagementService.MovePackageIdentityAsync (cyclomatic 19) src/NuGetGallery/Services/PackageStagingManagementService.cs:511 — PackageStagingManagementService.MovePackageIdentityAsync has cyclomatic complexity 19 (threshold 15). Of this number, 13 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PackageStagingPromotionService.PromotePackageAsync (cyclomatic 19) · ×1
  • PackageStagingPromotionService.PromotePackageAsync (cyclomatic 19) src/NuGetGallery/Services/PackageStagingPromotionService.cs:57 — PackageStagingPromotionService.PromotePackageAsync has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PackageUploadService.CommitPackageAsync (cyclomatic 19) · ×1
  • PackageUploadService.CommitPackageAsync (cyclomatic 19) src/NuGetGallery/Services/PackageUploadService.cs:111 — PackageUploadService.CommitPackageAsync has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · StagingBlobCleanupService.GetLiveReferencedPathsAsync (cyclomatic 19) · ×1
  • StagingBlobCleanupService.GetLiveReferencedPathsAsync (cyclomatic 19) src/NuGetGallery.Core/Services/StagingBlobCleanupService.cs:71 — StagingBlobCleanupService.GetLiveReferencedPathsAsync has cyclomatic complexity 19 (threshold 15). Of this number, 12 points are the body's own statements and 7 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Application.ExecuteAsync (cyclomatic 19) · ×1
  • Application.ExecuteAsync (cyclomatic 19) src/VerifyMicrosoftPackage/Application.cs:92 — Application.ExecuteAsync has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · EntraIdTokenPolicyValidator.EvaluateEntraIdServicePrincipal (cyclomatic 19) · ×1
  • EntraIdTokenPolicyValidator.EvaluateEntraIdServicePrincipal (cyclomatic 19) src/NuGetGallery.Services/Authentication/Federated/EntraIdTokenValidator.cs:127 — EntraIdTokenPolicyValidator.EvaluateEntraIdServicePrincipal has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · McpHelper.ProcessArguments (cyclomatic 19) · ×1
  • McpHelper.ProcessArguments (cyclomatic 19) src/NuGetGallery.Services/Helpers/McpHelper.cs:186 — McpHelper.ProcessArguments has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · EntityBuilder.UpdateCatalogEntry (cyclomatic 19) · ×1
  • EntityBuilder.UpdateCatalogEntry (cyclomatic 19) src/NuGet.Jobs.Catalog2Registration/Schema/EntityBuilder.cs:52 — EntityBuilder.UpdateCatalogEntry has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · d3.tree (cyclomatic 19) · ×1
  • d3.tree (cyclomatic 19) REDACTED:11149 — d3.tree has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 5 function items inside it that branch (apportion, firstWalk, a function literal at line 11277, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest. This is NOT this file's highest cyclomatic complexity: d3.log$1 (cyclomatic 25) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score. This file is where this pass's cyclomatic complexity CONCENTRATES: REDACTED holds 31 of the 99 methods over the threshold — including the worst — and 308 of the 911 points over it (34%), 4.9× the next-largest file (src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js at 63). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · PopularityTransferController.ValidateInputs (cyclomatic 18) · ×1
  • PopularityTransferController.ValidateInputs (cyclomatic 18) src/NuGetGallery/Areas/Admin/Controllers/PopularityTransferController.cs:40 — PopularityTransferController.ValidateInputs has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · StagingGroupResponse.FromGroup (cyclomatic 18) · ×1
  • StagingGroupResponse.FromGroup (cyclomatic 18) src/NuGetGallery/ResponseModels/StagingGroupResponse.cs:93 — StagingGroupResponse.FromGroup has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · StagedSymbolPackagePromotionEligibility.GetBlockers (cyclomatic 18) · ×1
  • StagedSymbolPackagePromotionEligibility.GetBlockers (cyclomatic 18) src/NuGetGallery/Services/StagedSymbolPackagePromotionEligibility.cs:15 — StagedSymbolPackagePromotionEligibility.GetBlockers has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · CatalogLeafDataProcessor.TryIngestExternalIconAsync (cyclomatic 18) · ×1
  • CatalogLeafDataProcessor.TryIngestExternalIconAsync (cyclomatic 18) src/Catalog/Icons/CatalogLeafDataProcessor.cs:254 — CatalogLeafDataProcessor.TryIngestExternalIconAsync has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MarkdownService.GetHtmlFromMarkdownMarkdig (cyclomatic 17) · ×1
  • MarkdownService.GetHtmlFromMarkdownMarkdig (cyclomatic 17) src/NuGetGallery/Services/MarkdownService.cs:215 — MarkdownService.GetHtmlFromMarkdownMarkdig has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PackageMetadataValidationService.ValidateMetadataBeforeUploadAsync (cyclomatic 17) · ×1
  • PackageMetadataValidationService.ValidateMetadataBeforeUploadAsync (cyclomatic 17) src/NuGetGallery/Services/PackageMetadataValidationService.cs:101 — PackageMetadataValidationService.ValidateMetadataBeforeUploadAsync has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ODataV2FeedController.GetUpdates (cyclomatic 17) · ×1
  • ODataV2FeedController.GetUpdates (cyclomatic 17) REDACTED:562 — ODataV2FeedController.GetUpdates has cyclomatic complexity 17 (threshold 15). Of this number, 10 points are the body's own statements and 7 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PackageDeleteService.CanPackageBeDeletedByUserAsync (cyclomatic 17) · ×1
  • PackageDeleteService.CanPackageBeDeletedByUserAsync (cyclomatic 17) src/NuGetGallery/Services/PackageDeleteService.cs:112 — PackageDeleteService.CanPackageBeDeletedByUserAsync has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SymbolPackageUploadService.ValidateUploadedSymbolsPackage (cyclomatic 17) · ×1
  • SymbolPackageUploadService.ValidateUploadedSymbolsPackage (cyclomatic 17) src/NuGetGallery/Services/SymbolPackageUploadService.cs:53 — SymbolPackageUploadService.ValidateUploadedSymbolsPackage has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PackagesController.UploadPackageInternal (cyclomatic 17) · ×1
  • PackagesController.UploadPackageInternal (cyclomatic 17) REDACTED:512 — PackagesController.UploadPackageInternal has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FederatedCredentialPolicyEvaluator.ValidateJwtByIssuerAsync (cyclomatic 17) · ×1
  • FederatedCredentialPolicyEvaluator.ValidateJwtByIssuerAsync (cyclomatic 17) src/NuGetGallery.Services/Authentication/Federated/FederatedCredentialPolicyEvaluator.cs:279 — FederatedCredentialPolicyEvaluator.ValidateJwtByIssuerAsync has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PackageValidationMessageData.PackageValidationMessageData.ctor (cyclomatic 17) · ×1
  • PackageValidationMessageData.PackageValidationMessageData.ctor (cyclomatic 17) src/NuGet.Services.Validation/PackageValidationMessageData.cs:89 — PackageValidationMessageData.PackageValidationMessageData.ctor has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · d3.axis.axis (cyclomatic 17) · ×1
  • d3.axis.axis (cyclomatic 17) REDACTED:607 — d3.axis.axis has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: d3.log$1 (cyclomatic 25) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score. This file is where this pass's cyclomatic complexity CONCENTRATES: REDACTED holds 31 of the 99 methods over the threshold — including the worst — and 308 of the 911 points over it (34%), 4.9× the next-largest file (src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js at 63). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · d3.polygonContains (cyclomatic 17) · ×1
  • d3.polygonContains (cyclomatic 17) REDACTED:8115 — d3.polygonContains has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: d3.log$1 (cyclomatic 25) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score. This file is where this pass's cyclomatic complexity CONCENTRATES: REDACTED holds 31 of the 99 methods over the threshold — including the worst — and 308 of the 911 points over it (34%), 4.9× the next-largest file (src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js at 63). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · d3.tickFormat (cyclomatic 17) · ×1
  • d3.tickFormat (cyclomatic 17) REDACTED:12037 — d3.tickFormat has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: d3.log$1 (cyclomatic 25) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score. This file is where this pass's cyclomatic complexity CONCENTRATES: REDACTED holds 31 of the 99 methods over the threshold — including the worst — and 308 of the 911 points over it (34%), 4.9× the next-largest file (src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js at 63). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · bootstrap.Modal.backdrop (cyclomatic 17) · ×1
  • bootstrap.Modal.backdrop (cyclomatic 17) src/NuGetGallery/Scripts/gallery/bootstrap.js:1125 — bootstrap.Modal.backdrop has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong to 2 function items inside it that branch. This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D1 · Cyclomatic Complexity · common.nuget.canElementBeFocused (cyclomatic 17) · ×1
  • common.nuget.canElementBeFocused (cyclomatic 17) REDACTED:251 — common.nuget.canElementBeFocused has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · PackageStagingPromotionService.ResendGroupAsync (cyclomatic 16) · ×1
  • PackageStagingPromotionService.ResendGroupAsync (cyclomatic 16) src/NuGetGallery/Services/PackageStagingPromotionService.cs:412 — PackageStagingPromotionService.ResendGroupAsync has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · PackagesController.VerifyPackage (cyclomatic 16) · ×1
  • PackagesController.VerifyPackage (cyclomatic 16) REDACTED:2603 — PackagesController.VerifyPackage has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · BlobStorageVulnerabilityWriter.BlobStorageVulnerabilityWriter.ctor (cyclomatic 16) · ×1
  • BlobStorageVulnerabilityWriter.BlobStorageVulnerabilityWriter.ctor (cyclomatic 16) src/GitHubVulnerabilities2v3/Extensions/BlobStorageVulnerabilityWriter.cs:41 — BlobStorageVulnerabilityWriter.BlobStorageVulnerabilityWriter.ctor has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · StagedSymbolPackageValidationOutcomeProcessor.ProcessValidationOutcomeAsync (cyclomatic 16) · ×1
  • StagedSymbolPackageValidationOutcomeProcessor.ProcessValidationOutcomeAsync (cyclomatic 16) src/NuGet.Services.Validation.Orchestrator/StagedSymbolPackageValidationOutcomeProcessor.cs:46 — StagedSymbolPackageValidationOutcomeProcessor.ProcessValidationOutcomeAsync has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · StagedSymbolPackagePromotionMessageHandler.HandleAsync (cyclomatic 16) · ×1
  • StagedSymbolPackagePromotionMessageHandler.HandleAsync (cyclomatic 16) src/NuGet.Services.Staging.Promotion/StagedSymbolPackagePromotionMessageHandler.cs:41 — StagedSymbolPackagePromotionMessageHandler.HandleAsync has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · d3.extent (cyclomatic 16) · ×1
  • d3.extent (cyclomatic 16) REDACTED:126 — d3.extent has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: d3.log$1 (cyclomatic 25) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score. This file is where this pass's cyclomatic complexity CONCENTRATES: REDACTED holds 31 of the 99 methods over the threshold — including the worst — and 308 of the 911 points over it (34%), 4.9× the next-largest file (src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js at 63). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · d3.interpolateTransform (cyclomatic 16) · ×1
  • d3.interpolateTransform (cyclomatic 16) REDACTED:2835 — d3.interpolateTransform has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 5 function items inside it that branch (translate, rotate, scale, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest. This is NOT this file's highest cyclomatic complexity: d3.log$1 (cyclomatic 25) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score. This file is where this pass's cyclomatic complexity CONCENTRATES: REDACTED holds 31 of the 99 methods over the threshold — including the worst — and 308 of the 911 points over it (34%), 4.9× the next-largest file (src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js at 63). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · d3.create$1 (cyclomatic 16) · ×1
  • d3.create$1 (cyclomatic 16) REDACTED:3236 — d3.create$1 has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 5 function items inside it that branch (start, tick, schedule, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest. This is NOT this file's highest cyclomatic complexity: d3.log$1 (cyclomatic 25) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score. This file is where this pass's cyclomatic complexity CONCENTRATES: REDACTED holds 31 of the 99 methods over the threshold — including the worst — and 308 of the 911 points over it (34%), 4.9× the next-largest file (src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js at 63). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · d3.dsvFormat.parseRows · ×1
  • d3.dsvFormat.parseRows::token (cyclomatic 16) REDACTED:5739 — d3.dsvFormat.parseRows::token has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: d3.log$1 (cyclomatic 25) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score. This file is where this pass's cyclomatic complexity CONCENTRATES: REDACTED holds 31 of the 99 methods over the threshold — including the worst — and 308 of the 911 points over it (34%), 4.9× the next-largest file (src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js at 63). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · d3.manyBody · ×1
  • d3.manyBody::apply (cyclomatic 16) REDACTED:6766 — d3.manyBody::apply has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: d3.log$1 (cyclomatic 25) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score. This file is where this pass's cyclomatic complexity CONCENTRATES: REDACTED holds 31 of the 99 methods over the threshold — including the worst — and 308 of the 911 points over it (34%), 4.9× the next-largest file (src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js at 63). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · jquery-ui-1.10.3.$.effects.effect.drop (cyclomatic 16) · ×1
  • jquery-ui-1.10.3.$.effects.effect.drop (cyclomatic 16) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:10660 — jquery-ui-1.10.3.$.effects.effect.drop has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages. This is NOT this file's highest cyclomatic complexity: jquery-ui-1.10.3.color.hook (cyclomatic 17) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D10 · Test Quality · Skipped test · ×1
  • Skipped test: RejectsUntrustedSigningCertificate tests/Validation.PackageSigning.ProcessSignature.Tests/SignatureValidatorIntegrationTests.cs:254 — Skipped — Flaky
D15 · Churn × Complexity Hotspots · Hotspot · ×1
  • Hotspot: REDACTED REDACTED:41 — REDACTED changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in Program.Main at line 41. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 15:29:59 -08:00' --until='2026-11-11 15:29:59 -08:00' --full-history --no-merges -- REDACTED`: 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.
D17 · Explicit Debt · BarePragmaDisable repeated 12 times in 6 files · ×1
  • BarePragmaDisable repeated 12 times in 6 files tests/NuGetGallery.Core.Facts/TestUtils/PackageServiceUtility.cs:43 — The identical BarePragmaDisable (`#pragma warning disable 0618`) appears 12 times in 6 files — one decision applied repeatedly (e.g. the same rule silenced on every overload of a fluent API), not 12 independent debts. Decide it once — at the type or project level, or by fixing the underlying pattern — rather than occurrence-by-occurrence. (Every occurrence still counts toward the score and metrics.)
D18 · Solution Shape · Solution references 5 projects that do not exist · ×1
  • Solution references 5 projects that do not exist python/StatsLogParser.slnx — `python/StatsLogParser.slnx` declares 5 project file(s) that are missing from the tree (`python/src/NuGet.Jobs.Common/NuGet.Jobs.Common.csproj`, `python/src/Stats.AzureCdnLogs.Common/Stats.AzureCdnLogs.Common.csproj`, `python/src/Stats.ImportAzureCdnStatistics/Stats.ImportAzureCdnStatistics.csproj`, `python/src/Stats.LogInterpretation/Stats.LogInterpretation.csproj`, `python/tests/Tests.Stats.ImportAzureCdnStatistics/Tests.Stats.ImportAzureCdnStatistics.csproj`). A solution-level restore or build fails on a dangling reference, so anyone building the solution rather than an individual project is blocked. Delete the stale entry from the solution, or restore the missing project file.
D2 · Cognitive Complexity · QueryResult.GetInnerResult (cognitive 72) · ×1
  • QueryResult.GetInnerResult (cognitive 72) src/NuGetGallery/WebApi/QueryResult.cs:116 — QueryResult.GetInnerResult has cognitive complexity 72 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · d3.linePoint (cognitive 66) · ×1
  • d3.linePoint (cognitive 66) REDACTED:7554 — d3.linePoint has cognitive complexity 66 (threshold 15). Drivers by points: if/else 25 (62 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 38). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · d3.zoom (cognitive 59) · ×1
  • d3.zoom (cognitive 59) REDACTED:16971 — d3.zoom has cognitive complexity 59 (threshold 15). Drivers by points: if/else 32 (40 pts), boolean chains 12, loops 4, ternaries 3 (nesting depth added 8). Most of this is not in the body itself: 3 of the 59 points are its own statements and the rest belongs to 32 function items inside it that branch (touchstarted, touchended, touchmoved, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · ManifestValidator.ValidateCore (cognitive 58) · ×1
  • ManifestValidator.ValidateCore (cognitive 58) src/NuGetGallery.Core/Packaging/ManifestValidator.cs:41 — ManifestValidator.ValidateCore has cognitive complexity 58 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JsonLdReader.Load (cognitive 58) · ×1
  • JsonLdReader.Load (cognitive 58) REDACTED:27 — JsonLdReader.Load has cognitive complexity 58 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PackageMetadataValidationService.CheckLicenseMetadataAsync (cognitive 57) · ×1
  • PackageMetadataValidationService.CheckLicenseMetadataAsync (cognitive 57) src/NuGetGallery/Services/PackageMetadataValidationService.cs:322 — PackageMetadataValidationService.CheckLicenseMetadataAsync has cognitive complexity 57 (threshold 15). Of this number, 56 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · d3.extent (cognitive 56) · ×1
  • d3.extent (cognitive 56) REDACTED:126 — d3.extent has cognitive complexity 56 (threshold 15). Drivers by points: if/else 10 (42 pts), loops 4 (12 pts), boolean chains 2 (nesting depth added 40). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · MarkdownService.GetHtmlFromMarkdownMarkdig (cognitive 55) · ×1
  • MarkdownService.GetHtmlFromMarkdownMarkdig (cognitive 55) src/NuGetGallery/Services/MarkdownService.cs:215 — MarkdownService.GetHtmlFromMarkdownMarkdig has cognitive complexity 55 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · PublicExternalIconUrlPolicy.IsRestrictedAddress (cognitive 55) · ×1
  • PublicExternalIconUrlPolicy.IsRestrictedAddress (cognitive 55) src/Catalog/Icons/PublicExternalIconUrlPolicy.cs:105 — PublicExternalIconUrlPolicy.IsRestrictedAddress has cognitive complexity 55 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · d3.color (cognitive 55) · ×1
  • d3.color (cognitive 55) REDACTED:2196 — d3.color has cognitive complexity 55 (threshold 15). Drivers by points: ternaries 10 (55 pts) (nesting depth added 45). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · MarkdownService.GetHtmlFromMarkdownCommonMark (cognitive 52) · ×1
  • MarkdownService.GetHtmlFromMarkdownCommonMark (cognitive 52) src/NuGetGallery/Services/MarkdownService.cs:102 — MarkdownService.GetHtmlFromMarkdownCommonMark has cognitive complexity 52 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · PackageDeprecationService.UpdateDeprecation (cognitive 52) · ×1
  • PackageDeprecationService.UpdateDeprecation (cognitive 52) src/NuGetGallery/Services/PackageDeprecationService.cs:33 — PackageDeprecationService.UpdateDeprecation has cognitive complexity 52 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · d3.clipEdge (cognitive 52) · ×1
  • d3.clipEdge (cognitive 52) REDACTED:16152 — d3.clipEdge has cognitive complexity 52 (threshold 15). Drivers by points: if/else 31 (47 pts), boolean chains 5 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · d3.clipLine (cognitive 50) · ×1
  • d3.clipLine (cognitive 50) REDACTED:8575 — d3.clipLine has cognitive complexity 50 (threshold 15). Drivers by points: if/else 30 (46 pts), boolean chains 4 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · d3.connectEdge (cognitive 49) · ×1
  • d3.connectEdge (cognitive 49) REDACTED:16216 — d3.connectEdge has cognitive complexity 49 (threshold 15). Drivers by points: if/else 24 (47 pts), boolean chains 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PackageHelper.ValidateNuGetPackageMetadata (cognitive 46) · ×1
  • PackageHelper.ValidateNuGetPackageMetadata (cognitive 46) src/NuGetGallery.Services/PackageManagement/PackageHelper.cs:83 — PackageHelper.ValidateNuGetPackageMetadata has cognitive complexity 46 (threshold 15). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · d3.clipCircle (cognitive 46) · ×1
  • d3.clipCircle (cognitive 46) REDACTED:8398 — d3.clipCircle has cognitive complexity 46 (threshold 15). Drivers by points: if/else 22 (27 pts), boolean chains 12, ternaries 5 (7 pts) (nesting depth added 7). Most of this is not in the body itself: 1 of the 46 points is its own statement and the rest belongs to 5 function items inside it that branch (a function literal at line 8427, intersect, code, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · d3.arc.arc (cognitive 46) · ×1
  • d3.arc.arc (cognitive 46) REDACTED:14104 — d3.arc.arc has cognitive complexity 46 (threshold 15). Drivers by points: if/else 24 (39 pts), ternaries 1 (4 pts), boolean chains 3 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · jquery-ui-1.10.3.$.effects.effect.size (cognitive 46) · ×1
  • jquery-ui-1.10.3.$.effects.effect.size (cognitive 46) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:11064 — jquery-ui-1.10.3.$.effects.effect.size has cognitive complexity 46 (threshold 15). Drivers by points: if/else 20 (30 pts), boolean chains 12, ternaries 2 (4 pts) (nesting depth added 12). Of this number, 26 points are the body's own statements and 20 belong to 4 function literals inside it that branch. This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · SymbolPackageStagingUploadService.ProcessUploadAsync (cognitive 45) · ×1
  • SymbolPackageStagingUploadService.ProcessUploadAsync (cognitive 45) src/NuGetGallery/Services/SymbolPackageStagingUploadService.cs:111 — SymbolPackageStagingUploadService.ProcessUploadAsync has cognitive complexity 45 (threshold 15). Of this number, 39 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · Program.Main (cognitive 45) · ×1
  • Program.Main (cognitive 45) REDACTED:41 — Program.Main has cognitive complexity 45 (threshold 15). Most of this is not in the body itself: 8 of the 45 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 684, 763). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · d3.clipCells (cognitive 43) · ×1
  • d3.clipCells (cognitive 43) REDACTED:16327 — d3.clipCells has cognitive complexity 43 (threshold 15). Drivers by points: if/else 10 (28 pts), loops 5 (10 pts), boolean chains 5 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ApiController.CreatePackageInternal (cognitive 41) · ×1
  • ApiController.CreatePackageInternal (cognitive 41) REDACTED:533 — ApiController.CreatePackageInternal has cognitive complexity 41 (threshold 15). Of this number, 39 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PackagesController.DisplayPackage (cognitive 39) · ×1
  • PackagesController.DisplayPackage (cognitive 39) REDACTED:902 — PackagesController.DisplayPackage has cognitive complexity 39 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · GitHubTokenPolicyValidator.EvaluatePolicyAsync (cognitive 39) · ×1
  • GitHubTokenPolicyValidator.EvaluatePolicyAsync (cognitive 39) src/NuGetGallery.Services/Authentication/Federated/GitHubTokenPolicyValidator.cs:175 — GitHubTokenPolicyValidator.EvaluatePolicyAsync has cognitive complexity 39 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SearchTextBuilder.Build (cognitive 39) · ×1
  • SearchTextBuilder.Build (cognitive 39) src/NuGet.Services.AzureSearch/SearchService/SearchTextBuilder.cs:140 — SearchTextBuilder.Build has cognitive complexity 39 (threshold 15). Of this number, 38 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PackagesController.VerifyPackageInternal (cognitive 38) · ×1
  • PackagesController.VerifyPackageInternal (cognitive 38) REDACTED:2821 — PackagesController.VerifyPackageInternal has cognitive complexity 38 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StagedSymbolPackagePromotionService.CompleteAsync (cognitive 38) · ×1
  • StagedSymbolPackagePromotionService.CompleteAsync (cognitive 38) src/NuGetGallery.Core/Services/StagedSymbolPackagePromotionService.cs:58 — StagedSymbolPackagePromotionService.CompleteAsync has cognitive complexity 38 (threshold 15). Of this number, 27 points are the body's own statements and 11 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · d3.tree_remove (cognitive 38) · ×1
  • d3.tree_remove (cognitive 38) REDACTED:6183 — d3.tree_remove has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (29 pts), boolean chains 5, loops 2 (3 pts), ternaries 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · d3.clipRejoin (cognitive 38) · ×1
  • d3.clipRejoin (cognitive 38) REDACTED:8025 — d3.clipRejoin has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 7 (18 pts) (nesting depth added 21). Of this number, 34 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Application.ExecuteAsync (cognitive 37) · ×1
  • Application.ExecuteAsync (cognitive 37) src/VerifyMicrosoftPackage/Application.cs:92 — Application.ExecuteAsync has cognitive complexity 37 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · page-manage-deprecation.ManageDeprecationViewModel (cognitive 36) · ×1
  • page-manage-deprecation.ManageDeprecationViewModel (cognitive 36) src/NuGetGallery/Scripts/gallery/page-manage-deprecation.js:3 — page-manage-deprecation.ManageDeprecationViewModel has cognitive complexity 36 (threshold 15). Drivers by points: if/else 18 (21 pts), boolean chains 14, loops 1 (nesting depth added 3). Most of this is not in the body itself: 11 of the 36 points are its own statements and the rest belongs to 17 function items inside it that branch (checkDeprecationState, a function literal at line 197, loadDeprecationFormState, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · StagingGroupPromotionService.TryFinalizeAsync (cognitive 35) · ×1
  • StagingGroupPromotionService.TryFinalizeAsync (cognitive 35) src/NuGetGallery.Core/Services/StagingGroupPromotionService.cs:77 — StagingGroupPromotionService.TryFinalizeAsync has cognitive complexity 35 (threshold 15). Most of this is not in the body itself: 6 of the 35 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 93, 117, 120, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · McpHelper.ProcessArguments (cognitive 35) · ×1
  • McpHelper.ProcessArguments (cognitive 35) src/NuGetGallery.Services/Helpers/McpHelper.cs:186 — McpHelper.ProcessArguments has cognitive complexity 35 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · d3.interpolateValue (cognitive 35) · ×1
  • d3.interpolateValue (cognitive 35) REDACTED:2766 — d3.interpolateValue has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 8 (32 pts), boolean chains 3 (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SearchAdaptor.TryReadSearchFilter (cognitive 34) · ×1
  • SearchAdaptor.TryReadSearchFilter (cognitive 34) src/NuGetGallery/OData/SearchService/SearchAdaptor.cs:219 — SearchAdaptor.TryReadSearchFilter has cognitive complexity 34 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AuthenticationController.LinkExternalAccount (cognitive 34) · ×1
  • AuthenticationController.LinkExternalAccount (cognitive 34) REDACTED:596 — AuthenticationController.LinkExternalAccount has cognitive complexity 34 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · d3.max (cognitive 34) · ×1
  • d3.max (cognitive 34) REDACTED:338 — d3.max has cognitive complexity 34 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 4 (12 pts), boolean chains 4 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (d3.min) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · d3.min (cognitive 34) · ×1
  • d3.min (cognitive 34) REDACTED:444 — d3.min has cognitive complexity 34 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 4 (12 pts), boolean chains 4 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (d3.max) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · PopularityTransferController.ValidateInputs (cognitive 33) · ×1
  • PopularityTransferController.ValidateInputs (cognitive 33) src/NuGetGallery/Areas/Admin/Controllers/PopularityTransferController.cs:40 — PopularityTransferController.ValidateInputs has cognitive complexity 33 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CatalogCommitUtilities.ProcessCatalogCommitsAsync (cognitive 33) · ×1
  • CatalogCommitUtilities.ProcessCatalogCommitsAsync (cognitive 33) src/Catalog/CatalogCommitUtilities.cs:150 — CatalogCommitUtilities.ProcessCatalogCommitsAsync has cognitive complexity 33 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EntityBuilder.UpdateCatalogEntry (cognitive 32) · ×1
  • EntityBuilder.UpdateCatalogEntry (cognitive 32) src/NuGet.Jobs.Catalog2Registration/Schema/EntityBuilder.cs:52 — EntityBuilder.UpdateCatalogEntry has cognitive complexity 32 (threshold 15). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PackageUploadService.CommitPackageAsync (cognitive 31) · ×1
  • PackageUploadService.CommitPackageAsync (cognitive 31) src/NuGetGallery/Services/PackageUploadService.cs:111 — PackageUploadService.CommitPackageAsync has cognitive complexity 31 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PackageDeprecationManagementService.UpdateDeprecation (cognitive 30) · ×1
  • PackageDeprecationManagementService.UpdateDeprecation (cognitive 30) src/NuGetGallery/Services/PackageDeprecationManagementService.cs:42 — PackageDeprecationManagementService.UpdateDeprecation has cognitive complexity 30 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StatisticsController.ProcessReport (cognitive 30) · ×1
  • StatisticsController.ProcessReport (cognitive 30) REDACTED:300 — StatisticsController.ProcessReport has cognitive complexity 30 (threshold 15). Of this number, 28 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · JobConfigurationManager.ReadCommandLineArguments (cognitive 30) · ×1
  • JobConfigurationManager.ReadCommandLineArguments (cognitive 30) src/NuGet.Jobs.Common/Configuration/JobConfigurationManager.cs:127 — JobConfigurationManager.ReadCommandLineArguments has cognitive complexity 30 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JsonSort.Compare (cognitive 30) · ×1
  • JsonSort.Compare (cognitive 30) src/Catalog/Helpers/JsonSort.cs:34 — JsonSort.Compare has cognitive complexity 30 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PackageStagingUploadService.ProcessUploadAsync (cognitive 29) · ×1
  • PackageStagingUploadService.ProcessUploadAsync (cognitive 29) src/NuGetGallery/Services/PackageStagingUploadService.cs:439 — PackageStagingUploadService.ProcessUploadAsync has cognitive complexity 29 (threshold 15). Of this number, 26 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · SupportRequestService.GetFilteredIssuesQueryable (cognitive 29) · ×1
  • SupportRequestService.GetFilteredIssuesQueryable (cognitive 29) src/NuGetGallery.Services/SupportRequest/SupportRequestService.cs:326 — SupportRequestService.GetFilteredIssuesQueryable has cognitive complexity 29 (threshold 15). Most of this is not in the body itself: 11 of the 29 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 369, 375). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · PackageDeleteService.CanPackageBeDeletedByUserAsync (cognitive 28) · ×1
  • PackageDeleteService.CanPackageBeDeletedByUserAsync (cognitive 28) src/NuGetGallery/Services/PackageDeleteService.cs:112 — PackageDeleteService.CanPackageBeDeletedByUserAsync has cognitive complexity 28 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AdminApiController.RevalidatePackageAsync (cognitive 27) · ×1
  • AdminApiController.RevalidatePackageAsync (cognitive 27) src/NuGetGallery/Areas/Admin/Controllers/AdminApiController.cs:486 — AdminApiController.RevalidatePackageAsync has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PackageMetadataValidationService.CheckPackageIdForBannedCharacters (cognitive 27) · ×1
  • PackageMetadataValidationService.CheckPackageIdForBannedCharacters (cognitive 27) src/NuGetGallery/Services/PackageMetadataValidationService.cs:246 — PackageMetadataValidationService.CheckPackageIdForBannedCharacters has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CloudDownloadCountService.RefreshCoreAsync (cognitive 27) · ×1
  • CloudDownloadCountService.RefreshCoreAsync (cognitive 27) src/NuGetGallery/Services/CloudDownloadCountService.cs:156 — CloudDownloadCountService.RefreshCoreAsync has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BlobStorageVulnerabilityWriter.WriteVulnerabilityAsync (cognitive 27) · ×1
  • BlobStorageVulnerabilityWriter.WriteVulnerabilityAsync (cognitive 27) src/GitHubVulnerabilities2v3/Extensions/BlobStorageVulnerabilityWriter.cs:176 — BlobStorageVulnerabilityWriter.WriteVulnerabilityAsync has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CatalogWriterBase.LoadIndexResource (cognitive 27) · ×1
  • CatalogWriterBase.LoadIndexResource (cognitive 27) src/Catalog/CatalogWriterBase.cs:254 — CatalogWriterBase.LoadIndexResource has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NuGetQueryParser.Tokenize (cognitive 27) · ×1
  • NuGetQueryParser.Tokenize (cognitive 27) src/NuGet.Services.AzureSearch/SearchService/NuGetQueryParser.cs:106 — NuGetQueryParser.Tokenize has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · d3.tree_cover (cognitive 27) · ×1
  • d3.tree_cover (cognitive 27) REDACTED:6033 — d3.tree_cover has cognitive complexity 27 (threshold 15). Drivers by points: loops 4 (12 pts), boolean chains 7, if/else 5 (6 pts), match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · d3.calendar · ×1
  • d3.calendar::tickFormat (cognitive 27) REDACTED:13472 — d3.calendar::tickFormat has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 7 (27 pts) (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SearchResponseHelper.GetDeprecationsOrNull (cognitive 26) · ×1
  • SearchResponseHelper.GetDeprecationsOrNull (cognitive 26) src/NuGetGallery/Helpers/SearchResponseHelper.cs:14 — SearchResponseHelper.GetDeprecationsOrNull has cognitive complexity 26 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · ListPackageItemRequiredSignerViewModelFactory.SetupInternal (cognitive 26) · ×1
  • ListPackageItemRequiredSignerViewModelFactory.SetupInternal (cognitive 26) src/NuGetGallery/Helpers/ViewModelExtensions/ListPackageItemRequiredSignerViewModelFactory.cs:56 — ListPackageItemRequiredSignerViewModelFactory.SetupInternal has cognitive complexity 26 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · SupportRequestService.UpdateIssueAsync (cognitive 26) · ×1
  • SupportRequestService.UpdateIssueAsync (cognitive 26) src/NuGetGallery.Services/SupportRequest/SupportRequestService.cs:93 — SupportRequestService.UpdateIssueAsync has cognitive complexity 26 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · d3.manyBody · ×1
  • d3.manyBody::apply (cognitive 26) REDACTED:6766 — d3.manyBody::apply has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 2, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CloudBlobCoreFileStorageService.CopyFileAsync (cognitive 25) · ×1
  • CloudBlobCoreFileStorageService.CopyFileAsync (cognitive 25) src/NuGetGallery.Core/Services/CloudBlobCoreFileStorageService.cs:187 — CloudBlobCoreFileStorageService.CopyFileAsync has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StagingDeletionService.DeleteGroupAsync (cognitive 25) · ×1
  • StagingDeletionService.DeleteGroupAsync (cognitive 25) src/NuGetGallery.Core/Services/StagingDeletionService.cs:135 — StagingDeletionService.DeleteGroupAsync has cognitive complexity 25 (threshold 15). Of this number, 18 points are the body's own statements and 7 belong to 6 function literals inside it that branch. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · CatalogLeafDataProcessor.TryIngestExternalIconAsync (cognitive 25) · ×1
  • CatalogLeafDataProcessor.TryIngestExternalIconAsync (cognitive 25) src/Catalog/Icons/CatalogLeafDataProcessor.cs:254 — CatalogLeafDataProcessor.TryIngestExternalIconAsync has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · d3.formatLocale.format.format (cognitive 25) · ×1
  • d3.formatLocale.format.format (cognitive 25) REDACTED:7155 — d3.formatLocale.format.format has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 6, loops 1 (3 pts), match/switch 1, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · d3.packEnclose (cognitive 25) · ×1
  • d3.packEnclose (cognitive 25) REDACTED:10743 — d3.packEnclose has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 5 (7 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · bootstrap.Tooltip.show (cognitive 25) · ×1
  • bootstrap.Tooltip.show (cognitive 25) src/NuGetGallery/Scripts/gallery/bootstrap.js:1616 — bootstrap.Tooltip.show has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 8, ternaries 3 (6 pts) (nesting depth added 8). Of this number, 23 points are the body's own statements and 2 belong to one function item inside it that branches. This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · ODataV2FeedController.GetCoreAsync (cognitive 24) · ×1
  • ODataV2FeedController.GetCoreAsync (cognitive 24) REDACTED:271 — ODataV2FeedController.GetCoreAsync has cognitive complexity 24 (threshold 15). Of this number, 23 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StagingController.AddSymbolPackages (cognitive 24) · ×1
  • StagingController.AddSymbolPackages (cognitive 24) REDACTED:383 — StagingController.AddSymbolPackages has cognitive complexity 24 (threshold 15). Most of this is not in the body itself: 9 of the 24 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 396, 464). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · PackagesController.UploadPackageInternal (cognitive 24) · ×1
  • PackagesController.UploadPackageInternal (cognitive 24) REDACTED:512 — PackagesController.UploadPackageInternal has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CorePackageService.UpdateIsLatestAsync (cognitive 24) · ×1
  • CorePackageService.UpdateIsLatestAsync (cognitive 24) src/NuGetGallery.Core/Services/CorePackageService.cs:116 — CorePackageService.UpdateIsLatestAsync has cognitive complexity 24 (threshold 15). Of this number, 19 points are the body's own statements and 5 belong to 5 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AzureStorage.AreSynchronized (cognitive 24) · ×1
  • AzureStorage.AreSynchronized (cognitive 24) src/Catalog/Persistence/AzureStorage.cs:453 — AzureStorage.AreSynchronized has cognitive complexity 24 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · d3.stratify.stratify (cognitive 24) · ×1
  • d3.stratify.stratify (cognitive 24) REDACTED:10997 — d3.stratify.stratify has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 2, loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · d3.squarifyRatio (cognitive 24) · ×1
  • d3.squarifyRatio (cognitive 24) REDACTED:11303 — d3.squarifyRatio has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (12 pts), ternaries 2 (6 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SearchAdaptor.GetNextLink (cognitive 23) · ×1
  • SearchAdaptor.GetNextLink (cognitive 23) src/NuGetGallery/OData/SearchService/SearchAdaptor.cs:358 — SearchAdaptor.GetNextLink has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReserveNamespacesCommand.ExecuteAsync (cognitive 23) · ×1
  • ReserveNamespacesCommand.ExecuteAsync (cognitive 23) src/GalleryTools/Commands/ReserveNamespacesCommand.cs:48 — ReserveNamespacesCommand.ExecuteAsync has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AzureStorage.AzureStorage.ctor (cognitive 23) · ×1
  • AzureStorage.AzureStorage.ctor (cognitive 23) src/NuGet.Services.Storage/AzureStorage.cs:43 — AzureStorage.AzureStorage.ctor has cognitive complexity 23 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · CommandHelpers.GetEndpointConfiguration (cognitive 23) · ×1
  • CommandHelpers.GetEndpointConfiguration (cognitive 23) src/Ng/CommandHelpers.cs:295 — CommandHelpers.GetEndpointConfiguration has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CatalogLeafFetcher.AddLatestLeafAsync (cognitive 23) · ×1
  • CatalogLeafFetcher.AddLatestLeafAsync (cognitive 23) src/NuGet.Services.AzureSearch/Catalog2AzureSearch/CatalogLeafFetcher.cs:143 — CatalogLeafFetcher.AddLatestLeafAsync has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PackageLagCatalogLeafProcessor.ComputeLagForQueries (cognitive 23) · ×1
  • PackageLagCatalogLeafProcessor.ComputeLagForQueries (cognitive 23) src/PackageLagMonitor/PackageLagCatalogLeafProcessor.cs:122 — PackageLagCatalogLeafProcessor.ComputeLagForQueries has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · d3.bounds (cognitive 23) · ×1
  • d3.bounds (cognitive 23) REDACTED:7651 — d3.bounds has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 2 (4 pts), boolean chains 2, ternaries 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · d3.area$3.area (cognitive 23) · ×1
  • d3.area$3.area (cognitive 23) REDACTED:14381 — d3.area$3.area has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 2 (6 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · bootstrap.Modal.backdrop (cognitive 23) · ×1
  • bootstrap.Modal.backdrop (cognitive 23) src/NuGetGallery/Scripts/gallery/bootstrap.js:1125 — bootstrap.Modal.backdrop has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 4 (7 pts), boolean chains 5 (nesting depth added 7). Of this number, 16 points are the body's own statements and 7 belong to 2 function items inside it that branch. This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · clamp.clamp · ×1
  • clamp.clamp::truncate (cognitive 23) src/NuGetGallery/Scripts/gallery/clamp.js:149 — clamp.clamp::truncate has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (20 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (clamp.clamp) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · LockUserController.Update (cognitive 22) · ×1
  • LockUserController.Update (cognitive 22) src/NuGetGallery/Areas/Admin/Controllers/LockUserController.cs:52 — LockUserController.Update has cognitive complexity 22 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · PackageStagingPromotionService.PromoteGroupAsync (cognitive 22) · ×1
  • PackageStagingPromotionService.PromoteGroupAsync (cognitive 22) src/NuGetGallery/Services/PackageStagingPromotionService.cs:270 — PackageStagingPromotionService.PromoteGroupAsync has cognitive complexity 22 (threshold 15). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AssetFrameworkHelper.GetAssetFrameworks (cognitive 22) · ×1
  • AssetFrameworkHelper.GetAssetFrameworks (cognitive 22) src/NuGetGallery.Core/Services/AssetFrameworkHelper.cs:30 — AssetFrameworkHelper.GetAssetFrameworks has cognitive complexity 22 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · ConfigurationService.ResolveConfigObject (cognitive 22) · ×1
  • ConfigurationService.ResolveConfigObject (cognitive 22) REDACTED:124 — ConfigurationService.ResolveConfigObject has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ValidationSetProcessor.ProcessNotStartedValidations (cognitive 22) · ×1
  • ValidationSetProcessor.ProcessNotStartedValidations (cognitive 22) src/NuGet.Services.Validation.Orchestrator/ValidationSetProcessor.cs:174 — ValidationSetProcessor.ProcessNotStartedValidations has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · d3.interpolateString (cognitive 22) · ×1
  • d3.interpolateString (cognitive 22) REDACTED:2718 — d3.interpolateString has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (17 pts), ternaries 2 (3 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · d3.dsvFormat.parseRows · ×1
  • d3.dsvFormat.parseRows::token (cognitive 22) REDACTED:5739 — d3.dsvFormat.parseRows::token has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · d3.polygonContains (cognitive 22) · ×1
  • d3.polygonContains (cognitive 22) REDACTED:8115 — d3.polygonContains has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 5, loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · d3.addBeach (cognitive 22) · ×1
  • d3.addBeach (cognitive 22) REDACTED:16563 — d3.addBeach has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PackageMetadataValidationService.ValidateSignatureFilePresenceAsync (cognitive 21) · ×1
  • PackageMetadataValidationService.ValidateSignatureFilePresenceAsync (cognitive 21) src/NuGetGallery/Services/PackageMetadataValidationService.cs:1025 — PackageMetadataValidationService.ValidateSignatureFilePresenceAsync has cognitive complexity 21 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · PackagesController.ListPackages (cognitive 21) · ×1
  • PackagesController.ListPackages (cognitive 21) REDACTED:1320 — PackagesController.ListPackages has cognitive complexity 21 (threshold 15). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · McpHelper.ProcessKeyValueInputs (cognitive 21) · ×1
  • McpHelper.ProcessKeyValueInputs (cognitive 21) src/NuGetGallery.Services/Helpers/McpHelper.cs:279 — McpHelper.ProcessKeyValueInputs has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PackageVulnerabilitiesVerifier.VerifyVulnerabilityInDatabase (cognitive 21) · ×1
  • PackageVulnerabilitiesVerifier.VerifyVulnerabilityInDatabase (cognitive 21) src/VerifyGitHubVulnerabilities/Verify/PackageVulnerabilitiesVerifier.cs:80 — PackageVulnerabilitiesVerifier.VerifyVulnerabilityInDatabase has cognitive complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConfigurationFactory.InjectPropertyWithConfiguration (cognitive 21) · ×1
  • ConfigurationFactory.InjectPropertyWithConfiguration (cognitive 21) src/NuGet.Services.Configuration/ConfigurationFactory.cs:67 — ConfigurationFactory.InjectPropertyWithConfiguration has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DocumentFixUpEvaluator.TryFixUpAsync (cognitive 21) · ×1
  • DocumentFixUpEvaluator.TryFixUpAsync (cognitive 21) src/NuGet.Services.AzureSearch/Catalog2AzureSearch/DocumentFixUpEvaluator.cs:35 — DocumentFixUpEvaluator.TryFixUpAsync has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeleteStagingBlobsTask.ProcessAsync (cognitive 21) · ×1
  • DeleteStagingBlobsTask.ProcessAsync (cognitive 21) src/Gallery.Maintenance/DeleteStagingBlobsTask.cs:54 — DeleteStagingBlobsTask.ProcessAsync has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PackageDefinition.from_request_url (cognitive 21) · ×1
  • PackageDefinition.from_request_url (cognitive 21) python/StatsLogParser/loginterpretation/packagedefinition.py:25 — PackageDefinition.from_request_url has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · d3.add (cognitive 21) · ×1
  • d3.add (cognitive 21) REDACTED:5953 — d3.add has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 2, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SymbolPackageUploadService.CreateAndUploadSymbolsPackage (cognitive 20) · ×1
  • SymbolPackageUploadService.CreateAndUploadSymbolsPackage (cognitive 20) src/NuGetGallery/Services/SymbolPackageUploadService.cs:145 — SymbolPackageUploadService.CreateAndUploadSymbolsPackage has cognitive complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StagingBlobCleanupService.GetLiveReferencedPathsAsync (cognitive 20) · ×1
  • StagingBlobCleanupService.GetLiveReferencedPathsAsync (cognitive 20) src/NuGetGallery.Core/Services/StagingBlobCleanupService.cs:71 — StagingBlobCleanupService.GetLiveReferencedPathsAsync has cognitive complexity 20 (threshold 15). Of this number, 15 points are the body's own statements and 5 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HashCommand.Hash (cognitive 20) · ×1
  • HashCommand.Hash (cognitive 20) src/GalleryTools/Commands/HashCommand.cs:42 — HashCommand.Hash has cognitive complexity 20 (threshold 15). Of this number, 15 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · ValidatePackageIdsCommand.Execute (cognitive 20) · ×1
  • ValidatePackageIdsCommand.Execute (cognitive 20) src/GalleryTools/Commands/ValidatePackageIdsCommand.cs:46 — ValidatePackageIdsCommand.Execute has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SponsorshipUrlService.GetSponsorshipUrlEntriesInternal (cognitive 20) · ×1
  • SponsorshipUrlService.GetSponsorshipUrlEntriesInternal (cognitive 20) src/NuGetGallery.Services/PackageManagement/SponsorshipUrlService.cs:164 — SponsorshipUrlService.GetSponsorshipUrlEntriesInternal has cognitive complexity 20 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · PackageVulnerabilitiesVerifier.VerifyVulnerabilityForRangeAsync (cognitive 20) · ×1
  • PackageVulnerabilitiesVerifier.VerifyVulnerabilityForRangeAsync (cognitive 20) src/VerifyGitHubVulnerabilities/Verify/PackageVulnerabilitiesVerifier.cs:233 — PackageVulnerabilitiesVerifier.VerifyVulnerabilityForRangeAsync has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ModelExtensions.IsSemVer2 (cognitive 20) · ×1
  • ModelExtensions.IsSemVer2 (cognitive 20) src/NuGet.Protocol.Catalog/Models/ModelExtensions.cs:182 — ModelExtensions.IsSemVer2 has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HiveMerger.MergeAsync (cognitive 20) · ×1
  • HiveMerger.MergeAsync (cognitive 20) src/NuGet.Jobs.Catalog2Registration/Hives/HiveMerger.cs:49 — HiveMerger.MergeAsync has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NewPackageRegistrationFromKustoProducer.ProduceWorkAsync (cognitive 20) · ×1
  • NewPackageRegistrationFromKustoProducer.ProduceWorkAsync (cognitive 20) src/NuGet.Services.AzureSearch/Db2AzureSearch/NewPackageRegistrationFromKustoProducer.cs:77 — NewPackageRegistrationFromKustoProducer.ProduceWorkAsync has cognitive complexity 20 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · SymbolValidationMessageHandlerRouter.GetHandlerAsync (cognitive 20) · ×1
  • SymbolValidationMessageHandlerRouter.GetHandlerAsync (cognitive 20) src/NuGet.Services.Validation.Orchestrator/SymbolValidationMessageHandlerRouter.cs:57 — SymbolValidationMessageHandlerRouter.GetHandlerAsync has cognitive complexity 20 (threshold 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · d3.selection_data (cognitive 20) · ×1
  • d3.selection_data (cognitive 20) REDACTED:1045 — d3.selection_data has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (7 pts), boolean chains 3, ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · d3.chord.chord (cognitive 20) · ×1
  • d3.chord.chord (cognitive 20) REDACTED:4746 — d3.chord.chord has cognitive complexity 20 (threshold 15). Drivers by points: loops 6 (9 pts), if/else 3 (5 pts), ternaries 2 (5 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · d3.clip.<returned closure> (cognitive 20) · ×1
  • d3.clip.<returned closure> (cognitive 20) REDACTED:8183 — d3.clip.<returned closure> has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 7). None of this is in the body itself: all 20 points belong to 3 function items inside it that branch (ringEnd, a function literal at line 8203, point). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · d3.tree (cognitive 20) · ×1
  • d3.tree (cognitive 20) REDACTED:11149 — d3.tree has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 4, loops 1 (2 pts), ternaries 1 (nesting depth added 6). None of this is in the body itself: all 20 points belong to 5 function items inside it that branch (apportion, firstWalk, a function literal at line 11273, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · d3.attachCircle (cognitive 20) · ×1
  • d3.attachCircle (cognitive 20) REDACTED:16425 — d3.attachCircle has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 4, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · jquery-ui-1.10.3.$.ui.intersect (cognitive 20) · ×1
  • jquery-ui-1.10.3.$.ui.intersect (cognitive 20) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:2106 — jquery-ui-1.10.3.$.ui.intersect has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 18, if/else 1, match/switch 1. This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · jquery-ui-1.10.3.$.fn.position (cognitive 20) · ×1
  • jquery-ui-1.10.3.$.fn.position (cognitive 20) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:12138 — jquery-ui-1.10.3.$.fn.position has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, boolean chains 5. Most of this is not in the body itself: 9 of the 20 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 12217, 12166, 12255, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · PackageMetadataValidationService.ValidateMetadataBeforeUploadAsync (cognitive 19) · ×1
  • PackageMetadataValidationService.ValidateMetadataBeforeUploadAsync (cognitive 19) src/NuGetGallery/Services/PackageMetadataValidationService.cs:101 — PackageMetadataValidationService.ValidateMetadataBeforeUploadAsync has cognitive complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · SymbolPackageStagingUploadService.ValidateTarget (cognitive 19) · ×1
  • SymbolPackageStagingUploadService.ValidateTarget (cognitive 19) src/NuGetGallery/Services/SymbolPackageStagingUploadService.cs:414 — SymbolPackageStagingUploadService.ValidateTarget has cognitive complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · AdminControllerBase.SearchForPackages (cognitive 19) · ×1
  • AdminControllerBase.SearchForPackages (cognitive 19) src/NuGetGallery/Areas/Admin/Controllers/AdminControllerBase.cs:17 — AdminControllerBase.SearchForPackages has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GitHubVersionRangeParser.ToNuGetVersionRange (cognitive 19) · ×1
  • GitHubVersionRangeParser.ToNuGetVersionRange (cognitive 19) src/NuGet.Services.GitHub/Ingest/GitHubVersionRangeParser.cs:10 — GitHubVersionRangeParser.ToNuGetVersionRange has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LightningJob.PrepareAsync (cognitive 19) · ×1
  • LightningJob.PrepareAsync (cognitive 19) src/Ng/Jobs/LightningJob.cs:226 — LightningJob.PrepareAsync has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StagedSymbolPackageValidationOutcomeProcessor.ProcessValidationOutcomeAsync (cognitive 19) · ×1
  • StagedSymbolPackageValidationOutcomeProcessor.ProcessValidationOutcomeAsync (cognitive 19) src/NuGet.Services.Validation.Orchestrator/StagedSymbolPackageValidationOutcomeProcessor.cs:46 — StagedSymbolPackageValidationOutcomeProcessor.ProcessValidationOutcomeAsync has cognitive complexity 19 (threshold 15). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · d3.drag (cognitive 19) · ×1
  • d3.drag (cognitive 19) REDACTED:1861 — d3.drag has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 3, loops 3, match/switch 1 (nesting depth added 3). None of this is in the body itself: all 19 points belong to 14 function items inside it that branch (touchstarted, touchended, mousedowned, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · d3.create$1 (cognitive 19) · ×1
  • d3.create$1 (cognitive 19) REDACTED:3236 — d3.create$1 has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 4, ternaries 1 (nesting depth added 4). None of this is in the body itself: all 19 points belong to 5 function items inside it that branch (start, tick, schedule, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · d3.clipRectangle · ×1
  • d3.clipRectangle::corner (cognitive 19) REDACTED:8658 — d3.clipRectangle::corner has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 7 (19 pts) (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · d3.formatLocale$1.newParse.<returned closure> (cognitive 19) · ×1
  • d3.formatLocale$1.newParse.<returned closure> (cognitive 19) REDACTED:12928 — d3.formatLocale$1.newParse.<returned closure> has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PackageStagingManagementService.GetStagingGroupPackagePage (cognitive 18) · ×1
  • PackageStagingManagementService.GetStagingGroupPackagePage (cognitive 18) src/NuGetGallery/Services/PackageStagingManagementService.cs:697 — PackageStagingManagementService.GetStagingGroupPackagePage has cognitive complexity 18 (threshold 15). Of this number, 14 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PackageStagingPromotionService.PromotePackageAsync (cognitive 18) · ×1
  • PackageStagingPromotionService.PromotePackageAsync (cognitive 18) src/NuGetGallery/Services/PackageStagingPromotionService.cs:57 — PackageStagingPromotionService.PromotePackageAsync has cognitive complexity 18 (threshold 15). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · UndoSoftDeleteService.RestoreFilesAsync (cognitive 18) · ×1
  • UndoSoftDeleteService.RestoreFilesAsync (cognitive 18) src/NuGetGallery/Services/UndoSoftDeleteService.cs:267 — UndoSoftDeleteService.RestoreFilesAsync has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Tokenizer.Scan (cognitive 18) · ×1
  • Tokenizer.Scan (cognitive 18) src/NuGetGallery/Infrastructure/Lucene/NuGetQueryParser.cs:122 — Tokenizer.Scan has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AuthenticationController.SignIn (cognitive 18) · ×1
  • AuthenticationController.SignIn (cognitive 18) REDACTED:126 — AuthenticationController.SignIn has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SecurityPolicyService.EvaluatePackagePoliciesInternalAsync (cognitive 18) · ×1
  • SecurityPolicyService.EvaluatePackagePoliciesInternalAsync (cognitive 18) src/NuGetGallery.Services/Security/SecurityPolicyService.cs:187 — SecurityPolicyService.EvaluatePackagePoliciesInternalAsync has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PublicExternalIconUrlPolicy.IsAllowedAsync (cognitive 18) · ×1
  • PublicExternalIconUrlPolicy.IsAllowedAsync (cognitive 18) src/Catalog/Icons/PublicExternalIconUrlPolicy.cs:31 — PublicExternalIconUrlPolicy.IsAllowedAsync has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NewPackageRegistrationFromDbProducer.ProduceWorkAsync (cognitive 18) · ×1
  • NewPackageRegistrationFromDbProducer.ProduceWorkAsync (cognitive 18) src/NuGet.Services.AzureSearch/Db2AzureSearch/NewPackageRegistrationFromDbProducer.cs:80 — NewPackageRegistrationFromDbProducer.ProduceWorkAsync has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AzureSearchTextBuilder.AppendRequiredAlternatives (cognitive 18) · ×1
  • AzureSearchTextBuilder.AppendRequiredAlternatives (cognitive 18) src/NuGet.Services.AzureSearch/SearchService/AzureSearchTextBuilder.cs:82 — AzureSearchTextBuilder.AppendRequiredAlternatives has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WeeklySummaryNotificationTask.FillInTopSupportRequestReasons (cognitive 18) · ×1
  • WeeklySummaryNotificationTask.FillInTopSupportRequestReasons (cognitive 18) src/NuGet.SupportRequests.Notifications/Tasks/WeeklySummaryNotificationTask.cs:195 — WeeklySummaryNotificationTask.FillInTopSupportRequestReasons has cognitive complexity 18 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · Job.Init (cognitive 18) · ×1
  • Job.Init (cognitive 18) src/PackageHash/Job.cs:42 — Job.Init has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FindDuplicateFiles.FindDuplicates (cognitive 18) · ×1
  • FindDuplicateFiles.FindDuplicates (cognitive 18) build/FindDuplicateFiles.cs:110 — FindDuplicateFiles.FindDuplicates has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · d3.selection_on (cognitive 18) · ×1
  • d3.selection_on (cognitive 18) REDACTED:1583 — d3.selection_on has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (8 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · d3.collide.force (cognitive 18) · ×1
  • d3.collide.force (cognitive 18) REDACTED:6386 — d3.collide.force has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 10). Most of this is not in the body itself: 3 of the 18 points are its own statements and the rest belongs to one function item inside it that branches (apply). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · bootstrap.Affix.getState (cognitive 18) · ×1
  • bootstrap.Affix.getState (cognitive 18) src/NuGetGallery/Scripts/gallery/bootstrap.js:2524 — bootstrap.Affix.getState has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (9 pts), if/else 5 (6 pts), boolean chains 3 (nesting depth added 5). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · clamp.clamp (cognitive 18) · ×1
  • clamp.clamp (cognitive 18) src/NuGetGallery/Scripts/gallery/clamp.js:29 — clamp.clamp has cognitive complexity 18 (threshold 15). Drivers by points: if/else 27 (34 pts), boolean chains 13, ternaries 2 (3 pts) (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: one other method here (clamp.clamp::truncate) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · jquery-ui-1.10.3.$.effects.effect.bounce (cognitive 18) · ×1
  • jquery-ui-1.10.3.$.effects.effect.bounce (cognitive 18) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:10504 — jquery-ui-1.10.3.$.effects.effect.bounce has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 7, if/else 7, ternaries 2 (3 pts), loops 1 (nesting depth added 1). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · AdminApiController.SoftDeletePackageAsync (cognitive 17) · ×1
  • AdminApiController.SoftDeletePackageAsync (cognitive 17) src/NuGetGallery/Areas/Admin/Controllers/AdminApiController.cs:246 — AdminApiController.SoftDeletePackageAsync has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LockPackageController.Update (cognitive 17) · ×1
  • LockPackageController.Update (cognitive 17) src/NuGetGallery/Areas/Admin/Controllers/LockPackageController.cs:52 — LockPackageController.Update has cognitive complexity 17 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · PackagesController.Delete (cognitive 17) · ×1
  • PackagesController.Delete (cognitive 17) REDACTED:2140 — PackagesController.Delete has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PackagesController.VerifyPackage (cognitive 17) · ×1
  • PackagesController.VerifyPackage (cognitive 17) REDACTED:2603 — PackagesController.VerifyPackage has cognitive complexity 17 (threshold 15). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ReflowCommand.ExecuteAsync (cognitive 17) · ×1
  • ReflowCommand.ExecuteAsync (cognitive 17) src/GalleryTools/Commands/ReflowCommand.cs:49 — ReflowCommand.ExecuteAsync has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ApiKeyAuthenticationHandler.AuthenticateCoreAsync (cognitive 17) · ×1
  • ApiKeyAuthenticationHandler.AuthenticateCoreAsync (cognitive 17) src/NuGetGallery.Services/Authentication/Providers/ApiKey/ApiKeyAuthenticationHandler.cs:77 — ApiKeyAuthenticationHandler.AuthenticateCoreAsync has cognitive complexity 17 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · PackageService.FindLatestVersionsById (cognitive 17) · ×1
  • PackageService.FindLatestVersionsById (cognitive 17) src/NuGetGallery.Services/PackageManagement/PackageService.cs:303 — PackageService.FindLatestVersionsById has cognitive complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PackageValidationMessageData.PackageValidationMessageData.ctor (cognitive 17) · ×1
  • PackageValidationMessageData.PackageValidationMessageData.ctor (cognitive 17) src/NuGet.Services.Validation/PackageValidationMessageData.cs:89 — PackageValidationMessageData.PackageValidationMessageData.ctor has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CatalogWriterHelper.WritePackageDetailsToCatalogAsync (cognitive 17) · ×1
  • CatalogWriterHelper.WritePackageDetailsToCatalogAsync (cognitive 17) src/Catalog/Helpers/CatalogWriterHelper.cs:38 — CatalogWriterHelper.WritePackageDetailsToCatalogAsync has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StagedPackagePromotionMessageHandler.HandleAsync (cognitive 17) · ×1
  • StagedPackagePromotionMessageHandler.HandleAsync (cognitive 17) src/NuGet.Services.Staging.Promotion/StagedPackagePromotionMessageHandler.cs:91 — StagedPackagePromotionMessageHandler.HandleAsync has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · d3.axis.axis (cognitive 17) · ×1
  • d3.axis.axis (cognitive 17) REDACTED:607 — d3.axis.axis has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 10 (14 pts), boolean chains 2, if/else 1 (nesting depth added 4). Of this number, 14 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · d3.contours · ×1
  • d3.contours::isorings::stitch (cognitive 17) REDACTED:5431 — d3.contours::isorings::stitch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (17 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · d3.tree_visit (cognitive 17) · ×1
  • d3.tree_visit (cognitive 17) REDACTED:6258 — d3.tree_visit has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · d3.tree_visitAfter (cognitive 17) · ×1
  • d3.tree_visitAfter (cognitive 17) REDACTED:6273 — d3.tree_visitAfter has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · d3.simulation (cognitive 17) · ×1
  • d3.simulation (cognitive 17) REDACTED:6589 — d3.simulation has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 2, loops 2 (nesting depth added 4). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 13 function items inside it that branch (tick, initializeNodes, step, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · ListPackageItemRequiredSignerViewModelFactory.CanEditRequiredSigner (cognitive 16) · ×1
  • ListPackageItemRequiredSignerViewModelFactory.CanEditRequiredSigner (cognitive 16) src/NuGetGallery/Helpers/ViewModelExtensions/ListPackageItemRequiredSignerViewModelFactory.cs:141 — ListPackageItemRequiredSignerViewModelFactory.CanEditRequiredSigner has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ODataV2FeedController.GetUpdates (cognitive 16) · ×1
  • ODataV2FeedController.GetUpdates (cognitive 16) REDACTED:562 — ODataV2FeedController.GetUpdates has cognitive complexity 16 (threshold 15). Of this number, 8 points are the body's own statements and 8 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PackageStagingManagementService.MovePackageIdentityAsync (cognitive 16) · ×1
  • PackageStagingManagementService.MovePackageIdentityAsync (cognitive 16) src/NuGetGallery/Services/PackageStagingManagementService.cs:511 — PackageStagingManagementService.MovePackageIdentityAsync has cognitive complexity 16 (threshold 15). Of this number, 10 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PackageStagingUploadService.ResolveTarget (cognitive 16) · ×1
  • PackageStagingUploadService.ResolveTarget (cognitive 16) src/NuGetGallery/Services/PackageStagingUploadService.cs:357 — PackageStagingUploadService.ResolveTarget has cognitive complexity 16 (threshold 15). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · HtmlExtensions.PreFormattedText (cognitive 16) · ×1
  • HtmlExtensions.PreFormattedText (cognitive 16) src/NuGetGallery/Helpers/HtmlExtensions.cs:61 — HtmlExtensions.PreFormattedText has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PackageMetadata.FromNuspecReader (cognitive 16) · ×1
  • PackageMetadata.FromNuspecReader (cognitive 16) src/NuGetGallery.Core/Packaging/PackageMetadata.cs:222 — PackageMetadata.FromNuspecReader has cognitive complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SemVerLevelKey.ForPackage (cognitive 16) · ×1
  • SemVerLevelKey.ForPackage (cognitive 16) src/NuGetGallery.Core/SemVerLevelKey.cs:71 — SemVerLevelKey.ForPackage has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CredentialBuilder.VerifyScopes (cognitive 16) · ×1
  • CredentialBuilder.VerifyScopes (cognitive 16) src/NuGetGallery.Services/Authentication/CredentialBuilder.cs:148 — CredentialBuilder.VerifyScopes has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EntraIdTokenPolicyValidator.EvaluateEntraIdServicePrincipal (cognitive 16) · ×1
  • EntraIdTokenPolicyValidator.EvaluateEntraIdServicePrincipal (cognitive 16) src/NuGetGallery.Services/Authentication/Federated/EntraIdTokenValidator.cs:127 — EntraIdTokenPolicyValidator.EvaluateEntraIdServicePrincipal has cognitive complexity 16 (threshold 15). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · FederatedCredentialPolicyEvaluator.GetMatchingPolicyAsync (cognitive 16) · ×1
  • FederatedCredentialPolicyEvaluator.GetMatchingPolicyAsync (cognitive 16) src/NuGetGallery.Services/Authentication/Federated/FederatedCredentialPolicyEvaluator.cs:84 — FederatedCredentialPolicyEvaluator.GetMatchingPolicyAsync has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RequirePackageMetadataComplianceUtility.ValidatePackageAuthors (cognitive 16) · ×1
  • RequirePackageMetadataComplianceUtility.ValidatePackageAuthors (cognitive 16) src/NuGetGallery.Services/Security/RequirePackageMetadataComplianceUtility.cs:56 — RequirePackageMetadataComplianceUtility.ValidatePackageAuthors has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BlobStorageVulnerabilityWriter.RunUpdate (cognitive 16) · ×1
  • BlobStorageVulnerabilityWriter.RunUpdate (cognitive 16) src/GitHubVulnerabilities2v3/Extensions/BlobStorageVulnerabilityWriter.cs:283 — BlobStorageVulnerabilityWriter.RunUpdate has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CommitCollector.FetchAsync (cognitive 16) · ×1
  • CommitCollector.FetchAsync (cognitive 16) src/Catalog/CommitCollector.cs:27 — CommitCollector.FetchAsync has cognitive complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GalleryDatabaseQueryService.ReadPackagesAsync (cognitive 16) · ×1
  • GalleryDatabaseQueryService.ReadPackagesAsync (cognitive 16) src/Catalog/Helpers/GalleryDatabaseQueryService.cs:248 — GalleryDatabaseQueryService.ReadPackagesAsync has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JsonLdWriter.MakeExpandedForm (cognitive 16) · ×1
  • JsonLdWriter.MakeExpandedForm (cognitive 16) REDACTED:90 — JsonLdWriter.MakeExpandedForm has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Db2CatalogJob.RunInternalAsync (cognitive 16) · ×1
  • Db2CatalogJob.RunInternalAsync (cognitive 16) src/Ng/Jobs/Db2CatalogJob.cs:162 — Db2CatalogJob.RunInternalAsync has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UpdateDownloadsCommand.CleanDownloadData (cognitive 16) · ×1
  • UpdateDownloadsCommand.CleanDownloadData (cognitive 16) src/NuGet.Services.AzureSearch/Auxiliary2AzureSearch/UpdateDownloadsCommand.cs:386 — UpdateDownloadsCommand.CleanDownloadData has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BatchPusher.IndexAsync (cognitive 16) · ×1
  • BatchPusher.IndexAsync (cognitive 16) src/NuGet.Services.AzureSearch/BatchPusher.cs:158 — BatchPusher.IndexAsync has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExpireStagingTask.ProcessAsync (cognitive 16) · ×1
  • ExpireStagingTask.ProcessAsync (cognitive 16) src/Gallery.Maintenance/ExpireStagingTask.cs:50 — ExpireStagingTask.ProcessAsync has cognitive complexity 16 (threshold 15). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 73, 86, 99, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · CopyAzureContainerJob.TryCopyContainerAsync (cognitive 16) · ×1
  • CopyAzureContainerJob.TryCopyContainerAsync (cognitive 16) src/CopyAzureContainer/CopyAzureContainerJob.cs:93 — CopyAzureContainerJob.TryCopyContainerAsync has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StagedSymbolPackagePromotionMessageHandler.HandleAsync (cognitive 16) · ×1
  • StagedSymbolPackagePromotionMessageHandler.HandleAsync (cognitive 16) src/NuGet.Services.Staging.Promotion/StagedSymbolPackagePromotionMessageHandler.cs:41 — StagedSymbolPackagePromotionMessageHandler.HandleAsync has cognitive complexity 16 (threshold 15). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · TestApplication.ExecuteAsync (cognitive 16) · ×1
  • TestApplication.ExecuteAsync (cognitive 16) tools/AzureSqlConnectionTest/TestApplication.cs:64 — TestApplication.ExecuteAsync has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · d3.interpolateTransform (cognitive 16) · ×1
  • d3.interpolateTransform (cognitive 16) REDACTED:2835 — d3.interpolateTransform has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 4, ternaries 1 (nesting depth added 1). None of this is in the body itself: all 16 points belong to 5 function items inside it that branch (rotate, translate, scale, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · d3.transition_selectAll (cognitive 16) · ×1
  • d3.transition_selectAll (cognitive 16) REDACTED:3712 — d3.transition_selectAll has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (7 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · d3.tree_find (cognitive 16) · ×1
  • d3.tree_find (cognitive 16) REDACTED:6114 — d3.tree_find has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · jquery-ui-1.10.3.$.effects.effect.blind (cognitive 16) · ×1
  • jquery-ui-1.10.3.$.effects.effect.blind (cognitive 16) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:10437 — jquery-ui-1.10.3.$.effects.effect.blind has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (7 pts), ternaries 4 (6 pts), boolean chains 3 (nesting depth added 3). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member pair (29 shared lines) · ×1
  • Near-duplicate member pair (29 shared lines) src/NuGetGallery/Controllers/StagingApiController.cs:111 — src/NuGetGallery/Controllers/StagingApiController.cs:111-157 | src/NuGetGallery/Controllers/StagingApiController.cs:166-212 — These two members are variants of one another: 29 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 · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (6 members, 50+ identical tokens) src/NuGetGallery.Core/Infrastructure/Mail/Messages/PackageAddedMessage.cs:78 — src/NuGetGallery.Core/Infrastructure/Mail/Messages/PackageAddedMessage.cs:78-109 | src/NuGetGallery.Core/Infrastructure/Mail/Messages/StagedPackageUploadedMessage.cs:45-69 | src/NuGetGallery.Core/Infrastructure/Mail/Messages/StagedPackageValidationSucceededMessage.cs:45-67 | src/NuGetGallery.Core/Infrastructure/Mail/Messages/StagedPackageValidationTakingTooLongMessage.cs:46-68 | src/NuGetGallery.Core/Infrastructure/Mail/Messages/SymbolPackageAddedMessage.cs:77-104 | src/NuGetGallery/Infrastructure/Mail/Messages/ContactOwnersMessage.cs:68-95 — These 6 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 6 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 6 times.
D4 · Code Duplication · Edited copy of a member (62 corresponding lines) · ×1
  • Edited copy of a member (62 corresponding lines) src/Gallery.Maintenance/ExpireStagingTask.cs:210 — src/Gallery.Maintenance/ExpireStagingTask.cs:210-271 | src/Gallery.Maintenance/ExpireStagingTask.cs:274-335 — These two members are one piece of code written twice and then edited apart: 62 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (81 corresponding lines) · ×1
  • Edited copy of a member (81 corresponding lines) REDACTED:289 — REDACTED:289-369 | REDACTED:460-559 — These two members are one piece of code written twice and then edited apart: 81 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (49 corresponding lines) · ×1
  • Edited copy of a member (49 corresponding lines) src/NuGet.Services.AzureSearch/BaseDocumentBuilder.cs:87 — src/NuGet.Services.AzureSearch/BaseDocumentBuilder.cs:87-139 | src/NuGet.Services.AzureSearch/BaseDocumentBuilder.cs:145-193 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (69 corresponding lines) · ×1
  • Edited copy of a member (69 corresponding lines) src/NuGetGallery/Services/PackageMetadataValidationService.cs:513 — src/NuGetGallery/Services/PackageMetadataValidationService.cs:513-581 | src/NuGetGallery/Services/PackageMetadataValidationService.cs:584-666 — These two members are one piece of code written twice and then edited apart: 69 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (65 corresponding lines) · ×1
  • Edited copy of a member (65 corresponding lines) src/NuGet.Services.Validation/Entities/ValidationEntitiesContext.cs:621 — src/NuGet.Services.Validation/Entities/ValidationEntitiesContext.cs:621-699 | src/NuGet.Services.Validation/Entities/ValidationEntitiesContext.cs:788-852 — These two members are one piece of code written twice and then edited apart: 65 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (100 corresponding lines) · ×1
  • Edited copy of a member (100 corresponding lines) src/NuGet.Services.Validation.Orchestrator/BaseValidationMessageHandler.cs:102 — src/NuGet.Services.Validation.Orchestrator/BaseValidationMessageHandler.cs:102-201 | src/NuGet.Services.Validation.Orchestrator/BaseValidationMessageHandler.cs:318-417 — These two members are one piece of code written twice and then edited apart: 100 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (41 corresponding lines) · ×1
  • Edited copy of a member (41 corresponding lines) src/NuGetGallery/Infrastructure/Mail/Messages/ReportAbuseMessage.cs:26 — src/NuGetGallery/Infrastructure/Mail/Messages/ReportAbuseMessage.cs:26-77 | src/NuGetGallery/Infrastructure/Mail/Messages/ReportMyPackageMessage.cs:24-64 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (47 corresponding lines) · ×1
  • Edited copy of a member (47 corresponding lines) src/NuGet.Jobs.Catalog2Registration/Catalog2RegistrationCommand.cs:53 — src/NuGet.Jobs.Catalog2Registration/Catalog2RegistrationCommand.cs:53-99 | src/NuGet.Services.AzureSearch/Catalog2AzureSearch/Catalog2AzureSearchCommand.cs:54-111 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (52 corresponding lines) · ×1
  • Edited copy of a member (52 corresponding lines) src/NuGet.Services.AzureSearch/Db2AzureSearch/NewPackageRegistrationFromKustoProducer.cs:271 — src/NuGet.Services.AzureSearch/Db2AzureSearch/NewPackageRegistrationFromKustoProducer.cs:271-322 | src/NuGet.Services.AzureSearch/Db2AzureSearch/NewPackageRegistrationFromKustoProducer.cs:406-458 — These two members are one piece of code written twice and then edited apart: 52 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 17+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 17+ corresponding lines) src/NuGetGallery.Services/AccountManagement/DeleteAccountService.cs:58 — src/NuGetGallery.Services/AccountManagement/DeleteAccountService.cs:58-76 | src/NuGetGallery/Services/PackageDeleteService.cs:82-110 | src/NuGetGallery/Services/SymbolPackageStagingUploadService.cs:64-80 | src/NuGetGallery/Services/UndoSoftDeleteService.cs:51-67 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 39+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 39+ corresponding lines) src/NuGet.Services.AzureSearch/AuxiliaryFiles/DownloadDataClient.cs:45 — src/NuGet.Services.AzureSearch/AuxiliaryFiles/DownloadDataClient.cs:45-90 | src/NuGet.Services.AzureSearch/AuxiliaryFiles/PopularityTransferDataClient.cs:45-83 | src/NuGet.Services.AzureSearch/AuxiliaryFiles/VerifiedPackagesDataClient.cs:46-84 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 39 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (59 corresponding lines) · ×1
  • Edited copy of a member (59 corresponding lines) src/NuGet.Services.Storage/AzureStorage.cs:244 — src/NuGet.Services.Storage/AzureStorage.cs:244-302 | src/Catalog/Persistence/AzureStorage.cs:226-284 — These two members are one piece of code written twice and then edited apart: 59 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 44+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 44+ corresponding lines) src/NuGet.Services.AzureSearch/SearchService/AzureSearchService.cs:64 — src/NuGet.Services.AzureSearch/SearchService/AzureSearchService.cs:64-107 | src/NuGet.Services.AzureSearch/SearchService/AzureSearchService.cs:143-209 | src/NuGet.Services.AzureSearch/SearchService/AzureSearchService.cs:212-255 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 44 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (43 corresponding lines) · ×1
  • Edited copy of a member (43 corresponding lines) src/NuGetGallery.Core/Features/EditableFeatureFlagFileStorageService.cs:43 — src/NuGetGallery.Core/Features/EditableFeatureFlagFileStorageService.cs:43-85 | src/NuGetGallery.Core/Login/EditableLoginConfigurationFileStorageService.cs:37-89 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (54 corresponding lines) · ×1
  • Edited copy of a member (54 corresponding lines) src/NuGetGallery/Services/JsonStatisticsService.cs:343 — src/NuGetGallery/Services/JsonStatisticsService.cs:343-396 | src/NuGetGallery/Services/JsonStatisticsService.cs:399-454 — These two members are one piece of code written twice and then edited apart: 54 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (34 corresponding lines) · ×1
  • Edited copy of a member (34 corresponding lines) src/GitHubVulnerabilities2Db/Job.cs:175 — src/GitHubVulnerabilities2Db/Job.cs:175-208 | src/GitHubVulnerabilities2v3/Job.cs:132-173 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 31+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 31+ corresponding lines) src/NuGet.Services.Validation.Orchestrator/Job.cs:359 — src/NuGet.Services.Validation.Orchestrator/Job.cs:359-395 | src/NuGet.Services.Validation.Orchestrator/Job.cs:398-430 | src/NuGet.Services.Validation.Orchestrator/Job.cs:612-642 | src/NuGet.Services.Validation.Orchestrator/Job.cs:645-675 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 31 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (55 corresponding lines) · ×1
  • Edited copy of a member (55 corresponding lines) src/NuGetGallery.Services/PackageManagement/SponsorshipUrlService.cs:47 — src/NuGetGallery.Services/PackageManagement/SponsorshipUrlService.cs:47-102 | src/NuGetGallery.Services/PackageManagement/SponsorshipUrlService.cs:105-159 — These two members are one piece of code written twice and then edited apart: 55 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 27+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 27+ corresponding lines) src/Catalog/Persistence/FileStorage.cs:104 — src/Catalog/Persistence/FileStorage.cs:104-132 | src/Catalog/Persistence/FileStorage.cs:135-161 | src/NuGet.Services.Storage/FileStorage.cs:126-154 | src/NuGet.Services.Storage/FileStorage.cs:159-185 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 27 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (33 corresponding lines) · ×1
  • Edited copy of a member (33 corresponding lines) src/Validation.PackageSigning.ProcessSignature/SignaturePartsExtractor.cs:584 — src/Validation.PackageSigning.ProcessSignature/SignaturePartsExtractor.cs:584-628 | src/Validation.PackageSigning.ProcessSignature/SignaturePartsExtractor.cs:632-664 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 22+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 22+ corresponding lines) REDACTED:286 — REDACTED:286-307 | REDACTED:313-340 | REDACTED:346-377 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 23+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 23+ corresponding lines) src/NuGetGallery/Services/AsynchronousValidationMessageEmitter.cs:49 — src/NuGetGallery/Services/AsynchronousValidationMessageEmitter.cs:49-71 | src/NuGetGallery/Services/StagedPackageValidationMessageEmitter.cs:31-56 | src/NuGetGallery/Services/StagedSymbolPackageValidationMessageEmitter.cs:34-60 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (39 corresponding lines) · ×1
  • Edited copy of a member (39 corresponding lines) src/Catalog/Dnx/DnxMaker.cs:43 — src/Catalog/Dnx/DnxMaker.cs:43-87 | src/Catalog/Dnx/DnxMaker.cs:96-134 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 25+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 25+ corresponding lines) src/NuGet.Services.AzureSearch/Db2AzureSearch/NewPackageRegistrationFromKustoProducer.cs:51 — src/NuGet.Services.AzureSearch/Db2AzureSearch/NewPackageRegistrationFromKustoProducer.cs:51-75 | src/NuGet.Services.AzureSearch/Db2AzureSearch/NewPackageRegistrationFromKustoProducer.cs:239-268 | src/NuGet.Services.AzureSearch/Db2AzureSearch/NewPackageRegistrationFromKustoProducer.cs:374-403 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 25 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 32+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 32+ corresponding lines) src/NuGetGallery/Services/JsonStatisticsService.cs:239 — src/NuGetGallery/Services/JsonStatisticsService.cs:239-271 | src/NuGetGallery/Services/JsonStatisticsService.cs:274-305 | src/NuGetGallery/Services/JsonStatisticsService.cs:308-340 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 32 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 9+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 9+ corresponding lines) src/NuGetGallery/Controllers/StagingApiController.cs:46 — src/NuGetGallery/Controllers/StagingApiController.cs:46-54 | REDACTED:39-47 | src/NuGetGallery/Services/PackageUploadService.cs:40-55 | src/NuGetGallery/Services/SymbolPackageUploadService.cs:35-43 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 19+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 19+ corresponding lines) src/NuGet.Services.Validation.Orchestrator/Services/PackageMessageService.cs:31 — src/NuGet.Services.Validation.Orchestrator/Services/PackageMessageService.cs:31-49 | src/NuGet.Services.Validation.Orchestrator/Services/PackageMessageService.cs:52-75 | src/NuGet.Services.Validation.Orchestrator/Services/SymbolsMessageService.cs:55-81 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (28 corresponding lines) · ×1
  • Edited copy of a member (28 corresponding lines) src/NuGetGallery.Core/Services/CoreLicenseFileService.cs:49 — src/NuGetGallery.Core/Services/CoreLicenseFileService.cs:49-76 | src/NuGetGallery.Core/Services/CoreReadmeFileService.cs:61-88 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 16+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 16+ corresponding lines) src/NuGet.Services.AzureSearch/AuxiliaryFiles/DownloadDataClient.cs:95 — src/NuGet.Services.AzureSearch/AuxiliaryFiles/DownloadDataClient.cs:95-110 | src/NuGet.Services.AzureSearch/AuxiliaryFiles/OwnerDataClient.cs:104-119 | src/NuGet.Services.AzureSearch/AuxiliaryFiles/PopularityTransferDataClient.cs:88-104 | src/NuGet.Services.AzureSearch/AuxiliaryFiles/VerifiedPackagesDataClient.cs:89-105 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 8+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 8+ corresponding lines) src/NuGetGallery.Services/PackageManagement/PackageOwnershipManagementService.cs:38 — src/NuGetGallery.Services/PackageManagement/PackageOwnershipManagementService.cs:38-47 | REDACTED:59-67 | src/NuGetGallery/Controllers/JsonApiController.cs:38-46 | REDACTED:37-44 | src/NuGetGallery/Services/SearchSideBySideService.cs:34-43 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (57 corresponding lines) · ×1
  • Edited copy of a member (57 corresponding lines) src/NuGetGallery/Areas/Admin/Controllers/AdminApiController.cs:127 — src/NuGetGallery/Areas/Admin/Controllers/AdminApiController.cs:127-183 | src/NuGetGallery/Areas/Admin/Controllers/AdminApiController.cs:188-244 — These two members are one piece of code written twice and then edited apart: 57 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 26+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 26+ corresponding lines) src/NuGetGallery/Infrastructure/ABTestEnrollmentFactory.cs:99 — src/NuGetGallery/Infrastructure/ABTestEnrollmentFactory.cs:99-129 | src/NuGetGallery/Infrastructure/ABTestEnrollmentFactory.cs:132-163 | src/NuGetGallery/Infrastructure/ABTestEnrollmentFactory.cs:166-191 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 26 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (32 corresponding lines) · ×1
  • Edited copy of a member (32 corresponding lines) src/NuGetGallery/Services/CertificateService.cs:85 — src/NuGetGallery/Services/CertificateService.cs:85-122 | src/NuGetGallery/Services/CertificateService.cs:125-156 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 7+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 7+ corresponding lines) src/Validation.PackageSigning.ProcessSignature/SignatureValidationMessageHandler.cs:47 — src/Validation.PackageSigning.ProcessSignature/SignatureValidationMessageHandler.cs:47-54 | src/Validation.PackageSigning.RevalidateCertificate/CertificateRevalidator.cs:29-35 | src/Validation.PackageSigning.ValidateCertificate/CertificateValidationMessageHandler.cs:42-51 | src/Validation.Symbols/SymbolsValidatorMessageHandler.cs:33-39 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 13+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 13+ corresponding lines) src/DatabaseMigrationTools/CatalogValidationDbMigrationContext.cs:16 — src/DatabaseMigrationTools/CatalogValidationDbMigrationContext.cs:16-28 | src/DatabaseMigrationTools/GalleryDbMigrationContext.cs:15-27 | src/DatabaseMigrationTools/SupportRequestDbMigrationContext.cs:16-28 | src/DatabaseMigrationTools/ValidationDbMigrationContext.cs:15-27 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 6+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 6+ corresponding lines) src/NuGetGallery.Services/Mail/Messages/PackageOwnerAddedMessage.cs:21 — src/NuGetGallery.Services/Mail/Messages/PackageOwnerAddedMessage.cs:21-28 | src/NuGetGallery.Services/Mail/Messages/PackageOwnerRemovedMessage.cs:20-25 | src/NuGetGallery.Services/Mail/Messages/PackageOwnershipRequestCanceledMessage.cs:21-26 | src/NuGetGallery.Services/Mail/Messages/PackageOwnershipRequestDeclinedMessage.cs:21-26 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 21+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 21+ corresponding lines) src/NuGet.Services.Storage/BlobLeaseService.cs:87 — src/NuGet.Services.Storage/BlobLeaseService.cs:87-110 | src/NuGet.Services.Storage/BlobLeaseService.cs:131-151 | src/Validation.Common.Job/Leases/CloudBlobLeaseService.cs:73-93 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 15+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 15+ corresponding lines) src/NuGetGallery/Infrastructure/AntiForgeryErrorFilter.cs:11 — src/NuGetGallery/Infrastructure/AntiForgeryErrorFilter.cs:11-25 | src/NuGetGallery/Infrastructure/ReadOnlyModeErrorFilter.cs:11-25 | src/NuGetGallery/Infrastructure/RequestValidationExceptionFilter.cs:12-26 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 12+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 12+ corresponding lines) src/Catalog/DurableCursor.cs:33 — src/Catalog/DurableCursor.cs:33-44 | src/NuGet.Services.Cursor/DurableCursor.cs:33-44 | src/UpdateBlobProperties/Cursor.cs:35-46 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 9+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 9+ corresponding lines) src/GitHubVulnerabilities2Db/Job.cs:57 — src/GitHubVulnerabilities2Db/Job.cs:57-66 | src/GitHubVulnerabilities2v3/Job.cs:71-80 | src/VerifyGitHubVulnerabilities/Job.cs:64-72 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (1 corresponding lines) · ×1
  • Edited copy of a member (1 corresponding lines) src/NuGetGallery/Infrastructure/Mail/Messages/ReportAbuseMessage.cs:23 — src/NuGetGallery/Infrastructure/Mail/Messages/ReportAbuseMessage.cs:23-23 | src/NuGetGallery/Infrastructure/Mail/Messages/ReportMyPackageMessage.cs:21-21 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (8 members, 7+ corresponding lines) · ×1
  • Edited copies of one member (8 members, 7+ corresponding lines) src/NuGetGallery/Infrastructure/Mail/Messages/OrganizationMemberRemovedMessage.cs:33 — src/NuGetGallery/Infrastructure/Mail/Messages/OrganizationMemberRemovedMessage.cs:33-39 | src/NuGetGallery/Infrastructure/Mail/Messages/OrganizationMemberUpdatedMessage.cs:33-39 | src/NuGetGallery/Infrastructure/Mail/Messages/OrganizationMembershipRequestCanceledMessage.cs:33-39 | src/NuGetGallery/Infrastructure/Mail/Messages/OrganizationMembershipRequestMessage.cs:52-62 | src/NuGetGallery/Infrastructure/Mail/Messages/OrganizationTransformAcceptedMessage.cs:31-37 | src/NuGetGallery/Infrastructure/Mail/Messages/OrganizationTransformInitiatedMessage.cs:37-43 | src/NuGetGallery/Infrastructure/Mail/Messages/OrganizationTransformRejectedMessage.cs:45-51 | src/NuGetGallery/Infrastructure/Mail/Messages/OrganizationTransformRequestMessage.cs:46-52 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. 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. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (47–49 lines × 2) · ×1
  • Duplicated block (47–49 lines × 2) src/NuGet.Services.Validation.Orchestrator/PackageSigning/ValidateCertificate/PackageCertificatesValidator.cs:290 — src/NuGet.Services.Validation.Orchestrator/PackageSigning/ValidateCertificate/PackageCertificatesValidator.cs:290-338 | src/Validation.PackageSigning.Core/Extensions/PackageSignatureExtensions.cs:18-64 — 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 `src/NuGet.Services.Validation.Orchestrator/PackageSigning/ValidateCertificate/PackageCertificatesValidator.cs:290` 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 first that the copies are not typed on the same thing: the declarations holding them bind `signature` to `PackageSignature` in one and `this PackageSignature` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (33–36 lines × 2) · ×1
  • Duplicated block (33–36 lines × 2) src/NuGet.Services.Entities/StagedPackage.cs:35 — src/NuGet.Services.Entities/StagedPackage.cs:35-67 | src/NuGet.Services.Entities/StagingGroup.cs:28-63 — 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. 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 (27–34 lines × 2) · ×1
  • Duplicated block (27–34 lines × 2) src/NuGet.Services.Validation.Orchestrator/BaseValidationMessageHandler.cs:131 — src/NuGet.Services.Validation.Orchestrator/BaseValidationMessageHandler.cs:131-164 | src/NuGet.Services.Validation.Orchestrator/BaseValidationMessageHandler.cs:338-364 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `message` to `CheckValidatorData` in one and `FailValidationSetData` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (30 lines × 2) · ×1
  • Duplicated block (30 lines × 2) src/Validation.PackageSigning.ProcessSignature/Job.cs:53 — src/Validation.PackageSigning.ProcessSignature/Job.cs:53-82 | src/Validation.PackageSigning.ValidateCertificate/Job.cs:35-64 — 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 (29 lines × 2) · ×1
  • Duplicated block (29 lines × 2) src/NuGetGallery.Core/Services/CloudWrapperHelpers.cs:122 — src/NuGetGallery.Core/Services/CloudWrapperHelpers.cs:122-150 | src/NuGetGallery.Core/Services/CloudWrapperHelpers.cs:158-186 — 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 `src/NuGetGallery.Core/Services/CloudWrapperHelpers.cs:122` 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 (31 lines × 2) · ×1
  • Duplicated block (31 lines × 2) src/Catalog/Persistence/AzureStorage.cs:252 — src/Catalog/Persistence/AzureStorage.cs:252-282 | src/NuGet.Services.Storage/AzureStorage.cs:270-300 — 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 (28 lines × 2) · ×1
  • Duplicated block (28 lines × 2) src/NuGet.Services.Messaging.Email/EmailMessageFooter.cs:33 — src/NuGet.Services.Messaging.Email/EmailMessageFooter.cs:33-60 | src/NuGetGallery/Infrastructure/Mail/EmailMessageFooter.cs:34-61 — before extracting anything, compare `src/NuGet.Services.Messaging.Email/EmailMessageFooter.cs` and `src/NuGetGallery/Infrastructure/Mail/EmailMessageFooter.cs` as WHOLE FILES: 97% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 (14–29 lines × 2) · ×1
  • Duplicated block (14–29 lines × 2) src/GalleryTools/Commands/SeedFunctionalTestsCommand.cs:64 — src/GalleryTools/Commands/SeedFunctionalTestsCommand.cs:64-92 | src/GalleryTools/Commands/SeedSinglePackageCommand.cs:76-89 — 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 `src/GalleryTools/Commands/SeedFunctionalTestsCommand.cs:64` 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. 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 (27–28 lines × 2) · ×1
  • Duplicated block (27–28 lines × 2) src/NuGetGallery/Services/JsonStatisticsService.cs:181 — src/NuGetGallery/Services/JsonStatisticsService.cs:181-207 | src/NuGetGallery/Services/JsonStatisticsService.cs:239-266 — 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 `src/NuGetGallery/Services/JsonStatisticsService.cs:181` 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 (25 lines × 2) · ×1
  • Duplicated block (25 lines × 2) REDACTED:720 — REDACTED:720-744 | REDACTED:810-834 — 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 (24 lines × 2) · ×1
  • Duplicated block (24 lines × 2) src/NuGetGallery/OData/Serializers/V1FeedPackageAnnotationStrategy.cs:31 — src/NuGetGallery/OData/Serializers/V1FeedPackageAnnotationStrategy.cs:31-54 | src/NuGetGallery/OData/Serializers/V2FeedPackageAnnotationStrategy.cs:35-58 — 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 `src/NuGetGallery/OData/Serializers/V1FeedPackageAnnotationStrategy.cs:31` 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 (17–26 lines × 2) · ×1
  • Duplicated block (17–26 lines × 2) REDACTED:1384 — REDACTED:1384-1409 | REDACTED:1417-1433 — 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 (21–22 lines × 2) · ×1
  • Duplicated block (21–22 lines × 2) REDACTED:860 — REDACTED:860-881 | REDACTED:941-961 — 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 `REDACTED:860` 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 (16–20 lines × 2) · ×1
  • Duplicated block (16–20 lines × 2) src/NuGetGallery.Services/Security/SecurityPolicyService.cs:212 — src/NuGetGallery.Services/Security/SecurityPolicyService.cs:212-231 | src/NuGetGallery.Services/Security/SecurityPolicyService.cs:283-298 — 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 `src/NuGetGallery.Services/Security/SecurityPolicyService.cs:212` 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.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×1
  • Duplicated block (19 lines × 2) src/NuGet.Services.AzureSearch/Db2AzureSearch/NewPackageRegistrationFromDbProducer.cs:170 — src/NuGet.Services.AzureSearch/Db2AzureSearch/NewPackageRegistrationFromDbProducer.cs:170-188 | src/NuGet.Services.AzureSearch/Db2AzureSearch/NewPackageRegistrationFromKustoProducer.cs:785-803 — 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. 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 (9–19 lines × 3) · ×1
  • Duplicated block (9–19 lines × 3) src/NuGetGallery.Services/Telemetry/TelemetryService.cs:793 — src/NuGetGallery.Services/Telemetry/TelemetryService.cs:793-801 | src/NuGetGallery.Services/Telemetry/TelemetryService.cs:812-830 | src/NuGetGallery.Services/Telemetry/TelemetryService.cs:861-869 — 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 `src/NuGetGallery.Services/Telemetry/TelemetryService.cs:793` 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 (17 lines × 3) · ×1
  • Duplicated block (17 lines × 3) src/NuGet.Services.AzureSearch/AuxiliaryFiles/DownloadDataClient.cs:67 — src/NuGet.Services.AzureSearch/AuxiliaryFiles/DownloadDataClient.cs:67-83 | src/NuGet.Services.AzureSearch/AuxiliaryFiles/PopularityTransferDataClient.cs:60-76 | src/NuGet.Services.AzureSearch/AuxiliaryFiles/VerifiedPackagesDataClient.cs:61-77 — before extracting anything, compare `src/NuGet.Services.AzureSearch/AuxiliaryFiles/DownloadDataClient.cs` and `src/NuGet.Services.AzureSearch/AuxiliaryFiles/PopularityTransferDataClient.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 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 `src/NuGet.Services.AzureSearch/AuxiliaryFiles/DownloadDataClient.cs:67` 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.
D4 · Code Duplication · Duplicated block (18–19 lines × 2) · ×1
  • Duplicated block (18–19 lines × 2) src/NuGetGallery/Services/JsonStatisticsService.cs:346 — src/NuGetGallery/Services/JsonStatisticsService.cs:346-364 | src/NuGetGallery/Services/JsonStatisticsService.cs:402-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.
D4 · Code Duplication · Duplicated block (17–18 lines × 2) · ×1
  • Duplicated block (17–18 lines × 2) src/NuGet.Services.Validation.Orchestrator/Job.cs:213 — src/NuGet.Services.Validation.Orchestrator/Job.cs:213-229 | src/Validation.Common.Job/ValidationJobBase.cs:67-84 — 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 (15 lines × 6) · ×1
  • Duplicated block (15 lines × 6) src/NuGetGallery.Core/Infrastructure/Mail/Messages/PackageAddedMessage.cs:92 — src/NuGetGallery.Core/Infrastructure/Mail/Messages/PackageAddedMessage.cs:92-106 | src/NuGetGallery.Core/Infrastructure/Mail/Messages/StagedPackageUploadedMessage.cs:52-66 | src/NuGetGallery.Core/Infrastructure/Mail/Messages/StagedPackageValidationSucceededMessage.cs:50-64 | src/NuGetGallery.Core/Infrastructure/Mail/Messages/StagedPackageValidationTakingTooLongMessage.cs:51-65 | src/NuGetGallery.Core/Infrastructure/Mail/Messages/SymbolPackageAddedMessage.cs:87-101 | src/NuGetGallery/Infrastructure/Mail/Messages/ContactOwnersMessage.cs:78-92 — before extracting anything, compare `src/NuGetGallery.Core/Infrastructure/Mail/Messages/PackageAddedMessage.cs` and `src/NuGetGallery.Core/Infrastructure/Mail/Messages/SymbolPackageAddedMessage.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 51 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. 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 (16–17 lines × 2) · ×1
  • Duplicated block (16–17 lines × 2) src/NuGet.Services.Staging.Promotion/StagedSymbolPackagePromotionMessageHandler.cs:42 — src/NuGet.Services.Staging.Promotion/StagedSymbolPackagePromotionMessageHandler.cs:42-57 | src/NuGetGallery.Core/Services/StagedSymbolPackagePromotionService.cs:308-324 — 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 `src/NuGet.Services.Staging.Promotion/StagedSymbolPackagePromotionMessageHandler.cs:42` 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 (15 lines × 5) · ×1
  • Duplicated block (15 lines × 5) src/NuGetGallery/Areas/Admin/Models/AdminLockPackageRequest.cs:24 — src/NuGetGallery/Areas/Admin/Models/AdminLockPackageRequest.cs:24-38 | src/NuGetGallery/Areas/Admin/Models/AdminReflowPackageRequest.cs:22-36 | src/NuGetGallery/Areas/Admin/Models/AdminRevalidatePackageRequest.cs:23-37 | src/NuGetGallery/Areas/Admin/Models/AdminSoftDeletePackageRequest.cs:26-40 | src/NuGetGallery/Areas/Admin/Models/AdminUpdateListedPackageRequest.cs:25-39 — 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 5 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/NuGetGallery/Areas/Admin/Models/AdminLockPackageRequest.cs:24` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/NuGetGallery/Areas/Admin/Models/AdminLockPackageRequest.cs:23` calls `ValidationResult`, `nameof` and `src/NuGetGallery/Areas/Admin/Models/AdminReflowPackageRequest.cs:21` 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.
D4 · Code Duplication · Duplicated block (10–15 lines × 3) · ×1
  • Duplicated block (10–15 lines × 3) src/Stats.PostProcessReports/Job.cs:90 — src/Stats.PostProcessReports/Job.cs:90-104 | src/Stats.PostProcessReports/Job.cs:107-121 | src/Stats.PostProcessReports/Job.cs:124-133 — 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 `src/Stats.PostProcessReports/Job.cs:90` 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. 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 (13 lines × 4) · ×1
  • Duplicated block (13 lines × 4) src/NuGetGallery/Controllers/StagingApiController.cs:217 — src/NuGetGallery/Controllers/StagingApiController.cs:217-229 | src/NuGetGallery/Controllers/StagingApiController.cs:251-263 | src/NuGetGallery/Controllers/StagingApiController.cs:333-345 | src/NuGetGallery/Controllers/StagingApiController.cs:363-375 — 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 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 lines × 3) · ×1
  • Duplicated block (13 lines × 3) src/NuGetGallery/Controllers/StagingApiController.cs:542 — src/NuGetGallery/Controllers/StagingApiController.cs:542-554 | src/NuGetGallery/Controllers/StagingApiController.cs:568-580 | src/NuGetGallery/Controllers/StagingApiController.cs:602-614 — 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.
D4 · Code Duplication · Duplicated block (12–14 lines × 3) · ×1
  • Duplicated block (12–14 lines × 3) src/NuGet.Services.AzureSearch/AuxiliaryFiles/DownloadDataClient.cs:115 — src/NuGet.Services.AzureSearch/AuxiliaryFiles/DownloadDataClient.cs:115-128 | src/NuGet.Services.AzureSearch/AuxiliaryFiles/OwnerDataClient.cs:122-133 | src/NuGet.Services.AzureSearch/AuxiliaryFiles/PopularityTransferDataClient.cs:107-119 — before extracting anything, compare `src/NuGet.Services.AzureSearch/AuxiliaryFiles/DownloadDataClient.cs` and `src/NuGet.Services.AzureSearch/AuxiliaryFiles/OwnerDataClient.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 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 `src/NuGet.Services.AzureSearch/AuxiliaryFiles/DownloadDataClient.cs:115` 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–14 lines × 2) · ×1
  • Duplicated block (11–14 lines × 2) src/NuGet.Services.Validation.Orchestrator/Job.cs:165 — src/NuGet.Services.Validation.Orchestrator/Job.cs:165-175 | src/Validation.Common.Job/ValidationJobBase.cs:54-67 — 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 `src/NuGet.Services.Validation.Orchestrator/Job.cs:165` 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 (8 lines × 3) · ×1
  • Duplicated block (8 lines × 3) src/NuGetGallery/Controllers/StagingApiController.cs:70 — src/NuGetGallery/Controllers/StagingApiController.cs:70-77 | src/NuGetGallery/Controllers/StagingApiController.cs:130-137 | src/NuGetGallery/Controllers/StagingApiController.cs:185-192 — 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 first that the copies are not typed on the same thing: the declarations holding them bind `request` to `CreateStagingGroupRequest` in one and `StagePackageRequest` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×1
  • Duplicated block (10–11 lines × 2) REDACTED:1152 — REDACTED:1152-1162 | REDACTED:1577-1586 — 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 `REDACTED:1152` 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 (9–11 lines × 2) · ×1
  • Duplicated block (9–11 lines × 2) src/NuGet.Services.Staging.Promotion/Job.cs:43 — src/NuGet.Services.Staging.Promotion/Job.cs:43-51 | src/NuGet.Services.Validation.Orchestrator/Job.cs:142-152 — 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 `src/NuGet.Services.Validation.Orchestrator/Job.cs:142` 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 (9 lines × 3) · ×1
  • Duplicated block (9 lines × 3) REDACTED:1155 — REDACTED:1155-1163 | REDACTED:1199-1207 | REDACTED:1579-1587 — 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 lines × 5) · ×1
  • Duplicated block (6 lines × 5) src/NuGet.Services.AzureSearch/AuxiliaryFiles/AuxiliaryFileClient.cs:31 — src/NuGet.Services.AzureSearch/AuxiliaryFiles/AuxiliaryFileClient.cs:31-36 | src/NuGet.Services.AzureSearch/AuxiliaryFiles/DownloadDataClient.cs:31-36 | src/NuGet.Services.AzureSearch/AuxiliaryFiles/OwnerDataClient.cs:32-37 | src/NuGet.Services.AzureSearch/AuxiliaryFiles/PopularityTransferDataClient.cs:31-36 | src/NuGet.Services.AzureSearch/AuxiliaryFiles/VerifiedPackagesDataClient.cs:32-37 — before extracting anything, compare `src/NuGet.Services.AzureSearch/AuxiliaryFiles/DownloadDataClient.cs` and `src/NuGet.Services.AzureSearch/AuxiliaryFiles/OwnerDataClient.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 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 `src/NuGet.Services.AzureSearch/AuxiliaryFiles/AuxiliaryFileClient.cs:31` 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 (8 lines × 4) · ×1
  • Duplicated block (8 lines × 4) src/GalleryTools/Commands/CreateApiKeyCommand.cs:60 — src/GalleryTools/Commands/CreateApiKeyCommand.cs:60-67 | src/GalleryTools/Commands/CreateOrganizationCommand.cs:53-61 | src/GalleryTools/Commands/SeedFunctionalTestsCommand.cs:68-92 | src/GalleryTools/Commands/SeedSinglePackageCommand.cs:80-89 — 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. 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 (5 lines × 4) · ×1
  • Duplicated block (5 lines × 4) src/Ng/Jobs/Catalog2DnxJob.cs:46 — src/Ng/Jobs/Catalog2DnxJob.cs:46-50 | src/Ng/Jobs/Db2CatalogJob.cs:64-68 | src/Ng/Jobs/FixCatalogCachingJob.cs:53-57 | src/Ng/Jobs/NgJob.cs:52-56 — 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. 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 (411 lines × 2) · ×1
  • Duplicated block (411 lines × 2) src/GitHubVulnerabilities2Db/Gallery/ThrowingTelemetryService.cs:20 — src/GitHubVulnerabilities2Db/Gallery/ThrowingTelemetryService.cs:20-430 | src/VerifyMicrosoftPackage/Fakes/FakeTelemetryService.cs:17-432 — before extracting anything, compare `src/GitHubVulnerabilities2Db/Gallery/ThrowingTelemetryService.cs` and `src/VerifyMicrosoftPackage/Fakes/FakeTelemetryService.cs` as WHOLE FILES: 97% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×1
  • Duplicated block (27 lines × 2) src/NuGetGallery/Areas/Admin/DynamicData/EntityTemplates/Default_Edit.ascx.cs:11 — src/NuGetGallery/Areas/Admin/DynamicData/EntityTemplates/Default_Edit.ascx.cs:11-37 | src/NuGetGallery/Areas/Admin/DynamicData/EntityTemplates/Default_Insert.ascx.cs:11-37 — before extracting anything, compare `src/NuGetGallery/Areas/Admin/DynamicData/EntityTemplates/Default_Edit.ascx.cs` and `src/NuGetGallery/Areas/Admin/DynamicData/EntityTemplates/Default_Insert.ascx.cs` as WHOLE FILES: 96% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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.
D4 · Code Duplication · Duplicated block (26 lines × 2) · ×1
  • Duplicated block (26 lines × 2) src/NuGetGallery/Areas/Admin/DynamicData/FieldTemplates/Text_Edit.ascx.cs:8 — src/NuGetGallery/Areas/Admin/DynamicData/FieldTemplates/Text_Edit.ascx.cs:8-33 | src/NuGetGallery/Areas/Admin/DynamicData/FieldTemplates/Url_Edit.ascx.cs:10-41 — 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 `src/NuGetGallery/Areas/Admin/DynamicData/FieldTemplates/Text_Edit.ascx.cs:8` 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.
D44 · Platform End-of-Life · End-of-life runtime · ×1
  • End-of-life runtime: .NET net6.0 src/Microsoft.PackageManagement.Search.Web/Microsoft.PackageManagement.Search.Web.csproj:4 — src/Microsoft.PackageManagement.Search.Web/Microsoft.PackageManagement.Search.Web.csproj declares .NET net6.0 as this project's target framework, and .NET 6 LTS, support ended 2024-11-12. An unsupported runtime receives no security patches, so every vulnerability disclosed in it since 2024-11-12 is present and unfixable without moving off it. This is a migration rather than an upgrade: there is no newer release of a runtime that has ended.
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.
R1 · Type Safety · Type Safety · ×1
  • Type Safety — 0 typed · 46 plain JS — the untyped files are src/Bootstrap/js/affix.js, src/Bootstrap/js/alert.js, src/Bootstrap/js/button.js, src/Bootstrap/js/carousel.js, src/Bootstrap/js/collapse.js, src/Bootstrap/js/dropdown.js (+40 more).
R10 · Code Duplication · Duplicated block with local edits (149 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (149 matched lines × 2 locations) src/NuGetGallery/Scripts/gallery/page-api-keys.js:400 — src/NuGetGallery/Scripts/gallery/page-api-keys.js:400 · src/NuGetGallery/Scripts/gallery/page-trusted-publishing.js:663 — the two spans are one implementation copied and then locally edited — 938 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (54 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (54 matched lines × 2 locations) src/NuGetGallery/Scripts/gallery/page-api-keys.js:104 — src/NuGetGallery/Scripts/gallery/page-api-keys.js:104 · src/NuGetGallery/Scripts/gallery/page-trusted-publishing.js:421 — the two spans are one implementation copied and then locally edited — 459 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (39 lines × 2 locations) · ×1
  • Duplicated block (39 lines × 2 locations) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:1304 — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:1304 · src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:4456 — 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 with local edits (27 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (27 matched lines × 2 locations) src/NuGetGallery/Scripts/gallery/page-manage-sponsorship-links.js:32 — src/NuGetGallery/Scripts/gallery/page-manage-sponsorship-links.js:32 · src/NuGetGallery/Scripts/gallery/page-manage-sponsorship-links.js:79 — the two spans are one implementation copied and then locally edited — 144 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 (27 lines × 2 locations) · ×1
  • Duplicated block (27 lines × 2 locations) src/NuGetGallery/Scripts/gallery/page-trusted-publishing.js:140 — src/NuGetGallery/Scripts/gallery/page-trusted-publishing.js:140 · src/NuGetGallery/Scripts/gallery/page-trusted-publishing.js:311 — 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 (26 lines × 2 locations) · ×1
  • Duplicated block (26 lines × 2 locations) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:12323 — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:12323 · src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:12360 — 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 (25 lines × 2 locations) · ×1
  • Duplicated block (25 lines × 2 locations) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:1267 — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:1267 · src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:4417 — 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) src/NuGetGallery/Scripts/gallery/page-trusted-publishing.js:181 — src/NuGetGallery/Scripts/gallery/page-trusted-publishing.js:181 · src/NuGetGallery/Scripts/gallery/page-trusted-publishing.js:350 — 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 (20 lines × 2 locations) · ×1
  • Duplicated block (20 lines × 2 locations) src/Bootstrap/js/popover.js:90 — src/Bootstrap/js/popover.js:90 · src/Bootstrap/js/tooltip.js:653 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (18 lines × 2 locations) · ×1
  • Duplicated block (18 lines × 2 locations) src/NuGetGallery/Scripts/gallery/page-api-keys.js:376 — src/NuGetGallery/Scripts/gallery/page-api-keys.js:376 · src/NuGetGallery/Scripts/gallery/page-trusted-publishing.js:643 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
R10 · Code Duplication · Duplicated block (17 lines × 2 locations) · ×1
  • Duplicated block (17 lines × 2 locations) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:1723 — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:1723 · src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:1908 — 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) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:11961 — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:11961 · src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:11986 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (16 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (16 matched lines × 2 locations) src/NuGetGallery/Scripts/gallery/page-manage-owners.js:111 — src/NuGetGallery/Scripts/gallery/page-manage-owners.js:111 · src/NuGetGallery/Scripts/gallery/page-manage-owners.js:151 — the two spans are one implementation copied and then locally edited — 65 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 (13 lines × 4 locations) · ×1
  • Duplicated block (13 lines × 4 locations) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:10489 — src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:10489 · src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:10645 · src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:10699 · src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:11375 — 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.
R10 · Code Duplication · Duplicated block (13 lines × 2 locations) · ×1
  • Duplicated block (13 lines × 2 locations) src/NuGetGallery/Scripts/gallery/page-manage-packages.js:311 — src/NuGetGallery/Scripts/gallery/page-manage-packages.js:311 · src/NuGetGallery/Scripts/gallery/page-manage-packages.js:389 — 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 (11 lines × 7 locations) · ×1
  • Duplicated block (11 lines × 7 locations) src/Bootstrap/js/affix.js:128 — src/Bootstrap/js/affix.js:128 · src/Bootstrap/js/alert.js:71 · src/Bootstrap/js/button.js:87 · src/Bootstrap/js/collapse.js:191 · +3 more site(s) not listed — the 7 copies are spread across 7 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R2 · Cyclomatic Complexity · Complex function _generateHTML (cyclomatic 87, cognitive 206) · ×1
  • Complex function _generateHTML (cyclomatic 87, cognitive 206) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:9184 — _generateHTML has cyclomatic complexity 87 and cognitive complexity 206; 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 _doKeyDown (cyclomatic 45, cognitive 76) · ×1
  • Complex function _doKeyDown (cyclomatic 45, cognitive 76) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:8148 — _doKeyDown has cyclomatic complexity 45 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 parseDate (cyclomatic 42, cognitive 49) · ×1
  • Complex function parseDate (cyclomatic 42, cognitive 49) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:8672 — parseDate has cyclomatic complexity 42 and cognitive complexity 49; 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 _mouseDrag (cyclomatic 33, cognitive 54) · ×1
  • Complex function _mouseDrag (cyclomatic 33, cognitive 54) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:3784 — _mouseDrag has cyclomatic complexity 33 and cognitive complexity 54; 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 drag (cyclomatic 33, cognitive 43) · ×1
  • Complex function drag (cyclomatic 33, cognitive 43) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:1819 — drag has cyclomatic complexity 33 and cognitive complexity 43; 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 intersect (cyclomatic 30, cognitive 18) · ×1
  • Complex function intersect (cyclomatic 30, cognitive 18) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:2106 — intersect has cyclomatic complexity 30 and cognitive complexity 18; 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 _clear (cyclomatic 29, cognitive 40) · ×1
  • Complex function _clear (cyclomatic 29, cognitive 40) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:4646 — _clear has cyclomatic complexity 29 and cognitive complexity 40; 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 _respectSize (cyclomatic 29, cognitive 20) · ×1
  • Complex function _respectSize (cyclomatic 29, cognitive 20) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:2762 — _respectSize has cyclomatic complexity 29 and cognitive complexity 20; 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 _generateMonthYearHeader (cyclomatic 27, cognitive 46) · ×1
  • Complex function _generateMonthYearHeader (cyclomatic 27, cognitive 46) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:9368 — _generateMonthYearHeader has cyclomatic complexity 27 and cognitive complexity 46; 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 formatDate (cyclomatic 27, cognitive 42) · ×1
  • Complex function formatDate (cyclomatic 27, cognitive 42) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:8880 — formatDate has cyclomatic complexity 27 and cognitive complexity 42; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function _generatePosition (cyclomatic 26, cognitive 47) · ×1
  • Complex function _generatePosition (cyclomatic 26, cognitive 47) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:4559 — _generatePosition has cyclomatic complexity 26 and cognitive complexity 47; 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 _generatePosition (cyclomatic 25, cognitive 53) · ×1
  • Complex function _generatePosition (cyclomatic 25, cognitive 53) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:1441 — _generatePosition has cyclomatic complexity 25 and cognitive complexity 53; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function _contactContainers (cyclomatic 25, cognitive 52) · ×1
  • Complex function _contactContainers (cyclomatic 25, cognitive 52) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:4299 — _contactContainers has cyclomatic complexity 25 and cognitive complexity 52; 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 size (cyclomatic 25, cognitive 30) · ×1
  • Complex function size (cyclomatic 25, cognitive 30) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:11064 — size has cyclomatic complexity 25 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 24, cognitive 32) · ×1
  • Complex function (anonymous) (cyclomatic 24, cognitive 32) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:3395 — (anonymous) has cyclomatic complexity 24 and cognitive complexity 32; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 23, cognitive 36) · ×1
  • Complex function (anonymous) (cyclomatic 23, cognitive 36) src/NuGetGallery/Scripts/gallery/page-display-package.js:1 — (anonymous) has cyclomatic complexity 23 and cognitive complexity 36; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function keydown (cyclomatic 23, cognitive 14) · ×1
  • Complex function keydown (cyclomatic 23, cognitive 14) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:13227 — keydown has cyclomatic complexity 23 and cognitive complexity 14; 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 drag (cyclomatic 22, cognitive 33) · ×1
  • Complex function drag (cyclomatic 22, cognitive 33) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:1749 — drag has cyclomatic complexity 22 and cognitive complexity 33; 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 resize (cyclomatic 22, cognitive 31) · ×1
  • Complex function resize (cyclomatic 22, cognitive 31) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:3010 — resize has cyclomatic complexity 22 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function _showDatepicker (cyclomatic 22, cognitive 27) · ×1
  • Complex function _showDatepicker (cyclomatic 22, cognitive 27) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:8285 — _showDatepicker has cyclomatic complexity 22 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function bounce (cyclomatic 22, cognitive 26) · ×1
  • Complex function bounce (cyclomatic 22, cognitive 26) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:10504 — bounce has cyclomatic complexity 22 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function _keydown (cyclomatic 22, cognitive 21) · ×1
  • Complex function _keydown (cyclomatic 22, cognitive 21) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:11582 — _keydown has cyclomatic complexity 22 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 show (cyclomatic 21, cognitive 35) · ×1
  • Complex function show (cyclomatic 21, cognitive 35) src/Bootstrap/js/tooltip.js:318 — show has cyclomatic complexity 21 and cognitive complexity 35; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function _setOption (cyclomatic 20, cognitive 24) · ×1
  • Complex function _setOption (cyclomatic 20, cognitive 24) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:10180 — _setOption has cyclomatic complexity 20 and cognitive complexity 24; 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 _refreshValue (cyclomatic 19, cognitive 34) · ×1
  • Complex function _refreshValue (cyclomatic 19, cognitive 34) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:13169 — _refreshValue has cyclomatic complexity 19 and cognitive complexity 34; 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 _setContainment (cyclomatic 19, cognitive 18) · ×1
  • Complex function _setContainment (cyclomatic 19, cognitive 18) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:1353 — _setContainment has cyclomatic complexity 19 and cognitive complexity 18; 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 _optionDatepicker (cyclomatic 18, cognitive 25) · ×1
  • Complex function _optionDatepicker (cyclomatic 18, cognitive 25) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:8059 — _optionDatepicker has cyclomatic complexity 18 and cognitive complexity 25; 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 _setContainment (cyclomatic 18, cognitive 21) · ×1
  • Complex function _setContainment (cyclomatic 18, cognitive 21) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:4502 — _setContainment has cyclomatic complexity 18 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function _mouseStart (cyclomatic 18, cognitive 20) · ×1
  • Complex function _mouseStart (cyclomatic 18, cognitive 20) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:3650 — _mouseStart has cyclomatic complexity 18 and cognitive complexity 20; 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 _hideDatepicker (cyclomatic 17, cognitive 33) · ×1
  • Complex function _hideDatepicker (cyclomatic 17, cognitive 33) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:8450 — _hideDatepicker has cyclomatic complexity 17 and cognitive complexity 33; 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 canElementBeFocused (cyclomatic 17, cognitive 17) · ×1
  • Complex function canElementBeFocused (cyclomatic 17, cognitive 17) REDACTED:251 — canElementBeFocused has cyclomatic complexity 17 and cognitive complexity 17; 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 (anonymous) (cyclomatic 17, cognitive 17) · ×1
  • Complex function (anonymous) (cyclomatic 17, cognitive 17) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:2229 — (anonymous) has cyclomatic complexity 17 and cognitive complexity 17; 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 _eventHandler (cyclomatic 17, cognitive 15) · ×1
  • Complex function _eventHandler (cyclomatic 17, cognitive 15) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:14306 — _eventHandler has cyclomatic complexity 17 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function set (cyclomatic 16, cognitive 24) · ×1
  • Complex function set (cyclomatic 16, cognitive 24) src/NuGetGallery/Scripts/gallery/jquery-ui-1.10.3.js:5358 — set has cyclomatic complexity 16 and cognitive complexity 24; 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 clamp (cyclomatic 16, cognitive 18) · ×1
  • Complex function clamp (cyclomatic 16, cognitive 18) src/NuGetGallery/Scripts/gallery/clamp.js:29 — clamp has cyclomatic complexity 16 and cognitive complexity 18; 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 _UpdateData (cyclomatic 16, cognitive 16) · ×1
  • Complex function _UpdateData (cyclomatic 16, cognitive 16) src/NuGetGallery/Scripts/gallery/page-api-keys.js:73 — _UpdateData has cyclomatic complexity 16 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 · src/Bootstrap/js/tooltip.js · ×1
  • src/Bootstrap/js/tooltip.js: 540 lines of code src/Bootstrap/js/tooltip.js:1 — src/Bootstrap/js/tooltip.js has 540 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R4 · Test Coverage · Test Coverage · ×1
  • Test Coverage — 0% of 46 production file(s) reachable from 0 test file(s) via the import graph — 'production' here is the RESIDUE: every source file left once tests, tooling, generated output, config, declarations and declaration-only modules, fixture corpora, type fixtures, behaviour-free data modules, re-export barrels, registration/constant data modules and service workers are set aside, so the percentage is taken over a smaller denominator than the workspace's file count
R6 · Tooling · No lint script · ×1
  • No lint script — test ✓ · lint ✗ · typecheck ✓ — read from this repository's package.json scripts and corroborated against its CI workflows. A script counts when its name or command matches the step: `test` for the suite, `lint` or `prettier` for linting, `typecheck`/`type-check`/`tsc` for type checking. ✗ therefore means no script or CI step under those names was found, NOT that the step is absent from your pipeline — a task invoked by a runner this check does not read, or named something else entirely, is not seen and is worth confirming before acting on a cross. A ✓ means the wiring is DECLARED — a script or CI step under those names exists. It is not a statement that the step passes, or that it runs at all: nothing here installs a dependency or executes a suite.
R7 · Dead Code · Dead file (~32 LoC) · ×1
  • Dead file (~32 LoC) src/Bootstrap/package.js — no import path from any entry point (45 application, 1 tooling, 0 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 · Unused dependency '@lodder/grunt-postcss' · ×1
  • Unused dependency '@lodder/grunt-postcss' src/Bootstrap/package.json:28 — Declared in src/Bootstrap/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 'btoa' · ×1
  • Unused dependency 'btoa' src/Bootstrap/package.json:30 — Declared in src/Bootstrap/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 'glob' · ×1
  • Unused dependency 'glob' src/Bootstrap/package.json:32 — Declared in src/Bootstrap/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 'grunt-contrib-clean' · ×1
  • Unused dependency 'grunt-contrib-clean' src/Bootstrap/package.json:34 — Declared in src/Bootstrap/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 'grunt-contrib-concat' · ×1
  • Unused dependency 'grunt-contrib-concat' src/Bootstrap/package.json:35 — Declared in src/Bootstrap/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 'grunt-contrib-copy' · ×1
  • Unused dependency 'grunt-contrib-copy' src/Bootstrap/package.json:36 — Declared in src/Bootstrap/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 'grunt-contrib-cssmin' · ×1
  • Unused dependency 'grunt-contrib-cssmin' src/Bootstrap/package.json:37 — Declared in src/Bootstrap/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 'grunt-contrib-less' · ×1
  • Unused dependency 'grunt-contrib-less' src/Bootstrap/package.json:38 — Declared in src/Bootstrap/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 'grunt-contrib-uglify' · ×1
  • Unused dependency 'grunt-contrib-uglify' src/Bootstrap/package.json:39 — Declared in src/Bootstrap/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 'grunt-contrib-watch' · ×1
  • Unused dependency 'grunt-contrib-watch' src/Bootstrap/package.json:40 — Declared in src/Bootstrap/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 'grunt-exec' · ×1
  • Unused dependency 'grunt-exec' src/Bootstrap/package.json:41 — Declared in src/Bootstrap/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 'ip' · ×1
  • Unused dependency 'ip' src/Bootstrap/package.json:42 — Declared in src/Bootstrap/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 'lodash' · ×1
  • Unused dependency 'lodash' src/Bootstrap/package.json:44 — Declared in src/Bootstrap/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 'minimist' · ×1
  • Unused dependency 'minimist' src/Bootstrap/package.json:45 — Declared in src/Bootstrap/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.
S1 · Web-Security Posture · Obsolete TLS/SSL protocol version enabled · ×1
  • Obsolete TLS/SSL protocol version enabled src/NuGetGallery/App_Start/OwinStartup.cs:48 — `SecurityProtocol` explicitly selects `SecurityProtocolType.Ssl3`, a protocol version that is broken (SSL 2.0/3.0) or withdrawn (TLS 1.0/1.1, RFC 8996). Offering an obsolete version does not merely permit it — it is what a downgrade attack negotiates, so the weakest version on the list is the one that decides the connection's strength. Stop pinning versions here: leave the protocol unset (`SecurityProtocolType.SystemDefault`, or simply do not assign it) so the connection uses the OS policy and picks up TLS 1.3 and future versions without a code change. Where a version must be named explicitly, name `Tls12` and `Tls13` only.
S1 · Web-Security Posture · Password hash compared with `==` · ×1
  • Password hash compared with `==` src/NuGetGallery.Services/Authentication/ApiKeyV3.cs:68 — Password-hash field compared with `==` — use a constant-time compare to avoid timing oracles (CryptographicOperations.FixedTimeEquals).
S1 · Web-Security Posture · Weak hash algorithm · ×1
  • Weak hash algorithm src/NuGetGallery.Core/Certificates/CertificateFile.cs:69 — MD5/SHA1 is constructed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ for content integrity, or a KDF (PBKDF2/Argon2/BCrypt) for password storage. If it only derives a non-security identifier (a cache key, a file or mutex name), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as `System.IO.Hashing.XxHash64`/`Crc32` says it in code — since the algorithm alone cannot distinguish the two uses.
S1 · Web-Security Posture · Third-party script without Subresource Integrity · ×1
  • Third-party script without Subresource Integrity REDACTED:342 — `https://wcpstatic.microsoft.com/mscc/lib/v2/wcp-consent.js` is executed by this page with no Subresource Integrity. Whoever can answer that request — the CDN, anyone who compromises it, anyone on the network path — runs arbitrary script in this page's origin, with its session. The URL also names no version, so it resolves to whatever that origin serves at fetch time — the executed bytes can change with nobody touching this repository. 2 such include(s) across the repository's markup.
S1 · Web-Security Posture · Token validation disabled · ×1
  • Token validation disabled src/NuGetGallery.Services/Authentication/Providers/AzureActiveDirectoryV2/AzureActiveDirectoryV2Authenticator.cs:103 — `ValidateIssuer = false` means a token from a different issuer is accepted, provided its signing key chains — the identity provider is no longer pinned.
X1 · Async correctness · Blocking `Thread.Sleep` inside an `async` method · ×1
  • Blocking `Thread.Sleep` inside an `async` method src/Ng/Jobs/Db2CatalogJob.cs:219 — `Thread.Sleep` parks the thread for the whole delay: no other work runs on it, and under load the pool must grow to make up for it. `await Task.Delay(…)` suspends only this method.
X13 · Undrained process stream · Redirected process stream is never drained (deadlock) · ×1
  • Redirected process stream is never drained (deadlock) src/CopyAzureContainer/CopyAzureContainerJob.cs:152 — `RedirectStandardOutput` is set here, but `StandardOutput` is not being read when the code waits for the child to exit — it is never read, read only later, or read only in part. The child blocks as soon as it fills the StandardOutput pipe (~4 KB, never more than 64 KB), so it never finishes and never exits, and the read or wait above never returns: a `WaitForExit` timeout after a read does not help: the timeout bounds the WAIT, not the read that precedes it. Drain every redirected stream before blocking on the child — read one on a background thread (`BeginOutputReadLine()` with its `DataReceived` handler, or a `Task` running `ReadToEndAsync()` started before the other read and awaited after it) — or stop redirecting the stream you do not consume.
X14 · Bypassable address classification · IP classification is bypassable through an IPv4-in-IPv6 embedding · ×1
  • IP classification is bypassable through an IPv4-in-IPv6 embedding src/Catalog/Icons/PublicExternalIconUrlPolicy.cs:157 — This method unwraps IPv4-MAPPED IPv6 (`IsIPv4MappedToIPv6`, line 165) and rejects `10.0.0.0/8` on its IPv4 path, and it handles some IPv4-in-IPv6 embeddings — but not IPv4-compatible (`::a.b.c.d`) and 6to4 (`2002::/16`): either it never names it, or it names it and returns the verdict its IPv4 path gives public space. So `::10.0.0.1`, `2002:0a00:0001::` name a host inside `10.0.0.0/8`, the range this same method declares non-public, and reach the IPv6 branch at line 157 with the opposite verdict. Unwrap every embedding to its IPv4 form before classifying, or reject any IPv6 address carrying an embedded IPv4 outright.
X17 · Uncapped recursion over a caller-supplied document · Recursive walk over a caller-supplied document has no depth cap · ×1
  • Recursive walk over a caller-supplied document has no depth cap src/Catalog/Helpers/Utils.cs:103 — `CreateNuspecGraph` is public, takes a document from its caller (line 274) and hands it to `NormalizeXml`, which calls itself at line 103 with a child of the node it was given — and nowhere in `NormalizeXml` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the tree it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. A document nested past the stack that remains raises `StackOverflowException`, which .NET neither lets you catch nor unwinds: the process is torn down where it stands, taking every other request in flight with it, and no `try`/`catch` around `CreateNuspecGraph` can intervene. Thread a depth argument through `NormalizeXml` and reject the document past a fixed maximum, or rewrite the descent with an explicit stack.
X22 · Contradicted release guard · Primitive released twice · ×1
  • Primitive released twice src/Catalog/StringInterner.cs:34 — `_lock.ExitWriteLock()` gives `_lock` back here, and the `finally` gives it back again with `_lock.ExitUpgradeableReadLock()` on the same path — one acquire, two releases. On a semaphore the second raises the count past what was taken (or throws `SemaphoreFullException`), so a caller is admitted that the limit was there to keep out; on a lock it throws from the `finally`. Release once, in the `finally`.
Minor — 247 finding(s)
D24 · Comment Value · redundant comment · ×95
  • redundant comment src/Catalog/Dnx/DnxConstants.cs:21 — "Default Cache Control of Package Version Index (at Storage)" repeats the code it sits on: 6 of its 7 words (default, cache, control, package, version, index) are already in `public const string DefaultCacheControlOfPackageVersionIndex = "max-age=10";`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/Catalog/Dnx/DnxConstants.cs:24 — "Cache Duration of Package Version Index (at CDN)" repeats the code it sits on: 5 of its 6 words (cache, duration, package, version, index) are already in `public static readonly TimeSpan CacheDurationOfPackageVersionIndex = TimeSpan.FromSeconds(60);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/Catalog/Dnx/DnxConstants.cs:31 — "MinIntervalBeforeToReadUpdateOfFrontCursor >= CacheDurationOfPackageVersionIndex + 1 second" repeats the code it sits on: 12 of its 12 words (min, interval, read, update, front, cursor, cache, duration, package, version, index, second) are already in `public static readonly TimeSpan MinIntervalBeforeToReadUpdateOfFrontCursor = CacheDurationOfPackageVersionIndex + TimeSp …`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/Catalog/Helpers/Utils.cs:401 — "where the property exists on the graph being merged in remove it from the existing graph" repeats the code it sits on: 5 of its 6 words (property, exists, graph, remove, existing) are already in `public static void RemoveExistingProperties(IGraph existingGraph, IGraph graphToMerge, Uri[] properties)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/Catalog/HttpReadCursorWithUpdates.cs:55 — "If the cursor value was updated before or at storageDateTimeInUtc - minIntervalBeforeToReadUpdate, use the cursor value and there is no need to check the update …" repeats the code it sits on: 13 of its 16 words (cursor, value, updated, storage, date, time, utc, min, interval, read, update, check, updates) are already in `if (cursorValueWithUpdates.TimeStamp.HasValue && cursorValueWithUpdates.TimeStamp.Value <= storageDateTimeInUtc - minInt …`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/Catalog/PackageCatalogItem.cs:117 — "assert reasons to deprecation root node" repeats the code it sits on: 4 of its 5 words (reasons, deprecation, root, node) are already in `var deprecationReasonRootNode = graph.CreateUriNode(Schema.Predicates.Reasons);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/Catalog/Persistence/AzureStorage.cs:240 — "Start the copy operation" repeats the code it sits on: 3 of its 3 words (start, copy, operation) are already in `CopyFromUriOperation copyOperation = await destinationBlockBlob.StartCopyFromUriAsync(sourceBlockBlob.Uri, cancellationT …`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/GalleryTools/Commands/SeedFunctionalTestsCommand.cs:114 — "Org API keys: credential on testAccount, scoped to the org" repeats the code it sits on: 6 of its 7 words (org, api, keys, test, account, scoped) are already in `var testDataOrgApiKey = ops.CreateApiKey(testAccount, "CI TestData Org Push", scopeActions: new[] { NuGetScopes.PackageP …`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/Ng/Jobs/Db2CatalogJob.cs:357 — "Clear current segment" repeats the code it sits on: 3 of its 3 words (clear, current, segment) are already in `currentSegment.Clear();`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/Ng/Jobs/LightningJob.cs:311 — "Write command files" repeats the code it sits on: 3 of its 3 words (write, command, files) are already in `_log.WriteLine("Start preparing lightning reindex command files...");`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/Ng/Jobs/MonitoringProcessorJob.cs:292 — "Validations failed to run! Save this failed status to storage." repeats the code it sits on: 5 of its 6 words (validations, failed, run, save, status) are already in `await SaveFailedPackageMonitoringStatusAsync(queuedContext, validationFailedToRunException, token);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/Ng/Jobs/MonitoringProcessorJob.cs:345 — "A newer catalog entry of this package has already been validated." repeats the code it sits on: 5 of its 6 words (newer, catalog, entry, package, already) are already in `Logger.LogInformation("A newer catalog entry of {PackageId} {PackageVersion} has already been processed ({OldCommitTimeS …`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/NuGet.Jobs.Common/JobRunner.cs:150 — "Run the job loop" repeats the code it sits on: 3 of its 3 words (run, job, loop) are already in `exitCode = await JobLoop(job, runContinuously.Value, sleepDuration.Value, reinitializeAfterSeconds, jobArgsDictionary);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/NuGet.Jobs.GitHubIndexer/FetchedRepo.cs:43 — "Add the origin remote" repeats the code it sits on: 3 of its 3 words (add, origin, remote) are already in `_repo.Network.Remotes.Add("origin", _repoInfo.Url);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/NuGet.Services.AzureSearch/Auxiliary2AzureSearch/UpdateDownloadsCommand.cs:139 — "The "new" data is the latest popularity transfers data from the database." repeats the code it sits on: 5 of its 6 words (new, data, popularity, transfers, database) are already in `_logger.LogInformation("Fetching new popularity transfer data from database.");`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/NuGet.Services.AzureSearch/Db2AzureSearch/Db2AzureSearchCommand.cs:97 — "Write the verified packages data file." repeats the code it sits on: 4 of its 5 words (write, verified, packages, data) are already in `await WriteVerifiedPackagesDataAsync(initialAuxiliaryData.VerifiedPackages);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/NuGet.Services.AzureSearch/Db2AzureSearch/Db2AzureSearchCommand.cs:100 — "Write popularity transfers data file." repeats the code it sits on: 4 of its 5 words (write, popularity, transfers, data) are already in `await WritePopularityTransfersDataAsync(initialAuxiliaryData.PopularityTransfers);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/NuGet.Services.Metadata.Catalog.Monitoring/Resources/PackageRegistrationMetadataResourceV3.cs:61 — "If the registration index is missing, this will return null." repeats the code it sits on: 4 of its 5 words (registration, index, return, null) are already in `return _registration.GetPackageMetadata(package, NullSourceCacheContext.Instance, log, token);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/NuGet.Services.Metadata.Catalog.Monitoring/Utility/ContainerBuilderExtensions.cs:123 — "Flat-container validators" repeats the code it sits on: 3 of its 3 words (flat, container, validators) are already in `builder.RegisterValidator<FlatContainerEndpoint, PackageIsRepositorySignedValidator>();`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/NuGet.Services.Revalidate/Initialization/InitializationManager.cs:220 — "Insert each version of the package in descending order of the versions." repeats the code it sits on: 5 of its 6 words (version, package, descending, order, versions) are already in `var packageVersions = versions[packageRegistration.Key].OrderByDescending(v => v);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/NuGet.Services.Status/ActivePassiveComponent.cs:58 — "If any component is degraded, the status is degraded." repeats the code it sits on: 3 of its 3 words (component, degraded, status) are already in `if (subComponent.Status == ComponentStatus.Degraded)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/NuGet.Services.Storage/AzureStorage.cs:258 — "Start the copy operation" repeats the code it sits on: 3 of its 3 words (start, copy, operation) are already in `CopyFromUriOperation copyOperation = await destinationBlockBlob.StartCopyFromUriAsync(sourceBlockBlob.Uri, cancellationT …`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/NuGet.Services.Storage/AzureStorage.cs:439 — "Returns the primary blob service URI from the connection string" repeats the code it sits on: 7 of its 7 words (returns, primary, blob, service, uri, connection, string) are already in `public static Uri GetPrimaryServiceUri(string storageConnectionString)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/NuGet.Services.Validation.Orchestrator/BaseValidationMessageHandler.cs:324 — "Get the validation set by validation tracking ID" repeats the code it sits on: 5 of its 5 words (get, validation, set, tracking, id) are already in `var validationSet = await _validationStorageService.GetValidationSetAsync(message.ValidationTrackingId);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment REDACTED:56 — "Get unresolved issues" repeats the code it sits on: 3 of its 3 words (get, unresolved, issues) are already in `var query = SqlQuery.GetUnresolvedIssues;`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • + 70 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×40
  • Duplicated predicate src/NuGetGallery.Core/Infrastructure/Mail/Messages/StagingExpirationMessage.cs:109 — `!Uri.TryCreate(url, UriKind.Absolute, out var parsed) || (parsed.Scheme != Uri.UriSchemeHttp && parsed.Scheme != Uri.UriSchemeHttps)` appears character-identically in 2 files — src/NuGetGallery.Core/Infrastructure/Mail/Messages/StagingExpirationMessage.cs, src/NuGetGallery.Core/Services/StagingPromotionNotificationService.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/NuGetGallery/Queries/AutocompleteDatabasePackageIdsQuery.cs:35 — `!includePrerelease.HasValue || !includePrerelease.Value` appears character-identically in 2 files — src/NuGetGallery/Queries/AutocompleteDatabasePackageIdsQuery.cs, src/NuGetGallery/Queries/AutocompleteDatabasePackageVersionsQuery.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/NuGetGallery/Areas/Admin/Models/AdminSoftDeletePackageRequest.cs:59 — `!string.IsNullOrWhiteSpace(Version) && !NuGetVersion.TryParse(Version, out _)` appears character-identically in 4 files — src/NuGetGallery/Areas/Admin/Models/AdminReflowPackageRequest.cs, src/NuGetGallery/Areas/Admin/Models/AdminRevalidatePackageRequest.cs, src/NuGetGallery/Areas/Admin/Models/AdminSoftDeletePackageRequest.cs, src/NuGetGallery/Areas/Admin/Models/AdminUpdateListedPackageRequest.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/NuGetGallery/Areas/Admin/Controllers/FederatedCredentialsController.cs:215 — `!string.IsNullOrWhiteSpace(s) && NuGetScopes.ListOfScopes.Contains(s, StringComparer.Ordinal)` appears character-identically in 2 files — src/NuGetGallery.Services/Authentication/Federated/FederatedCredentialService.cs, src/NuGetGallery/Areas/Admin/Controllers/FederatedCredentialsController.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/NuGetGallery/Areas/Admin/DynamicData/FieldTemplates/Enumeration_Edit.ascx.cs:18 — `Mode == DataBoundControlMode.Insert || !Column.IsRequired` appears character-identically in 2 files — src/NuGetGallery/Areas/Admin/DynamicData/FieldTemplates/Enumeration_Edit.ascx.cs, src/NuGetGallery/Areas/Admin/DynamicData/FieldTemplates/ForeignKey_Edit.ascx.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/NuGetGallery/Infrastructure/Mail/Messages/ReportAbuseMessage.cs:48 — `Request.RequestingUser != null && Request.RequestingUserUrl != null` appears character-identically in 2 files — src/NuGetGallery/Infrastructure/Mail/Messages/ReportAbuseMessage.cs, src/NuGetGallery/Infrastructure/Mail/Messages/ReportMyPackageMessage.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:667 — `User.WasMultiFactorAuthenticated() || User.WasAzureActiveDirectoryAccountUsedForSignin()` appears character-identically in 3 files — REDACTED, REDACTED, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/NuGetGallery/Services/PackageMetadataValidationService.cs:147 — `_featureFlagService.IsInvalidPackageIdAllowedForAllPackages() || (_featureFlagService.IsInvalidPackageIdAllowedForExistingPackages() && _pac…` appears character-identically in 3 files — REDACTED, src/NuGetGallery/Services/PackageMetadataValidationService.cs, src/NuGetGallery/Services/PackageStagingUploadService.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/NuGet.Jobs.Catalog2Registration/Catalog2RegistrationCommand.cs:56 — `_options.Value.DependencyCursorUrls != null && _options.Value.DependencyCursorUrls.Any()` appears character-identically in 2 files — src/NuGet.Jobs.Catalog2Registration/Catalog2RegistrationCommand.cs, src/NuGet.Services.AzureSearch/Catalog2AzureSearch/Catalog2AzureSearchCommand.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:107 — `account == null || ActionsRequiringPermissions.ManageAccount.CheckPermissions(GetCurrentUser(), account) != PermissionsCheckResult.Allowed` appears character-identically in 2 files — REDACTED, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/NuGetGallery/OData/Conventions/EntitySetPropertyRoutingConvention.cs:48 — `actionMap.Contains(actionName) && actionMap[actionName].Any(desc => MatchHttpMethod(desc, controllerContext.Request.Method))` appears character-identically in 2 files — src/NuGetGallery/OData/Conventions/ActionCountRoutingConvention.cs, src/NuGetGallery/OData/Conventions/EntitySetPropertyRoutingConvention.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/NuGetGallery.Core/Auditing/UserAuditRecord.cs:114 — `affectedPolicies == null || affectedPolicies.Count() == 0` appears character-identically in 2 files — src/NuGetGallery.Core/Auditing/UserAuditRecord.cs, src/NuGetGallery.Core/Auditing/UserSecurityPolicyAuditRecord.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/NuGet.Services.Validation.Orchestrator/Configuration/SymbolPromotionValidationConfiguration.cs:50 — `attempt.Status != StagedPackageStatus.Promoting || !identity.StagingGroupKey.HasValue || identity.StagingGroup?.ActivePromotionId == attempt…` appears character-identically in 2 files — src/NuGet.Services.Validation.Orchestrator/Configuration/SymbolPromotionValidationConfiguration.cs, src/NuGet.Services.Validation.Orchestrator/StagedSymbolPackageValidationSetProvider.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/NuGet.Services.Validation.Orchestrator/PackageSigning/ValidateCertificate/PackageCertificatesValidator.cs:293 — `certificate.StatusUpdateTime.HasValue && certificate.StatusUpdateTime > time` appears character-identically in 2 files — src/NuGet.Services.Validation.Orchestrator/PackageSigning/ValidateCertificate/PackageCertificatesValidator.cs, src/Validation.PackageSigning.Core/Extensions/PackageSignatureExtensions.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/Validation.PackageSigning.ProcessSignature/SignatureValidationMessageHandler.cs:166 — `completed && _featureFlagService.IsQueueBackEnabled()` appears character-identically in 2 files — src/Validation.PackageSigning.ProcessSignature/SignatureValidationMessageHandler.cs, src/Validation.Symbols/SymbolsValidatorMessageHandler.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/NuGetGallery/Areas/Admin/DynamicData/PageTemplates/Details.aspx.cs:33 — `e.Exception == null || e.ExceptionHandled` appears character-identically in 3 files — src/NuGetGallery/Areas/Admin/DynamicData/PageTemplates/Details.aspx.cs, src/NuGetGallery/Areas/Admin/DynamicData/PageTemplates/Edit.aspx.cs, src/NuGetGallery/Areas/Admin/DynamicData/PageTemplates/Insert.aspx.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/NuGetGallery/Services/SymbolPackageUploadService.cs:115 — `ex is InvalidPackageException || ex is InvalidDataException || ex is EntityException` appears character-identically in 3 files — REDACTED, REDACTED, src/NuGetGallery/Services/SymbolPackageUploadService.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/NuGetGallery/Services/SymbolPackageUploadService.cs:127 — `ex is InvalidPackageException || ex is InvalidDataException || ex is EntityException || ex is FrameworkException` appears character-identically in 2 files — REDACTED, src/NuGetGallery/Services/SymbolPackageUploadService.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/NuGetGallery/Areas/Admin/DynamicData/EntityTemplates/Default_Edit.ascx.cs:29 — `ftuc != null && ftuc.DataControl != null` appears character-identically in 2 files — src/NuGetGallery/Areas/Admin/DynamicData/EntityTemplates/Default_Edit.ascx.cs, src/NuGetGallery/Areas/Admin/DynamicData/EntityTemplates/Default_Insert.ascx.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/NuGetGallery/Areas/Admin/DynamicData/PageTemplates/ListDetails.aspx.cs:62 — `fuc != null && fuc.FilterControl != null` appears character-identically in 2 files — src/NuGetGallery/Areas/Admin/DynamicData/PageTemplates/List.aspx.cs, src/NuGetGallery/Areas/Admin/DynamicData/PageTemplates/ListDetails.aspx.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/NuGetGallery/Services/PackageStagingUploadService.cs:112 — `groupId != null && string.IsNullOrWhiteSpace(groupId)` appears character-identically in 2 files — src/NuGetGallery/Services/PackageStagingUploadService.cs, src/NuGetGallery/Services/SymbolPackageStagingUploadService.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/NuGet.Jobs.Catalog2Registration/Hives/HiveUpdater.cs:167 — `hive == HiveType.Legacy || hive == HiveType.Gzipped` appears character-identically in 2 files — src/NuGet.Jobs.Catalog2Registration/Hives/HiveUpdater.cs, src/NuGet.Jobs.Catalog2Registration/Schema/EntityBuilder.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/NuGetGallery/ExtensionMethods.cs:368 — `identity == null || !identity.IsAuthenticated` appears character-identically in 2 files — src/NuGetGallery.Services/Extensions/ClaimsExtensions.cs, src/NuGetGallery/ExtensionMethods.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/Catalog/CatalogCommitUtilities.cs:284 — `item.CommitTimeStamp > front.Value && item.CommitTimeStamp <= back.Value` appears character-identically in 2 files — src/Catalog/CatalogCommitUtilities.cs, src/Catalog/CommitCollector.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate src/Bootstrap/js/dropdown.js:95 — `!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)` appears character-identically in 2 files — src/Bootstrap/js/dropdown.js, src/NuGetGallery/Scripts/gallery/bootstrap.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • + 15 more in this group — see findings.md.
X7 · Silent fallback defaults · Silent fallback default in catch · ×21
  • Silent fallback default in catch src/NuGetGallery/Areas/Admin/Helpers.cs:61 — `IsValidEmail` swallows `RegexMatchTimeoutException` into `return false;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
  • Silent fallback default in catch src/NuGetGallery/Services/ImageDomainValidator.cs:66 — `IsGitHubBadge` swallows `RegexMatchTimeoutException` into `return false;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
  • Silent fallback default in catch src/NuGetGallery/Services/PackageMetadataValidationService.cs:715 — `IsValidJsonObject` swallows `JsonReaderException` into `return false;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
  • Silent fallback default in catch src/NuGetGallery/Filters/ValidateRecaptchaResponseAttribute.cs:57 — `RecaptchaIsValid` swallows every exception into `return false;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
  • Silent fallback default in catch src/NuGetGallery/OData/SearchService/SearchHijacker.cs:100 — `CanProcessFilterClause` swallows `ODataException` into `return false;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
  • Silent fallback default in catch src/NuGetGallery/Services/JsonStatisticsService.cs:207 — `LoadDownloadPackages` swallows every exception into `return StatisticsReportResult.Failed;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
  • Silent fallback default in catch src/NuGetGallery.Core/Features/EditableFeatureFlagFileStorageService.cs:119 — `TrySaveInternalAsync` swallows `CloudBlobPreconditionFailedException` into `return ContentSaveResult.Conflict;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
  • Silent fallback default in catch src/NuGetGallery.Core/Login/EditableLoginConfigurationFileStorageService.cs:124 — `TrySaveInternalAsync` swallows `CloudBlobPreconditionFailedException` into `return ContentSaveResult.Conflict;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
  • Silent fallback default in catch src/NuGetGallery.Core/Services/CloudBlobWrapper.cs:455 — `FetchAttributesIfExistsAsync` swallows `CloudBlobGenericNotFoundException` into `return false;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
  • Silent fallback default in catch src/GalleryTools/Commands/ValidatePackageIdsCommand.cs:141 — `Execute` swallows every exception into `return 1;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
  • Silent fallback default in catch src/GalleryTools/Program.cs:38 — `Main` swallows every exception into `return 1;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
  • Silent fallback default in catch src/NuGetGallery.Services/Authentication/ApiKeyV4.cs:147 — `TryParseInternal` swallows `InvalidOperationException` into `return false;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
  • Silent fallback default in catch src/NuGetGallery.Services/Authentication/V3Hasher.cs:136 — `VerifyHashInternal` swallows every exception into `return false;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
  • Silent fallback default in catch src/Validation.Common.Job/Leases/CloudBlobLeaseService.cs:66 — `ReleaseAsync` swallows `RequestFailedException` into `return false;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
  • Silent fallback default in catch src/NuGet.Services.Logging/TelemetryInitializers/MachineNameTelemetryInitializer.cs:22 — `TryGetMachineName` swallows every exception into `return string.Empty;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
  • Silent fallback default in catch src/NuGet.Services.Storage/BlobLeaseService.cs:75 — `ReleaseAsync` swallows `RequestFailedException` into `return false;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
  • Silent fallback default in catch src/NuGet.Services.AzureSearch/IndexBuilder.cs:117 — `IndexExistsAsync` swallows `RequestFailedException` into `return false;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
  • Silent fallback default in catch src/Stats.AzureCdnLogs.Common/Collect/AzureStatsLogSource.cs:251 — `GetBlobAsync` swallows every exception into `return null;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
  • Silent fallback default in catch src/SplitLargeFiles/FileProperties.cs:77 — `DetectGzip` swallows `InvalidDataException` into `return false;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
  • Silent fallback default in catch src/UpdateBlobProperties/Updater.cs:91 — `UpdateAsync` swallows `RequestFailedException` into `return false;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
  • Silent fallback default in catch src/NuGetGallery.AppHost.Tools/BootstrapSearch.cs:69 — `IndexExistsAsync` swallows `RequestFailedException` into `return false;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
X4 · Structured logging · Interpolated log message defeats structured logging · ×17
  • Interpolated log message defeats structured logging src/NuGetGallery.Services/Authentication/Federated/FederatedCredentialPolicyEvaluator.cs:102 — Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
  • Interpolated log message defeats structured logging src/NuGet.Jobs.Common/Configuration/JobConfigurationManager.cs:138 — Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
  • Interpolated log message defeats structured logging src/NuGet.Jobs.Common/Extensions/LoggerExtensions.cs:40 — Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
  • Interpolated log message defeats structured logging src/NuGet.Jobs.Common/Extensions/LoggerExtensions.cs:47 — Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
  • Interpolated log message defeats structured logging src/NuGet.Jobs.Common/JobRunner.cs:97 — Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
  • Interpolated log message defeats structured logging src/Ng/Jobs/Catalog2DnxJob.cs:115 — Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
  • Interpolated log message defeats structured logging src/Ng/Jobs/Db2CatalogJob.cs:164 — Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
  • Interpolated log message defeats structured logging src/NuGet.Services.AzureSearch/Auxiliary2AzureSearch/DataSetComparer.cs:101 — Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
  • Interpolated log message defeats structured logging src/NuGet.Services.AzureSearch/Auxiliary2AzureSearch/DataSetComparer.cs:116 — Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
  • Interpolated log message defeats structured logging src/NuGet.Services.AzureSearch/Auxiliary2AzureSearch/DataSetComparer.cs:136 — Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
  • Interpolated log message defeats structured logging src/NuGet.Services.AzureSearch/Db2AzureSearch/NewPackageRegistrationFromDbProducer.cs:269 — Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
  • Interpolated log message defeats structured logging src/NuGet.Services.AzureSearch/Db2AzureSearch/NewPackageRegistrationFromDbProducer.cs:277 — Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
  • Interpolated log message defeats structured logging src/NuGet.Services.AzureSearch/Db2AzureSearch/PackageEntityIndexActionBuilder.cs:84 — Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
  • Interpolated log message defeats structured logging src/NuGet.Services.AzureSearch/Db2AzureSearch/PackageEntityIndexActionBuilder.cs:95 — Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
  • Interpolated log message defeats structured logging src/CopyAzureContainer/CopyAzureContainerJob.cs:161 — Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
  • Interpolated log message defeats structured logging src/Stats.CollectAzureChinaCDNLogs/Job.cs:123 — Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
  • Interpolated log message defeats structured logging src/NuGet.Services.Revalidate/Services/RevalidationThrottler.cs:75 — Logging an interpolated string (`$"..."`) collapses the event to plain text — you lose the named, queryable properties structured logging exists for. Use a message template with placeholders: `LogInformation("User {UserId} did {Action}", id, action)`. If these calls go through a logging wrapper that only accepts a pre-formatted string, give the wrapper a template+args overload that forwards to the underlying logger, then migrate call sites to it.
AX6 · Interface segregation · Fat interface · ×16
  • Fat interface: IPackageStagingManagementService (27 members) src/NuGetGallery/Services/IPackageStagingManagementService.cs:14 — `IPackageStagingManagementService` declares 27 members: `GetStagedPackagePage`, `GetStagedSymbolPackagePage`, `GetStagedPackage`, `GetStagedSymbolPackage`, `GetPackages`, `GetPackageStatus`, `GetStatus`, `IsEnabled`, `FindCurrentStagedPackage`, `OpenPackageContentAsync`, `UpdateListedAsync`, `DeletePackageAsync`, `GetStagedPackages`, `GetStagedPackages`, `GetStagingGroups`, `GetStagingGroups`, `FindStagingGroup`, `CreateStagingGroupAsync`, `RenameStagingGroupAsync`, `DeleteStagingGroupAsync`, `DeleteStagingGroupAsync`, `AddPackageToStagingGroupAsync`, `RemovePackageFromStagingGroupAsync`, `MovePackageIdentityAsync`, `GetStagingGroupSummaries`, `GetStagingGroupSummaryPage`, `GetStagingGroupPackagePage`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. Those 27 declarations carry 24 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 24 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: IStatisticsService (20 members) src/NuGetGallery/Services/IStatisticsService.cs:10 — `IStatisticsService` declares 20 members: `PackageDownloadsResult`, `PackageDownloads`, `PackageDownloadsSummary`, `PackageVersionDownloadsResult`, `PackageVersionDownloads`, `PackageVersionDownloadsSummary`, `CommunityPackageDownloadsResult`, `CommunityPackageDownloads`, `CommunityPackageDownloadsSummary`, `CommunityPackageVersionDownloadsResult`, `CommunityPackageVersionDownloads`, `CommunityPackageVersionDownloadsSummary`, `NuGetClientVersionResult`, `NuGetClientVersion`, `Last6WeeksResult`, `Last6Weeks`, `LastUpdatedUtc`, `Refresh`, `GetPackageDownloadsByVersion`, `GetPackageVersionDownloadsByClient`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: IEntitiesContext (23 members) src/NuGetGallery.Core/Entities/IEntitiesContext.cs:10 — `IEntitiesContext` declares 23 members: `Certificates`, `Deprecations`, `PackageRegistrations`, `PackageDependencies`, `PackageFrameworks`, `Credentials`, `Scopes`, `Users`, `UserSecurityPolicies`, `ReservedNamespaces`, `UserCertificates`, `SymbolPackages`, `StagedPackages`, `StagedSymbolPackages`, `StagedPackageIdentities`, `StagingGroups`, `Vulnerabilities`, `VulnerableRanges`, `PackageRenames`, `HasChanges`, `SaveChangesAsync`, `DeleteOnCommit`, `GetDatabase`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: ICoreFileStorageService (17 members) src/NuGetGallery.Core/Services/ICoreFileStorageService.cs:12 — `ICoreFileStorageService` declares 17 members under just 14 distinct name(s): `DeleteFileAsync`, `FileExistsAsync`, `GetFileAsync`, `GetFileReferenceAsync`, `GetPackageStreamMetadataAsync`, `GetFileUriAsync`, `GetFileReadUriAsync`, `GetPrivilegedFileUriAsync`, `GetPrivilegedFileUriWithDelegationSasAsync`, `SaveFileAsync`, `SaveFileAsync`, `SaveFileAsync`, `CopyFileAsync`, `CopyFileAsync`, `SetMetadataAsync`, `SetPropertiesAsync`, `GetETagOrNullAsync`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. That is an OVERLOAD SET, not 17 separate responsibilities: a caller binds to 14 operation(s) and uses the overload it selected, so the Interface-Segregation harm does NOT apply on the caller's side and splitting this into role-interfaces would scatter one operation without relieving anything. The burden that does remain is the IMPLEMENTER's — all 17 signatures must be written and kept in step. Reduce it by collapsing overloads (optional or default parameters, or an options object) rather than by segregating the interface.
  • Fat interface: ISimpleCloudBlob (28 members) src/NuGetGallery.Core/Services/ISimpleCloudBlob.cs:12 — `ISimpleCloudBlob` declares 28 members: `Properties`, `Metadata`, `CopyState`, `Uri`, `Name`, `LastModifiedUtc`, `ETag`, `IsSnapshot`, `OpenReadAsync`, `OpenWriteAsync`, `DeleteIfExistsAsync`, `DownloadToStreamAsync`, `DownloadToStreamAsync`, `ExistsAsync`, `SetPropertiesAsync`, `SetPropertiesAsync`, `SetMetadataAsync`, `UploadFromStreamAsync`, `UploadFromStreamAsync`, `FetchAttributesAsync`, `StartCopyAsync`, `GetSharedAccessSignature`, `GetDelegationSasAsync`, `OpenReadStreamAsync`, `SnapshotAsync`, `DownloadTextIfExistsAsync`, `FetchAttributesIfExistsAsync`, `OpenReadIfExistsAsync`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. Those 28 declarations carry 25 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 25 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: IFeatureFlagService (76 members) src/NuGetGallery.Services/Configuration/IFeatureFlagService.cs:9 — `IFeatureFlagService` declares 76 members: `IsAlternateStatisticsSourceEnabled`, `IsAsyncAccountDeleteEnabled`, `IsSelfServiceAccountDeleteEnabled`, `IsTyposquattingEnabled`, `IsTyposquattingEnabled`, `IsPackagesAtomFeedEnabled`, `IsPackagesAtomFeedCombinedAuthorsEnabled`, `IsManageDeprecationEnabled`, `IsManageDeprecationEnabled`, `IsManageDeprecationApiEnabled`, `IsDisplayVulnerabilitiesEnabled`, `IsManagePackagesVulnerabilitiesEnabled`, `IsDisplayFuGetLinksEnabled`, `IsDisplayNuGetTrendsLinksEnabled`, `IsDisplayNuGetPackageExplorerLinkEnabled`, `AreEmbeddedIconsEnabled`, `IsForceFlatContainerIconsEnabled`, `IsSearchSideBySideEnabled`, `IsGitHubUsageEnabled`, `IsAdvancedSearchEnabled`, `IsPackageDependentsEnabled`, `IsODataDatabaseReadOnlyEnabled`, `IsABTestingEnabled`, `IsPreviewHijackEnabled`, `IsGravatarProxyEnabled`, `ProxyGravatarEnSubdomain`, `AreDynamicODataCacheDurationsEnabled`, `IsShowEnable2FADialogEnabled`, `IsGet2FADismissFeedbackEnabled`, `IsPackageRenamesEnabled`, `ArePatternSetTfmHeuristicsEnabled`, `AreEmbeddedReadmesEnabled`, `IsODataV1GetAllEnabled`, `IsODataV1GetAllCountEnabled`, `IsODataV1GetSpecificNonHijackedEnabled`, `IsODataV1FindPackagesByIdNonHijackedEnabled`, `IsODataV1FindPackagesByIdCountNonHijackedEnabled`, `IsODataV1SearchNonHijackedEnabled`, `IsODataV1SearchCountNonHijackedEnabled`, `IsODataV2GetAllNonHijackedEnabled`, and 36 more. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. Those 76 declarations carry 74 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 74 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: IPackageService (34 members) src/NuGetGallery.Services/PackageManagement/IPackageService.cs:21 — `IPackageService` declares 34 members: `GetPackageDependents`, `FindPackagesById`, `FindPackagesById`, `FindPackagesById`, `IsDeletedStagingPackage`, `FindLatestVersionsById`, `FindPackageByIdAndVersion`, `FilterExactPackage`, `FilterLatestPackage`, `FilterLatestPackageBySuffix`, `FindPackagesByOwner`, `FindPackagesByAnyMatchingOwner`, `FindPackagesForAccountDeletion`, `FindPackageRegistrationsByOwner`, `FindPackagesByProfile`, `GetAllPackageRegistrations`, `FindDependentPackages`, `CreatePackageAsync`, `EnrichPackageFromNuGetPackage`, `ReplacePackageMetadataForStagedPackage`, `GetSupportedFrameworks`, `GetSupportedFrameworks`, `PublishPackageAsync`, `PublishPackageAsync`, `AddPackageOwnerAsync`, `RemovePackageOwnerAsync`, `WillPackageBeOrphanedIfOwnerRemoved`, `SetLicenseReportVisibilityAsync`, `EnsureValid`, `IncrementDownloadCountAsync`, `UpdatePackageVerifiedStatusAsync`, `SetRequiredSignerAsync`, `SetRequiredSignerAsync`, `GetPackageStatus`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. Those 34 declarations carry 29 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 29 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: ITelemetryService (83 members) src/NuGetGallery.Services/Telemetry/ITelemetryService.cs:13 — `ITelemetryService` declares 83 members: `TrackStagingPromotionAccepted`, `TrackGetPackageDownloadCountFailed`, `TrackGetPackageRegistrationDownloadCountFailed`, `TrackDownloadJsonRefreshDuration`, `TrackDownloadJsonTotalPackageIds`, `TrackDownloadJsonTotalPackageVersions`, `TrackDownloadCountDecreasedDuringRefresh`, `TrackPackageDownloadCountDecreasedFromGallery`, `TrackPackageRegistrationDownloadCountDecreasedFromGallery`, `TrackODataQueryFilterEvent`, `TrackODataCustomQuery`, `TrackPackagePushEvent`, `TrackPackagePushFailureEvent`, `TrackPackagePushDisconnectEvent`, `TrackPackageUnlisted`, `TrackPackageListed`, `TrackPackagesUpdateListed`, `TrackPackageDelete`, `TrackDuplicatePackageDeprecations`, `TrackPackageReupload`, `TrackPackageReflow`, `TrackPackageHardDeleteReflow`, `TrackPackageRevalidate`, `TrackPackageDeprecate`, `TrackPackageReadMeChangeEvent`, `TrackCreatePackageVerificationKeyEvent`, `TrackPackagePushNamespaceConflictEvent`, `TrackPackagePushOwnerlessNamespaceConflictEvent`, `TrackVerifyPackageKeyEvent`, `TrackNewUserRegistrationEvent`, `TrackUserChangedMultiFactorAuthentication`, `TrackNewCredentialCreated`, `TrackUserLogin`, `TrackUserPackageDeleteChecked`, `TrackPackageMetadataComplianceError`, `TrackPackageMetadataComplianceWarning`, `TrackUserPackageDeleteExecuted`, `TrackCertificateAdded`, `TrackPackageOwnershipAutomaticallyAdded`, `TrackCertificateActivated`, and 43 more. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: IUserService (26 members) src/NuGetGallery.Services/UserManagement/IUserService.cs:10 — `IUserService` declares 26 members: `AddMembershipRequestAsync`, `RejectMembershipRequestAsync`, `CancelMembershipRequestAsync`, `AddMemberAsync`, `UpdateMemberAsync`, `DeleteMemberAsync`, `ChangeEmailSubscriptionAsync`, `FindByEmailAddress`, `FindAllByEmailAddress`, `FindByUnconfirmedEmailAddress`, `FindByUsername`, `FindByKey`, `ConfirmEmailAddress`, `ChangeEmailAddress`, `CancelChangeEmailAddress`, `ChangeMultiFactorAuthentication`, `GetEmailAddressesForUserKeysAsync`, `CanTransformUserToOrganization`, `CanTransformUserToOrganization`, `RequestTransformToOrganizationAccount`, `TransformUserToOrganization`, `RejectTransformUserToOrganizationRequest`, `CancelTransformUserToOrganizationRequest`, `AddOrganizationAsync`, `GetSiteAdmins`, `SetIsAdministrator`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. Those 26 declarations carry 25 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 25 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: IAppConfiguration (107 members) src/NuGetGallery.Services/Configuration/IAppConfiguration.cs:9 — `IAppConfiguration` declares 107 members: `LuceneIndexLocation`, `Environment`, `WarningBanner`, `StagingExpirationDays`, `StagingQuotaLimit`, `StagingQuotaOwnerOverrides`, `StagingGroupLimit`, `RequireSSL`, `SSLPort`, `ForceSslExclusion`, `AzureStorage_Auditing_ConnectionString`, `AzureStorage_UserCertificates_ConnectionString`, `AzureStorage_Content_ConnectionString`, `AzureStorage_Packages_ConnectionString`, `AzureStorage_FlatContainer_ConnectionString`, `AzureStorage_Statistics_ConnectionString`, `AzureStorage_Statistics_ConnectionString_Alternate`, `AzureStorage_Uploads_ConnectionString`, `AzureStorage_Revalidation_ConnectionString`, `AzureStorageReadAccessGeoRedundant`, `AzureStorageUseMsi`, `AzureStorageMsiClientId`, `FeatureFlagsRefreshInterval`, `AdminPanelEnabled`, `AdminPanelDatabaseAccessEnabled`, `AdminApiEnabled`, `AdminApiAudience`, `AdminApiAllowedCallers`, `AdminApiTestModeEnabled`, `AsynchronousPackageValidationEnabled`, `BlockingAsynchronousPackageValidationEnabled`, `AsynchronousPackageValidationDelay`, `ValidationExpectedTime`, `DeprecateNuGetPasswordLogins`, `ConfirmEmailAddresses`, `ReadOnlyMode`, `FeedOnlyMode`, `FileStorageDirectory`, `Brand`, `StorageType`, and 67 more. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: IValidationEntitiesContext (17 members) src/NuGet.Services.Validation/Entities/IValidationContext.cs:10 — `IValidationEntitiesContext` declares 17 members: `PackageValidationSets`, `PackageValidations`, `PackageValidationIssues`, `ValidatorStatuses`, `PackageSigningStates`, `PackageSignatures`, `TrustedTimestamps`, `EndCertificates`, `CertificateValidations`, `CertificateChainLinks`, `ParentCertificates`, `PackageCompatibilityIssues`, `ScanOperationStates`, `PackageRevalidations`, `SymbolsServerRequests`, `ContentScanOperationState`, `SaveChangesAsync`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: ITelemetryService (22 members) src/Catalog/Telemetry/ITelemetryService.cs:12 — `ITelemetryService` declares 22 members: `GlobalDimensions`, `TrackCatalogIndexWriteDuration`, `TrackCatalogIndexReadDuration`, `TrackIndexCommitDuration`, `TrackIndexCommitTimeout`, `TrackPackageMissingHash`, `TrackPackageHasIncorrectHash`, `TrackPackageAlreadyHasHash`, `TrackPackageHashFixed`, `TrackMetric`, `TrackDuration`, `TrackExternalIconProcessingDuration`, `TrackEmbeddedIconProcessingDuration`, `TrackIconDeletionSuccess`, `TrackIconDeletionFailure`, `TrackExternalIconIngestionSuccess`, `TrackExternalIconIngestionFailure`, `TrackIconExtractionSuccess`, `TrackIconExtractionFailure`, `TrackGetPackageDetailsQueryDuration`, `TrackGetPackageQueryDuration`, `TrackCacheControlUpdate`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: IAzureSearchTelemetryService (41 members) src/NuGet.Services.AzureSearch/IAzureSearchTelemetryService.cs:10 — `IAzureSearchTelemetryService` declares 41 members: `TrackAuxiliaryFileDownloaded`, `TrackAuxiliaryFilesReload`, `TrackGetLatestLeaves`, `TrackGetOwnersForPackageId`, `TrackIndexPushFailure`, `TrackIndexPushSplit`, `TrackIndexPushSuccess`, `TrackUpdateOwnersCompleted`, `TrackOwnerSetComparison`, `TrackReadLatestIndexedOwners`, `TrackReadLatestOwnersFromDatabase`, `TrackPopularityTransfersSetComparison`, `TrackReadLatestIndexedPopularityTransfers`, `TrackReadLatestPopularityTransfersFromDatabase`, `TrackReadLatestVerifiedPackagesFromDatabase`, `TrackReplaceLatestIndexedOwners`, `TrackUploadOwnerChangeHistory`, `TrackReplaceLatestIndexedPopularityTransfers`, `TrackVersionListsUpdated`, `TrackCatalog2AzureSearchProcessBatch`, `TrackV2SearchQueryWithSearchIndex`, `TrackV2SearchQueryWithHijackIndex`, `TrackAutocompleteQuery`, `TrackDownloadSetComparison`, `TrackV3SearchQuery`, `TrackGetSearchServiceStatus`, `TrackDocumentCountQuery`, `TrackDownloadCountDecrease`, `TrackWarmQuery`, `TrackLastCommitTimestampQuery`, `TrackReadLatestIndexedDownloads`, `TrackReplaceLatestIndexedDownloads`, `TrackAuxiliary2AzureSearchCompleted`, `TrackV3GetDocument`, `TrackV2GetDocumentWithSearchIndex`, `TrackV2GetDocumentWithHijackIndex`, `TrackUpdateVerifiedPackagesCompleted`, `TrackReadLatestVerifiedPackages`, `TrackReplaceLatestVerifiedPackages`, `TrackAuxiliaryFilesStringCache`, and 1 more. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: IBaseMetadataDocument (27 members) src/NuGet.Services.AzureSearch/Models/IBaseMetadataDocument.cs:11 — `IBaseMetadataDocument` declares 27 members: `Authors`, `Copyright`, `Created`, `Description`, `FileSize`, `FlattenedDependencies`, `Hash`, `HashAlgorithm`, `IconUrl`, `Language`, `LastEdited`, `LicenseUrl`, `MinClientVersion`, `NormalizedVersion`, `OriginalVersion`, `PackageId`, `TokenizedPackageId`, `Prerelease`, `ProjectUrl`, `Published`, `ReleaseNotes`, `RequiresLicenseAcceptance`, `SemVerLevel`, `SortableTitle`, `Summary`, `Tags`, `Title`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: IValidationFileService (18 members) src/NuGet.Services.Validation.Orchestrator/IValidationPackageFileService.cs:12 — `IValidationFileService` declares 18 members: `DeleteValidationPackageFileAsync`, `DeletePackageFileAsync`, `DoesPackageFileExistAsync`, `DoesValidationPackageFileExistAsync`, `DownloadPackageFileToDiskAsync`, `BackupPackageFileFromValidationSetPackageAsync`, `CopyValidationPackageForValidationSetAsync`, `CopyPackageFileForValidationSetAsync`, `CopyValidationSetPackageToPackageFileAsync`, `CopyValidationPackageToPackageFileAsync`, `CopyPackageUrlForValidationSetAsync`, `DeletePackageForValidationSetAsync`, `GetPackageForValidationSetReadUriAsync`, `DoesValidationSetPackageExistAsync`, `UpdatePackageBlobMetadataInValidationSetAsync`, `UpdatePackageBlobMetadataInValidationAsync`, `UpdatePackageBlobPropertiesAsync`, `GetPublicPackageBlobETagOrNullAsync`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: ITelemetryService (24 members) src/NuGet.Services.Validation.Orchestrator/Telemetry/ITelemetryService.cs:12 — `ITelemetryService` declares 24 members: `TrackDurationToValidationSetCreation`, `TrackDurationToBackupPackage`, `TrackPackageStatusChange`, `TrackTotalValidationDuration`, `TrackSentValidationTakingTooLongMessage`, `TrackValidationSetTimeout`, `TrackStagingDurationToValidationSetCreation`, `TrackStagingValidationDuration`, `TrackStagingValidationSetTimeout`, `TrackValidatorTimeout`, `TrackValidatorDuration`, `TrackValidatorStarted`, `TrackDurationToStartPackageSigningValidator`, `TrackDurationToStartPackageCertificatesValidator`, `TrackValidationIssueCount`, `TrackValidationIssue`, `TrackClientValidationIssue`, `TrackMissingPackageForValidationMessage`, `TrackMissingNupkgForAvailablePackage`, `TrackDurationToHashPackage`, `TrackSymbolsMessageEnqueued`, `TrackDurationToExtractLicenseAndReadmeFile`, `TrackDurationToDeleteLicenseFile`, `TrackDurationToDeleteReadmeFile`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
P2 · Observability · Console output used as the logging channel · ×14
  • Console output used as the logging channel src/GalleryTools/Commands/PushPackageCommand.cs:37 — `src/GalleryTools/Commands/PushPackageCommand.cs` reports through `Console.Write…` at line 37 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
  • Console output used as the logging channel src/GalleryTools/Commands/PushPackageCommand.cs:50 — `src/GalleryTools/Commands/PushPackageCommand.cs` reports through `Console.Write…` at line 50 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
  • Console output used as the logging channel src/GalleryTools/Commands/PushPackageCommand.cs:66 — `src/GalleryTools/Commands/PushPackageCommand.cs` reports through `Console.Write…` at line 66 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
  • Console output used as the logging channel src/GalleryTools/Commands/PushPackageCommand.cs:81 — `src/GalleryTools/Commands/PushPackageCommand.cs` reports through `Console.Write…` at line 81 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
  • Console output used as the logging channel src/GalleryTools/Commands/PushPackageCommand.cs:111 — `src/GalleryTools/Commands/PushPackageCommand.cs` reports through `Console.Write…` at line 111 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
  • Console output used as the logging channel src/GalleryTools/Commands/PushPackageCommand.cs:115 — `src/GalleryTools/Commands/PushPackageCommand.cs` reports through `Console.Write…` at line 115 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
  • Console output used as the logging channel src/GalleryTools/Commands/SeedFunctionalTestsCommand.cs:43 — `src/GalleryTools/Commands/SeedFunctionalTestsCommand.cs` reports through `Console.Write…` at line 43 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
  • Console output used as the logging channel src/GalleryTools/Commands/SeedFunctionalTestsCommand.cs:57 — `src/GalleryTools/Commands/SeedFunctionalTestsCommand.cs` reports through `Console.Write…` at line 57 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
  • Console output used as the logging channel src/GalleryTools/Commands/SeedFunctionalTestsCommand.cs:64 — `src/GalleryTools/Commands/SeedFunctionalTestsCommand.cs` reports through `Console.Write…` at line 64 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
  • Console output used as the logging channel src/GalleryTools/Commands/SeedFunctionalTestsCommand.cs:127 — `src/GalleryTools/Commands/SeedFunctionalTestsCommand.cs` reports through `Console.Write…` at line 127 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
  • Console output used as the logging channel src/GalleryTools/Commands/SeedFunctionalTestsCommand.cs:152 — `src/GalleryTools/Commands/SeedFunctionalTestsCommand.cs` reports through `Console.Write…` at line 152 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
  • Console output used as the logging channel src/GalleryTools/Commands/SeedFunctionalTestsCommand.cs:156 — `src/GalleryTools/Commands/SeedFunctionalTestsCommand.cs` reports through `Console.Write…` at line 156 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
  • Console output used as the logging channel src/GalleryTools/Commands/SeedFunctionalTestsCommand.cs:161 — `src/GalleryTools/Commands/SeedFunctionalTestsCommand.cs` reports through `Console.Write…` at line 161 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
  • Console output used as the logging channel src/GalleryTools/Commands/SeedFunctionalTestsCommand.cs:210 — `src/GalleryTools/Commands/SeedFunctionalTestsCommand.cs` reports through `Console.Write…` at line 210 although other files in its project log through a logger. Console lines carry no level, category or structured properties and never reach the log pipeline or its exporters.
X7 · Silent fallback defaults · Silent fallback default on parse failure · ×6
  • Silent fallback default on parse failure src/GalleryTools/Commands/BackfillCommand.cs:111 — `Configure` returns `1` when `DateTime.TryParse(lastCreateTimeString, out lastCreateTime)` is false, with no log or throw — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer to the test rather than a stand-in for a value that could not be read, this is not a silent default: say so in a comment on the member and the row stops firing.
  • Silent fallback default on parse failure src/NuGetGallery.Services/Authentication/ApiKeyV3.cs:86 — `TryParseInternal` returns `false` when `Guid.TryParse(plaintextApiKey, out Guid apiKeyGuid)` is false, with no log or throw — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer to the test rather than a stand-in for a value that could not be read, this is not a silent default: say so in a comment on the member and the row stops firing.
  • Silent fallback default on parse failure src/NuGet.Protocol.Catalog/Models/ModelExtensions.cs:130 — `ParseRange` returns `VersionRange.All` when `VersionRange.TryParse(packageDependency.Range, out var parsed)` is false, with no log or throw — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer to the test rather than a stand-in for a value that could not be read, this is not a silent default: say so in a comment on the member and the row stops firing.
  • Silent fallback default on parse failure src/NuGet.Services.AzureSearch/SearchService/Models/ParameterUtilities.cs:66 — `ParseIncludeSemVer2` returns `false` when `NuGetVersion.TryParse(semVerLevel, out var semVerLevelVersion)` is false, with no log or throw — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer to the test rather than a stand-in for a value that could not be read, this is not a silent default: say so in a comment on the member and the row stops firing.
  • Silent fallback default on parse failure src/NuGet.Services.SearchService.Core/Controllers/SearchController.cs:37 — `IndexAsync` falls back to `HttpStatusCode.InternalServerError` when `result.Success` is false, with no log or throw — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer to the test rather than a stand-in for a value that could not be read, this is not a silent default: say so in a comment on the member and the row stops firing.
  • Silent fallback default on parse failure src/NuGet.Services.SearchService.Core/Controllers/SearchController.cs:53 — `GetStatusAsync` falls back to `HttpStatusCode.InternalServerError` when `result.Success` is false, with no log or throw — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer to the test rather than a stand-in for a value that could not be read, this is not a silent default: say so in a comment on the member and the row stops firing.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×5
  • Projects may be oversized for their cohesion src/NuGetGallery/NuGetGallery.csproj:1 — `NuGetGallery` overshoots its size bounds (54344 LoC, 701 public types across 36 namespaces). 5 of 142 project(s) overshoot their size bounds, lowering Project Cohesion to 9.3/10. Size alone is no reason to split a project: where its type references show a separable part, a Split row names it.
  • Projects may be oversized for their cohesion src/NuGetGallery.Services/NuGetGallery.Services.csproj:1 — `NuGetGallery.Services(net472)` overshoots its size bounds (22256 LoC, 274 public types across 25 namespaces). 5 of 142 project(s) overshoot their size bounds, lowering Project Cohesion to 9.3/10. Size alone is no reason to split a project: where its type references show a separable part, a Split row names it.
  • Projects may be oversized for their cohesion src/NuGet.Services.AzureSearch/NuGet.Services.AzureSearch.csproj:1 — `NuGet.Services.AzureSearch(net472)` overshoots its size bounds (14895 LoC, 215 public types across 8 namespaces). 5 of 142 project(s) overshoot their size bounds, lowering Project Cohesion to 9.3/10. Size alone is no reason to split a project: where its type references show a separable part, a Split row names it.
  • Projects may be oversized for their cohesion src/NuGetGallery.Core/NuGetGallery.Core.csproj:1 — `NuGetGallery.Core(net472)` overshoots its size bounds (14205 LoC, 251 public types across 18 namespaces). 5 of 142 project(s) overshoot their size bounds, lowering Project Cohesion to 9.3/10. Size alone is no reason to split a project: where its type references show a separable part, a Split row names it.
  • Projects may be oversized for their cohesion src/Catalog/NuGet.Services.Metadata.Catalog.csproj:1 — `NuGet.Services.Metadata.Catalog(net472)` overshoots its size bounds (10476 LoC, 149 public types across 12 namespaces). 5 of 142 project(s) overshoot their size bounds, lowering Project Cohesion to 9.3/10. Size alone is no reason to split a project: where its type references show a separable part, a Split row names it.
D27 · Navigability · Pass-through layer · ×2
  • Pass-through layer src/NuGetGallery/UrlHelperWrapper.cs:9 — UrlHelperWrapper: all 4 public methods forward their arguments unchanged to _urlHelper and add no behaviour — an extra hop (and usually an extra interface) to trace through. Call _urlHelper directly, or give the layer a job.
  • Pass-through layer src/NuGetGallery.Core/Entities/ReadOnlyEntitiesContext.cs:11 — ReadOnlyEntitiesContext: all 4 public methods forward their arguments unchanged to _entitiesContext and add no behaviour — an extra hop (and usually an extra interface) to trace through. Call _entitiesContext directly, or give the layer a job.
D30 · Dependency Vulnerabilities · Low CVE · ×2
  • REDACTED
  • REDACTED
ED3 · Event naming · Event not named in past tense · ×2
  • Event not named in past tense: OnCallDailyNotification src/NuGet.SupportRequests.Notifications/Notifications/OnCallDailyNotification.cs:10 — `OnCallDailyNotification` reads as an instruction, not a fact that happened: events describe something that already occurred. Name new events for the fact that occurred (e.g. `OrderPlaced`). Do not rename this one if it is already stored or published: its type name is written with every event recorded under it, so a rename can break replay of the stored stream and every subscriber that reads it, and a clearer name does not pay for that. If it has never been written or sent, renaming it now is safe.
  • Event not named in past tense: WeeklySummaryNotification src/NuGet.SupportRequests.Notifications/Notifications/WeeklySummaryNotification.cs:10 — `WeeklySummaryNotification` reads as an instruction, not a fact that happened: events describe something that already occurred. Name new events for the fact that occurred (e.g. `OrderPlaced`). Do not rename this one if it is already stored or published: its type name is written with every event recorded under it, so a rename can break replay of the stored stream and every subscriber that reads it, and a clearer name does not pay for that. If it has never been written or sent, renaming it now is safe.
X9 · Subsumed condition operand · Subsumed condition operand · ×2
  • Subsumed condition operand src/NuGetGallery/Infrastructure/SafeRedirectResult.cs:40 — `Url.StartsWith("//", StringComparison.Ordinal)` can never decide this `||` — every value satisfying `Url.StartsWith("//", StringComparison.Ordinal)` also satisfies `Url.StartsWith("/", StringComparison.Ordinal)`, 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.
  • Subsumed condition operand src/NuGetGallery/Infrastructure/SafeRedirectResult.cs:41 — `Url.StartsWith("/\\", StringComparison.Ordinal)` can never decide this `||` — every value satisfying `Url.StartsWith("/\\", StringComparison.Ordinal)` also satisfies `Url.StartsWith("/", StringComparison.Ordinal)`, 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.
C2 · Access Controls · No named authorization policies · ×1
  • No named authorization policies — Authorization IS enforced here (via [Authorize]/guards) — this is NOT a claim that endpoints are unprotected. What's missing is NAMED policies (AddAuthorization/AddPolicy, RequireRole/RequireClaim, RequireAuthorization): the access rules are implicit rather than named and testable. Recommendation, not a defect — name the rules so they're reviewable.
C3 · Audit Trail · Partial audit-trail evidence · ×1
  • Partial audit-trail evidence — An audit mechanism is present, but the trail is not yet complete — missing: an EF SaveChanges interceptor (or equivalent write-side hook, e.g. an event-store append every change flows through), [Audited] per-entity coverage.
C4 · Data Retention · Partial data-retention evidence · ×1
  • Partial data-retention evidence — A retention mechanism is present, but the data-lifecycle is not yet complete — missing: a documented retention period / data-expiry.
D16 · Bus Factor · Off-boarding risk · ×1
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 5 significant file(s) lose their only recent owner: src/Catalog/DurableCursorWithUpdates.cs, src/Catalog/HttpReadCursorWithUpdates.cs, src/UpdateBlobProperties/Updater.cs, src/UpdateBlobProperties/Job.cs, src/UpdateBlobProperties/Processor.cs. Pair on, review, or document these before any departure.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 5 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 (13 single-owned of 520 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 520 of the 2459 production source files in this repository met that bar). They are anonymized user #2 (2 file(s)), anonymized user #3 (2 file(s)), anonymized user #4 (2 file(s)), anonymized user #5 (1 file(s)), anonymized user #6 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: src/NuGetGallery/Services/PackageDeleteService.cs, src/NuGetGallery/Services/PackageDeprecationService.cs, src/GitHubVulnerabilities2v3/Extensions/BlobStorageVulnerabilityWriter.cs, src/NuGet.Services.ServiceBus/SubscriptionClientWrapper.cs, src/NuGetGallery/Areas/Admin/Services/ValidationAdminService.cs, src/Catalog/Icons/PublicExternalIconUrlPolicy.cs, src/VerifyGitHubVulnerabilities/Verify/PackageVulnerabilitiesVerifier.cs, src/NuGetGallery/Infrastructure/CookieTempDataProvider.cs.
D19 · Documentation Quality · Documentation · ×1
  • Documentation: no build, run or usage example src/GalleryTools/Readme.md:1 — `GalleryTools` is an executable (`OutputType Exe`) and neither `src/GalleryTools/Readme.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found src/AccountDeleter/AccountDeleter.csproj:4 — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`. ADRs are expected here because `src/AccountDeleter/AccountDeleter.csproj` makes this repository a deployable product (line 4).
D26 · Project Cohesion · Split NuGetGallery.Core(net472) · ×1
  • Split NuGetGallery.Core(net472) src/NuGetGallery.Core/NuGetGallery.Core.csproj:1 — `NuGetGallery.Core(net472)` overshoots its size bounds (14205 LoC, 251 public types across 18 namespaces). These parts reach the rest of the project only through its shared core (`(root)`, `Diagnostics`, `Extensions`, `Packaging`, `Services`, `Shared`), so they are the cleanest seams: `NuGetGallery.Frameworks` (12 types in 10 files): 0 of 89 of its type references cross into a sibling namespace, and the rest of the project uses it 0 times and it uses the rest 12 times; `NuGetGallery.Login` (7 types in 6 files): 0 of 72 of its type references cross into a sibling namespace, and the rest of the project uses it 0 times and it uses the rest 33 times; `NuGetGallery.Features` (6 types in 5 files): 5 of 44 of its type references cross into a sibling namespace, and the rest of the project uses it 0 times and it uses the rest 32 times. Extract each into its own project.
D26 · Project Cohesion · Split NuGetGallery.Services(net472) · ×1
  • Split NuGetGallery.Services(net472) src/NuGetGallery.Services/NuGetGallery.Services.csproj:1 — `NuGetGallery.Services(net472)` overshoots its size bounds (22256 LoC, 274 public types across 25 namespaces). These parts reach the rest of the project only through its shared core (`(root)`, `Areas`, `Configuration`), so they are the cleanest seams: `NuGetGallery.AsyncFileUpload` (5 types in 4 files): 1 of 33 of its type references cross into a sibling namespace, and the rest of the project uses it 0 times and it uses the rest 9 times. Extract each into its own project.
D26 · Project Cohesion · Split NuGet.Services.Metadata.Catalog(net472) · ×1
  • Split NuGet.Services.Metadata.Catalog(net472) src/Catalog/NuGet.Services.Metadata.Catalog.csproj:1 — `NuGet.Services.Metadata.Catalog(net472)` overshoots its size bounds (10476 LoC, 149 public types across 12 namespaces). These parts reach the rest of the project only through its shared core (`(root)`, `Extensions`, `JsonLDIntegration`, `Persistence`), so they are the cleanest seams: `NuGet.Services.Metadata.Catalog.Icons` (18 types in 17 files): 3 of 217 of its type references cross into a sibling namespace, and the rest of the project uses it 0 times and it uses the rest 125 times; `NuGet.Services.Metadata.Catalog.Dnx` (7 types in 5 files): 7 of 189 of its type references cross into a sibling namespace, and the rest of the project uses it 0 times and it uses the rest 139 times. Extract each into its own project.
D28 · Secrets (history) · Rotate the exposed credentials · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
P12 · CI test-gate honesty · Sleep-based test synchronization · ×1
  • Sleep-based test synchronization — 12 Task.Delay/Thread.Sleep call(s) in test code synchronize with background work by sleeping — a known flakiness precursor on slow runners. Prefer polling with a deadline or completion signals.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 58/69 service-like projects use logging (pure contract/DTO projects are excluded — they have nothing to log). Of those 69, 38 ship a process this repository operates; the rest are libraries their consumer hosts, where the logging decision belongs to the host.
P3 · Security & performance tooling · No dependency-update automation · ×1
  • No dependency-update automation Directory.Packages.props:9 — `Directory.Packages.props` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`.
P6 · Release Hygiene · Changelog looks stale/thin · ×1
  • Changelog looks stale/thin — The changelog this check read carries 2 versioned entries, against a bar of 3. Counted as either the distinct `x.y.z` versions it names (a link's target is not counted) or its version-shaped section headings (`## [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.
S1 · Web-Security Posture · Security headers incomplete · ×1
  • Security headers incomplete src/Microsoft.PackageManagement.Search.Web/StartupHelper.cs:84 — Set: X-Content-Type-Options. Missing: Content-Security-Policy, Strict-Transport-Security, X-Frame-Options — the four headers that carry the points of this card's security-headers term (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options), 0.5 each. (−1.5 on this card.)
X2 · Cancellation propagation · Not all async methods take a CancellationToken · ×1
  • Not all async methods take a CancellationToken — Only 286/1446 async methods accept a CancellationToken, so in-flight work can't be stopped early when the caller gives up — whatever ends it in your host (shutdown signal, timeout, abandoned request, user cancel). Thread a token through the call chain and honour it at each await and loop; where a method genuinely cannot be interrupted, omitting it is a deliberate choice — judge against your hosting model.
X5 · Nullable reference types · Nullable reference types not enabled everywhere · ×1
  • Nullable reference types not enabled everywhere — 2/5 NRT-eligible project(s) enable <Nullable>enable</Nullable> (projects targeting a pre-C#-8 framework are excluded — NRTs aren't available there). NRTs catch a whole class of null-deref bugs at compile time.
X5 · Nullable reference types · Null-forgiving operator (`!`) suppressions override nullable warnings · ×1
  • Null-forgiving operator (`!`) suppressions override nullable warnings — ~1.7 `!` suppressions per 1k syntax nodes — 47 suppression(s) across the 27770 syntax node(s) in code where nullable warnings are ENABLED, which is the only code a `!` can suppress anything in (a `!` under `#nullable disable` is inert and is not counted, and its file's nodes are not in the denominator). Each one tells the compiler to trust you about null, suppressing the very safety NRTs provide. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.
Minor — 81 finding(s)
D24 · Comment Value · doc comments repeat the names · ×40
  • doc comments repeat the names src/AccountDeleter/AccountDeleteMessageHandler.cs:46 — 0 of 6 documented parameters and 0 of 39 summaries in `AccountDeleter` only repeat the member or parameter name (e.g. "" for `command`). 5 documentation tag(s) are empty. Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names src/Gallery.CredentialExpiration/GalleryCredentialExpiration.cs:92 — 0 of 8 documented parameters and 1 of 8 summaries in `Gallery.CredentialExpiration` only repeat the member or parameter name (e.g. "Returns the expiring credentials." for `GetExpiringCredentials`). 7 documentation tag(s) are empty. Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names src/GitHubVulnerabilities2v3/Configuration/GitHubVulnerabilities2v3Configuration.cs:35 — 0 of 2 documented parameters and 1 of 12 summaries in `GitHubVulnerabilities2V3` only repeat the member or parameter name (e.g. "Cache control headers." for `IndexCacheControlHeader`). Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names src/NuGet.Jobs.GitHubIndexer/IRepoFetcher.cs:8 — 0 of 28 documented parameters and 1 of 49 summaries in `NuGet.Jobs.GitHubIndexer` only repeat the member or parameter name (e.g. "Fetches a repo." for `FetchRepo`). Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names src/NuGet.Protocol.Catalog/Models/ModelExtensions.cs:93 — 2 of 22 documented parameters and 2 of 30 summaries in `NuGet.Protocol.Catalog(net472)` only repeat the member or parameter name (e.g. "Parse the package version as a ." for `ParsePackageVersion`). 1 documentation tag(s) are empty. Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names src/NuGet.Services.AzureSearch/Auxiliary2AzureSearch/IDownloadSetComparer.cs:13 — 3 of 62 documented parameters and 1 of 202 summaries in `NuGet.Services.AzureSearch(net472)` only repeat the member or parameter name (e.g. "The old data." for `oldData`). Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names src/NuGet.Services.CatalogValidation/Entities/CatalogValidationEntitiesContext.cs:48 — 1 of 1 documented parameters and 0 of 3 summaries in `NuGet.Services.CatalogValidation(net472)` only repeat the member or parameter name (e.g. "The model builder." for `modelBuilder`). Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names src/NuGet.Services.Configuration/ConfigurationFactory.cs:58 — 1 of 16 documented parameters and 2 of 22 summaries in `NuGet.Services.Configuration(net472)` only repeat the member or parameter name (e.g. "Injects a property of specified by with configuration." for `InjectPropertyWithConfiguration`). Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names tests/NuGet.Services.Configuration.Tests/ConfigurationFactoryFacts.cs:106 — 0 of 6 documented parameters and 1 of 20 summaries in `NuGet.Services.Configuration.Tests` only repeat the member or parameter name (e.g. "Test data for the tests." for `ConfigurationFactoryTestData`). Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names src/NuGet.Services.Contracts/Validation/ValidationIssueCode.cs:8 — 0 of 0 documented parameters and 5 of 30 summaries in `NuGet.Services.Contracts(net472)` only repeat the member or parameter name (e.g. "The codes for ." for `ValidationIssueCode`). Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names src/NuGet.Services.DatabaseMigration/IMigrationContextFactory.cs:17 — 1 of 1 documented parameters and 0 of 5 summaries in `NuGet.Services.DatabaseMigration` only repeat the member or parameter name (e.g. "The target database for migration" for `migrationTargetDatabase`). Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names src/NuGet.Services.Entities/AccountDelete.cs:20 — 3 of 11 documented parameters and 4 of 188 summaries in `NuGet.Services.Entities(net472)` only repeat the member or parameter name (e.g. "The deleted account key." for `DeletedAccountKey`). Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names src/NuGet.Services.KeyVault/CachingSecretReader.cs:141 — 0 of 10 documented parameters and 1 of 16 summaries in `NuGet.Services.KeyVault(net472)` only repeat the member or parameter name (e.g. "A cached secret." for `CachedSecret`). Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names src/NuGet.Services.Licenses/CompositeLicenseExpressionSegmentType.cs:17 — 0 of 8 documented parameters and 1 of 17 summaries in `NuGet.Services.Licenses(net472)` only repeat the member or parameter name (e.g. "License identifier" for `LicenseIdentifier`). Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names src/NuGet.Services.Logging/TelemetryProcessors/ExceptionTelemetryProcessor.cs:28 — 1 of 14 documented parameters and 0 of 19 summaries in `NuGet.Services.Logging(net472)` only repeat the member or parameter name (e.g. "A telemetry client." for `telemetryClient`). Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names src/NuGet.Services.Messaging/IEmailMessageEnqueuer.cs:13 — 0 of 1 documented parameters and 0 of 6 summaries in `NuGet.Services.Messaging(net472)` only repeat the member or parameter name (e.g. "" for `message`). 1 documentation tag(s) are empty. Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names src/NuGet.Services.Messaging.Email/EmailBuilder.cs:44 — 1 of 5 documented parameters and 5 of 28 summaries in `NuGet.Services.Messaging.Email(net472)` only repeat the member or parameter name (e.g. "The encoded Url" for `encodedUrl`). Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names src/Catalog/Helpers/CatalogWriterHelper.cs:22 — 20 of 84 documented parameters and 1 of 71 summaries in `NuGet.Services.Metadata.Catalog(net472)` only repeat the member or parameter name (e.g. "A package catalog item creator." for `packageCatalogItemCreator`). 4 documentation tag(s) are empty. Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names src/NuGet.Services.Revalidate/Services/StartRevalidationResult.cs:8 — 0 of 10 documented parameters and 1 of 61 summaries in `NuGet.Services.Revalidate` only repeat the member or parameter name (e.g. "The result of ." for `StartRevalidationResult`). Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names src/NuGet.Services.ServiceBus/IBrokeredMessageSerializer.cs:12 — 0 of 37 documented parameters and 2 of 36 summaries in `NuGet.Services.ServiceBus(net472)` only repeat the member or parameter name (e.g. "Serialize a into a ." for `Serialize`). Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names src/NuGet.Services.Staging/StagingPromotionMessage.cs:39 — 1 of 13 documented parameters and 0 of 20 summaries in `NuGet.Services.Staging` only repeat the member or parameter name (e.g. "The staging group key." for `stagingGroupKey`). Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names src/NuGet.Services.Staging.Promotion/StagedPackagePromotionMessageHandler.cs:41 — 10 of 28 documented parameters and 0 of 19 summaries in `NuGet.Services.Staging.Promotion` only repeat the member or parameter name (e.g. "The staged package repository." for `stagedPackageRepository`). Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names src/NuGet.Services.Status/Event.cs:15 — 0 of 0 documented parameters and 1 of 43 summaries in `NuGet.Services.Status(net472)` only repeat the member or parameter name (e.g. "The of the affected." for `AffectedComponentPath`). Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names src/NuGet.Services.Storage/IBlobLeaseService.cs:24 — 1 of 23 documented parameters and 2 of 28 summaries in `NuGet.Services.Storage(net472)` only repeat the member or parameter name (e.g. "The cancellation token." for `cancellationToken`). 2 documentation tag(s) are empty. Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names src/NuGet.Services.Validation/Entities/EndCertificateStatus.cs:6 — 1 of 4 documented parameters and 7 of 207 summaries in `NuGet.Services.Validation(net472)` only repeat the member or parameter name (e.g. "The status for a given ." for `EndCertificateStatus`). Delete the restating tags, or add what the name does not say.
  • + 15 more in this group — see findings.md.
D10 · Test Quality · Mock framework · ×37
  • Mock framework: Moq — NuGetGallery.Facts references Moq.
  • Mock framework: Moq — NuGetGallery.Core.Facts references Moq.
  • Mock framework: Moq — NuGet.Services.DatabaseMigration.Facts references Moq.
  • Mock framework: Moq — AccountDeleter.Facts references Moq.
  • Mock framework: Moq — GitHubVulnerabilities2Db.Facts references Moq.
  • Mock framework: Moq — GitHubVulnerabilities2v3.Facts references Moq.
  • Mock framework: Moq — NuGet.Services.Testing.Entities references Moq.
  • Mock framework: Moq — NgTests references Moq.
  • Mock framework: Moq — NuGet.Services.V3.Tests references Moq.
  • Mock framework: Moq — CatalogMetadataTests references Moq.
  • Mock framework: Moq — Tests.Stats.CollectAzureChinaCDNLogs references Moq.
  • Mock framework: Moq — NuGet.Services.Staging.Promotion.Tests references Moq.
  • Mock framework: Moq — Validation.PackageSigning.RevalidateCertificate.Tests references Moq.
  • Mock framework: Moq — Validation.PackageSigning.ScanAndSign.Tests references Moq.
  • Mock framework: Moq — NuGet.Services.Revalidate.Tests references Moq.
  • Mock framework: Moq — StatusAggregator.Tests references Moq.
  • Mock framework: Moq — Tests.Stats.CDNLogsSanitizer references Moq.
  • Mock framework: Moq — NuGet.Jobs.GitHubIndexer.Tests references Moq.
  • Mock framework: Moq — NuGet.Services.SearchService.Core.Tests references Moq.
  • Mock framework: Moq — Validation.ContentScan.Tests references Moq.
  • Mock framework: Moq — Stats.PostProcessReports.Tests references Moq.
  • Mock framework: Moq — NuGet.Services.Configuration.Tests references Moq.
  • Mock framework: Moq — NuGet.Services.Logging.Tests references Moq.
  • Mock framework: Moq — NuGet.Services.Cursor.Tests references Moq.
  • Mock framework: Moq — NuGet.Services.Owin.Tests references Moq.
  • + 12 more in this group — see findings.md.
D10 · Test Quality · Skipped (documented) · ×4
  • Skipped (documented): OneSecondCacheTime tests/NuGetGallery.Facts/Controllers/PackagesControllerFacts.cs:2350 — Skipped with a documented reason — a deferral, not lazy debt: Flaky test, tracked by issue https://github.com/NuGet/NuGetGallery/issues/8231
  • Skipped (documented): ProcessingTimesForSuccessfulAuthAndFailedAuthAreSimilar tests/NuGetGallery.Facts/Infrastructure/Authentication/V3HasherTests.cs:70 — Skipped with a documented reason — a deferral, not lazy debt: This test is not deterministic. Lets not run it as part of CI
  • Skipped (documented): WaitsOrchestratorToShutDown tests/NuGet.Services.Validation.Orchestrator.Tests/OrchestrationRunnerFacts.cs:46 — Skipped with a documented reason — a deferral, not lazy debt: Flaky test. Won't run it as part of CI.
  • Skipped (documented): RegularOptionsSnapshotCaches tests/NuGet.Services.Configuration.Tests/MicrosoftExtensionsConfigurationIntegrationFacts.cs:83 — Skipped with a documented reason — a deferral, not lazy debt: The default IOptionsSnapshot<TOptions> behavior demo

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/canine-gitleaks.toml --log-opts "--full-history --all --skip=0 --max-count=200" --report-format json --report-path /tmp/watchdog-gitleaks-853c587f264b4a1c943f8dd79763c0a3/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=200 --max-count=800" --report-format json --report-path /tmp/watchdog-gitleaks-853c587f264b4a1c943f8dd79763c0a3/history-1.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-1.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=1000 --max-count=3200" --report-format json --report-path /tmp/watchdog-gitleaks-853c587f264b4a1c943f8dd79763c0a3/history-2.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-2.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=4200 --max-count=5075" --report-format json --report-path /tmp/watchdog-gitleaks-853c587f264b4a1c943f8dd79763c0a3/history-3.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-3.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=9275 --max-count=2591" --report-format json --report-path /tmp/watchdog-gitleaks-853c587f264b4a1c943f8dd79763c0a3/history-4.json --exit-code 0 --source .2artifacts/raw/gitleaks-history-4.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-853c587f264b4a1c943f8dd79763c0a3/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/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt .editorconfig .eslintignore .gitattributes .github .gitignore .pipelines .vs CODE_OF_CONDUCT.md CONTRIBUTING.md COPYRIGHT.txt CREDITS.txt CodeQL.yml CredScanSuppressions.json Directory.Build.targets Directory.Packages.props LICENSE.txt NuGet.Jobs.FunctionalTests.sln NuGet.Jobs.sln NuGet.Server.Common.sln NuGet.config NuGetGallery.Aspire.slnx NuGetGallery.FunctionalTests.sln NuGetGallery.sln README.md RemovedPackages.md SECURITY.md build build.ps1 build.shared.ps1 content docs global.json packages.config python sign.thirdparty.props src test.ps1 tests tools152artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesdotnet—dotnet list NuGetGallery.sln package --vulnerable --include-transitive --format json0artifacts/raw/dotnet-vulnerable.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .10artifacts/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 2 file(s) — `src/NuGetGallery.AppHost.Tools/SeedBlobs.cs`, `REDACTED` — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.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/** .0artifacts/raw/trivy-fs.json

Run 01a1e564-956e-792d-90c7-567ae1ec79b6 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

Appendix C — Personal-data map

Every field, property and record parameter whose name is conventional personal data — 86 field(s) across 2 categories, each with an exact repo-relative file:line. This is the data inventory a compliance review starts from — right-to-erasure, retention, minimisation. Detected by NAME, from the C# syntax tree, with a deliberately specific identifier classifier — the same one the C1–C5 compliance cards use to decide whether personal data is present, so CardDefinition or FileName don't trip. Two caveats stated rather than glossed: those cards additionally require corroboration (a persistence/account signal, or two distinct PII categories) that this inventory deliberately does not, so it lists more than they gate on; and D32 Data Compliance shares nothing with it — that dimension is a separate semgrep ruleset for personal data leaking into logs, URLs and browser storage, and a clean D32 result says nothing about this list. Informational — it feeds no score.

Email — 81 field(s)
  • AccountDeleteConfiguration.EmailConfiguration src/AccountDeleter/Configuration/AccountDeleteConfiguration.cs:23
  • EmailConfiguration.EmailSettingsUrl src/AccountDeleter/Configuration/EmailConfiguration.cs:43
  • GalleryConfiguration.SupportEmailSiteRoot src/AccountDeleter/Configuration/GalleryConfiguration.cs:123
  • InitializationConfiguration.EmailPublisherConnectionString src/Gallery.CredentialExpiration/Configuration/InitializationConfiguration.cs:16
  • InitializationConfiguration.EmailPublisherTopicName src/Gallery.CredentialExpiration/Configuration/InitializationConfiguration.cs:18
  • ExpiredCredentialData.EmailAddress src/Gallery.CredentialExpiration/Models/ExpiredCredentialData.cs:17
  • MaintenanceEmailConfiguration.EmailSettingsUrl src/Gallery.Maintenance/MaintenanceEmailConfiguration.cs:17
  • User.EmailAddress src/NuGet.Services.Entities/User.cs:78
  • User.UnconfirmedEmailAddress src/NuGet.Services.Entities/User.cs:81
  • User.EmailConfirmationToken src/NuGet.Services.Entities/User.cs:114
  • User.LastSavedEmailAddress src/NuGet.Services.Entities/User.cs:133
  • IFlightUser.EmailAddress src/NuGet.Services.FeatureFlags/IFlightUser.cs:16
  • PromotionEmailConfiguration.EmailSettingsUrl src/NuGet.Services.Staging.Promotion/PromotionEmailConfiguration.cs:19
  • EmailConfiguration.EmailSettingsUrl src/NuGet.Services.Validation.Orchestrator/Configuration/EmailConfiguration.cs:57
  • MessageServiceConfiguration.EmailConfiguration src/NuGet.Services.Validation.Orchestrator/Services/MessageServiceConfiguration.cs:13
  • InitializationConfiguration.EmailPublisherConnectionString src/NuGet.SupportRequests.Notifications/Configuration/InitializationConfiguration.cs:13
  • InitializationConfiguration.EmailPublisherTopicName src/NuGet.SupportRequests.Notifications/Configuration/InitializationConfiguration.cs:18
  • InitializationConfiguration.TargetEmailAddress src/NuGet.SupportRequests.Notifications/Configuration/InitializationConfiguration.cs:23
  • SupportRequest.OwnerEmail src/NuGet.SupportRequests.Notifications/Models/SupportRequest.cs:14
  • INotification.TargetEmailAddress src/NuGet.SupportRequests.Notifications/Notifications/INotification.cs:16
  • OnCallDailyNotification.TargetEmailAddress src/NuGet.SupportRequests.Notifications/Notifications/OnCallDailyNotification.cs:42
  • WeeklySummaryNotification.TargetEmailAddress src/NuGet.SupportRequests.Notifications/Notifications/WeeklySummaryNotification.cs:68
  • WeeklySummaryNotificationTask._targetEmailAddress src/NuGet.SupportRequests.Notifications/Tasks/WeeklySummaryNotificationTask.cs:22
  • FailedAuthenticatedOperationAuditRecord.UsernameOrEmail src/NuGetGallery.Core/Auditing/FailedAuthenticatedOperationAuditRecord.cs:14
  • UserAuditRecord.EmailAddress src/NuGetGallery.Core/Auditing/UserAuditRecord.cs:15
  • UserAuditRecord.UnconfirmedEmailAddress src/NuGetGallery.Core/Auditing/UserAuditRecord.cs:16
  • UserAuditRecord.AffectedEmailAddress src/NuGetGallery.Core/Auditing/UserAuditRecord.cs:28
  • FlightUser.EmailAddress src/NuGetGallery.Core/Features/FeatureFlagClientExtensions.cs:35
  • PackageAddedMessage._emailSettingsUrl src/NuGetGallery.Core/Infrastructure/Mail/Messages/PackageAddedMessage.cs:19
  • StagedPackageUploadedMessage._emailSettingsUrl src/NuGetGallery.Core/Infrastructure/Mail/Messages/StagedPackageUploadedMessage.cs:16
  • StagedPackageValidationSucceededMessage._emailSettingsUrl src/NuGetGallery.Core/Infrastructure/Mail/Messages/StagedPackageValidationSucceededMessage.cs:16
  • StagedPackageValidationTakingTooLongMessage._emailSettingsUrl src/NuGetGallery.Core/Infrastructure/Mail/Messages/StagedPackageValidationTakingTooLongMessage.cs:16
  • StagingExpirationMessage._emailSettingsUrl src/NuGetGallery.Core/Infrastructure/Mail/Messages/StagingExpirationMessage.cs:24
  • StagingPromotionCompletedMessage._emailSettingsUrl src/NuGetGallery.Core/Infrastructure/Mail/Messages/StagingPromotionCompletedMessage.cs:23
  • SymbolPackageAddedMessage._emailSettingsUrl src/NuGetGallery.Core/Infrastructure/Mail/Messages/SymbolPackageAddedMessage.cs:20
  • LoginDiscontinuation.DiscontinuedForEmailAddresses src/NuGetGallery.Core/Login/LoginDiscontinuation.cs:14
  • LoginDiscontinuation.ExceptionsForEmailAddresses src/NuGetGallery.Core/Login/LoginDiscontinuation.cs:16
  • LoginDiscontinuation.ForceTransformationToOrganizationForEmailAddresses src/NuGetGallery.Core/Login/LoginDiscontinuation.cs:17
  • OrganizationTenantPair.EmailDomain src/NuGetGallery.Core/Login/LoginDiscontinuation.cs:111
  • StagingPromotionNotificationService._emailSettingsUrl src/NuGetGallery.Core/Services/StagingPromotionNotificationService.cs:21
  • + 41 more field(s) in this category.
Name — 5 field(s)
  • PackageEntry.FullName src/Catalog/PackageEntry.cs:30
  • PackageEntry.FullName src/NuGet.Protocol.Catalog/Models/PackageEntry.cs:17
  • DeleteOnCloseReadOnlyTempFile.FullName src/Validation.Common.Job/TempFiles/DeleteOnCloseReadOnlyTempFile.cs:33
  • ITempFile.FullName src/Validation.Common.Job/TempFiles/ITempFile.cs:16
  • TempFile.FullName src/Validation.Common.Job/TempFiles/TempFile.cs:54

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