Public report of FirelyTeam/firely-cql-sdk, published 17 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, 17 November 2026, 22:22 UTC · Survey ID cd_d3d88cbb023f4da08b1362f494e70240

FirelyTeam/firely-cql-sdk

Measured 17 November 2026, 22:21 UTC, at code version 7109a71

First survey, so nothing to compare with yet Code coverage: not measuredBoundary Type-Coupling: not measured

Code coverage is not measured: The repo's test suite did not build.

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

CAI score 54.5out of 100 Adequate
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 medium codebase: 83,494 lines of product code in 29 projects, tests not counted · Estimated rebuild effort: about 2.2 person-years · Weakest lens: Security and Compliance, 30.4

Findings by how serious they are

34 critical 518 serious 133 minor

5 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
17 November 2026, 22:21 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 ▸

66of 66 dimensions measured by tools.
671of 685 findings point to an exact file and line, so you can open each one in the code. The other 14 concern the repository as a whole, such as missing documentation.
66dimensions across 6 lenses, read from 83,494 lines of product code in 29 projects.
Chapters

Executive summary

FirelyTeam/firely-cql-sdk falls short of our standard for production, in part because we found no encryption of stored data, no key vault and no enforced HTTPS. It scores 54.5 out of 100 and is rated Adequate, and one of its 34 critical findings is a security problem in its automatic dependency updates.

Security and Compliance, at 30.4, is the weakest lens and counts most in the score. The best first step is encrypting the sensitive stored data and keeping its keys in a vault, worth about 16.0 points. Fixing the security flaws the scanner found comes next, worth about 7.9 points. Raising Security and Compliance to 70 would lift the score to about 72.8.

One automatic update takes new releases before a bad one can be spotted. Setting a waiting period for automatic updates would close this risk. The 11 warnings switched off for a whole file need narrowing to the lines that need them.

The product code is 83,494 lines, about €320,000 to rebuild.

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.
Security and Compliance 30.4 · counts for 46%Production Readiness 70.3 · counts for 25%Code Health 70.6 · counts for 14%Architecture 83.8 · counts for 8%Maturity 93.1 · counts for 4%Performance 97.1 · counts for 2%

If Security and Compliance rose from 30.4 to 70, the lowest score rated Strong, the score would rise from 54.5 to about 72.8.

Code composition: what the lines of code are
Business logic 23%Supporting code 22%Tests 54%Generated by tools 0%
Rebuild cost: about €320,000 · Estimate
Cost to rebuild€100,000 to €540,000, for 1,732 to 5,637 hours of work, about 2.2 person-years for 1 to 5 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.8 at a score of 55. 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.
SizeMedium: 83,494 lines of product code
Comment linesThe estimate prices 59,303 lines. Comment lines count towards the size of 83,494 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
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.).
Raises the score by about 16.0 points · Medium effort · Data Protection
2
Resolve the 92 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (52), REDACTED (11), REDACTED (6).
Raises the score by about 7.9 points · Medium effort · Static Analysis (SAST)
3
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing.
Raises the score by about 2.8 points · Low effort · Supply-chain Provenance & Signing

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 €320,000 to build again, about 2.2 person-years of work. Its weakest lens is Security and Compliance, at 30.4 (Weak). Security and Compliance is about how well the product is protected, and how it handles personal data. Because the weakest lens counts most in the score, work on Security and Compliance also moves the score most.
Based on: the rebuild estimate · the Security and Compliance grade · how much each lens counts
What to do: Start with the Security and Compliance actions in Top priorities.
If you do one thing first · First action
Encrypt sensitive data at rest (ASP.NET Core Data Protection / column encryption) and manage keys in a vault. Of all the actions in this report, it raises the score most for the work it takes: about 16.0 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 7.4 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 2% to 5% on every change. The history of the code shows how much it changes: about 102,453 lines over the last 90 days, which is about 415,504 lines a year. At that pace, the extra work comes to an estimated 20.8 to 138.5 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture — bounded-context dependency graph

Each box is a bounded context (its layer projects grouped, or a project count when large); arrows show dependencies between contexts. A shared kernel is where many arrows converge.

arch CLI CLI ctx:Cql Cql 11 projects CLI->ctx:Cql CqlSdkExamples CqlSdkExamples CqlSdkExamples->ctx:Cql CqlSdkExamplesPreview CqlSdkExamplesPreview CqlSdkExamplesPreview->ctx:Cql Authoring Authoring Authoring->ctx:Cql Measures.Demo Measures.Demo Measures.Demo->ctx:Cql PackagerCLI PackagerCLI PackagerCLI->ctx:Cql XsdToCSharpConverter XsdToCSharpConverter ctx:Elm (Cql/Elm) Elm (Cql/Elm) 1 project ctx:Cql->ctx:Elm (Cql/Elm) ctx:Cql (Cql/Cql) Cql (Cql/Cql) 1 project ctx:Cql (Cql/Cql)->ctx:Cql ctx:Cql (Cql/Cql)->ctx:Elm (Cql/Elm) ctx:Demo Demo 2 projects ctx:Demo->ctx:Cql __more__ +2 more contexts

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.

68 modules, with 172 dependencies between them. 8 loops run through 21 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 28 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 Abstractions2 Exceptions3 Packager.Commands.Global4 Compiler.CodeModel5 Packager.Commands.Logging6 Primitives7 Comparers8 Conversion9 ValueSets10 Operators11 Runtime12 Elm13 Fhir14 Invocation.Toolkit.Errors15 Toolkit16 Compiler.Preprocessing17 CqlToElm.Builtin18 CqlToElm.Scopes19 Compiler20 CqlToElm.Visitors21 CodeGeneration.NET22 CqlToElm23 Packaging24 CodeGeneration.NET.Toolkit.Internal25 CqlToElm.Toolkit.Internal26 Invocation.Toolkit.Internal27 Packaging.Toolkit28 CodeGeneration.NET.Toolkit29 CqlToElm.Toolkit30 Invocation.Toolkit31 CodeGeneration.NET.Toolkit.Extensions32 CqlToElm.Toolkit.Extensions33 Invocation.Toolkit.Extensions34 Packager.Options35 Packaging.Toolkit.Extensions36 Packager37 Packager.Commands.CqlToFhir38 Packager.Commands.ElmToFhir39 Packager.Commands.ExtractLibraryAttachments40 Packager.Commands.ReplaceLibraryAttachments
1 Abstractions
2 Exceptions
3 Packager.Commands.Global
4 Compiler.CodeModel1
5 Packager.Commands.Logging1
6 Primitives6
7 Comparers18
8 Conversion3
9 ValueSets82
10 Operators121323
11 Runtime22
12 Elm44
13 Fhir1815743
14 Invocation.Toolkit.Errors23
15 Toolkit2
16 Compiler.Preprocessing93
17 CqlToElm.Builtin366
18 CqlToElm.Scopes22
19 Compiler4517433756
20 CqlToElm.Visitors20125
21 CodeGeneration.NET2265414
22 CqlToElm154422
23 Packaging2241753
24 CodeGeneration.NET.Toolkit.Internal222
25 CqlToElm.Toolkit.Internal21144
26 Invocation.Toolkit.Internal3142210
27 Packaging.Toolkit52112
28 CodeGeneration.NET.Toolkit321461
29 CqlToElm.Toolkit32151
30 Invocation.Toolkit3112223
31 CodeGeneration.NET.Toolkit.Extensions31452
32 CqlToElm.Toolkit.Extensions11312
33 Invocation.Toolkit.Extensions21122115
34 Packager.Options111123
35 Packaging.Toolkit.Extensions12733
36 Packager123
37 Packager.Commands.CqlToFhir11142
38 Packager.Commands.ElmToFhir11142
39 Packager.Commands.ExtractLibraryAttachments1112
40 Packager.Commands.ReplaceLibraryAttachments11112
Uses a module listed above itPart of a loopThe module itself
1 Abstractions2 Exceptions3 Packager.Commands.Global4 Compiler.CodeModel5 Packager.Commands.Logging6 Primitives7 Comparers8 Conversion9 ValueSets10 Operators11 Runtime12 Elm13 Fhir14 Invocation.Toolkit.Errors15 Toolkit16 Compiler.Preprocessing17 CqlToElm.Builtin18 CqlToElm.Scopes19 Compiler20 CqlToElm.Visitors21 CodeGeneration.NET22 CqlToElm23 Packaging24 CodeGeneration.NET.Toolkit.Internal25 CqlToElm.Toolkit.Internal26 Invocation.Toolkit.Internal27 Packaging.Toolkit28 CodeGeneration.NET.Toolkit29 CqlToElm.Toolkit30 Invocation.Toolkit31 CodeGeneration.NET.Toolkit.Extensions32 CqlToElm.Toolkit.Extensions33 Invocation.Toolkit.Extensions34 Packager.Options35 Packaging.Toolkit.Extensions36 Packager37 Packager.Commands.CqlToFhir38 Packager.Commands.ElmToFhir39 Packager.Commands.ExtractLibraryAttachments40 Packager.Commands.ReplaceLibraryAttachmentsAbstractions1Exceptions2Packager.Commands.Global3Compiler.CodeModel4Packager.Commands.Logging5Primitives6Comparers7Conversion8ValueSets9Operators10Runtime11Elm12Fhir13Invocation.Toolkit.Errors14Toolkit15Compiler.Preprocessing16CqlToElm.Builtin17CqlToElm.Scopes18Compiler19CqlToElm.Visitors20CodeGeneration.NET21CqlToElm22Packaging23CodeGeneration.NET.Toolkit.Internal24CqlToElm.Toolkit.Internal25Invocation.Toolkit.Internal26Packaging.Toolkit27CodeGeneration.NET.Toolkit28CqlToElm.Toolkit29Invocation.Toolkit30CodeGeneration.NET.Toolkit.Extensions31CqlToElm.Toolkit.Extensions32Invocation.Toolkit.Extensions33Packager.Options34Packaging.Toolkit.Extensions35Packager36Packager.Commands.CqlToFhir37Packager.Commands.ElmToFhir38Packager.Commands.ExtractLibraryAttachments39Packager.Commands.ReplaceLibraryAttachments40116183821213232244181574323293366224517433756201252265414154422224175322221144314221052112321461321513112223314521131221122115111123127331231114211142111211112+28 more modules (most-connected shown)

At a glance — Code Health · 70.6 · Strong ·

At a glance — Architecture · 83.8 · Strong ·

At a glance — Maturity · 93.1 · Exemplary ·

At a glance — Readiness · 70.3 · Strong ·

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

At a glance — Performance · 97.1 · Exemplary ·

Security & Compliance — OWASP Top-10 mapping

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

OWASP categoryFindingsSeverity
A05:2025 — Injection97High / Critical
A03:2025 — Software Supply Chain Failures2Medium

Roadmap

Top priorities: 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.); Resolve the 92 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (52), REDACTED (11), REDACTED (6); Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing.

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

Do thisHelpsEffortDimension
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.).+16.0 ptsMediumData Protection
Resolve the 92 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (52), REDACTED (11), REDACTED (6).+7.9 ptsMediumStatic Analysis (SAST)
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing.+2.8 ptsLowSupply-chain Provenance & Signing
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing.+2.8 ptsLowSupply-chain Provenance & Signing
Resolve the 4 AnalyzerSeverityNone finding(s) in Explicit Debt — start with .editorconfig (4).+2.4 ptsLowExplicit Debt
Resolve the 9 NoWarnInCsproj finding(s) in Explicit Debt — start with cql-sdk.props (3), cql-demo.props (2), CoreTests.csproj.+2.4 ptsLowExplicit Debt
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED.+1.7 ptsLowStatic Analysis (SAST)
Resolve the 10 FileScopedPragmaDisable finding(s) in Explicit Debt — start with IntervalRelationshipGridDump.cs, CqlOperatorsBinder.Bind.cs, Defaults.cs.+2.4 ptsMediumExplicit Debt

File quality

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

FileScoreBandWorst signal
REDACTED3.7SlopExplicit Debt: FileScopedPragmaDisable repeated across 20 files
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.8MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.3MixedStatic Analysis (SAST): Medium: REDACTED
Cql/Cql.Compiler/CqlOperatorsBinder.Bind.cs5.4MixedExplicit Debt: FileScopedPragmaDisable
Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs5.5MixedCyclomatic Complexity: CqlOperators.Expand (cyclomatic 22)
.editorconfig5.5MixedExplicit Debt: AnalyzerSeverityNone
cql-sdk.props5.8MixedExplicit Debt: NoWarnInCsproj
REDACTED5.8MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.9MixedStatic Analysis (SAST): Medium: REDACTED
Cql/Cql.Compiler/CodeBuilderContext.cs6.0MixedExplicit Debt: CommentedOutCode
Cql/Cql.CqlToElm/Visitors/QueryExpressionVisitor.cs6.0MixedExplicit Debt: TodoComment
Cql/Cql.Compiler/CodeBuilderContext.Query.cs6.0MixedExplicit Debt: TodoComment
Cql/Cql.Compiler/CodeBuilderContext.Operators.cs6.0MixedExplicit Debt: TodoComment
Cql/Cql.CqlToElm/InvocationBuilder.cs6.0MixedExplicit Debt: CommentedOutCode
Cql/Cql.CqlToElm/Visitors/LibraryVisitor.cs6.0MixedExplicit Debt: TodoComment
Cql/Cql.CqlToElm/Visitors/ExpressionVisitor.cs6.0MixedExplicit Debt: TodoComment

How the grades work

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

Critical — 34

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

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

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

Could not be resolved — 5

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 66 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, the weighted average across measured dimensions.

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

What we checked — 66 dimensions across the health lenses
D1D2D3D4D5D6D7D10D11D13D15D16D17D18D19D20D24D26D27D28D29D30D34D35D36D43D44AX1AX10AX2AX3AX4AX5AX6AX8C1C4GD1IC1M1M2M3M4P1P3P4P6PF1PF3X1X12X16X18X19X2X20X21X23X25X27X28X29X3X30X4X5

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, 671 of 685 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 01a1eb9a-0bd4-7a11-bb86-2cd7c6aabc6c.

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.

  • 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 3,095 test(s) behind this row are the ones the C# collector could read, and this repository also carries at least 2 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 — 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. Test reliability is scored on the 1 tier(s) that produced comparable repeat runs; 1 tier(s) did not, and are excluded from the measurement rather than counted (unit: not included — too large to re-run within its budget; other: measured (0 flaky)). This is OUR limitation, not a defect in the repository.
  • 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. `dotnet list package` did not return usable output (restore or query failed); no outdated/vulnerable/deprecated data to assess. The tool said: /usr/share/dotnet/sdk/10.0.400/NuGet.targets(521,5): error MSB3202: The project file "submodules/Firely.Cql.Sdk.Integration.Runner/CodeGen/CodeGen.csproj" was not found. [Cql-Sdk-All.slnx].
  • D14 License Compliance — 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. License scan produced no result — the tool ran but wrote no JSON report (no package reference resolved); the offline NuGet fallback resolved nothing.
  • 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: Project file not found: 'submodules/Firely.Cql.Sdk.Integration.Runner/CodeGen/CodeGen.csproj'.
  • 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.
  • 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 — 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. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D21 Naming Consistency — 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. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D22 Internal API Consistency — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. The loaded project set declares no packable project and no `.Contracts` project, so there is no intentionally-exposed surface for API consistency to be judged over.
  • 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 (83,263 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; `Cql/PackagerCLI/Hl7.Cql.Packager.Demo.appsettings.json`, `Cql/PackagerCLI/Hl7.Cql.Packager.appsettings.debug.json`, `Cql/PackagerCLI/Hl7.Cql.Packager.dqm-content-qicore-2025.appsettings.json` 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 — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. The solution did not restore on the analyzer's .NET SDK (an SDK/target-framework/restore mismatch, common for an older codebase), so there was no restored dependency graph to scan. 1 of 2 declared ecosystem(s) (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. `Cql/CodeGeneration.NET/CSharpNamingConventions.cs`, `Cql/CodeGeneration.NET/LibrarySetCSharpCodeGenerator.DefinitionWriter.cs`, `Cql/CodeGeneration.NET/LibrarySetCSharpCodeGenerator.LibrarySetWriter.cs`, `Cql/CodeGeneration.NET/LibrarySetCSharpCodeGenerator.LibraryWriter.cs`, `Cql/CodeGeneration.NET/Toolkit/Internal/ElmToolkitScopedState.cs`, … (+92 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
  • 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. 11 further occurrence(s) are not listed individually; the score already reflects all 51.
  • M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.

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

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.
  • D7 Architectural Integrity: Layering is checked against detected/declared rules — an architecture whose boundaries live in convention or in code review, not in a rule a scanner can read, is not enforced here.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • D11 Test Reliability: Flakiness is inferred from history/markers — we run the suite once (for coverage), not the repeated runs under varied conditions that reveal nondeterminism, so a flaky test never recorded as failing is invisible here.
  • D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • 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.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • 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.
  • 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.
  • 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.
  • 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.4 / 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.4 / 10 · rule-coverage 100% · ceiling Prevented

70 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was DateTimeIso8601.DateTimeIso8601.ctor at 70. A further 19 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 CodeBuilderContext.TranslateElement at 58 — they are counted neither in the figure above nor in this dimension's score. 9 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: Cql/Cql.CqlToElm/ElmFactory.cs (ElmFactory.CreateElmNode at 31), Cql/Cql.Compiler/CqlOperatorsBinder.cs (CqlOperatorsBinder.BindToMethod at 24), Cql/Cql.Runtime/Operators/CqlOperators.ArithmeticOperators.cs (CqlOperators.HighBoundary at 22), Examples/CqlSdkExamples/Program.cs (Program.PickExample at 20), Cql/CodeGeneration.NET/CSharpEmitter.Scope.cs (Scope.CountSpineNodes at 19), and 4 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.

CqlOperators.Expand (cyclomatic 20) · ×4Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:517
CqlOperators.Expand (cyclomatic 17) · ×4Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:811
CqlOperators.Expand (cyclomatic 22) · ×2Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:737
CqlOperators.Expand (cyclomatic 19) · ×2Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:592
DateTimeIso8601.DateTimeIso8601.ctor (cyclomatic 70)Cql/Iso8601/DateTimeIso8601.cs:158

+ 57 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 DateTimeIso8601.DateTimeIso8601.ctor (cyclomatic 70). — Refactoring it lifts Cyclomatic Complexity from 6.4 to about 6.5/10.

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

D2 · Cognitive Complexity5.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 5.4 / 10 · rule-coverage 100% · ceiling Prevented

98 method(s) exceeded the cognitive complexity threshold of 15; the worst was DateTimeIso8601.DateTimeIso8601.ctor at 160.

CqlOperators.Expand (cognitive 46) · ×3Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:178
CqlOperators.Expand (cognitive 35) · ×2Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:504
CqlOperators.Expand (cognitive 25) · ×2Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:517
CqlOperators.Expand (cognitive 20) · ×2Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:811
DateTimeIso8601.DateTimeIso8601.ctor (cognitive 160)Cql/Iso8601/DateTimeIso8601.cs:158

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

What to do

  1. Bring the 6 bodies over 60 down to 60 or less in Cognitive Complexity — start with DateTimeIso8601.DateTimeIso8601.ctor (cognitive 160), CqlDateTime.CompareValues (cognitive 128), ExpressionVisitor.VisitQuery (cognitive 79). — 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 6 together lifts Cognitive Complexity from 5.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 Classes8.9 / 10Strong✓ 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 8.9 / 10 · rule-coverage 100% · ceiling Prevented

21 god class(es) detected.

TooManyMethods: CqlOperators · ×8Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs
MethodTooLong: ExpressionVisitor.VisitQuery · ×7Cql/Cql.CqlToElm/Visitors/QueryExpressionVisitor.cs:16
FileTooLong: Operators/CqlOperators.IntervalOperators.cs · ×6Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs

What to do

  1. Resolve the 8 TooManyMethods finding(s) in God Classes — start with CqlOperators.IntervalOperators.cs, CodeBuilderContext.Operators.cs, LiteralVisitor.cs. — One of this dimension's main actionable groups (8 warning-level).
  2. Resolve the 7 MethodTooLong finding(s) in God Classes — start with QueryExpressionVisitor.cs, CqlToFhirProgram.cs, CoercionProvider.cs. — One of this dimension's main actionable groups (7 warning-level).
  3. Resolve the 6 FileTooLong finding(s) in God Classes — start with CqlOperators.IntervalOperators.cs, XsdCodeGenerator.cs, CqlOperators.ArithmeticOperators.cs. — One of this dimension's main actionable groups (6 warning-level).

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

D4 · Code Duplication8.0 / 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 8.0 / 10 · rule-coverage 100% · ceiling Verified

57 duplicated block group(s) detected. 5.0 % of the production lines (4,149 of 83,263) are in a reported copy. A further 73 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 6 of the 130 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.

Edited copy of a member (13 corresponding lines) · ×5Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:1083
Duplicated block (13 lines × 2) · ×5Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:541
Edited copy of a member (12 corresponding lines) · ×4Cql/Cql.Runtime/Operators/CqlOperators.AggregateFunctions.cs:571
Members sharing a duplicated core (4 members, 50+ identical tokens) · ×3Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:738
Edited copy of a member (19 corresponding lines) · ×3Cql/Cql.Runtime/Comparers/EnumComparer.cs:28

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

What to do

  1. Resolve the 5 Edited copy of a member (13 corresponding lines) finding(s) in Code Duplication — start with CqlOperators.IntervalOperators.cs, REDACTED, CqlOperators.ComparisonOperators.cs. — One of this dimension's main actionable groups (5 warning-level).
  2. Resolve the 5 Duplicated block (13 lines × 2) finding(s) in Code Duplication — start with CqlOperators.IntervalOperators.cs (3), CqlToFhirProgram.cs, CqlOperators.ListOperators.cs. — One of this dimension's main actionable groups (5 warning-level).
  3. Resolve the 4 Edited copy of a member (12 corresponding lines) finding(s) in Code Duplication — start with CqlOperators.AggregateFunctions.cs, CqlOperators.DateTimeOperators.cs, ElmToolkit.cs. — One of this dimension's main actionable groups (4 warning-level).

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

D5 · Coupling9.2 / 10Stronggated by 3 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.2 / 10 · rule-coverage 100% · ceiling Prevented

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

Off the main sequence: Iso8601 · ×3Cql/Iso8601/Iso8601.csproj:1

What to do

  1. Resolve the 3 Off the main sequence finding(s) in Coupling — start with Iso8601.csproj, Cql.Model.csproj, Cql.Firely.csproj. — One of this dimension's main actionable groups (3 warning-level).

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

D6 · Cohesion (LCOM4)9.9 / 10Stronggated by 1 serious finding✓ 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.9 / 10 · rule-coverage 100% · ceiling Verified

1 of 94 classes have LCOM4 above 3.

Low cohesion: CqlOperators (LCOM4 68)Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:17

What to do

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

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

D7 · Architectural Integrity10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the code respects its intended layering / architecture rules.

Method: Enforcement rung (Prevented/Verified/Documented) per checkable ADR via Roslyn, plus dependency cycles via the engine shared with D5/AX3. Deterministic, exact.

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

All 1 mechanizable ADR(s) are enforced: 1 by analyzers, 0 by tests. Cycles found: 0.

✓ On the Gold path — maintain.

Detailed fixes: d7_recommendation.md.

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

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

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

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

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

Skipped test: ConvertParameters_Date_Macro · ×8Cql/CoreTests/FhirTypeConverterTests.cs:218
No assertions: Model_FhirR4Cql/CoreTests/ModelTest.cs:23
Skipped (documented): ToQuantity_OfAStringWithAUnitThatIsNotUcum_IsNull · ×4Cql/CoreTests/ToOperatorTests.cs:350

What to do

  1. Resolve the 8 Skipped test finding(s) in Test Quality — start with FhirTypeConverterTests.cs (8). — One of this dimension's main actionable groups (8 warning-level).
  2. Resolve the 1 No assertions finding(s) in Test Quality — start with ModelTest.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.

D11 · Test Reliability10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the tests pass reliably, with no flakiness.

Method: Suite re-run N times within tiered wall-clock budgets (unit to e2e); tests failing non-deterministically across runs flagged; guarded tests retried when #if guards detected.

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

Only 1 of 2 test tiers measured — the score covers those alone. 0 flaky across 1 measured tier(s). unit: not included — too large to re-run within its budget; other: measured (0 flaky).

✓ On the Gold path — maintain.

Detailed fixes: d11_recommendation.md.

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

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

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

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

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

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

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

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

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

Top hotspots: Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs (41×22=902); Cql/Cql.Abstractions/Primitives/CqlDateTimeMath.cs (9×42=378); Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs (17×22=374)

Hotspot: Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs · ×10Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:737

What to do

  1. Resolve the 10 Hotspot finding(s) in Churn × Complexity Hotspots — start with CqlOperators.IntervalOperators.cs, CqlDateTimeMath.cs, CqlOperators.ListOperators.cs. — One of this dimension's main actionable groups (10 warning-level).

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

D16 · Bus Factor8.5 / 10Strong✓ 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 8.5 / 10 · rule-coverage 100% · ceiling Documented

42 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs. Counted over 270 of the 477 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Off-boarding risk: anonymized user #1 · ×3

What to do

  1. Resolve the 3 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (3 recommendation-level).

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

D17 · Explicit Debt8.9 / 10Adequategated by 25 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 8.9 / 10 · rule-coverage 100% · ceiling Prevented

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

FileScopedPragmaDisable · ×10Cql/CoreTests/IntervalRelationshipGridDump.cs:10
NoWarnInCsproj · ×9Cql/CoreTests/CoreTests.csproj:13
AnalyzerSeverityNone · ×4.editorconfig:4
WriteOnlyPrivateFieldCql/CoreTests/QueriesTest.cs:55
FileScopedPragmaDisable repeated across 20 filesREDACTED:1

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

What to do

  1. Resolve the 10 FileScopedPragmaDisable finding(s) in Explicit Debt — start with IntervalRelationshipGridDump.cs, CqlOperatorsBinder.Bind.cs, Defaults.cs. — One of this dimension's main actionable groups (10 issue-level).
  2. Resolve the 9 NoWarnInCsproj finding(s) in Explicit Debt — start with cql-sdk.props (3), cql-demo.props (2), CoreTests.csproj. — One of this dimension's main actionable groups (9 issue-level).
  3. Resolve the 4 AnalyzerSeverityNone finding(s) in Explicit Debt — start with .editorconfig (4). — One of this dimension's main actionable groups (4 issue-level).

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

D18 · Solution Shape10.0 / 10Stronggated by 1 serious finding✓ 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

27 projects, 774 source files, 152511 hand-written lines of code (82474 production / 70037 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 238 generated (machine-written code — designer, scaffolded and tool-emitted files — excluded from quality), 79 inter-project edges (build status unknown — did not finish).

Solution references 7 projects that do not existCql-Sdk-All.slnx

What to do

  1. Resolve the 1 Solution references 7 projects that do not exist finding(s) in Solution Shape — start with Cql-Sdk-All.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 Quality10.0 / 10Exemplary○ Nothing flagged

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

2 of 2 documentation facets pass in full. 40 document(s) read across 24 unit(s).

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

D20 · ADR Quality10.0 / 10Exemplary○ Nothing flagged

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

0 of 4 evaluated ADRs have a defect readable from the log itself (a missing or empty section, no title, a single option, consequences with no cost, no status, a missing enforcement field, a status the log contradicts, a dangling link, an unlinked second decision on one question, a date that is no calendar day). How well each record argues its case is not measured.

✓ On the Gold path — maintain.

Detailed fixes: d20_recommendation.md.

D24 · Comment Value7.3 7.1 / 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.1 / 10 · rule-coverage 98% · ceiling Documented

61 of 2233 judged comments only repeat the code they sit on (2.7 %). 58 comment(s) in another language or script were not judged.

redundant comment · ×36Cql/CodeGeneration.NET/CSharpEmitter.Print.cs:170
doc comments repeat the names · ×10Cql/CodeGeneration.NET/CacheKeyGenerator.cs:20

What to do

  1. Resolve the 36 redundant comment finding(s) in Comment Value — start with TypeSpecifierVisitor.cs (4), ElmSerializerTests.cs (3), TerminalParsers.cs (3). — One of this dimension's main actionable groups (36 recommendation-level).

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

D26 · Project Cohesion8.6 / 10Strong✓ 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 8.6 / 10 · rule-coverage 100% · ceiling Documented

2 of 29 projects flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion · ×2Cql/Cql.Grammar/Cql.Grammar.csproj:1

What to do

  1. Resolve the 2 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with Cql.Grammar.csproj, Cql.Runtime.csproj. — One of this dimension's main actionable groups (2 recommendation-level).

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

D27 · Navigability9.3 / 10Exemplary✓ 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 9.3 / 10 · rule-coverage 100% · ceiling Documented

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

✓ On the Gold path — maintain.

Detailed fixes: d27_recommendation.md.

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

D29 · Static Analysis (SAST)0.1 / 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.1 / 10 · rule-coverage 100% · ceiling Documented

97 finding(s): 0 critical, 1 high, 96 medium, 0 low. semgrep hit a parse error in 131 file(s) — `Cql/CodeGeneration.NET/CSharpNamingConventions.cs` (lines 27–30, line 30), `Cql/CodeGeneration.NET/LibrarySetCSharpCodeGenerator.DefinitionWriter.cs` (line 62, line 89, line 116, …), `Cql/CodeGeneration.NET/LibrarySetCSharpCodeGenerator.LibrarySetWriter.cs` (lines 9–15, line 43), `Cql/CodeGeneration.NET/LibrarySetCSharpCodeGenerator.LibraryWriter.cs` (line 223, line 248, line 250), `Cql/CodeGeneration.NET/Toolkit/Internal/ElmToolkitScopedState.cs` (line 14), … (+126 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 97 of those file(s) — `Cql/CodeGeneration.NET/CSharpNamingConventions.cs`, `Cql/CodeGeneration.NET/LibrarySetCSharpCodeGenerator.LibrarySetWriter.cs`, `Cql/CodeGeneration.NET/Toolkit/Internal/ElmToolkitScopedState.cs`, `Cql/CoreTests/Abstractions/CSharpFormatterTests.cs`, `Cql/CoreTests/AgeOperatorTests.cs`, … (+92 more) — 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 18 of those file(s) — `Cql/CoreTests/CqlAssemblyInfoReaderTests.cs`, `Cql/CoreTests/CqlComparersTests.cs`, `Cql/CoreTests/ValueSetSourceFacadeMemoTests.cs`, `Cql/Cql.Abstractions/Abstractions/CqlConceptDefinitionAttribute.cs`, `Cql/Cql.Abstractions/Abstractions/CqlExpressionDefinitionAttribute.cs`, … (+13 more) — 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.

REDACTED
REDACTED
REDACTED
REDACTED

What to do

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

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

D30 · Dependency Vulnerabilities10.0 / 10Exemplary○ Nothing flagged

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

No known-vulnerable dependencies in the 1 ecosystem(s) that were scanned (osv). Partial dependency scan: 1 of 2 declared ecosystem(s) were scanned (osv), and the findings above are real and complete for them. nuget was not scanned (nuget: the solution did not restore on the analyzer's .NET SDK (an SDK/target-framework/restore mismatch, common for an older codebase), so there was no restored dependency graph to scan), so this is not the whole dependency surface and the result is reported at reduced confidence.

✓ On the Gold path — maintain.

Detailed fixes: d30_recommendation.md.

D34 · Knowledge Freshness9.7 / 10Exemplary✓ Tool-verified

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

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

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

8 of 270 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is Cql/Cql.CqlToElm/Scopes/SymbolTable.cs. Counted over 270 of the 477 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned file · ×8Cql/Cql.CqlToElm/Scopes/SymbolTable.cs:1
Orphaned files with no living knowledge

✓ On the Gold path — maintain.

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

D35 · Change Coupling9.9 / 10Stronggated by 4 serious findings✓ Tool-verified

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

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

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

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

Strongest change-coupling: ResourcePackager.cs↔LibraryExtensions.cs 70%; CqlToFhirOptions.cs↔ElmToFhirCommand.cs 64%; CqlToFhirOptions.cs↔ElmToFhirOptions.cs 64%

Change coupling: ResourcePackager.cs ↔ LibraryExtensions.cs · ×3Cql/Cql.Packaging/ResourcePackager.cs:1
Change-coupling hub: CqlToFhirOptions.cs → ElmToFhirCommand.cs, ElmToFhirOptions.cs, ElmToFhirProgram.csCql/PackagerCLI/Commands.CqlToFhir/CqlToFhirOptions.cs

What to do

  1. Resolve the 3 Change coupling finding(s) in Change Coupling — start with ResourcePackager.cs, CqlToFhirCommand.cs, PackagerCliServiceCollectionExtensions.cs. — One of this dimension's main actionable groups (3 warning-level).
  2. Resolve the 1 Change-coupling hub finding(s) in Change Coupling — start with CqlToFhirOptions.cs. — One of this dimension's main actionable groups (1 warning-level).

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

D36 · Supply-chain Provenance & Signing3.3 / 10Weak✓ Tool-verified

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

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

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

1/3 supply-chain integrity signals present (provenance, signing, SBOM).

REDACTED
REDACTED

What to do

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

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

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

What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. 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-Life10.0 / 10Exemplary✓ 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 10.0 / 10 · rule-coverage 100% · ceiling Documented

0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 10 platform declaration(s) and 0 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.

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

Frontend & cross-cutting dimensions

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

AX1 · Captive dependencies10.0 / 10Exemplary✓ 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.

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

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

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 singletons4.9 / 10Weak✓ 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.

  • `TypeConverter` is a singleton (one shared instance) but mutates instance state outside any lock (_converters, _customConverters; e.g. `_converters` at line 144). — Cql/Cql.Runtime/Conversion/TypeConverter.cs:34
  • `VersionedIdentifier` is not registered, but `LibraryBuilder` creates it and keeps it in the static `schemaIdentifier`, 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 (id, version; e.g. `id` at line 55). — Cql/Elm/Elm.cs:129
  • `ModelInfo` is not registered, but `SystemTypes` creates it and keeps it in the static `bootstrapSystemModel`, 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 (requiredModelInfoField, typeInfoField, conversionInfoField, contextInfoField, nameField, versionField; e.g. `requiredModelInfoField` at line 78). — Cql/Cql.Model/modelinfo.cs:25
  • `DateTimeIso8601` is not registered, but the singleton `CqlDateTime` creates it and keeps it in `InUtc`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (_string; e.g. `_string` at line 93). — Cql/Iso8601/DateTimeIso8601.cs:15
  • `TimeIso8601` is not registered, but the singleton `CqlTime` creates it and keeps it in `InUtc`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (_string; e.g. `_string` at line 116). — Cql/Iso8601/TimeIso8601.cs:15

What to do

  • Keep singletons stateless or back their state with thread-safe types (Concurrent*/Immutable*); otherwise concurrent callers race.
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 Hl7.Cql.Comparers ↔ Hl7.Cql.Primitives depend on each other. The lightest dependency in the cycle is Hl7.Cql.Primitives → Hl7.Cql.Comparers (Hl7.Cql.Primitives.CqlDate → Hl7.Cql.Comparers.ICqlComparable, 6 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. — Cql/Cql.Abstractions/Primitives/CqlDate.cs:10
  • The namespaces Hl7.Cql.Compiler ↔ Hl7.Cql.Compiler.CodeModel ↔ Hl7.Cql.Compiler.Preprocessing depend on each other. The lightest dependency in the cycle is Hl7.Cql.Compiler.CodeModel → Hl7.Cql.Compiler (Hl7.Cql.Compiler.CodeModel.CodeExpressionExtensions → Hl7.Cql.Compiler.TypeConversion, 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. — Cql/Cql.Compiler/CodeModel/CodeExpressionExtensions.cs:21
  • The namespaces Hl7.Cql.CodeGeneration.NET.Toolkit ↔ Hl7.Cql.CodeGeneration.NET.Toolkit.Internal depend on each other. The lightest dependency in the cycle is Hl7.Cql.CodeGeneration.NET.Toolkit → Hl7.Cql.CodeGeneration.NET.Toolkit.Internal (Hl7.Cql.CodeGeneration.NET.Toolkit.ElmToolkit → Hl7.Cql.CodeGeneration.NET.Toolkit.Internal.ElmToolkitServices, 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. — Cql/CodeGeneration.NET/Toolkit/ElmToolkit.cs:10
  • The namespaces Hl7.Cql.CqlToElm ↔ Hl7.Cql.CqlToElm.Builtin ↔ Hl7.Cql.CqlToElm.Scopes ↔ Hl7.Cql.CqlToElm.Visitors depend on each other. The lightest dependency in the cycle is Hl7.Cql.CqlToElm.Visitors → Hl7.Cql.CqlToElm.Builtin (Hl7.Cql.CqlToElm.Visitors.LibraryVisitor → Hl7.Cql.CqlToElm.Builtin.SystemLibrary, 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. — Cql/Cql.CqlToElm/Visitors/LibraryVisitor.cs:9
  • The namespaces Hl7.Cql.CqlToElm.Toolkit ↔ Hl7.Cql.CqlToElm.Toolkit.Internal depend on each other. The lightest dependency in the cycle is Hl7.Cql.CqlToElm.Toolkit → Hl7.Cql.CqlToElm.Toolkit.Internal (Hl7.Cql.CqlToElm.Toolkit.CqlToolkit → Hl7.Cql.CqlToElm.Toolkit.Internal.CqlToolkitServices, 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. — Cql/Cql.CqlToElm/Toolkit/CqlToolkit.cs:9
  • The namespaces Hl7.Cql.Invocation.Toolkit ↔ Hl7.Cql.Invocation.Toolkit.Internal depend on each other. The lightest dependency in the cycle is Hl7.Cql.Invocation.Toolkit → Hl7.Cql.Invocation.Toolkit.Internal (Hl7.Cql.Invocation.Toolkit.InvocationToolkit → Hl7.Cql.Invocation.Toolkit.Internal.LibrarySetInvokerBuilderServices, 3 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. — Cql/Cql.Invocation/Toolkit/InvocationToolkit.cs:11
  • The namespaces Hl7.Cql.Packaging ↔ Hl7.Cql.Packaging.Toolkit ↔ Hl7.Cql.Packaging.Toolkit.Internal depend on each other. The lightest dependency in the cycle is Hl7.Cql.Packaging.Toolkit → Hl7.Cql.Packaging.Toolkit.Internal (Hl7.Cql.Packaging.Toolkit.PackagingToolkit → Hl7.Cql.Packaging.Toolkit.Internal.PackagingToolkitServices, 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. — Cql/Cql.Packaging/Toolkit/PackagingToolkit.cs:12
  • The namespaces Hl7.Cql.Packager ↔ Hl7.Cql.Packager.Commands.Logging ↔ Hl7.Cql.Packager.Options depend on each other. The lightest dependency in the cycle is Hl7.Cql.Packager.Commands.Logging → Hl7.Cql.Packager (Hl7.Cql.Packager.Commands.Logging.LoggingOptions → Hl7.Cql.Packager.IBindOptions, 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. — Cql/PackagerCLI/Commands.Logging/LoggingOptions.cs:11

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.
AX4 · Dependency direction10.0 / 10Exemplary✓ Tool-verified

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

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

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.6 / 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.

  • `ICqlOperators` declares 503 members: `Comparer`, `CreateValueSetFacade`, `Convert`, `Retrieve`, `Abs`, `Abs`, `Abs`, `Abs`, `Add`, `Add`, `Add`, `Add`, `Add`, `Add`, `Add`, `After`, `After`, `After`, `After`, `After`, `After`, `After`, `After`, `After`, `After`, `After`, `After`, `After`, `After`, `After`, `After`, `After`, `After`, `After`, `After`, `After`, `After`, `Age`, `AgeAt`, `Aggregate`, and 463 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 503 declarations carry 229 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 229 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. — Cql/Cql.Runtime/Operators/ICqlOperators.cs:21
  • `IcqlListener` declares 358 members: `EnterDefinition`, `ExitDefinition`, `EnterLibrary`, `ExitLibrary`, `EnterLibraryDefinition`, `ExitLibraryDefinition`, `EnterUsingDefinition`, `ExitUsingDefinition`, `EnterIncludeDefinition`, `ExitIncludeDefinition`, `EnterLocalIdentifier`, `ExitLocalIdentifier`, `EnterAccessModifier`, `ExitAccessModifier`, `EnterParameterDefinition`, `ExitParameterDefinition`, `EnterCodesystemDefinition`, `ExitCodesystemDefinition`, `EnterValuesetDefinition`, `ExitValuesetDefinition`, `EnterCodesystems`, `ExitCodesystems`, `EnterCodesystemIdentifier`, `ExitCodesystemIdentifier`, `EnterLibraryIdentifier`, `ExitLibraryIdentifier`, `EnterCodeDefinition`, `ExitCodeDefinition`, `EnterConceptDefinition`, `ExitConceptDefinition`, `EnterCodeIdentifier`, `ExitCodeIdentifier`, `EnterCodesystemId`, `ExitCodesystemId`, `EnterValuesetId`, `ExitValuesetId`, `EnterVersionSpecifier`, `ExitVersionSpecifier`, `EnterCodeId`, `ExitCodeId`, and 318 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. — Cql/Cql.Grammar/cqlListener.cs:39
  • `IcqlVisitor<Result>` declares 179 members: `VisitDefinition`, `VisitLibrary`, `VisitLibraryDefinition`, `VisitUsingDefinition`, `VisitIncludeDefinition`, `VisitLocalIdentifier`, `VisitAccessModifier`, `VisitParameterDefinition`, `VisitCodesystemDefinition`, `VisitValuesetDefinition`, `VisitCodesystems`, `VisitCodesystemIdentifier`, `VisitLibraryIdentifier`, `VisitCodeDefinition`, `VisitConceptDefinition`, `VisitCodeIdentifier`, `VisitCodesystemId`, `VisitValuesetId`, `VisitVersionSpecifier`, `VisitCodeId`, `VisitTypeSpecifier`, `VisitNamedTypeSpecifier`, `VisitModelIdentifier`, `VisitListTypeSpecifier`, `VisitIntervalTypeSpecifier`, `VisitTupleTypeSpecifier`, `VisitTupleElementDefinition`, `VisitChoiceTypeSpecifier`, `VisitStatement`, `VisitExpressionDefinition`, `VisitContextDefinition`, `VisitFluentModifier`, `VisitFunctionDefinition`, `VisitOperandDefinition`, `VisitFunctionBody`, `VisitQuerySource`, `VisitAliasedQuerySource`, `VisitAlias`, `VisitQueryInclusionClause`, `VisitWithClause`, and 139 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. — Cql/Cql.Grammar/cqlVisitor.cs:40

What to do

  • Split fat interfaces into focused role-interfaces so clients depend only on what they use.
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.

C1 · Data Protection0.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.
C4 · Data Retention5.0 / 10Adequate✓ 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: an expiry limit — a declared maximum age / TTL after which the data is no longer kept, a scheduled purge / cleanup job (PurgeOlderThan / CleanupJob).

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.
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. (×6) — Cql/Cql.Abstractions/Comparers/CqlComparer.cs:47, Cql/Cql.Abstractions/Comparers/CqlComparer.cs:123, Cql/Cql.Abstractions/Comparers/CqlComparer.cs:202, …

What to do

  • Finish or delete NotImplementedException stubs and replace placeholder literals before shipping.
IC1 · Incompleteness & stubs8.0 / 10Strong✓ 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.

  • `AddElmFileWithDependencies` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. (×2) — Cql/CodeGeneration.NET/Toolkit/Extensions/ElmToolkitExtensions.Adding.cs:219, Cql/CodeGeneration.NET/Toolkit/Extensions/ElmToolkitExtensions.Adding.cs:234
  • `CreateFromExisting` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — Cql/Cql.CqlToElm/Scopes/LibraryBuilder.cs:22
  • Control only reaches here when `enumerator.MoveNext()` is true, because the guard on line 1022 exits otherwise. This test is therefore always false and everything it guards is unreachable. Implement the distinction that was intended, or delete the test. — Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:1026
  • A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something. (×9) — Cql/CoreTests/FhirTypeConverterTests.cs:218, Cql/CoreTests/FhirTypeConverterTests.cs:240, Cql/CoreTests/FhirTypeConverterTests.cs:262, …
  • A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers). (×26) — Cql/Cql.Compiler/CodeBuilderContext.Operators.cs:614, Cql/Cql.Compiler/CodeBuilderContext.Operators.cs:615, Cql/Cql.Compiler/CodeBuilderContext.Query.cs:107, …
  • 8 consecutive lines of code sit inside a `/* … */` block — a block of code switched off rather than removed, which rots and confuses. Delete it (version control remembers). — Cql/Cql.Compiler/CodeBuilderContext.cs:139

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)9.3 / 10Exemplary✓ 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.

M2 · Architecture documentation10.0 / 10Exemplary✓ 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.

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 accuracy8.8 / 10Strong✓ Tool-verified

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.

  • README.md names .NET 8, but the projects target .NET 10. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — README.md:16
  • docs/technical-readme.md names .NET 11, but the projects target .NET 10. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/technical-readme.md:206

What to do

  • Reconcile the README with reality: README.md names .NET 8, but the projects target .NET 10; docs/technical-readme.md names .NET 11, but the projects target .NET 10.
P1 · CI/CD gates10.0 / 10Exemplary○ Nothing flagged

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

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

P3 · Security & performance 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.

  • No static application security testing detected. For this repository's stack, add CodeQL's csharp pack, or a .NET security analyzer package (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 7 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
  • `REDACTED` schedules updates, but no `package-ecosystem` entry covers `maven`, `gitsubmodule`, which this tree depends on — so those dependencies get no update pull requests and no advisory pressure, however complete the dep-scan credit looks. Add the missing entries to the `updates:` list. — REDACTED:7

What to do

  • Add a SAST step to CI running what this repository's stack ships: CodeQL's csharp pack, or a .NET security analyzer package — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
  • Dependabot is configured but does not watch `maven`, `gitsubmodule` — add those `package-ecosystem` entries to REDACTED so those dependencies get the same automatic update and advisory pressure as the ones it already covers.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & 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

  • Make sure a person approves each release. The release job names an environment, but its approval rules live in the code host's settings, where we can't see them. Check that a reviewer must approve each release, or publish releases as drafts first, so a bad build can be stopped before anyone downloads it.
P6 · Release Hygiene10.0 / 10Exemplary✓ Tool-verified

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

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

PF1 · Benchmark discipline9.5 / 10Exemplary✓ Tool-verified

Readiness · Performance — Whether the code protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.

Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI; off .NET, the same ladder over Go testing.B, Rust criterion/#[bench]/divan, JMH/kotlinx-benchmark, pytest-benchmark/asv/pyperf, tinybench/mitata/vitest bench/benchmark.js and Swift package-benchmark — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.

PF3 · Async & latency hygiene10.0 / 10Exemplary✓ 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.

X1 · Async correctness10.0 / 10Exemplary○ Nothing flagged

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.

X12 · Unreachable branch8.0 / 10Strong✓ Tool-verified

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.

  • `case DateTimePrecision.Unknown:` can never be true where it stands: the guard on line 219 (`dtp == DateTimePrecision.Unknown`) left this block when it was true. No value of `dtp` satisfies all of that, so this case label never runs. Reorder the tests, drop the dead branch, or fix the bound that was meant. — Cql/Cql.Abstractions/Primitives/CqlDate.cs:254
  • `case DateTimePrecision.Unknown:` can never be true where it stands: the guard on line 311 (`dtp == DateTimePrecision.Unknown`) left this block when it was true. No value of `dtp` satisfies all of that, so this case label never runs. Reorder the tests, drop the dead branch, or fix the bound that was meant. — Cql/Cql.Abstractions/Primitives/CqlDateTime.cs:316
  • `case DateTimePrecision.Unknown:` can never be true where it stands: the guard on line 230 (`dtp == DateTimePrecision.Unknown`) left this block when it was true. No value of `dtp` satisfies all of that, so this case label never runs. Reorder the tests, drop the dead branch, or fix the bound that was meant. — Cql/Cql.Abstractions/Primitives/CqlTime.cs:319

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.
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.

X18 · Disposal-pattern correctness5.5 / 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.

  • `_services` (line 42) holds a `CqlToolkitServices` that `CqlToolkit` acquires itself — every assignment to it is a call that opens or creates a new instance for the caller to own — and nothing in `CqlToolkit` ever releases it: the type is not `IDisposable`, declares no `Dispose`, and every other mention of `_services` 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 `CqlToolkit`. Implement `IDisposable` and release `_services` there, or take the instance from the caller so its owner ends it. — Cql/Cql.CqlToElm/Toolkit/CqlToolkit.cs:42
  • `ServiceScope` is never created by `CqlToolkitServices` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 163). Its declared type `IServiceScope` 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. — Cql/Cql.CqlToElm/Toolkit/Internal/CqlToolkitServices.cs:163
  • `scope` is never created by `ElmToolkitScopedState` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 18). Its declared type `IServiceScope` 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. — Cql/CodeGeneration.NET/Toolkit/Internal/ElmToolkitScopedState.cs:18
  • `_writer` (line 25) holds a `StreamWriter` that `LibraryRunner` creates itself with `new`, and nothing in `LibraryRunner` ever releases it: the type is not `IDisposable`, declares no `Dispose`, and every other mention of `_writer` only reads through it. And `LibraryRunner` is not a process-lifetime owner: `new LibraryRunner(options)` (REDACTED line 50) creates one per call and drops it when the call returns, so each call strands one unreleased `StreamWriter` (a timer that keeps firing, a handle, a socket) until finalization. Implement `IDisposable`, release `_writer` there and dispose the owner at that call site — or keep one owner for the process instead of one per call. — Demo/CLI/LibraryRunner.cs:25

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 propagation4.0 / 10Weak✓ 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 0/6 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. (×5) — Cql/Cql.Firely/ValueSetSource.cs:252, Cql/Cql.Firely/ValueSetSource.cs:264, Cql/Cql.Firely/ValueSetSource.cs:316, …
  • Neither takes a CancellationToken nor reads the one of the function it sits in, while it calls something that takes one — this work can't be stopped early once started. Take the token, or pass on the enclosing one. — Cql/Cql.Firely/ValueSetSource.cs:277

What to do

  • Thread a CancellationToken through async methods so work stops promptly on cancellation.
X20 · Mistyped argument guard10.0 / 10Exemplary○ Nothing flagged

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.

X21 · Side-effecting pattern guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.

Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.

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.

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 element7.1 / 10Strong✓ Tool-verified

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.

  • This loop runs once per element of `declaringTypes`, and the statement it guards acts on the element it is on — `var readError = new CqlLibraryDeclaredByMoreThanOneTypeError( sameAssembly ? ...`. The test deciding whether that statement runs does not: `sameAssembly` reads `declaringTypes[0]`, a subscript that does not move, so whatever it answers for that one element it answers for ALL of them. One `if` names the same collection at two different subscripts — the fixed one at line 135, which is the contradiction: either the test was meant to be per-element, in which case every element that differs from the fixed one is handled wrongly and all in the same direction, or it really is one answer for the whole collection, in which case it is being re-asked on every pass and belongs above the loop. The `if` is in the wrong place under both readings. Give the test the loop variable, or hoist it out. — Cql/Cql.Invocation/Toolkit/LibrarySetInvoker.cs:140

What to do

  • Each finding names the test and the statement it guards, which index the same collection at two different subscripts — one fixed, one the loop variable. Confirm from the two, then decide which subscript the test meant. If it was meant to be per-element, give it the loop variable so each element is judged on itself. If it really is one answer for the whole collection, hoist the test OUT of the loop, where a reader can see it is asked once and where it is not re-evaluated on every pass — leaving it inside, reading a fixed element, is the one arrangement that cannot be right under either reading.
X3 · Exception handling10.0 / 10Exemplary○ Nothing flagged

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.

X30 · Support guard that admits what it rejects7.0 / 10Adequate✓ Tool-verified

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.

  • `reader.TokenType == JsonTokenType.StartObject && reader.Read() && reader.Toke...` can never be true: it asks `reader.TokenType` to equal both `JsonTokenType.StartObject` and `JsonTokenType.PropertyName` at once. Whatever this condition guards never runs, so every value it was written to refuse passes. Join the two equalities with `||` (either value) or test the second one on the value it was meant for. — Cql/Elm/Serialization/PolymorphicArrayJsonConverter.cs:16
  • `reader.TokenType == JsonTokenType.PropertyName && reader.GetString() == "def"...` can never be true: it asks `reader.TokenType` to equal both `JsonTokenType.PropertyName` and `JsonTokenType.StartArray` at once. Whatever this condition guards never runs, so every value it was written to refuse passes. Join the two equalities with `||` (either value) or test the second one on the value it was meant for. — Cql/Elm/Serialization/PolymorphicArrayJsonConverter.cs:33

What to do

  • Each finding expands the condition by De Morgan and names the two terms that disagree — a capability the body needs, and a value the guard refuses. Confirm from the expansion, then decide where the parentheses belong. Almost always the fault term was meant to be conjoined with the capabilities rather than listed beside them: `!((a || b) && x == k)` rejects anything that is neither a nor b, AND anything whose x is not k, which is what a support guard is for. Leaving it as written is the one arrangement that admits exactly the values the guard names.
X4 · Structured logging10.0 / 10Exemplary○ Nothing flagged

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.

X5 · Nullable reference types7.2 / 10Strong✓ 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.

  • 24/25 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.
  • ~3.2 `!` suppressions per 1k syntax nodes — 905 suppression(s) across the 279216 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

  • Enable <Nullable>enable</Nullable> across all projects and resolve warnings rather than suppressing with `!`.

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 Health70.6StrongSolid.
Architecture83.8StrongSolid.
Maturity93.1ExemplarySolid.
Readiness70.3StrongSolid.
Security30.4Weak — gated by D29, D36, C1Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance97.1ExemplaryStrongest area.
Unscored — 3 check(s) recorded observations but carry no score

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

  • P12 CI test-gate honesty — 1 observation(s) recorded · Reported, not scored — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
  • X10 Duplicated predicate — 17 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 3 control(s) we could not find positive evidence for

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

  • C3 Audit Trail — Repo shows no audit-logging mechanism (IAuditable, an immutable audit log, an EF SaveChanges interceptor) for sensitive changes — absence of evidence is not evidence of a working control. Record an audit trail in code (or document where it lives) so this dimension can be scored.
  • 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. 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 — 45 check(s) not relevant to this codebase

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

  • AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
  • AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
  • AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
  • AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
  • AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
  • AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
  • AXB1 Runtime evidence locked — no reproducible boot — This repository has nothing the runtime tiers could boot or serve — no markup, no UI framework or web-server dependency, no UI component source, no native UI project and no API definition — nothing here is a surface to boot — so runtime a11y/egress/header evidence has no subject here. Not applicable: this is neither a gap in the scan nor a finding about your code.
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • C2 Access Controls — No access-control surface detected in the analyzed source — no web/app surface to authorize (no HTTP API or web-UI project) and no authorization code at all (no [Authorize]/policies, no imperative guard methods). Access control is therefore N/A here — this is a library/CLI, which is authorized by its CALLER, not by itself. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
  • D12 Dependency Hygiene — Dependency hygiene not measured
  • D14 License Compliance — Licence collector did not produce a result
  • D21 Naming Consistency — D21 withholds its case and prefix conventions rows: 3 candidate(s) found and not reported.
  • D22 Internal API Consistency — No intentionally-exposed public API to evaluate for consistency.
  • 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 — None of 0 binding record(s) states a rule in checkable form (a backticked element with a prohibition, or an `adr-rules` block), so conformance cannot be read from the code. Write the rule as an `adr-rules` block (`forbid:` a symbol, a package or a dependency) to make it checkable.
  • 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) — 97 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
  • 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.
  • D8 Code Coverage — Coverage NOT MEASURED: this repository did not build in our analyzer environment (a C#/MSBuild compiler error), so no coverage could be collected. It is excluded from the score rather than counted as a near-zero defect. We did not read WHERE the failing diagnostic is, so this does not claim the fault is in your test code — a repository written for an older SDK band can compile for you and not for us. Run `dotnet build` on this commit; if it succeeds, the gap is ours. Committing the Cobertura/OpenCover/lcov report your CI already produces also lets us measure real coverage without building anything.
  • DM1 Domain Modelling — not scored — this repository shows only 1 of the 3 signals this lens looks for (45 value object(s))
  • ED1 Event-Driven — not scored — this repository shows none of the 3 signals this lens looks for
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • P2 Observability — This repo is a library, not a deployed service — it has no process to operate, so production observability (structured logging, tracing/metrics, health checks) is N/A. A library may log via an injected ILogger, but the absence of operational telemetry is not a defect here. If it grows a host (web API, worker), the dimension reactivates.
  • P7 Outbound HTTP resilience — not applicable — this isn't a service/API/worker
  • 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
  • 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.
  • S1 Web-Security Posture — No web surface detected in the analyzed source — no HTTP API or web-UI project (no controllers/minimal-API endpoints, no Razor/Blazor views) and no web middleware (HTTPS redirection, HSTS, security headers, cookies). Transport security, security headers, secure cookies, CSRF/input-validation and middleware-order controls are therefore N/A here — this is a library/CLI/worker, not a web app. Crypto hygiene was still checked and found nothing to flag. If this codebase becomes web-facing, the dimension reactivates automatically.
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X13 Undrained process stream — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • 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
  • X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X24 Document value interpolated into markup unescaped — 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.
  • X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

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

Critical — 34 finding(s)
D17 · Explicit Debt · FileScopedPragmaDisable · ×10
  • FileScopedPragmaDisable Cql/CoreTests/IntervalRelationshipGridDump.cs:10 — #pragma warning disable CS8620, CS8619, CS8604, CS8625 — 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.
  • FileScopedPragmaDisable Cql/Cql.Compiler/CqlOperatorsBinder.Bind.cs:20 — #pragma warning disable CS1591 — 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.
  • FileScopedPragmaDisable Cql/Cql.Compiler/Defaults.cs:13 — #pragma warning disable CS1591 — 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.
  • FileScopedPragmaDisable Cql/Cql.Compiler/Extensions.cs:13 — #pragma warning disable CS1591 — 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.
  • FileScopedPragmaDisable Cql/Elm/Library.Serialization.cs:13 — #pragma warning disable CS1591 — 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.
  • FileScopedPragmaDisable Cql/Elm/Narrative.cs:11 — #pragma warning disable CS1591 — 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.
  • FileScopedPragmaDisable Cql/Cql.CqlToElm/DependencyInjection/CqlToElmServiceCollectionExtensions.cs:15 — #pragma warning disable IDE0130 // Namespace does not match folder structure — 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.
  • FileScopedPragmaDisable Cql/PackagerCLI/DependencyInjection/OptionsBinder.cs:12 — #pragma warning disable IDE0130 // Namespace does not match folder structure — 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.
  • FileScopedPragmaDisable Cql/PackagerCLI/DependencyInjection/PackagerCLiLoggingBuilderExtensions.cs:16 — #pragma warning disable IDE0130 // Namespace does not match folder structure — 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.
  • FileScopedPragmaDisable Cql/PackagerCLI/DependencyInjection/PackagerCliServiceCollectionExtensions.cs:14 — #pragma warning disable IDE0130 // Namespace does not match folder structure — 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.
D17 · Explicit Debt · NoWarnInCsproj · ×9
  • NoWarnInCsproj Cql/CoreTests/CoreTests.csproj:13 — CS1591 — this warning is switched off for the WHOLE project, in every file it builds, including code written years from now: nothing at the call site records that the rule was ever silenced, so the next reader has no reason to look here. Fix what the rule is reporting and drop the code from the list, or — if some occurrences really are legitimate — narrow the suppression to those sites and give each one its reason, so the rule keeps protecting the rest of the project.
  • NoWarnInCsproj Cql/PackagerCLI/PackagerCLI.csproj:30 — CS1591 — this warning is switched off for the WHOLE project, in every file it builds, including code written years from now: nothing at the call site records that the rule was ever silenced, so the next reader has no reason to look here. Fix what the rule is reporting and drop the code from the list, or — if some occurrences really are legitimate — narrow the suppression to those sites and give each one its reason, so the rule keeps protecting the rest of the project.
  • NoWarnInCsproj Demo/cql-demo.props:26 — CS1591 — this project generates an XML documentation file as a build output, so its documentation is something it PUBLISHES to whoever consumes the assembly, and this entry switches off a rule whose only job is to report that documentation missing or malformed. The two decisions sit in the same file and the quiet one wins: the documentation this project ships has holes exactly where the rule would have pointed, no build says so, and the people who meet the gap are downstream — in their editor, at the moment they are trying to use the member. Write the documentation the rule is asking for and drop the code from the list; where only some elements genuinely cannot carry it, narrow the suppression to those sites and give each one its reason, so the rest of the API stays covered. If the documentation was never meant to be consumed, the honest fix is the other line — stop generating the file, so the project no longer publishes something it is choosing not to check.
  • NoWarnInCsproj Cql/Cql.Abstractions/Cql.Abstractions.csproj:10 — CS8601 — this warning is switched off for the WHOLE project, in every file it builds, including code written years from now: nothing at the call site records that the rule was ever silenced, so the next reader has no reason to look here. Fix what the rule is reporting and drop the code from the list, or — if some occurrences really are legitimate — narrow the suppression to those sites and give each one its reason, so the rule keeps protecting the rest of the project.
  • NoWarnInCsproj Cql/Cql.Grammar/Cql.Grammar.csproj:10 — RS0016 — this warning is switched off for the WHOLE project, in every file it builds, including code written years from now: nothing at the call site records that the rule was ever silenced, so the next reader has no reason to look here. Fix what the rule is reporting and drop the code from the list, or — if some occurrences really are legitimate — narrow the suppression to those sites and give each one its reason, so the rule keeps protecting the rest of the project.
  • NoWarnInCsproj cql-sdk.props:14 — RS0016 — this warning is switched off for the WHOLE project, in every file it builds, including code written years from now: nothing at the call site records that the rule was ever silenced, so the next reader has no reason to look here. Fix what the rule is reporting and drop the code from the list, or — if some occurrences really are legitimate — narrow the suppression to those sites and give each one its reason, so the rule keeps protecting the rest of the project.
  • NoWarnInCsproj cql-sdk.props:10 — RS0026 — this warning is switched off for the WHOLE project, in every file it builds, including code written years from now: nothing at the call site records that the rule was ever silenced, so the next reader has no reason to look here. Fix what the rule is reporting and drop the code from the list, or — if some occurrences really are legitimate — narrow the suppression to those sites and give each one its reason, so the rule keeps protecting the rest of the project.
  • NoWarnInCsproj cql-sdk.props:14 — RS0017 — this warning is switched off for the WHOLE project, in every file it builds, including code written years from now: nothing at the call site records that the rule was ever silenced, so the next reader has no reason to look here. Fix what the rule is reporting and drop the code from the list, or — if some occurrences really are legitimate — narrow the suppression to those sites and give each one its reason, so the rule keeps protecting the rest of the project.
  • NoWarnInCsproj Demo/cql-demo.props:26 — CS0618 — this warning is switched off for the WHOLE project, in every file it builds, including code written years from now: nothing at the call site records that the rule was ever silenced, so the next reader has no reason to look here. Fix what the rule is reporting and drop the code from the list, or — if some occurrences really are legitimate — narrow the suppression to those sites and give each one its reason, so the rule keeps protecting the rest of the project.
AX3 · Project dependency cycles · Namespace dependency cycle · ×8
  • Namespace dependency cycle Cql/Cql.Abstractions/Primitives/CqlDate.cs:10 — The namespaces Hl7.Cql.Comparers ↔ Hl7.Cql.Primitives depend on each other. The lightest dependency in the cycle is Hl7.Cql.Primitives → Hl7.Cql.Comparers (Hl7.Cql.Primitives.CqlDate → Hl7.Cql.Comparers.ICqlComparable, 6 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 Cql/Cql.Compiler/CodeModel/CodeExpressionExtensions.cs:21 — The namespaces Hl7.Cql.Compiler ↔ Hl7.Cql.Compiler.CodeModel ↔ Hl7.Cql.Compiler.Preprocessing depend on each other. The lightest dependency in the cycle is Hl7.Cql.Compiler.CodeModel → Hl7.Cql.Compiler (Hl7.Cql.Compiler.CodeModel.CodeExpressionExtensions → Hl7.Cql.Compiler.TypeConversion, 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 Cql/CodeGeneration.NET/Toolkit/ElmToolkit.cs:10 — The namespaces Hl7.Cql.CodeGeneration.NET.Toolkit ↔ Hl7.Cql.CodeGeneration.NET.Toolkit.Internal depend on each other. The lightest dependency in the cycle is Hl7.Cql.CodeGeneration.NET.Toolkit → Hl7.Cql.CodeGeneration.NET.Toolkit.Internal (Hl7.Cql.CodeGeneration.NET.Toolkit.ElmToolkit → Hl7.Cql.CodeGeneration.NET.Toolkit.Internal.ElmToolkitServices, 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 Cql/Cql.CqlToElm/Visitors/LibraryVisitor.cs:9 — The namespaces Hl7.Cql.CqlToElm ↔ Hl7.Cql.CqlToElm.Builtin ↔ Hl7.Cql.CqlToElm.Scopes ↔ Hl7.Cql.CqlToElm.Visitors depend on each other. The lightest dependency in the cycle is Hl7.Cql.CqlToElm.Visitors → Hl7.Cql.CqlToElm.Builtin (Hl7.Cql.CqlToElm.Visitors.LibraryVisitor → Hl7.Cql.CqlToElm.Builtin.SystemLibrary, 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 Cql/Cql.CqlToElm/Toolkit/CqlToolkit.cs:9 — The namespaces Hl7.Cql.CqlToElm.Toolkit ↔ Hl7.Cql.CqlToElm.Toolkit.Internal depend on each other. The lightest dependency in the cycle is Hl7.Cql.CqlToElm.Toolkit → Hl7.Cql.CqlToElm.Toolkit.Internal (Hl7.Cql.CqlToElm.Toolkit.CqlToolkit → Hl7.Cql.CqlToElm.Toolkit.Internal.CqlToolkitServices, 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 Cql/Cql.Invocation/Toolkit/InvocationToolkit.cs:11 — The namespaces Hl7.Cql.Invocation.Toolkit ↔ Hl7.Cql.Invocation.Toolkit.Internal depend on each other. The lightest dependency in the cycle is Hl7.Cql.Invocation.Toolkit → Hl7.Cql.Invocation.Toolkit.Internal (Hl7.Cql.Invocation.Toolkit.InvocationToolkit → Hl7.Cql.Invocation.Toolkit.Internal.LibrarySetInvokerBuilderServices, 3 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 Cql/Cql.Packaging/Toolkit/PackagingToolkit.cs:12 — The namespaces Hl7.Cql.Packaging ↔ Hl7.Cql.Packaging.Toolkit ↔ Hl7.Cql.Packaging.Toolkit.Internal depend on each other. The lightest dependency in the cycle is Hl7.Cql.Packaging.Toolkit → Hl7.Cql.Packaging.Toolkit.Internal (Hl7.Cql.Packaging.Toolkit.PackagingToolkit → Hl7.Cql.Packaging.Toolkit.Internal.PackagingToolkitServices, 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 Cql/PackagerCLI/Commands.Logging/LoggingOptions.cs:11 — The namespaces Hl7.Cql.Packager ↔ Hl7.Cql.Packager.Commands.Logging ↔ Hl7.Cql.Packager.Options depend on each other. The lightest dependency in the cycle is Hl7.Cql.Packager.Commands.Logging → Hl7.Cql.Packager (Hl7.Cql.Packager.Commands.Logging.LoggingOptions → Hl7.Cql.Packager.IBindOptions, 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.
D17 · Explicit Debt · AnalyzerSeverityNone · ×4
  • AnalyzerSeverityNone .editorconfig:4 — CS1591 — this rule is switched off for every file the section matches, in every project under this directory, and the only record that it was ever switched off is this line: nothing at the sites it would have reported says so, so a reader of that code has no reason to look here, and code added years from now inherits the decision silently. Fix what the rule reports and delete the entry, or — where some sites really are legitimate — leave the rule on and suppress it at those sites with their reasons, so it keeps protecting the rest of the tree. If the rule is genuinely unwanted here, say why — on this line after the entry, or in the comment run directly above it: a comment that only repeats the rule's own title is read as no explanation at all and leaves this row in place.
  • AnalyzerSeverityNone .editorconfig:14 — CA1310 — this rule is switched off for every file the section matches, in every project under this directory, and the only record that it was ever switched off is this line: nothing at the sites it would have reported says so, so a reader of that code has no reason to look here, and code added years from now inherits the decision silently. Fix what the rule reports and delete the entry, or — where some sites really are legitimate — leave the rule on and suppress it at those sites with their reasons, so it keeps protecting the rest of the tree. If the rule is genuinely unwanted here, say why — on this line after the entry, or in the comment run directly above it: a comment that only repeats the rule's own title is read as no explanation at all and leaves this row in place.
  • AnalyzerSeverityNone .editorconfig:17 — CA1304 — this rule is switched off for every file the section matches, in every project under this directory, and the only record that it was ever switched off is this line: nothing at the sites it would have reported says so, so a reader of that code has no reason to look here, and code added years from now inherits the decision silently. Fix what the rule reports and delete the entry, or — where some sites really are legitimate — leave the rule on and suppress it at those sites with their reasons, so it keeps protecting the rest of the tree. If the rule is genuinely unwanted here, say why — on this line after the entry, or in the comment run directly above it: a comment that only repeats the rule's own title is read as no explanation at all and leaves this row in place.
  • AnalyzerSeverityNone .editorconfig:20 — CA1309 — this rule is switched off for every file the section matches, in every project under this directory, and the only record that it was ever switched off is this line: nothing at the sites it would have reported says so, so a reader of that code has no reason to look here, and code added years from now inherits the decision silently. Fix what the rule reports and delete the entry, or — where some sites really are legitimate — leave the rule on and suppress it at those sites with their reasons, so it keeps protecting the rest of the tree. If the rule is genuinely unwanted here, say why — on this line after the entry, or in the comment run directly above it: a comment that only repeats the rule's own title is read as no explanation at all and leaves this row in place.
D17 · Explicit Debt · WriteOnlyPrivateField · ×1
  • WriteOnlyPrivateField Cql/CoreTests/QueriesTest.cs:55 — private CqlCode[] TestCodes — 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.
D17 · Explicit Debt · FileScopedPragmaDisable repeated across 20 files · ×1
  • FileScopedPragmaDisable repeated across 20 files REDACTED:1 — The identical FileScopedPragmaDisable (`#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member`) appears in 20 files (20 occurrences) — a single repo-wide policy (e.g. a Directory.Build.props decision or an idiomatic suppression), not 20 independent debts. Decide it once centrally rather than file-by-file. (Every occurrence still counts toward the score and metrics.)
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
Serious — 518 finding(s)
D29 · Static Analysis (SAST) · 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
  • REDACTED
  • + 67 more in this group — see findings.md.
D17 · Explicit Debt · TodoComment · ×25
  • TodoComment Cql/Cql.Compiler/CodeBuilderContext.Operators.cs:362 — //@ TODO: Cast - As — 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 Cql/Cql.Compiler/CodeBuilderContext.Operators.cs:688 — //@ TODO: Cast - ConvertLiteral — 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 Cql/Cql.Compiler/CodeBuilderContext.Operators.cs:703 — //@ TODO: Cast - ConvertLiteral — 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 Cql/Cql.Compiler/CodeBuilderContext.Operators.cs:717 — //@ TODO: Cast - ConvertLiteral — 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 Cql/Cql.Compiler/CodeBuilderContext.Query.cs:780 — //@ TODO: Cast - Instance — 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 Cql/Cql.Compiler/CodeBuilderContext.Query.cs:807 — //@ TODO: Cast - Instance — 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 Cql/Cql.CqlToElm/Builtin/BuiltinModelProvider.cs:26 — // TODO: test with multiple versions of the same model; maybe don't support that — 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 Cql/Cql.CqlToElm/Visitors/ConditionalExpressionVisitor.cs:30 — // TODO: refactor case terms into the InvocationBuilder? — 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 Cql/Cql.CqlToElm/Visitors/ExpressionVisitor.cs:50 — // TODO: make a system function & validate it — 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 Cql/Cql.CqlToElm/Visitors/ExpressionVisitor.cs:92 — // TODO: this should be incorporated in the validation framework — 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 Cql/Cql.CqlToElm/Visitors/LibraryVisitor.cs:437 — //TODO: might want to introduce some kind of error type. — 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 Cql/Cql.CqlToElm/Visitors/QueryExpressionVisitor.cs:119 — // TODO: figure out how to handle scope redefinition gracefully — 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 Cql/Cql.CqlToElm/Visitors/TypeSpecifierVisitor.cs:84 — //TODO: Might need ErrorTypeSpecifier here — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment REDACTED:855 — // TODO: this is a performance problem — 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 Cql/Cql.Packaging/DataRequirementsAnalyzer.cs:180 — // TODO: Support retrieval when the target is a CodeSystemRef — 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 Cql/Cql.Packaging/DataRequirementsAnalyzer.cs:205 — // TODO: no system??? — 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 Cql/Cql.Packaging/DataRequirementsAnalyzer.cs:225 — // TODO: no system??? — 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:347 — //TODO: use mapper when values in CqlToElmInfo results anything but strings — 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 Cql/Cql.Runtime/Runtime/DefinitionDictionary.cs:342 — //@ TODO: Choice type? — 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 Cql/Cql.Runtime/ValueSets/ValueSetUnion.cs:44 — // TODO: If this interface would not require codes to be unique, we could make this more performant. — 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 Cql/Cql.Runtime/ValueSets/ValueSetUnion.cs:48 — // TODO: it's undefined what comparator to use for the equality of the Union operator, — 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 Cql/CqlToElmTests/(tests)/QueryTest.cs:273 — // TODO: make this optionally fail w/ config 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 Cql/CqlToElmTests/(tests)/QueryTest.cs:288 — // TODO: make this optionally fail w/ config 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 Cql/Elm/IDefinitionElement.cs:407 — // TODO: This does not guard against duplicate signatures, like the Create method does.
  • TodoComment Demo/CLI/LibraryRunner.cs:79 — //TODO: research test parameter location relative to test data files in vs-code tool — 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.
D15 · Churn × Complexity Hotspots · Hotspot · ×10
  • Hotspot: Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:737 — Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs changed 41 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in CqlOperators.Expand at line 737. 1 of those changes was a fix/bug commit, and the other 40 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 22:27:55 +01:00' --until='2026-11-17 22:27:55 +01:00' --full-history --no-merges -- Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: Cql/Cql.Abstractions/Primitives/CqlDateTimeMath.cs Cql/Cql.Abstractions/Primitives/CqlDateTimeMath.cs:185 — Cql/Cql.Abstractions/Primitives/CqlDateTimeMath.cs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in CqlDateTimeMath.WholeCalendarPeriodsBetween at line 185. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 22:27:55 +01:00' --until='2026-11-17 22:27:55 +01:00' --full-history --no-merges -- Cql/Cql.Abstractions/Primitives/CqlDateTimeMath.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:422 — Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in CqlOperators.Expand at line 422. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 22:27:55 +01:00' --until='2026-11-17 22:27:55 +01:00' --full-history --no-merges -- Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:327 — REDACTED changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in FhirTypeConverter.ConvertCqlPrimitivesToFhir at line 327. 3 of those changes were fix/bug commits, and the other 10 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 22:27:55 +01:00' --until='2026-11-17 22:27:55 +01: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.
  • Hotspot: Cql/Cql.Compiler/CodeBuilderContext.Query.cs Cql/Cql.Compiler/CodeBuilderContext.Query.cs:28 — Cql/Cql.Compiler/CodeBuilderContext.Query.cs changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in CodeBuilderContext.Query at line 28. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 22:27:55 +01:00' --until='2026-11-17 22:27:55 +01:00' --full-history --no-merges -- Cql/Cql.Compiler/CodeBuilderContext.Query.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: Cql/Cql.CqlToElm/Visitors/QueryExpressionVisitor.cs Cql/Cql.CqlToElm/Visitors/QueryExpressionVisitor.cs:16 — Cql/Cql.CqlToElm/Visitors/QueryExpressionVisitor.cs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 43 in ExpressionVisitor.VisitQuery at line 16. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 22:27:55 +01:00' --until='2026-11-17 22:27:55 +01:00' --full-history --no-merges -- Cql/Cql.CqlToElm/Visitors/QueryExpressionVisitor.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: Cql/Cql.Compiler/CodeBuilderContext.TypeFor.cs Cql/Cql.Compiler/CodeBuilderContext.TypeFor.cs:21 — Cql/Cql.Compiler/CodeBuilderContext.TypeFor.cs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in CodeBuilderContext.TypeFor at line 21. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 22:27:55 +01:00' --until='2026-11-17 22:27:55 +01:00' --full-history --no-merges -- Cql/Cql.Compiler/CodeBuilderContext.TypeFor.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: Cql/Cql.CqlToElm/Visitors/LibraryVisitor.cs Cql/Cql.CqlToElm/Visitors/LibraryVisitor.cs:304 — Cql/Cql.CqlToElm/Visitors/LibraryVisitor.cs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in DefinitionVisitor.VisitStatements at line 304. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 22:27:55 +01:00' --until='2026-11-17 22:27:55 +01:00' --full-history --no-merges -- Cql/Cql.CqlToElm/Visitors/LibraryVisitor.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: Cql/Iso8601/DateTimeIso8601.cs Cql/Iso8601/DateTimeIso8601.cs:376 — Cql/Iso8601/DateTimeIso8601.cs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in DateTimeIso8601.ParseComponents at line 376. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 22:27:55 +01:00' --until='2026-11-17 22:27:55 +01:00' --full-history --no-merges -- Cql/Iso8601/DateTimeIso8601.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: Cql/Cql.Compiler/CodeBuilderContext.Operators.cs Cql/Cql.Compiler/CodeBuilderContext.Operators.cs:362 — Cql/Cql.Compiler/CodeBuilderContext.Operators.cs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in CodeBuilderContext.As at line 362. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 22:27:55 +01:00' --until='2026-11-17 22:27:55 +01:00' --full-history --no-merges -- Cql/Cql.Compiler/CodeBuilderContext.Operators.cs`: 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.
D10 · Test Quality · Skipped test · ×8
  • Skipped test: ConvertParameters_Date_Macro Cql/CoreTests/FhirTypeConverterTests.cs:218 — Skipped — skipped
  • Skipped test: ConvertParameters_Date_MacroAddOperator Cql/CoreTests/FhirTypeConverterTests.cs:240 — Skipped — skipped
  • Skipped test: ConvertParameters_Date_MacroSubtractOperator Cql/CoreTests/FhirTypeConverterTests.cs:262 — Skipped — skipped
  • Skipped test: ConvertParameters_DateTime_Macro Cql/CoreTests/FhirTypeConverterTests.cs:309 — Skipped — skipped
  • Skipped test: ConvertParameters_IntervalDateTime_Period_ExplicitRange Cql/CoreTests/FhirTypeConverterTests.cs:376 — Skipped — skipped
  • Skipped test: ConvertParameters_IntervalDateTime_Period_Marco Cql/CoreTests/FhirTypeConverterTests.cs:401 — Skipped — skipped
  • Skipped test: ConvertParameters_IntervalDate_Period_ExplicitRange Cql/CoreTests/FhirTypeConverterTests.cs:428 — Skipped — skipped
  • Skipped test: ConvertParameters_IntervalDate_Period_Marco Cql/CoreTests/FhirTypeConverterTests.cs:454 — Skipped — skipped
D3 · God Classes · TooManyMethods · ×8
  • TooManyMethods: CqlOperators Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs — TooManyMethods — 3912 significant lines (blank, comment-only and punctuation-only lines excluded), 594 methods, declared across 16 files: Operators/CqlOperators.IntervalOperators.cs (218), Operators/CqlOperators.ArithmeticOperators.cs (81), Operators/CqlOperators.TypeOperators.cs (63), Operators/CqlOperators.ListOperators.cs (46), +12 more file(s). The bar is 30 methods; this is 564 over it, 19.80× 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: CodeBuilderContext Cql/Cql.Compiler/CodeBuilderContext.Operators.cs — TooManyMethods — 2207 significant lines (blank, comment-only and punctuation-only lines excluded), 128 methods, declared across 12 files: Cql.Compiler/CodeBuilderContext.Operators.cs (24), REDACTED (22), Cql.Compiler/CodeBuilderContext.Query.cs (18), Cql.Compiler/CodeBuilderContext.Refs.cs (14), +8 more file(s). The bar is 30 methods; this is 98 over it, 4.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: ExpressionVisitor Cql/Cql.CqlToElm/Visitors/LiteralVisitor.cs — TooManyMethods — 1681 significant lines (blank, comment-only and punctuation-only lines excluded), 96 methods, declared across 7 files: Visitors/InvocationTermVisitor.cs (20), Visitors/LiteralVisitor.cs (20), Visitors/BinaryExpressionVisitor.cs (18), Visitors/UnaryExpressionVisitor.cs (15), +3 more file(s). The bar is 30 methods; this is 66 over it, 3.20× 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: ElmFactory Cql/Cql.CqlToElm/ElmFactory.cs — TooManyMethods — 341 significant lines (blank, comment-only and punctuation-only lines excluded), 43 methods. The bar is 30 methods; this is 13 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.
  • TooManyMethods: CSharpEmitter Cql/CodeGeneration.NET/CSharpEmitter.Print.cs — TooManyMethods — 360 significant lines (blank, comment-only and punctuation-only lines excluded), 41 methods, declared across 2 files: CodeGeneration.NET/CSharpEmitter.Print.cs (36), CodeGeneration.NET/CSharpEmitter.cs (5). 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: FhirTypeConverter REDACTED — TooManyMethods — 407 significant lines (blank, comment-only and punctuation-only lines excluded), 36 methods. The bar is 30 methods; this is 6 over it, 1.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.
  • TooManyMethods: CqlOperatorsBinder Cql/Cql.Compiler/CqlOperatorsBinder.Specific.cs — TooManyMethods — 524 significant lines (blank, comment-only and punctuation-only lines excluded), 32 methods, declared across 5 files: Cql.Compiler/CqlOperatorsBinder.Specific.cs (14), Cql.Compiler/CqlOperatorsBinder.Fusion.cs (8), Cql.Compiler/CqlOperatorsBinder.Bind.cs (5), Cql.Compiler/CqlOperatorsBinder.Conversions.cs (4), +1 more file(s). The bar is 30 methods; this is 2 over it, 1.07× 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: XsdCodeGenerator tools/XsdToCSharpConverter/XsdCodeGenerator.cs — TooManyMethods — 586 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.
D3 · God Classes · MethodTooLong · ×7
  • MethodTooLong: ExpressionVisitor.VisitQuery Cql/Cql.CqlToElm/Visitors/QueryExpressionVisitor.cs:16 — MethodTooLong — VisitQuery runs 213 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 113 over it, 2.13× 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: CqlToFhirProgram.Run Cql/PackagerCLI/Commands.CqlToFhir/CqlToFhirProgram.cs:47 — MethodTooLong — Run runs 150 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 50 over it, 1.50× 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: CoercionProvider.Coerce Cql/Cql.CqlToElm/CoercionProvider.cs:29 — MethodTooLong — Coerce runs 143 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 43 over it, 1.43× 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: ElmToFhirProgram.Run Cql/PackagerCLI/Commands.ElmToFhir/ElmToFhirProgram.cs:34 — MethodTooLong — Run 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: CqlDateTime.CompareValues Cql/Cql.Abstractions/Primitives/CqlDateTime.cs:276 — MethodTooLong — CompareValues runs 132 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 32 over it, 1.32× 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: DateTimeIso8601.DateTimeIso8601(…) Cql/Iso8601/DateTimeIso8601.cs:158 — MethodTooLong — DateTimeIso8601(…) runs 111 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 11 over it, 1.11× 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: ExpressionVisitor.HandleBeforeOrAfter Cql/Cql.CqlToElm/Visitors/TimingExpressionVisitor.cs:249 — MethodTooLong — HandleBeforeOrAfter runs 105 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 5 over it, 1.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.
D17 · Explicit Debt · BarePragmaDisable · ×6
  • BarePragmaDisable Cql/Cql.Runtime/Operators/CqlOperators.AggregateFunctions.cs:1 — #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member — 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 Cql/Cql.Runtime/Operators/CqlOperators.ArithmeticOperators.cs:1 — #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member — 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 Cql/Cql.Runtime/Operators/CqlOperators.ClinicalOperators2.cs:1 — #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member — 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 Cql/Cql.Runtime/Operators/CqlOperators.ComparisonOperators.cs:1 — #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member — 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 Cql/Cql.Runtime/Operators/CqlOperators.FusedOperators.cs:1 — #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member — 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 Cql/Cql.Runtime/Operators/CqlOperators.cs:1 — #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member — 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 · FileTooLong · ×6
  • FileTooLong: Operators/CqlOperators.IntervalOperators.cs Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs — FileTooLong — 1229 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 729 over it, 2.46× 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: XsdToCSharpConverter/XsdCodeGenerator.cs tools/XsdToCSharpConverter/XsdCodeGenerator.cs — FileTooLong — 593 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 93 over it, 1.19× 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: Operators/CqlOperators.ArithmeticOperators.cs Cql/Cql.Runtime/Operators/CqlOperators.ArithmeticOperators.cs — FileTooLong — 572 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 72 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: Operators/CqlOperators.ListOperators.cs Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs — FileTooLong — 549 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 49 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: Operators/ICqlOperators.cs Cql/Cql.Runtime/Operators/ICqlOperators.cs — FileTooLong — 516 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 16 over it, 1.03× 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: Cql.Compiler/CodeBuilderContext.Query.cs Cql/Cql.Compiler/CodeBuilderContext.Query.cs — FileTooLong — 506 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 6 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.
GD1 · Unfinished & placeholder code · Unfinished stub · ×6
  • Unfinished stub — throws NotImplementedException Cql/Cql.Abstractions/Comparers/CqlComparer.cs:47 — A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException Cql/Cql.Abstractions/Comparers/CqlComparer.cs:123 — A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException Cql/Cql.Abstractions/Comparers/CqlComparer.cs:202 — A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException Cql/Cql.CqlToElm/Scopes/LibraryBuilder.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 Cql/CodeGeneration.NET/Toolkit/Extensions/ElmToolkitExtensions.Adding.cs:219 — A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException Cql/CodeGeneration.NET/Toolkit/Extensions/ElmToolkitExtensions.Adding.cs:234 — A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
D17 · Explicit Debt · DeadPreprocessorBranch · ×5
  • DeadPreprocessorBranch Cql/CoreTests/ModelTest.cs:92 — #if VNEXT — 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 Cql/Cql.Firely/BundleDataSource.cs:131 — #if VNEXT — 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 Cql/Cql.Runtime/Operators/CompositeDataSource.cs:25 — #if VNEXT — 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 Cql/Cql.Runtime/Operators/CompositeDataSource.cs:31 — #if VNEXT — 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 Cql/Cql.Runtime/Operators/IDataSource.cs:42 — #if VNEXT — 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.
D17 · Explicit Debt · CommentedOutCode · ×5
  • CommentedOutCode Cql/Cql.Compiler/CodeBuilderContext.Query.cs:305 — 9 consecutive commented-code lines
  • CommentedOutCode Cql/Cql.Compiler/IdentifierNormalizer.cs:68 — 9 consecutive commented-code lines
  • CommentedOutCode Cql/Cql.Compiler/CodeBuilderContext.cs:139 — 8 consecutive commented-code lines
  • CommentedOutCode Cql/Cql.Compiler/IdentifierNormalizer.cs:59 — 8 consecutive commented-code lines
  • CommentedOutCode Cql/Cql.CqlToElm/InvocationBuilder.cs:386 — 3 consecutive commented-code lines
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×5
  • Edited copy of a member (13 corresponding lines) Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:1083 — Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:1083-1095 | Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:1103-1115 — 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:93 — REDACTED:93-105 | REDACTED:125-137 — 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) Cql/Cql.Runtime/Operators/CqlOperators.ComparisonOperators.cs:155 — Cql/Cql.Runtime/Operators/CqlOperators.ComparisonOperators.cs:155-167 | Cql/Cql.Runtime/Operators/CqlOperators.DateTimeOperators.cs:50-62 — 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) Cql/Cql.Runtime/Runtime/CqlLibraryIdentifier.cs:113 — Cql/Cql.Runtime/Runtime/CqlLibraryIdentifier.cs:113-125 | Cql/Cql.Runtime/Runtime/CqlLibraryVersion.cs:113-125 — 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) Cql/Cql.Runtime/Operators/CqlOperators.FusedOperators.cs:67 — Cql/Cql.Runtime/Operators/CqlOperators.FusedOperators.cs:67-81 | Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:52-64 — 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 · Duplicated block (13 lines × 2) · ×5
  • Duplicated block (13 lines × 2) Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:541 — Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:541-553 | Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:205-217 — 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 `Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:541` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:686 — Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:686-698 | Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:366-378 — 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 `Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:686` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) Cql/PackagerCLI/Commands.CqlToFhir/CqlToFhirProgram.cs:71 — Cql/PackagerCLI/Commands.CqlToFhir/CqlToFhirProgram.cs:71-83 | Cql/PackagerCLI/Commands.ElmToFhir/ElmToFhirProgram.cs:64-76 — before extracting anything, compare `Cql/PackagerCLI/Commands.CqlToFhir/CqlToFhirProgram.cs` and `Cql/PackagerCLI/Commands.ElmToFhir/ElmToFhirProgram.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 168 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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. Read the line range as the matched WINDOW rather than a finished unit: at `Cql/PackagerCLI/Commands.CqlToFhir/CqlToFhirProgram.cs:71` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (13 lines × 2) Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:554 — Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:554-566 | Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:699-711 — 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 `Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:554` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (13 lines × 2) Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:218 — Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:218-230 | Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:379-391 — 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 `Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:218` 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.
X2 · Cancellation propagation · Async method without CancellationToken · ×5
  • Async method without CancellationToken: Add Cql/Cql.Firely/ValueSetSource.cs:252 — No CancellationToken parameter — this work can't be stopped early once started.
  • Async method without CancellationToken: Add Cql/Cql.Firely/ValueSetSource.cs:264 — No CancellationToken parameter — this work can't be stopped early once started.
  • Async method without CancellationToken: GetOrBuildMemoized Cql/Cql.Firely/ValueSetSource.cs:316 — No CancellationToken parameter — this work can't be stopped early once started.
  • Async method without CancellationToken: Load Cql/Cql.Firely/ValueSetSource.cs:380 — No CancellationToken parameter — this work can't be stopped early once started.
  • Async method without CancellationToken: ToValueSetDictionaryAsync Cql/Cql.Firely/ValueSetSource.cs:561 — No CancellationToken parameter — this work can't be stopped early once started.
AX2 · Stateful singletons · Stateful shared instance · ×4
  • Stateful shared instance: VersionedIdentifier Cql/Elm/Elm.cs:129 — `VersionedIdentifier` is not registered, but `LibraryBuilder` creates it and keeps it in the static `schemaIdentifier`, 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 (id, version; e.g. `id` at line 55).
  • Stateful shared instance: ModelInfo Cql/Cql.Model/modelinfo.cs:25 — `ModelInfo` is not registered, but `SystemTypes` creates it and keeps it in the static `bootstrapSystemModel`, 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 (requiredModelInfoField, typeInfoField, conversionInfoField, contextInfoField, nameField, versionField; e.g. `requiredModelInfoField` at line 78).
  • Stateful shared instance: DateTimeIso8601 Cql/Iso8601/DateTimeIso8601.cs:15 — `DateTimeIso8601` is not registered, but the singleton `CqlDateTime` creates it and keeps it in `InUtc`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (_string; e.g. `_string` at line 93).
  • Stateful shared instance: TimeIso8601 Cql/Iso8601/TimeIso8601.cs:15 — `TimeIso8601` is not registered, but the singleton `CqlTime` creates it and keeps it in `InUtc`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (_string; e.g. `_string` at line 116).
D1 · Cyclomatic Complexity · CqlOperators.Expand (cyclomatic 20) · ×4
  • CqlOperators.Expand (cyclomatic 20) Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:517 — CqlOperators.Expand 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. This shape REPEATS in the file: one other method here (CqlOperators.Expand) 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.
  • CqlOperators.Expand (cyclomatic 20) Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:662 — CqlOperators.Expand 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. This shape REPEATS in the file: one other method here (CqlOperators.Expand) 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.
  • CqlOperators.Expand (cyclomatic 20) Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:178 — CqlOperators.Expand 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. This shape REPEATS in the file: one other method here (CqlOperators.Expand) 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.
  • CqlOperators.Expand (cyclomatic 20) Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:339 — CqlOperators.Expand 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. This shape REPEATS in the file: one other method here (CqlOperators.Expand) 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.
D1 · Cyclomatic Complexity · CqlOperators.Expand (cyclomatic 17) · ×4
  • CqlOperators.Expand (cyclomatic 17) Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:811 — CqlOperators.Expand 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. This shape REPEATS in the file: one other method here (CqlOperators.Expand) 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.
  • CqlOperators.Expand (cyclomatic 17) Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:869 — CqlOperators.Expand 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. This shape REPEATS in the file: one other method here (CqlOperators.Expand) 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.
  • CqlOperators.Expand (cyclomatic 17) Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:504 — CqlOperators.Expand 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 shape REPEATS in the file: one other method here (CqlOperators.Expand) 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.
  • CqlOperators.Expand (cyclomatic 17) Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:568 — CqlOperators.Expand 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 shape REPEATS in the file: one other method here (CqlOperators.Expand) 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.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×4
  • Edited copy of a member (12 corresponding lines) Cql/Cql.Runtime/Operators/CqlOperators.AggregateFunctions.cs:571 — Cql/Cql.Runtime/Operators/CqlOperators.AggregateFunctions.cs:571-584 | Cql/Cql.Runtime/Operators/CqlOperators.AggregateFunctions.cs:702-713 — 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) Cql/Cql.Runtime/Operators/CqlOperators.DateTimeOperators.cs:88 — Cql/Cql.Runtime/Operators/CqlOperators.DateTimeOperators.cs:88-99 | Cql/Cql.Runtime/Operators/CqlOperators.DateTimeOperators.cs:381-392 — 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) Cql/CodeGeneration.NET/Toolkit/ElmToolkit.cs:254 — Cql/CodeGeneration.NET/Toolkit/ElmToolkit.cs:254-265 | Cql/CodeGeneration.NET/Toolkit/ElmToolkit.cs:276-291 — 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) Cql/Cql.Abstractions/Primitives/CqlDate.cs:81 — Cql/Cql.Abstractions/Primitives/CqlDate.cs:81-92 | Cql/Cql.Abstractions/Primitives/CqlDateTime.cs:133-144 — 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.
D2 · Cognitive Complexity · CqlOperators.Expand (cognitive 46) · ×3
  • CqlOperators.Expand (cognitive 46) Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:178 — CqlOperators.Expand has cognitive complexity 46 (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. This shape REPEATS in the file: one other method here (CqlOperators.Expand) 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.
  • CqlOperators.Expand (cognitive 46) Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:339 — CqlOperators.Expand has cognitive complexity 46 (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. This shape REPEATS in the file: one other method here (CqlOperators.Expand) 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.
  • CqlOperators.Expand (cognitive 46) Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:422 — CqlOperators.Expand has cognitive complexity 46 (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.
D35 · Change Coupling · Change coupling · ×3
  • Change coupling: ResourcePackager.cs ↔ LibraryExtensions.cs Cql/Cql.Packaging/ResourcePackager.cs:1 — `Cql/Cql.Packaging/ResourcePackager.cs` and `Cql/Elm/LibraryExtensions.cs` change together 70% of the time (7 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). 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 `84e87f8c` Use VersionedLibraryIdentifier; `e71f67a9` Add VersionedLibraryIdentifier property; `9400de50` Create measures — run `git show` on any of them.
  • Change coupling: CqlToFhirCommand.cs ↔ ElmToFhirCommand.cs Cql/PackagerCLI/Commands.CqlToFhir/CqlToFhirCommand.cs:1 — `Cql/PackagerCLI/Commands.CqlToFhir/CqlToFhirCommand.cs` and `Cql/PackagerCLI/Commands.ElmToFhir/ElmToFhirCommand.cs` change together 52% of the time (21 of the 40 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). 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 21 shared commits counted here, the most recent 3 are `dc0619cb` Replace string-based reflection with compiler-checked lookups; `72901fa2` Add configurable Measure.group.code system to the packager; `627b8dd5` Improve log file setup error handling and binding — run `git show` on any of them.
  • Change coupling: PackagerCliServiceCollectionExtensions.cs ↔ OptionsConsoleDumper.cs Cql/PackagerCLI/DependencyInjection/PackagerCliServiceCollectionExtensions.cs:1 — `Cql/PackagerCLI/DependencyInjection/PackagerCliServiceCollectionExtensions.cs` and `Cql/PackagerCLI/OptionsConsoleDumper.cs` change together 50% of the time (15 of the 30 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). 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 15 shared commits counted here, the most recent 3 are `5f83f43b` Refactor exit codes and environment usage for clarity; `5a5a6ee1` Canonical builder now uses the appsettings for fixed library canonicals; `31b52e28` Update logging — run `git show` on any of them.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×3
  • Members sharing a duplicated core (4 members, 50+ identical tokens) Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:738 — Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:738-810 | Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:423-503 | Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:505-567 | Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:569-631 — 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) Cql/CodeGeneration.NET/Toolkit/Extensions/ElmToolkitExtensions.Saving.cs:153 — Cql/CodeGeneration.NET/Toolkit/Extensions/ElmToolkitExtensions.Saving.cs:153-245 | Cql/CodeGeneration.NET/Toolkit/Extensions/ElmToolkitExtensions.Saving.cs:267-309 | Cql/Cql.CqlToElm/Toolkit/Extensions/CqlToolkitExtensions.Saving.cs:84-127 | Cql/Cql.Packaging/Toolkit/Extensions/PackagingToolkitExtensions.Saving.cs:114-176 — 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) Cql/Cql.Compiler/CodeBuilderContext.Operators.cs:107 — Cql/Cql.Compiler/CodeBuilderContext.Operators.cs:107-145 | Cql/Cql.Compiler/CodeBuilderContext.Operators.cs:148-185 | Cql/Cql.Compiler/CodeBuilderContext.Operators.cs:217-246 | Cql/Cql.Compiler/CodeBuilderContext.Operators.cs:267-295 — 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 (19 corresponding lines) · ×3
  • Edited copy of a member (19 corresponding lines) Cql/Cql.Runtime/Comparers/EnumComparer.cs:28 — Cql/Cql.Runtime/Comparers/EnumComparer.cs:28-46 | Cql/Cql.Firely/Comparers/FhirEnumComparer.cs:23-44 — 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) Cql/Cql.Runtime/Operators/CqlOperators.AggregateFunctions.cs:174 — Cql/Cql.Runtime/Operators/CqlOperators.AggregateFunctions.cs:174-192 | Cql/Cql.Runtime/Operators/CqlOperators.AggregateFunctions.cs:199-217 — 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) Demo/Measures.Authoring/Program.cs:16 — Demo/Measures.Authoring/Program.cs:16-34 | Demo/Measures.Demo/Program.cs:15-38 — 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 copy of a member (15 corresponding lines) · ×3
  • Edited copy of a member (15 corresponding lines) Cql/Cql.CqlToElm/ElmFactory.cs:223 — Cql/Cql.CqlToElm/ElmFactory.cs:223-241 | Cql/Cql.CqlToElm/ElmFactory.cs:500-514 — 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) Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:132 — Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:132-146 | Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:1099-1113 — 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) Cql/Cql.Compiler/BuilderContextExtensions.cs:53 — Cql/Cql.Compiler/BuilderContextExtensions.cs:53-67 | Cql/Cql.Compiler/BuilderContextExtensions.cs:76-90 — 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 · Duplicated block (12 lines × 2) · ×3
  • Duplicated block (12 lines × 2) Cql/Cql.Runtime/Operators/CqlOperators.AggregateFunctions.cs:175 — Cql/Cql.Runtime/Operators/CqlOperators.AggregateFunctions.cs:175-186 | Cql/Cql.Runtime/Operators/CqlOperators.AggregateFunctions.cs:200-211 — 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 `Cql/Cql.Runtime/Operators/CqlOperators.AggregateFunctions.cs:175` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) Cql/Cql.Runtime/Runtime/EnumerableExceptionHandlingExtensions.cs:89 — Cql/Cql.Runtime/Runtime/EnumerableExceptionHandlingExtensions.cs:89-100 | Cql/Cql.Runtime/Runtime/EnumerableExceptionHandlingExtensions.cs:141-152 — 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 `Cql/Cql.Runtime/Runtime/EnumerableExceptionHandlingExtensions.cs:89` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) Cql/Cql.CqlToElm/Visitors/TerminalParsers.cs:109 — Cql/Cql.CqlToElm/Visitors/TerminalParsers.cs:109-120 | Cql/Cql.CqlToElm/Visitors/TerminalParsers.cs:123-134 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×3
  • Duplicated block (11 lines × 2) Cql/Cql.Runtime/Operators/CqlOperators.ArithmeticOperators.cs:108 — Cql/Cql.Runtime/Operators/CqlOperators.ArithmeticOperators.cs:108-118 | Cql/Cql.Runtime/Operators/CqlOperators.ArithmeticOperators.cs:780-790 — 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 `Cql/Cql.Runtime/Operators/CqlOperators.ArithmeticOperators.cs:108` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) Cql/Iso8601/DateTimeIso8601.cs:436 — Cql/Iso8601/DateTimeIso8601.cs:436-446 | Cql/Iso8601/TimeIso8601.cs:316-326 — before extracting anything, compare `Cql/Iso8601/DateTimeIso8601.cs` and `Cql/Iso8601/TimeIso8601.cs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 129 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 `Cql/Iso8601/DateTimeIso8601.cs:436` 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) Cql/Cql.Abstractions/Primitives/CqlDate.cs:109 — Cql/Cql.Abstractions/Primitives/CqlDate.cs:109-119 | Cql/Cql.Abstractions/Primitives/CqlDateTime.cs:162-172 — 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 `Cql/Cql.Abstractions/Primitives/CqlDate.cs:109` 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 × 2) · ×3
  • Duplicated block (7 lines × 2) Cql/PackagerCLI/Commands.CqlToFhir/CqlToFhirProgram.cs:100 — Cql/PackagerCLI/Commands.CqlToFhir/CqlToFhirProgram.cs:100-106 | Cql/PackagerCLI/Commands.ElmToFhir/ElmToFhirProgram.cs:207-213 — before extracting anything, compare `Cql/PackagerCLI/Commands.CqlToFhir/CqlToFhirProgram.cs` and `Cql/PackagerCLI/Commands.ElmToFhir/ElmToFhirProgram.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 168 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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.
  • Duplicated block (7 lines × 2) Cql/PackagerCLI/Commands.CqlToFhir/CqlToFhirOptions.cs:18 — Cql/PackagerCLI/Commands.CqlToFhir/CqlToFhirOptions.cs:18-24 | Cql/PackagerCLI/Commands.ElmToFhir/ElmToFhirOptions.cs:18-24 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) Cql/CodeGeneration.NET/Toolkit/Extensions/ElmToolkitExtensions.Adding.cs:279 — Cql/CodeGeneration.NET/Toolkit/Extensions/ElmToolkitExtensions.Adding.cs:279-285 | Cql/Cql.CqlToElm/Toolkit/Extensions/CqlToolkitExtensions.Adding.cs:156-162 — 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.
D5 · Coupling · Off the main sequence · ×3
  • Off the main sequence: Iso8601 Cql/Iso8601/Iso8601.csproj:1 — Iso8601: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
  • Off the main sequence: Cql.Model Cql/Cql.Model/Cql.Model.csproj:1 — Cql.Model: abstractness 0.00, instability 0.20, distance 0.80 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
  • Off the main sequence: Cql.Firely Cql/Cql.Firely/Cql.Firely.csproj:1 — Cql.Firely: abstractness 0.03, instability 0.25, distance 0.72 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
IC1 · Incompleteness & stubs · Unfinished stub · ×3
  • Unfinished stub — throws NotImplementedException Cql/CodeGeneration.NET/Toolkit/Extensions/ElmToolkitExtensions.Adding.cs:219 — `AddElmFileWithDependencies` 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 Cql/CodeGeneration.NET/Toolkit/Extensions/ElmToolkitExtensions.Adding.cs:234 — `AddElmFileWithDependencies` 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 Cql/Cql.CqlToElm/Scopes/LibraryBuilder.cs:22 — `CreateFromExisting` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
X12 · Unreachable branch · Branch is unreachable · ×3
  • Branch is unreachable — its condition cannot hold here Cql/Cql.Abstractions/Primitives/CqlDate.cs:254 — `case DateTimePrecision.Unknown:` can never be true where it stands: the guard on line 219 (`dtp == DateTimePrecision.Unknown`) left this block when it was true. No value of `dtp` satisfies all of that, so this case label never runs. Reorder the tests, drop the dead branch, or fix the bound that was meant.
  • Branch is unreachable — its condition cannot hold here Cql/Cql.Abstractions/Primitives/CqlDateTime.cs:316 — `case DateTimePrecision.Unknown:` can never be true where it stands: the guard on line 311 (`dtp == DateTimePrecision.Unknown`) left this block when it was true. No value of `dtp` satisfies all of that, so this case label never runs. Reorder the tests, drop the dead branch, or fix the bound that was meant.
  • Branch is unreachable — its condition cannot hold here Cql/Cql.Abstractions/Primitives/CqlTime.cs:319 — `case DateTimePrecision.Unknown:` can never be true where it stands: the guard on line 230 (`dtp == DateTimePrecision.Unknown`) left this block when it was true. No value of `dtp` satisfies all of that, so this case label never runs. Reorder the tests, drop the dead branch, or fix the bound that was meant.
D1 · Cyclomatic Complexity · CqlOperators.Expand (cyclomatic 22) · ×2
  • CqlOperators.Expand (cyclomatic 22) Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:737 — CqlOperators.Expand 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.
  • CqlOperators.Expand (cyclomatic 22) Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:422 — CqlOperators.Expand 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.
D1 · Cyclomatic Complexity · CqlOperators.Expand (cyclomatic 19) · ×2
  • CqlOperators.Expand (cyclomatic 19) Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:592 — CqlOperators.Expand 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.
  • CqlOperators.Expand (cyclomatic 19) Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:261 — CqlOperators.Expand 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.
D2 · Cognitive Complexity · CqlOperators.Expand (cognitive 35) · ×2
  • CqlOperators.Expand (cognitive 35) Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:504 — CqlOperators.Expand 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. This shape REPEATS in the file: one other method here (CqlOperators.Expand) 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.
  • CqlOperators.Expand (cognitive 35) Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:568 — CqlOperators.Expand 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. This shape REPEATS in the file: one other method here (CqlOperators.Expand) 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 · CqlOperators.Expand (cognitive 25) · ×2
  • CqlOperators.Expand (cognitive 25) Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:517 — CqlOperators.Expand 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. This shape REPEATS in the file: one other method here (CqlOperators.Expand) 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.
  • CqlOperators.Expand (cognitive 25) Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:662 — CqlOperators.Expand 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. This shape REPEATS in the file: one other method here (CqlOperators.Expand) 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 · CqlOperators.Expand (cognitive 20) · ×2
  • CqlOperators.Expand (cognitive 20) Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:811 — CqlOperators.Expand has cognitive complexity 20 (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. This shape REPEATS in the file: one other method here (CqlOperators.Expand) 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.
  • CqlOperators.Expand (cognitive 20) Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:869 — CqlOperators.Expand has cognitive complexity 20 (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. This shape REPEATS in the file: one other method here (CqlOperators.Expand) 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
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (18 corresponding lines) · ×2
  • Edited copy of a member (18 corresponding lines) Cql/Iso8601/DateTimeIso8601.cs:483 — Cql/Iso8601/DateTimeIso8601.cs:483-519 | Cql/Iso8601/TimeIso8601.cs:368-389 — 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) Cql/Cql.CqlToElm/Visitors/TimingExpressionVisitor.cs:472 — Cql/Cql.CqlToElm/Visitors/TimingExpressionVisitor.cs:472-489 | Cql/Cql.CqlToElm/Visitors/TimingExpressionVisitor.cs:495-512 — 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 · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (6 members, 50+ identical tokens) Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:518 — Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:518-591 | Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:593-661 | Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:663-736 | Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:179-260 | Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:262-338 | Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:340-421 — 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.
  • Members sharing a duplicated core (6 members, 50+ identical tokens) Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:518 — Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:518-591 | Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:593-661 | Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:663-736 | Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:738-810 | Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:812-868 | Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:870-926 — 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 (17 corresponding lines) · ×2
  • Edited copy of a member (17 corresponding lines) Cql/Cql.Runtime/Operators/CqlOperators.IntervalBoundaries.cs:111 — Cql/Cql.Runtime/Operators/CqlOperators.IntervalBoundaries.cs:111-127 | Cql/Cql.Runtime/Operators/CqlOperators.IntervalBoundaries.cs:131-147 — 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) Cql/Cql.Runtime/Operators/CqlOperators.AggregateFunctions.cs:548 — Cql/Cql.Runtime/Operators/CqlOperators.AggregateFunctions.cs:548-564 | Cql/Cql.Runtime/Operators/CqlOperators.AggregateFunctions.cs:679-695 — 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 (24 corresponding lines) · ×2
  • Edited copy of a member (24 corresponding lines) Cql/Cql.Runtime/Operators/CqlOperators.AggregateFunctions.cs:387 — Cql/Cql.Runtime/Operators/CqlOperators.AggregateFunctions.cs:387-412 | Cql/Cql.Runtime/Operators/CqlOperators.AggregateFunctions.cs:484-507 — 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) Cql/Cql.Runtime/Comparers/CqlComparers.CqlQuantityCqlComparer.cs:37 — Cql/Cql.Runtime/Comparers/CqlComparers.CqlQuantityCqlComparer.cs:37-66 | Cql/Cql.Runtime/Comparers/CqlComparers.CqlQuantityCqlComparer.cs:72-95 — 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, 27+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 27+ corresponding lines) Cql/Cql.Runtime/Comparers/CqlComparers.ListEqualComparer.cs:26 — Cql/Cql.Runtime/Comparers/CqlComparers.ListEqualComparer.cs:26-55 | Cql/Cql.Runtime/Comparers/CqlComparers.ListEqualComparer.cs:61-97 | Cql/Cql.Runtime/Comparers/CqlComparers.ListEqualComparer.cs:103-129 — These 3 members are one piece of code written 3 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 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 27+ corresponding lines) Examples/CqlSdkExamples/310 Invoking CQL Hello World/Program.cs:25 — Examples/CqlSdkExamples/310 Invoking CQL Hello World/Program.cs:25-51 | Examples/CqlSdkExamples/320 Invoking CQL Hello World with Parameter/Program.cs:25-57 | Examples/CqlSdkExamples/330 Invoking CQL Hello World function with Argument/Program.cs:25-51 — These 3 members are one piece of code written 3 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 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (29 corresponding lines) · ×2
  • Edited copy of a member (29 corresponding lines) Cql/Cql.Runtime/Operators/CqlOperators.AggregateFunctions.cs:86 — Cql/Cql.Runtime/Operators/CqlOperators.AggregateFunctions.cs:86-114 | Cql/Cql.Runtime/Operators/CqlOperators.AggregateFunctions.cs:128-168 — 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:42 — REDACTED:42-70 | REDACTED:89-117 — 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 copies of one member (3 members, 16+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 16+ corresponding lines) Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:1853 — Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:1853-1868 | Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:1871-1886 | Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:1889-1904 — These 3 members are one piece of code written 3 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 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 16+ corresponding lines) Cql/Cql.CqlToElm/InvocationBuilder.cs:48 — Cql/Cql.CqlToElm/InvocationBuilder.cs:48-65 | Cql/Cql.CqlToElm/InvocationBuilder.cs:74-89 | Cql/Cql.CqlToElm/InvocationBuilder.cs:99-115 — These 3 members are one piece of code written 3 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 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (8 corresponding lines) · ×2
  • Edited copy of a member (8 corresponding lines) Cql/Cql.Abstractions/Primitives/CqlInterval.cs:41 — Cql/Cql.Abstractions/Primitives/CqlInterval.cs:41-48 | Cql/Cql.Abstractions/Primitives/CqlInterval.cs:63-70 — 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) Cql/Cql.CqlToElm/Toolkit/Extensions/CqlToolkitExtensions.Adding.cs:155 — Cql/Cql.CqlToElm/Toolkit/Extensions/CqlToolkitExtensions.Adding.cs:155-162 | Cql/CodeGeneration.NET/Toolkit/Extensions/ElmToolkitExtensions.Adding.cs:278-285 — 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 (16 corresponding lines) · ×2
  • Edited copy of a member (16 corresponding lines) Cql/Cql.CqlToElm/Toolkit/Extensions/CqlToolkitExtensions.Adding.cs:109 — Cql/Cql.CqlToElm/Toolkit/Extensions/CqlToolkitExtensions.Adding.cs:109-127 | Cql/Cql.Invocation/Toolkit/Extensions/InvocationToolkitExtensions.Adding.cs:36-51 — 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) Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:790 — Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:790-807 | Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:934-949 — 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 (23 corresponding lines) · ×2
  • Edited copy of a member (23 corresponding lines) Cql/Cql.Runtime/Operators/CqlOperators.AggregateFunctions.cs:357 — Cql/Cql.Runtime/Operators/CqlOperators.AggregateFunctions.cs:357-383 | Cql/Cql.Runtime/Operators/CqlOperators.AggregateFunctions.cs:458-480 — 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) Cql/Cql.Runtime/Operators/CqlOperators.FusedOperators.cs:137 — Cql/Cql.Runtime/Operators/CqlOperators.FusedOperators.cs:137-164 | Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:92-114 — 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, 10+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 10+ corresponding lines) Cql/Cql.Compiler/CqlOperatorsBinder.Specific.cs:27 — Cql/Cql.Compiler/CqlOperatorsBinder.Specific.cs:27-37 | Cql/Cql.Compiler/CqlOperatorsBinder.Specific.cs:272-282 | Cql/Cql.Compiler/CqlOperatorsBinder.Specific.cs:287-296 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 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, 10+ corresponding lines) Cql/Cql.CqlToElm/CqlLibraryString.cs:57 — Cql/Cql.CqlToElm/CqlLibraryString.cs:57-66 | Cql/Cql.Runtime/Runtime/CqlLibraryIdentifier.cs:90-99 | Cql/Cql.Runtime/Runtime/CqlLibraryVersion.cs:90-99 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 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 (7 members, 12+ corresponding lines) · ×2
  • Edited copies of one member (7 members, 12+ corresponding lines) Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:340 — Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:340-351 | Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:354-365 | Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:367-378 | Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:380-391 | Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:394-405 | Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:407-418 | Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:420-431 — These 7 members are one piece of code written 7 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 7 times and the copies will drift further apart.
  • Edited copies of one member (7 members, 12+ corresponding lines) Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:1978 — Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:1978-1989 | Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:1991-2002 | Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:2004-2015 | Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:2017-2028 | Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:2031-2042 | Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:2044-2055 | Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:2057-2068 — These 7 members are one piece of code written 7 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 7 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×2
  • Duplicated block (6 lines × 2) Cql/Cql.CqlToElm/Visitors/LiteralVisitor.cs:181 — Cql/Cql.CqlToElm/Visitors/LiteralVisitor.cs:181-186 | Cql/Cql.CqlToElm/Visitors/LiteralVisitor.cs:499-504 — 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 `Cql/Cql.CqlToElm/Visitors/LiteralVisitor.cs:181` 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 `context` to `cqlParser.DateTimeLiteralContext` in one and `cqlParser.TimeLiteralContext` 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) Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:244 — Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:244-249 | Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:404-409 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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 (22 lines × 2) · ×2
  • Duplicated block (22 lines × 2) Cql/CodeGeneration.NET/Toolkit/Extensions/ElmToolkitExtensions.Saving.cs:275 — Cql/CodeGeneration.NET/Toolkit/Extensions/ElmToolkitExtensions.Saving.cs:275-296 | Cql/Cql.CqlToElm/Toolkit/Extensions/CqlToolkitExtensions.Saving.cs:93-114 — before extracting anything, compare `Cql/CodeGeneration.NET/Toolkit/Extensions/ElmToolkitExtensions.Saving.cs` and `Cql/Cql.CqlToElm/Toolkit/Extensions/CqlToolkitExtensions.Saving.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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.
  • Duplicated block (22 lines × 2) tools/XsdToCSharpConverter/XsdCodeGenerator.cs:426 — tools/XsdToCSharpConverter/XsdCodeGenerator.cs:426-447 | tools/XsdToCSharpConverter/XsdCodeGenerator.cs:588-609 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×2
  • Duplicated block (16 lines × 2) Cql/Cql.Runtime/Operators/CqlOperators.AggregateFunctions.cs:388 — Cql/Cql.Runtime/Operators/CqlOperators.AggregateFunctions.cs:388-403 | Cql/Cql.Runtime/Operators/CqlOperators.AggregateFunctions.cs:485-500 — 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 `Cql/Cql.Runtime/Operators/CqlOperators.AggregateFunctions.cs:388` 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, `Cql/Cql.Runtime/Operators/CqlOperators.AggregateFunctions.cs:408` calls `Sqrt` and `Cql/Cql.Runtime/Operators/CqlOperators.AggregateFunctions.cs:504` 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 (16 lines × 2) Cql/Iso8601/DateTimeIso8601.cs:498 — Cql/Iso8601/DateTimeIso8601.cs:498-513 | Cql/Iso8601/TimeIso8601.cs:371-386 — before extracting anything, compare `Cql/Iso8601/DateTimeIso8601.cs` and `Cql/Iso8601/TimeIso8601.cs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 129 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.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×2
  • Duplicated block (15 lines × 3) Cql/CodeGeneration.NET/Toolkit/Extensions/ElmToolkitExtensions.Saving.cs:282 — Cql/CodeGeneration.NET/Toolkit/Extensions/ElmToolkitExtensions.Saving.cs:282-296 | Cql/Cql.CqlToElm/Toolkit/Extensions/CqlToolkitExtensions.Saving.cs:100-114 | Cql/Cql.Packaging/Toolkit/Extensions/PackagingToolkitExtensions.Saving.cs:143-157 — before extracting anything, compare `Cql/CodeGeneration.NET/Toolkit/Extensions/ElmToolkitExtensions.Saving.cs` and `Cql/Cql.CqlToElm/Toolkit/Extensions/CqlToolkitExtensions.Saving.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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.
  • Duplicated block (15 lines × 3) Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:193 — Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:193-207 | Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:276-290 | Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:354-368 — 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 `Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:193` 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 (15 lines × 2) · ×2
  • Duplicated block (15 lines × 2) Cql/PackagerCLI/Commands.CqlToFhir/CqlToFhirCommand.cs:20 — Cql/PackagerCLI/Commands.CqlToFhir/CqlToFhirCommand.cs:20-34 | Cql/PackagerCLI/Commands.ElmToFhir/ElmToFhirCommand.cs:20-34 — before extracting anything, compare `Cql/PackagerCLI/Commands.CqlToFhir/CqlToFhirCommand.cs` and `Cql/PackagerCLI/Commands.ElmToFhir/ElmToFhirCommand.cs` as WHOLE FILES: 84% 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. Read the line range as the matched WINDOW rather than a finished unit: at `Cql/PackagerCLI/Commands.CqlToFhir/CqlToFhirCommand.cs:20` 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 (15 lines × 2) Cql/Cql.Runtime/Operators/CqlOperators.ArithmeticOperators.cs:310 — Cql/Cql.Runtime/Operators/CqlOperators.ArithmeticOperators.cs:310-324 | Cql/Cql.Runtime/Operators/CqlOperators.ArithmeticOperators.cs:390-404 — 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.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×2
  • Duplicated block (14 lines × 2) Cql/CodeGeneration.NET/LibrarySetCSharpCodeGenerator.DefinitionWriter.cs:77 — Cql/CodeGeneration.NET/LibrarySetCSharpCodeGenerator.DefinitionWriter.cs:77-90 | Cql/CodeGeneration.NET/LibrarySetCSharpCodeGenerator.DefinitionWriter.cs:104-117 — 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 `Cql/CodeGeneration.NET/LibrarySetCSharpCodeGenerator.DefinitionWriter.cs:77` 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.
  • Duplicated block (14 lines × 2) Examples/CqlSdkExamples/400 Invoke from all FHIR Resources in Directory/Program.cs:66 — Examples/CqlSdkExamples/400 Invoke from all FHIR Resources in Directory/Program.cs:66-79 | Examples/CqlSdkExamples/410 Invoke from all FHIR Resource and Dependencies in Directory/Program.cs:81-94 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Examples/CqlSdkExamples/400 Invoke from all FHIR Resources in Directory/Program.cs:66` 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 (13 lines × 3) · ×2
  • Duplicated block (13 lines × 3) Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:557 — Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:557-569 | Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:627-639 | Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:702-714 — 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 `Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:557` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (13 lines × 3) Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:221 — Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:221-234 | Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:299-311 | Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:382-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 `Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:221` 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 (10 lines × 2) · ×2
  • Duplicated block (10 lines × 2) Cql/Iso8601/DateIso8601.cs:232 — Cql/Iso8601/DateIso8601.cs:232-241 | Cql/Iso8601/DateTimeIso8601.cs:484-493 — before extracting anything, compare `Cql/Iso8601/DateIso8601.cs` and `Cql/Iso8601/DateTimeIso8601.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 42 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 `Cql/Iso8601/DateIso8601.cs:232` 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) Cql/Iso8601/DateTimeIso8601.cs:417 — Cql/Iso8601/DateTimeIso8601.cs:417-429 | Cql/Iso8601/DateTimeIso8601.cs:439-448 — 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 `Cql/Iso8601/DateTimeIso8601.cs:417` 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 × 2) · ×2
  • Duplicated block (8 lines × 2) Cql/Cql.CqlToElm/Scopes/SymbolTable.cs:118 — Cql/Cql.CqlToElm/Scopes/SymbolTable.cs:118-125 | Cql/Cql.CqlToElm/Scopes/SymbolTable.cs:213-220 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Cql/Cql.CqlToElm/Scopes/SymbolTable.cs:118` 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 (8 lines × 2) Cql/Cql.Compiler/CodeBuilderContext.Operators.cs:230 — Cql/Cql.Compiler/CodeBuilderContext.Operators.cs:230-237 | Cql/Cql.Compiler/CodeBuilderContext.Operators.cs:272-279 — 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.
X18 · Disposal-pattern correctness · Disposes a dependency it does not own · ×2
  • Disposes a dependency it does not own Cql/Cql.CqlToElm/Toolkit/Internal/CqlToolkitServices.cs:163 — `ServiceScope` is never created by `CqlToolkitServices` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 163). Its declared type `IServiceScope` 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.
  • Disposes a dependency it does not own Cql/CodeGeneration.NET/Toolkit/Internal/ElmToolkitScopedState.cs:18 — `scope` is never created by `ElmToolkitScopedState` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 18). Its declared type `IServiceScope` 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.
X30 · Support guard that admits what it rejects · Support guard that admits what it rejects · ×2
  • Support guard that admits what it rejects Cql/Elm/Serialization/PolymorphicArrayJsonConverter.cs:16 — `reader.TokenType == JsonTokenType.StartObject && reader.Read() && reader.Toke...` can never be true: it asks `reader.TokenType` to equal both `JsonTokenType.StartObject` and `JsonTokenType.PropertyName` at once. Whatever this condition guards never runs, so every value it was written to refuse passes. Join the two equalities with `||` (either value) or test the second one on the value it was meant for.
  • Support guard that admits what it rejects Cql/Elm/Serialization/PolymorphicArrayJsonConverter.cs:33 — `reader.TokenType == JsonTokenType.PropertyName && reader.GetString() == "def"...` can never be true: it asks `reader.TokenType` to equal both `JsonTokenType.PropertyName` and `JsonTokenType.StartArray` at once. Whatever this condition guards never runs, so every value it was written to refuse passes. Join the two equalities with `||` (either value) or test the second one on the value it was meant for.
AX2 · Stateful singletons · Stateful singleton · ×1
  • Stateful singleton: TypeConverter Cql/Cql.Runtime/Conversion/TypeConverter.cs:34 — `TypeConverter` is a singleton (one shared instance) but mutates instance state outside any lock (_converters, _customConverters; e.g. `_converters` at line 144).
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 · DateTimeIso8601.DateTimeIso8601.ctor (cyclomatic 70) · ×1
  • DateTimeIso8601.DateTimeIso8601.ctor (cyclomatic 70) Cql/Iso8601/DateTimeIso8601.cs:158 — DateTimeIso8601.DateTimeIso8601.ctor has cyclomatic complexity 70 (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 · CodeBuilderContext.GetBindArgs (cyclomatic 59) · ×1
  • CodeBuilderContext.GetBindArgs (cyclomatic 59) Cql/Cql.Compiler/CodeBuilderContext.cs:259 — CodeBuilderContext.GetBindArgs has cyclomatic complexity 59 (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 · CoercionProvider.Coerce (cyclomatic 45) · ×1
  • CoercionProvider.Coerce (cyclomatic 45) Cql/Cql.CqlToElm/CoercionProvider.cs:29 — CoercionProvider.Coerce has cyclomatic complexity 45 (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 · ExpressionVisitor.VisitQuery (cyclomatic 43) · ×1
  • ExpressionVisitor.VisitQuery (cyclomatic 43) Cql/Cql.CqlToElm/Visitors/QueryExpressionVisitor.cs:16 — ExpressionVisitor.VisitQuery has cyclomatic complexity 43 (threshold 15). Of this number, 39 points are the body's own statements and 4 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 · CqlTypeToFhirTypeMapper.TypeEntryFor (cyclomatic 43) · ×1
  • CqlTypeToFhirTypeMapper.TypeEntryFor (cyclomatic 43) REDACTED:114 — CqlTypeToFhirTypeMapper.TypeEntryFor has cyclomatic complexity 43 (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.
D1 · Cyclomatic Complexity · CqlDateTime.CompareValues (cyclomatic 42) · ×1
  • CqlDateTime.CompareValues (cyclomatic 42) Cql/Cql.Abstractions/Primitives/CqlDateTime.cs:276 — CqlDateTime.CompareValues has cyclomatic complexity 42 (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 · CqlDateTimeMath.WholeCalendarPeriodsBetween (cyclomatic 42) · ×1
  • CqlDateTimeMath.WholeCalendarPeriodsBetween (cyclomatic 42) Cql/Cql.Abstractions/Primitives/CqlDateTimeMath.cs:185 — CqlDateTimeMath.WholeCalendarPeriodsBetween has cyclomatic complexity 42 (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 · CqlToFhirProgram.Run (cyclomatic 35) · ×1
  • CqlToFhirProgram.Run (cyclomatic 35) Cql/PackagerCLI/Commands.CqlToFhir/CqlToFhirProgram.cs:47 — CqlToFhirProgram.Run 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.
D1 · Cyclomatic Complexity · ExpressionVisitor.HandleBeforeOrAfter (cyclomatic 33) · ×1
  • ExpressionVisitor.HandleBeforeOrAfter (cyclomatic 33) Cql/Cql.CqlToElm/Visitors/TimingExpressionVisitor.cs:249 — ExpressionVisitor.HandleBeforeOrAfter 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 · ElmToFhirProgram.Run (cyclomatic 31) · ×1
  • ElmToFhirProgram.Run (cyclomatic 31) Cql/PackagerCLI/Commands.ElmToFhir/ElmToFhirProgram.cs:34 — ElmToFhirProgram.Run has cyclomatic complexity 31 (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 · TimeIso8601.TimeIso8601.ctor (cyclomatic 31) · ×1
  • TimeIso8601.TimeIso8601.ctor (cyclomatic 31) Cql/Iso8601/TimeIso8601.cs:157 — TimeIso8601.TimeIso8601.ctor has cyclomatic complexity 31 (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 · CoercionProvider.GetCoercionCost (cyclomatic 31) · ×1
  • CoercionProvider.GetCoercionCost (cyclomatic 31) Cql/Cql.CqlToElm/CoercionProvider.cs:242 — CoercionProvider.GetCoercionCost has cyclomatic complexity 31 (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 · TypeCSharpFormat.WriteTo (cyclomatic 30) · ×1
  • TypeCSharpFormat.WriteTo (cyclomatic 30) Cql/Cql.Abstractions/Abstractions/Infrastructure/CSharpFormatter.cs:99 — TypeCSharpFormat.WriteTo 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.
D1 · Cyclomatic Complexity · ExpressionVisitor.HandleConcurrentWith (cyclomatic 29) · ×1
  • ExpressionVisitor.HandleConcurrentWith (cyclomatic 29) Cql/Cql.CqlToElm/Visitors/TimingExpressionVisitor.cs:558 — ExpressionVisitor.HandleConcurrentWith has cyclomatic complexity 29 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · SymbolTable.TryResolveFluentFunction (cyclomatic 28) · ×1
  • SymbolTable.TryResolveFluentFunction (cyclomatic 28) Cql/Cql.CqlToElm/Scopes/SymbolTable.cs:142 — SymbolTable.TryResolveFluentFunction has cyclomatic complexity 28 (threshold 15). Of this number, 20 points are the body's own statements and 8 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 · CodeBuilderContext.Instance (cyclomatic 27) · ×1
  • CodeBuilderContext.Instance (cyclomatic 27) Cql/Cql.Compiler/CodeBuilderContext.Query.cs:763 — CodeBuilderContext.Instance 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 · CqlOperators.OverCompletions (cyclomatic 26) · ×1
  • CqlOperators.OverCompletions (cyclomatic 26) Cql/Cql.Runtime/Operators/CqlOperators.IntervalBoundaries.cs:211 — CqlOperators.OverCompletions 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 · ExpressionVisitor.createFunctionInvocation (cyclomatic 26) · ×1
  • ExpressionVisitor.createFunctionInvocation (cyclomatic 26) Cql/Cql.CqlToElm/Visitors/InvocationTermVisitor.cs:453 — ExpressionVisitor.createFunctionInvocation 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 · CodeBuilderContext.ChangeType (cyclomatic 26) · ×1
  • CodeBuilderContext.ChangeType (cyclomatic 26) Cql/Cql.Compiler/CodeBuilderContext.Operators.cs:769 — CodeBuilderContext.ChangeType 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 · DateIso8601.DateIso8601.ctor (cyclomatic 25) · ×1
  • DateIso8601.DateIso8601.ctor (cyclomatic 25) Cql/Iso8601/DateIso8601.cs:93 — DateIso8601.DateIso8601.ctor 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.
D1 · Cyclomatic Complexity · InvocationBuilder.MatchSignature (cyclomatic 24) · ×1
  • InvocationBuilder.MatchSignature (cyclomatic 24) Cql/Cql.CqlToElm/InvocationBuilder.cs:149 — InvocationBuilder.MatchSignature 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 · CqlDateTimeMath.BoundariesBetween (cyclomatic 23) · ×1
  • CqlDateTimeMath.BoundariesBetween (cyclomatic 23) Cql/Cql.Abstractions/Primitives/CqlDateTimeMath.cs:57 — CqlDateTimeMath.BoundariesBetween has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CSharpEmitter.PrintBinary (cyclomatic 23) · ×1
  • CSharpEmitter.PrintBinary (cyclomatic 23) Cql/CodeGeneration.NET/CSharpEmitter.Print.cs:464 — CSharpEmitter.PrintBinary has cyclomatic complexity 23 (threshold 15). 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 · CqlOperatorsBinder.ResolveMethodInfosWithPotentialArgumentConversions (cyclomatic 23) · ×1
  • CqlOperatorsBinder.ResolveMethodInfosWithPotentialArgumentConversions (cyclomatic 23) Cql/Cql.Compiler/CqlOperatorsBinder.Bind.cs:171 — CqlOperatorsBinder.ResolveMethodInfosWithPotentialArgumentConversions has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AssemblyCompiler.CompileLibrariesInDependencyWaves (cyclomatic 22) · ×1
  • AssemblyCompiler.CompileLibrariesInDependencyWaves (cyclomatic 22) Cql/CodeGeneration.NET/AssemblyCompiler.cs:143 — AssemblyCompiler.CompileLibrariesInDependencyWaves has cyclomatic complexity 22 (threshold 15). Of this number, 16 points are the body's own statements and 6 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 · CodeBuilderContext.TypeFor (cyclomatic 22) · ×1
  • CodeBuilderContext.TypeFor (cyclomatic 22) Cql/Cql.Compiler/CodeBuilderContext.TypeFor.cs:93 — CodeBuilderContext.TypeFor 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.
D1 · Cyclomatic Complexity · CumulativeMedicationDurationFHIR4_1_0_000.ToDaily (cyclomatic 22) · ×1
  • CumulativeMedicationDurationFHIR4_1_0_000.ToDaily (cyclomatic 22) REDACTED:362 — CumulativeMedicationDurationFHIR4_1_0_000.ToDaily has cyclomatic complexity 22 (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 · XsdCodeGenerator.IsOptionalValueType (cyclomatic 21) · ×1
  • XsdCodeGenerator.IsOptionalValueType (cyclomatic 21) tools/XsdToCSharpConverter/XsdCodeGenerator.cs:873 — XsdCodeGenerator.IsOptionalValueType 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. This is NOT this file's highest cyclomatic complexity: XsdCodeGenerator.GetXmlDataType (cyclomatic 37) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · CSharpFormatterExtensions.GetCSharpKeyword (cyclomatic 21) · ×1
  • CSharpFormatterExtensions.GetCSharpKeyword (cyclomatic 21) Cql/Cql.Abstractions/Abstractions/Infrastructure/CSharpFormatter.cs:13 — CSharpFormatterExtensions.GetCSharpKeyword has cyclomatic complexity 21 (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.
D1 · Cyclomatic Complexity · CqlTime.CompareValues (cyclomatic 21) · ×1
  • CqlTime.CompareValues (cyclomatic 21) Cql/Cql.Abstractions/Primitives/CqlTime.cs:215 — CqlTime.CompareValues 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 · CqlOperators.ConvertStringToBooleanImpl (cyclomatic 21) · ×1
  • CqlOperators.ConvertStringToBooleanImpl (cyclomatic 21) Cql/Cql.Runtime/Operators/CqlOperators.TypeOperators.cs:101 — CqlOperators.ConvertStringToBooleanImpl has cyclomatic complexity 21 (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.
D1 · Cyclomatic Complexity · DateTimeIso8601.ParseComponents (cyclomatic 21) · ×1
  • DateTimeIso8601.ParseComponents (cyclomatic 21) Cql/Iso8601/DateTimeIso8601.cs:376 — DateTimeIso8601.ParseComponents 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 · CqlDate.CompareValues (cyclomatic 20) · ×1
  • CqlDate.CompareValues (cyclomatic 20) Cql/Cql.Abstractions/Primitives/CqlDate.cs:186 — CqlDate.CompareValues 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 · FhirTypeConverter.ConvertCqlPrimitivesToFhir (cyclomatic 20) · ×1
  • FhirTypeConverter.ConvertCqlPrimitivesToFhir (cyclomatic 20) REDACTED:327 — FhirTypeConverter.ConvertCqlPrimitivesToFhir 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 9 function literals inside it that branch (lines 343, 376, 395, …). 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 · SymbolTable.TryResolveFunction (cyclomatic 20) · ×1
  • SymbolTable.TryResolveFunction (cyclomatic 20) Cql/Cql.CqlToElm/Scopes/SymbolTable.cs:70 — SymbolTable.TryResolveFunction has cyclomatic complexity 20 (threshold 15). 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 · DefinitionVisitor.VisitStatements (cyclomatic 20) · ×1
  • DefinitionVisitor.VisitStatements (cyclomatic 20) Cql/Cql.CqlToElm/Visitors/LibraryVisitor.cs:304 — DefinitionVisitor.VisitStatements 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 · SaveAssemblyBinariesToDirectoryOptions.Save (cyclomatic 20) · ×1
  • SaveAssemblyBinariesToDirectoryOptions.Save (cyclomatic 20) Cql/CodeGeneration.NET/Toolkit/Extensions/ElmToolkitExtensions.Saving.cs:152 — SaveAssemblyBinariesToDirectoryOptions.Save 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 · XsdCodeGenerator.GenerateTypes (cyclomatic 19) · ×1
  • XsdCodeGenerator.GenerateTypes (cyclomatic 19) tools/XsdToCSharpConverter/XsdCodeGenerator.cs:73 — XsdCodeGenerator.GenerateTypes has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: XsdCodeGenerator.GetXmlDataType (cyclomatic 37) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · ExpressionVisitor.VisitIntervalSelector (cyclomatic 19) · ×1
  • ExpressionVisitor.VisitIntervalSelector (cyclomatic 19) Cql/Cql.CqlToElm/Visitors/ExpressionVisitor.cs:52 — ExpressionVisitor.VisitIntervalSelector 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 · CodeBuilderContext.ProcessExpressionDef (cyclomatic 19) · ×1
  • CodeBuilderContext.ProcessExpressionDef (cyclomatic 19) Cql/Cql.Compiler/CodeBuilderContext.LibraryDefs.cs:87 — CodeBuilderContext.ProcessExpressionDef has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 9 of the 19 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 90, 134, 164). 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 · CodeBuilderContext.Query (cyclomatic 19) · ×1
  • CodeBuilderContext.Query (cyclomatic 19) Cql/Cql.Compiler/CodeBuilderContext.Query.cs:28 — CodeBuilderContext.Query has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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 · PolymorphicArrayJsonConverter.Read (cyclomatic 18) · ×1
  • PolymorphicArrayJsonConverter.Read (cyclomatic 18) Cql/Elm/Serialization/PolymorphicArrayJsonConverter.cs:14 — PolymorphicArrayJsonConverter.Read 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 · CqlTypeToFhirTypeMapper.TypeEntryFor (cyclomatic 18) · ×1
  • CqlTypeToFhirTypeMapper.TypeEntryFor (cyclomatic 18) REDACTED:205 — CqlTypeToFhirTypeMapper.TypeEntryFor 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 is NOT this file's highest cyclomatic complexity: CqlTypeToFhirTypeMapper.TypeEntryFor (cyclomatic 34) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · CqlSingletonFromMultipleElementsError.RenderElementTypeName (cyclomatic 17) · ×1
  • CqlSingletonFromMultipleElementsError.RenderElementTypeName (cyclomatic 17) Cql/Cql.Runtime/Operators/Errors/Errors.cs:54 — CqlSingletonFromMultipleElementsError.RenderElementTypeName 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 · TimeIso8601.TryParse (cyclomatic 17) · ×1
  • TimeIso8601.TryParse (cyclomatic 17) Cql/Iso8601/TimeIso8601.cs:273 — TimeIso8601.TryParse 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 · CoercionProvider.HasImplicitConversion (cyclomatic 17) · ×1
  • CoercionProvider.HasImplicitConversion (cyclomatic 17) Cql/Cql.CqlToElm/CoercionProvider.cs:387 — CoercionProvider.HasImplicitConversion 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 · ExpressionVisitor.VisitInstanceSelector (cyclomatic 17) · ×1
  • ExpressionVisitor.VisitInstanceSelector (cyclomatic 17) Cql/Cql.CqlToElm/Visitors/InvocationTermVisitor.cs:82 — ExpressionVisitor.VisitInstanceSelector 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 · ExpressionVisitor.VisitDateTimeLiteral (cyclomatic 17) · ×1
  • ExpressionVisitor.VisitDateTimeLiteral (cyclomatic 17) Cql/Cql.CqlToElm/Visitors/LiteralVisitor.cs:102 — ExpressionVisitor.VisitDateTimeLiteral 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 · CodeBuilderContext.TypeFor (cyclomatic 17) · ×1
  • CodeBuilderContext.TypeFor (cyclomatic 17) Cql/Cql.Compiler/CodeBuilderContext.TypeFor.cs:21 — CodeBuilderContext.TypeFor 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 · CodeExpressionExtensions.TryNewAssignToTypeExpression (cyclomatic 17) · ×1
  • CodeExpressionExtensions.TryNewAssignToTypeExpression (cyclomatic 17) Cql/Cql.Compiler/CodeModel/CodeExpressionExtensions.cs:30 — CodeExpressionExtensions.TryNewAssignToTypeExpression 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 · IdentifierNormalizer.Normalize (cyclomatic 17) · ×1
  • IdentifierNormalizer.Normalize (cyclomatic 17) Cql/Cql.Compiler/IdentifierNormalizer.cs:21 — IdentifierNormalizer.Normalize 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 · FhirLibraryUtilities.LoadFhirLibraryAndDependencies (cyclomatic 17) · ×1
  • FhirLibraryUtilities.LoadFhirLibraryAndDependencies (cyclomatic 17) Cql/Cql.Invocation/Toolkit/Extensions/InvocationToolkitExtensions.FhirLibraryAdding.cs:118 — FhirLibraryUtilities.LoadFhirLibraryAndDependencies 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 · XsdCodeGenerator.GenerateMembers (cyclomatic 16) · ×1
  • XsdCodeGenerator.GenerateMembers (cyclomatic 16) tools/XsdToCSharpConverter/XsdCodeGenerator.cs:311 — XsdCodeGenerator.GenerateMembers 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: XsdCodeGenerator.GetXmlDataType (cyclomatic 37) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · ReplaceLibraryAttachmentsProgram.Run (cyclomatic 16) · ×1
  • ReplaceLibraryAttachmentsProgram.Run (cyclomatic 16) Cql/PackagerCLI/Commands.ReplaceLibraryAttachments/ReplaceLibraryAttachmentsProgram.cs:22 — ReplaceLibraryAttachmentsProgram.Run 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 · ModelProvider.IsProperSubtypeOf (cyclomatic 16) · ×1
  • ModelProvider.IsProperSubtypeOf (cyclomatic 16) REDACTED:328 — ModelProvider.IsProperSubtypeOf 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. 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 · ExpressionVisitor.HandleIncludedIn (cyclomatic 16) · ×1
  • ExpressionVisitor.HandleIncludedIn (cyclomatic 16) Cql/Cql.CqlToElm/Visitors/TimingExpressionVisitor.cs:151 — ExpressionVisitor.HandleIncludedIn 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 · CodeBuilderContext.As (cyclomatic 16) · ×1
  • CodeBuilderContext.As (cyclomatic 16) Cql/Cql.Compiler/CodeBuilderContext.Operators.cs:362 — CodeBuilderContext.As has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CodeProperty.CodeProperty.ctor (cyclomatic 16) · ×1
  • CodeProperty.CodeProperty.ctor (cyclomatic 16) Cql/Cql.Compiler/CodeModel/CodeProperty.cs:17 — CodeProperty.CodeProperty.ctor has cyclomatic complexity 16 (threshold 15). 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.
D10 · Test Quality · No assertions · ×1
  • No assertions: Model_FhirR4 Cql/CoreTests/ModelTest.cs:23 — 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.
D18 · Solution Shape · Solution references 7 projects that do not exist · ×1
  • Solution references 7 projects that do not exist Cql-Sdk-All.slnx — `Cql-Sdk-All.slnx` declares 7 project file(s) that are missing from the tree (`submodules/Firely.Cql.Sdk.Integration.Runner/CodeGen/CodeGen.csproj`, `submodules/Firely.Cql.Sdk.Integration.Runner/Hedis2025.GoldenTests/Hedis2025.GoldenTests.csproj`, `submodules/Firely.Cql.Sdk.Integration.Runner/IntegrationRunner.Benchmarks/IntegrationRunner.Benchmarks.csproj`, `submodules/Firely.Cql.Sdk.Integration.Runner/IntegrationRunner.Harness/IntegrationRunner.Harness.csproj`, `submodules/Firely.Cql.Sdk.Integration.Runner/IntegrationRunner.Measurement/IntegrationRunner.Measurement.csproj`, `submodules/Firely.Cql.Sdk.Integration.Runner/IntegrationRunner.Verify/IntegrationRunner.Verify.csproj`, +1 more). 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 · DateTimeIso8601.DateTimeIso8601.ctor (cognitive 160) · ×1
  • DateTimeIso8601.DateTimeIso8601.ctor (cognitive 160) Cql/Iso8601/DateTimeIso8601.cs:158 — DateTimeIso8601.DateTimeIso8601.ctor has cognitive complexity 160 (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 · CqlDateTime.CompareValues (cognitive 128) · ×1
  • CqlDateTime.CompareValues (cognitive 128) Cql/Cql.Abstractions/Primitives/CqlDateTime.cs:276 — CqlDateTime.CompareValues has cognitive complexity 128 (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 · ExpressionVisitor.VisitQuery (cognitive 79) · ×1
  • ExpressionVisitor.VisitQuery (cognitive 79) Cql/Cql.CqlToElm/Visitors/QueryExpressionVisitor.cs:16 — ExpressionVisitor.VisitQuery has cognitive complexity 79 (threshold 15). Of this number, 75 points are the body's own statements and 4 belong to 2 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 · TimeIso8601.TimeIso8601.ctor (cognitive 67) · ×1
  • TimeIso8601.TimeIso8601.ctor (cognitive 67) Cql/Iso8601/TimeIso8601.cs:157 — TimeIso8601.TimeIso8601.ctor has cognitive complexity 67 (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 · ExpressionVisitor.VisitInstanceSelector (cognitive 63) · ×1
  • ExpressionVisitor.VisitInstanceSelector (cognitive 63) Cql/Cql.CqlToElm/Visitors/InvocationTermVisitor.cs:82 — ExpressionVisitor.VisitInstanceSelector has cognitive complexity 63 (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 · CodeBuilderContext.GetBindArgs (cognitive 63) · ×1
  • CodeBuilderContext.GetBindArgs (cognitive 63) Cql/Cql.Compiler/CodeBuilderContext.cs:259 — CodeBuilderContext.GetBindArgs has cognitive complexity 63 (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 · CqlDateTimeMath.WholeCalendarPeriodsBetween (cognitive 60) · ×1
  • CqlDateTimeMath.WholeCalendarPeriodsBetween (cognitive 60) Cql/Cql.Abstractions/Primitives/CqlDateTimeMath.cs:185 — CqlDateTimeMath.WholeCalendarPeriodsBetween has cognitive complexity 60 (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 · CqlOperatorsBinder.ResolveMethodInfosWithPotentialArgumentConversions (cognitive 59) · ×1
  • CqlOperatorsBinder.ResolveMethodInfosWithPotentialArgumentConversions (cognitive 59) Cql/Cql.Compiler/CqlOperatorsBinder.Bind.cs:171 — CqlOperatorsBinder.ResolveMethodInfosWithPotentialArgumentConversions has cognitive complexity 59 (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 · CqlToFhirProgram.Run (cognitive 50) · ×1
  • CqlToFhirProgram.Run (cognitive 50) Cql/PackagerCLI/Commands.CqlToFhir/CqlToFhirProgram.cs:47 — CqlToFhirProgram.Run has cognitive complexity 50 (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 · CqlOperators.OverCompletions (cognitive 47) · ×1
  • CqlOperators.OverCompletions (cognitive 47) Cql/Cql.Runtime/Operators/CqlOperators.IntervalBoundaries.cs:211 — CqlOperators.OverCompletions has cognitive complexity 47 (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 · TypeCSharpFormat.WriteTo (cognitive 46) · ×1
  • TypeCSharpFormat.WriteTo (cognitive 46) Cql/Cql.Abstractions/Abstractions/Infrastructure/CSharpFormatter.cs:99 — TypeCSharpFormat.WriteTo has cognitive complexity 46 (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 · DateTimeIso8601.ParseComponents (cognitive 46) · ×1
  • DateTimeIso8601.ParseComponents (cognitive 46) Cql/Iso8601/DateTimeIso8601.cs:376 — DateTimeIso8601.ParseComponents has cognitive complexity 46 (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 · AssemblyCompiler.CompileLibrariesInDependencyWaves (cognitive 46) · ×1
  • AssemblyCompiler.CompileLibrariesInDependencyWaves (cognitive 46) Cql/CodeGeneration.NET/AssemblyCompiler.cs:143 — AssemblyCompiler.CompileLibrariesInDependencyWaves has cognitive complexity 46 (threshold 15). Of this number, 32 points are the body's own statements and 14 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 · CodeBuilderContext.ChangeType (cognitive 46) · ×1
  • CodeBuilderContext.ChangeType (cognitive 46) Cql/Cql.Compiler/CodeBuilderContext.Operators.cs:769 — CodeBuilderContext.ChangeType has cognitive complexity 46 (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 · InvocationBuilder.MatchSignature (cognitive 45) · ×1
  • InvocationBuilder.MatchSignature (cognitive 45) Cql/Cql.CqlToElm/InvocationBuilder.cs:149 — InvocationBuilder.MatchSignature has cognitive complexity 45 (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 · ElmToFhirProgram.Run (cognitive 44) · ×1
  • ElmToFhirProgram.Run (cognitive 44) Cql/PackagerCLI/Commands.ElmToFhir/ElmToFhirProgram.cs:34 — ElmToFhirProgram.Run has cognitive complexity 44 (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 · DateIso8601.DateIso8601.ctor (cognitive 44) · ×1
  • DateIso8601.DateIso8601.ctor (cognitive 44) Cql/Iso8601/DateIso8601.cs:93 — DateIso8601.DateIso8601.ctor has cognitive complexity 44 (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 · SymbolTable.TryResolveFluentFunction (cognitive 43) · ×1
  • SymbolTable.TryResolveFluentFunction (cognitive 43) Cql/Cql.CqlToElm/Scopes/SymbolTable.cs:142 — SymbolTable.TryResolveFluentFunction has cognitive complexity 43 (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 · DefinitionVisitor.VisitStatements (cognitive 43) · ×1
  • DefinitionVisitor.VisitStatements (cognitive 43) Cql/Cql.CqlToElm/Visitors/LibraryVisitor.cs:304 — DefinitionVisitor.VisitStatements has cognitive complexity 43 (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 · CqlOperators.Expand (cognitive 42) · ×1
  • CqlOperators.Expand (cognitive 42) Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:261 — CqlOperators.Expand has cognitive complexity 42 (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 · TimeIso8601.TryParse (cognitive 39) · ×1
  • TimeIso8601.TryParse (cognitive 39) Cql/Iso8601/TimeIso8601.cs:273 — TimeIso8601.TryParse 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 · CoercionProvider.Coerce (cognitive 38) · ×1
  • CoercionProvider.Coerce (cognitive 38) Cql/Cql.CqlToElm/CoercionProvider.cs:29 — CoercionProvider.Coerce has cognitive complexity 38 (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 · SaveAssemblyBinariesToDirectoryOptions.Save (cognitive 38) · ×1
  • SaveAssemblyBinariesToDirectoryOptions.Save (cognitive 38) Cql/CodeGeneration.NET/Toolkit/Extensions/ElmToolkitExtensions.Saving.cs:152 — SaveAssemblyBinariesToDirectoryOptions.Save has cognitive complexity 38 (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 · CodeBuilderContext.TypeFor (cognitive 38) · ×1
  • CodeBuilderContext.TypeFor (cognitive 38) Cql/Cql.Compiler/CodeBuilderContext.TypeFor.cs:93 — CodeBuilderContext.TypeFor 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 · ExpressionVisitor.HandleBeforeOrAfter (cognitive 34) · ×1
  • ExpressionVisitor.HandleBeforeOrAfter (cognitive 34) Cql/Cql.CqlToElm/Visitors/TimingExpressionVisitor.cs:249 — ExpressionVisitor.HandleBeforeOrAfter 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 · CqlDate.CompareValues (cognitive 33) · ×1
  • CqlDate.CompareValues (cognitive 33) Cql/Cql.Abstractions/Primitives/CqlDate.cs:186 — CqlDate.CompareValues has cognitive complexity 33 (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 · CqlTime.CompareValues (cognitive 33) · ×1
  • CqlTime.CompareValues (cognitive 33) Cql/Cql.Abstractions/Primitives/CqlTime.cs:215 — CqlTime.CompareValues 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 · CodeBuilderContext.Instance (cognitive 33) · ×1
  • CodeBuilderContext.Instance (cognitive 33) Cql/Cql.Compiler/CodeBuilderContext.Query.cs:763 — CodeBuilderContext.Instance has cognitive complexity 33 (threshold 15). Of this number, 27 points are the body's own statements and 6 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 · CodeBuilderContext.TypeFor (cognitive 33) · ×1
  • CodeBuilderContext.TypeFor (cognitive 33) Cql/Cql.Compiler/CodeBuilderContext.TypeFor.cs:21 — CodeBuilderContext.TypeFor has cognitive complexity 33 (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 · XsdCodeGenerator.GenerateTypes (cognitive 32) · ×1
  • XsdCodeGenerator.GenerateTypes (cognitive 32) tools/XsdToCSharpConverter/XsdCodeGenerator.cs:73 — XsdCodeGenerator.GenerateTypes has cognitive complexity 32 (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 · ExpressionVisitor.createFunctionInvocation (cognitive 32) · ×1
  • ExpressionVisitor.createFunctionInvocation (cognitive 32) Cql/Cql.CqlToElm/Visitors/InvocationTermVisitor.cs:453 — ExpressionVisitor.createFunctionInvocation has cognitive complexity 32 (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 · CqlDateTimeMath.BoundariesBetween (cognitive 31) · ×1
  • CqlDateTimeMath.BoundariesBetween (cognitive 31) Cql/Cql.Abstractions/Primitives/CqlDateTimeMath.cs:57 — CqlDateTimeMath.BoundariesBetween 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 · DateTimeIso8601.Format (cognitive 31) · ×1
  • DateTimeIso8601.Format (cognitive 31) Cql/Iso8601/DateTimeIso8601.cs:482 — DateTimeIso8601.Format has cognitive complexity 31 (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 · FhirTypeConverter.ConvertCqlPrimitivesToFhir (cognitive 31) · ×1
  • FhirTypeConverter.ConvertCqlPrimitivesToFhir (cognitive 31) REDACTED:327 — FhirTypeConverter.ConvertCqlPrimitivesToFhir has cognitive complexity 31 (threshold 15). Most of this is not in the body itself: 1 of the 31 points is its own statement and the rest belongs to 9 function literals inside it that branch (lines 343, 376, 395, …). 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 · CoercionProvider.HasImplicitConversion (cognitive 31) · ×1
  • CoercionProvider.HasImplicitConversion (cognitive 31) Cql/Cql.CqlToElm/CoercionProvider.cs:387 — CoercionProvider.HasImplicitConversion 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 · CqlTypeToFhirTypeMapper.TypeEntryFor (cognitive 30) · ×1
  • CqlTypeToFhirTypeMapper.TypeEntryFor (cognitive 30) REDACTED:205 — CqlTypeToFhirTypeMapper.TypeEntryFor has cognitive complexity 30 (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 · FhirLibraryUtilities.LoadFhirLibraryAndDependencies (cognitive 29) · ×1
  • FhirLibraryUtilities.LoadFhirLibraryAndDependencies (cognitive 29) Cql/Cql.Invocation/Toolkit/Extensions/InvocationToolkitExtensions.FhirLibraryAdding.cs:118 — FhirLibraryUtilities.LoadFhirLibraryAndDependencies has cognitive complexity 29 (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 · CqlOperators.Expand (cognitive 27) · ×1
  • CqlOperators.Expand (cognitive 27) Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:737 — CqlOperators.Expand 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 · SymbolTable.TryResolveFunction (cognitive 27) · ×1
  • SymbolTable.TryResolveFunction (cognitive 27) Cql/Cql.CqlToElm/Scopes/SymbolTable.cs:70 — SymbolTable.TryResolveFunction 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 · DefinitionVisitor.VisitContextDefinition (cognitive 26) · ×1
  • DefinitionVisitor.VisitContextDefinition (cognitive 26) Cql/Cql.CqlToElm/Visitors/LibraryVisitor.cs:480 — DefinitionVisitor.VisitContextDefinition 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 · LibraryJsonSerializer.CorrectLegacyConstructs (cognitive 26) · ×1
  • LibraryJsonSerializer.CorrectLegacyConstructs (cognitive 26) Cql/Elm/Serialization/LibraryJsonSerializer.cs:276 — LibraryJsonSerializer.CorrectLegacyConstructs has cognitive complexity 26 (threshold 15). Of this number, 17 points are the body's own statements and 9 belong to 2 function items 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 · CodeBuilderContext.ProcessExpressionDef (cognitive 25) · ×1
  • CodeBuilderContext.ProcessExpressionDef (cognitive 25) Cql/Cql.Compiler/CodeBuilderContext.LibraryDefs.cs:87 — CodeBuilderContext.ProcessExpressionDef has cognitive complexity 25 (threshold 15). Most of this is not in the body itself: 9 of the 25 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 90, 134, 164). 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 · CodeBuilderContext.Query (cognitive 25) · ×1
  • CodeBuilderContext.Query (cognitive 25) Cql/Cql.Compiler/CodeBuilderContext.Query.cs:28 — CodeBuilderContext.Query has cognitive 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, 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 · XsdCodeGenerator.IsOptionalValueType (cognitive 24) · ×1
  • XsdCodeGenerator.IsOptionalValueType (cognitive 24) tools/XsdToCSharpConverter/XsdCodeGenerator.cs:873 — XsdCodeGenerator.IsOptionalValueType 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 · CoercionProvider.GetCoercionCost (cognitive 24) · ×1
  • CoercionProvider.GetCoercionCost (cognitive 24) Cql/Cql.CqlToElm/CoercionProvider.cs:242 — CoercionProvider.GetCoercionCost has cognitive complexity 24 (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 · ExpressionVisitor.VisitDateTimeLiteral (cognitive 24) · ×1
  • ExpressionVisitor.VisitDateTimeLiteral (cognitive 24) Cql/Cql.CqlToElm/Visitors/LiteralVisitor.cs:102 — ExpressionVisitor.VisitDateTimeLiteral 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 · ExpressionVisitor.VisitConversionExpressionTerm (cognitive 24) · ×1
  • ExpressionVisitor.VisitConversionExpressionTerm (cognitive 24) Cql/Cql.CqlToElm/Visitors/UnaryExpressionVisitor.cs:220 — ExpressionVisitor.VisitConversionExpressionTerm 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 · CodeBuilderContext.Case (cognitive 24) · ×1
  • CodeBuilderContext.Case (cognitive 24) Cql/Cql.Compiler/CodeBuilderContext.Operators.cs:536 — CodeBuilderContext.Case 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 · CqlOperators.Expand (cognitive 23) · ×1
  • CqlOperators.Expand (cognitive 23) Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:592 — CqlOperators.Expand 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 · DefinitionDictionary.Score (cognitive 23) · ×1
  • DefinitionDictionary.Score (cognitive 23) Cql/Cql.Runtime/Runtime/DefinitionDictionary.cs:312 — DefinitionDictionary.Score 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 · ModelProvider.IsProperSubtypeOf (cognitive 23) · ×1
  • ModelProvider.IsProperSubtypeOf (cognitive 23) REDACTED:328 — ModelProvider.IsProperSubtypeOf has cognitive 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: 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 · CodeBuilderContext.Retrieve (cognitive 23) · ×1
  • CodeBuilderContext.Retrieve (cognitive 23) Cql/Cql.Compiler/CodeBuilderContext.Refs.cs:125 — CodeBuilderContext.Retrieve 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 · CodeBuilderContext.As (cognitive 22) · ×1
  • CodeBuilderContext.As (cognitive 22) Cql/Cql.Compiler/CodeBuilderContext.Operators.cs:362 — CodeBuilderContext.As 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 · CodeBuilderContext.PropertyHelper (cognitive 22) · ×1
  • CodeBuilderContext.PropertyHelper (cognitive 22) Cql/Cql.Compiler/CodeBuilderContext.Query.cs:603 — CodeBuilderContext.PropertyHelper 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 · CodeBuilderContext.Binding (cognitive 22) · ×1
  • CodeBuilderContext.Binding (cognitive 22) Cql/Cql.Compiler/CodeBuilderContext.Query.cs:698 — CodeBuilderContext.Binding 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 · SaveFhirResourcesToDirectoriesOptions.Save (cognitive 22) · ×1
  • SaveFhirResourcesToDirectoriesOptions.Save (cognitive 22) Cql/Cql.Packaging/Toolkit/Extensions/PackagingToolkitExtensions.Saving.cs:113 — SaveFhirResourcesToDirectoriesOptions.Save 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 · CumulativeMedicationDurationFHIR4_1_0_000.ToDaily (cognitive 22) · ×1
  • CumulativeMedicationDurationFHIR4_1_0_000.ToDaily (cognitive 22) REDACTED:362 — CumulativeMedicationDurationFHIR4_1_0_000.ToDaily has cognitive complexity 22 (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 · XsdCodeGenerator.GenerateMembers (cognitive 21) · ×1
  • XsdCodeGenerator.GenerateMembers (cognitive 21) tools/XsdToCSharpConverter/XsdCodeGenerator.cs:311 — XsdCodeGenerator.GenerateMembers 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 · MarkdownReportFormatter.FormatReport (cognitive 21) · ×1
  • MarkdownReportFormatter.FormatReport (cognitive 21) Cql/PackagerCLI/Reporting/MarkdownReportFormatter.cs:23 — MarkdownReportFormatter.FormatReport 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 · LibraryCodeBuilderContext.ProcessLibrary (cognitive 21) · ×1
  • LibraryCodeBuilderContext.ProcessLibrary (cognitive 21) Cql/Cql.Compiler/LibraryCodeBuilderContext.cs:58 — LibraryCodeBuilderContext.ProcessLibrary has cognitive complexity 21 (threshold 15). None of this is in the body itself: all 21 points belong to one function literal inside it that branches (line 59). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · CqlOperators.CollapseHelper (cognitive 20) · ×1
  • CqlOperators.CollapseHelper (cognitive 20) Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:239 — CqlOperators.CollapseHelper 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: 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 · ExpressionVisitor.VisitIntervalSelector (cognitive 20) · ×1
  • ExpressionVisitor.VisitIntervalSelector (cognitive 20) Cql/Cql.CqlToElm/Visitors/ExpressionVisitor.cs:52 — ExpressionVisitor.VisitIntervalSelector 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 · FhirMeasureExtensions.AnnotateMeasurePopulations (cognitive 20) · ×1
  • FhirMeasureExtensions.AnnotateMeasurePopulations (cognitive 20) REDACTED:156 — FhirMeasureExtensions.AnnotateMeasurePopulations 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 · ExtractLibraryAttachmentsProgram.Run (cognitive 19) · ×1
  • ExtractLibraryAttachmentsProgram.Run (cognitive 19) Cql/PackagerCLI/Commands.ExtractLibraryAttachments/ExtractLibraryAttachmentsProgram.cs:21 — ExtractLibraryAttachmentsProgram.Run 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.
D2 · Cognitive Complexity · ReplaceLibraryAttachmentsProgram.Run (cognitive 19) · ×1
  • ReplaceLibraryAttachmentsProgram.Run (cognitive 19) Cql/PackagerCLI/Commands.ReplaceLibraryAttachments/ReplaceLibraryAttachmentsProgram.cs:22 — ReplaceLibraryAttachmentsProgram.Run 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 · CqlOperators.ToClosedHelper (cognitive 19) · ×1
  • CqlOperators.ToClosedHelper (cognitive 19) Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:2246 — CqlOperators.ToClosedHelper 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 · ExpressionVisitor.VisitListSelector (cognitive 19) · ×1
  • ExpressionVisitor.VisitListSelector (cognitive 19) Cql/Cql.CqlToElm/Visitors/ExpressionVisitor.cs:121 — ExpressionVisitor.VisitListSelector 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 · ExpressionVisitor.VisitPolarityExpressionTerm (cognitive 19) · ×1
  • ExpressionVisitor.VisitPolarityExpressionTerm (cognitive 19) Cql/Cql.CqlToElm/Visitors/LiteralVisitor.cs:297 — ExpressionVisitor.VisitPolarityExpressionTerm 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 · DateTime.ToString (cognitive 19) · ×1
  • DateTime.ToString (cognitive 19) Cql/Elm/DebuggerDisplays.cs:37 — DateTime.ToString 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 · LambdaDefinitionWriter.AppendLambdaDefinition (cognitive 19) · ×1
  • LambdaDefinitionWriter.AppendLambdaDefinition (cognitive 19) Cql/CodeGeneration.NET/LibrarySetCSharpCodeGenerator.LambdaDefinitionWriter.cs:22 — LambdaDefinitionWriter.AppendLambdaDefinition 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 · LibrarySet.LoadLibraryAndDependencies (cognitive 19) · ×1
  • LibrarySet.LoadLibraryAndDependencies (cognitive 19) Cql/Cql.Compiler/LibrarySet.cs:237 — LibrarySet.LoadLibraryAndDependencies 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 · LibraryInvoker.SelectDependencyLibraries (cognitive 19) · ×1
  • LibraryInvoker.SelectDependencyLibraries (cognitive 19) Cql/Cql.Invocation/Toolkit/LibraryInvoker.cs:75 — LibraryInvoker.SelectDependencyLibraries 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 · OptionsBinder.ApplySpecialPropertyBindings (cognitive 18) · ×1
  • OptionsBinder.ApplySpecialPropertyBindings (cognitive 18) Cql/PackagerCLI/DependencyInjection/OptionsBinder.cs:24 — OptionsBinder.ApplySpecialPropertyBindings has cognitive complexity 18 (threshold 15). Of this number, 17 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 · BuiltinModelProvider.Add (cognitive 18) · ×1
  • BuiltinModelProvider.Add (cognitive 18) Cql/Cql.CqlToElm/Builtin/BuiltinModelProvider.cs:31 — BuiltinModelProvider.Add 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 · ListEqualComparer.EqualsValues (cognitive 17) · ×1
  • ListEqualComparer.EqualsValues (cognitive 17) Cql/Cql.Runtime/Comparers/CqlComparers.ListEqualComparer.cs:57 — ListEqualComparer.EqualsValues 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 · LibraryBuilder.CreateReference (cognitive 17) · ×1
  • LibraryBuilder.CreateReference (cognitive 17) Cql/Cql.CqlToElm/Scopes/LibraryBuilder.cs:34 — LibraryBuilder.CreateReference 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 · ExpressionVisitor.HandleIncludedIn (cognitive 17) · ×1
  • ExpressionVisitor.HandleIncludedIn (cognitive 17) Cql/Cql.CqlToElm/Visitors/TimingExpressionVisitor.cs:151 — ExpressionVisitor.HandleIncludedIn 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 · CSharpEmitter.PrintBinary (cognitive 17) · ×1
  • CSharpEmitter.PrintBinary (cognitive 17) Cql/CodeGeneration.NET/CSharpEmitter.Print.cs:464 — CSharpEmitter.PrintBinary 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 · IdentifierNormalizer.Normalize (cognitive 17) · ×1
  • IdentifierNormalizer.Normalize (cognitive 17) Cql/Cql.Compiler/IdentifierNormalizer.cs:21 — IdentifierNormalizer.Normalize has cognitive complexity 17 (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 · DataRequirementsAnalyzer.Visit (cognitive 17) · ×1
  • DataRequirementsAnalyzer.Visit (cognitive 17) Cql/Cql.Packaging/DataRequirementsAnalyzer.cs:77 — DataRequirementsAnalyzer.Visit 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 · MarkdownReportFormatter.CalculateColumnWidths (cognitive 16) · ×1
  • MarkdownReportFormatter.CalculateColumnWidths (cognitive 16) Cql/PackagerCLI/Reporting/MarkdownReportFormatter.cs:142 — MarkdownReportFormatter.CalculateColumnWidths 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 · CqlTupleTypeComparer.CompareValues (cognitive 16) · ×1
  • CqlTupleTypeComparer.CompareValues (cognitive 16) Cql/Cql.Runtime/Comparers/CqlComparers.CqlTupleTypeComparer.cs:27 — CqlTupleTypeComparer.CompareValues 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 · CqlOperators.Mode (cognitive 16) · ×1
  • CqlOperators.Mode (cognitive 16) Cql/Cql.Runtime/Operators/CqlOperators.AggregateFunctions.cs:311 — CqlOperators.Mode 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 · BaseTypeResolver.GetListElementType (cognitive 16) · ×1
  • BaseTypeResolver.GetListElementType (cognitive 16) REDACTED:177 — BaseTypeResolver.GetListElementType 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: 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 · TypeSpecifierVisitor.TryGetMatchingTypes (cognitive 16) · ×1
  • TypeSpecifierVisitor.TryGetMatchingTypes (cognitive 16) Cql/Cql.CqlToElm/Visitors/TypeSpecifierVisitor.cs:150 — TypeSpecifierVisitor.TryGetMatchingTypes 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 · PolymorphicArrayJsonConverter.Read (cognitive 16) · ×1
  • PolymorphicArrayJsonConverter.Read (cognitive 16) Cql/Elm/Serialization/PolymorphicArrayJsonConverter.cs:14 — PolymorphicArrayJsonConverter.Read 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 · CodeBuilderContext.List (cognitive 16) · ×1
  • CodeBuilderContext.List (cognitive 16) Cql/Cql.Compiler/CodeBuilderContext.Operators.cs:628 — CodeBuilderContext.List 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 · CodeExpressionExtensions.TryNewAssignToTypeExpression (cognitive 16) · ×1
  • CodeExpressionExtensions.TryNewAssignToTypeExpression (cognitive 16) Cql/Cql.Compiler/CodeModel/CodeExpressionExtensions.cs:30 — CodeExpressionExtensions.TryNewAssignToTypeExpression 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 · LibrarySetInvoker.CreateLibraryInvokers (cognitive 16) · ×1
  • LibrarySetInvoker.CreateLibraryInvokers (cognitive 16) Cql/Cql.Invocation/Toolkit/LibrarySetInvoker.cs:103 — LibrarySetInvoker.CreateLibraryInvokers has cognitive complexity 16 (threshold 15). Of this number, 14 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.
D35 · Change Coupling · Change-coupling hub · ×1
  • Change-coupling hub: CqlToFhirOptions.cs → ElmToFhirCommand.cs, ElmToFhirOptions.cs, ElmToFhirProgram.cs Cql/PackagerCLI/Commands.CqlToFhir/CqlToFhirOptions.cs — `Cql/PackagerCLI/Commands.CqlToFhir/CqlToFhirOptions.cs` changes together with 3 other files — `Cql/PackagerCLI/Commands.ElmToFhir/ElmToFhirCommand.cs`, `Cql/PackagerCLI/Commands.ElmToFhir/ElmToFhirOptions.cs`, `Cql/PackagerCLI/Commands.ElmToFhir/ElmToFhirProgram.cs` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
D4 · Code Duplication · Near-duplicate member pair (167 shared lines) · ×1
  • Near-duplicate member pair (167 shared lines) Cql/PackagerCLI/Commands.CqlToFhir/CqlToFhirProgram.cs:48 — Cql/PackagerCLI/Commands.CqlToFhir/CqlToFhirProgram.cs:48-310 | Cql/PackagerCLI/Commands.ElmToFhir/ElmToFhirProgram.cs:35-276 — These two members are variants of one another: 167 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 · Edited copy of a member (81 corresponding lines) · ×1
  • Edited copy of a member (81 corresponding lines) Cql/Iso8601/DateTimeIso8601.cs:377 — Cql/Iso8601/DateTimeIso8601.cs:377-466 | Cql/Iso8601/TimeIso8601.cs:274-354 — 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 (47 corresponding lines) · ×1
  • Edited copy of a member (47 corresponding lines) Cql/Cql.CqlToElm/CoercionProvider.cs:80 — Cql/Cql.CqlToElm/CoercionProvider.cs:80-127 | Cql/Cql.CqlToElm/CoercionProvider.cs:129-175 — 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 copies of one member (3 members, 30+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 30+ corresponding lines) Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:438 — Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:438-467 | Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:975-1006 | Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:2075-2104 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 30 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) Cql/Cql.Runtime/Operators/CqlOperators.EqualityAndEquivalence.cs:40 — Cql/Cql.Runtime/Operators/CqlOperators.EqualityAndEquivalence.cs:40-90 | Cql/Cql.Runtime/Operators/CqlOperators.EqualityAndEquivalence.cs:135-173 — 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 copy of a member (36 corresponding lines) · ×1
  • Edited copy of a member (36 corresponding lines) Cql/Cql.Runtime/Runtime/EnumerableExceptionHandlingExtensions.cs:76 — Cql/Cql.Runtime/Runtime/EnumerableExceptionHandlingExtensions.cs:76-124 | Cql/Cql.Runtime/Runtime/EnumerableExceptionHandlingExtensions.cs:131-166 — 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 (10 corresponding lines) · ×1
  • Edited copy of a member (10 corresponding lines) Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:1363 — Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:1363-1372 | Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:1380-1389 — 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 copy of a member (25 corresponding lines) · ×1
  • Edited copy of a member (25 corresponding lines) Cql/CodeGeneration.NET/LibrarySetCSharpCodeGenerator.DefinitionWriter.cs:71 — Cql/CodeGeneration.NET/LibrarySetCSharpCodeGenerator.DefinitionWriter.cs:71-95 | Cql/CodeGeneration.NET/LibrarySetCSharpCodeGenerator.DefinitionWriter.cs:99-123 — 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 (14 corresponding lines) · ×1
  • Edited copy of a member (14 corresponding lines) Cql/Cql.Runtime/Operators/CqlOperators.ArithmeticOperators.cs:156 — Cql/Cql.Runtime/Operators/CqlOperators.ArithmeticOperators.cs:156-169 | Cql/Cql.Runtime/Operators/CqlOperators.ArithmeticOperators.cs:966-985 — 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 (31 corresponding lines) · ×1
  • Edited copy of a member (31 corresponding lines) Cql/CodeGeneration.NET/Toolkit/Extensions/ElmToolkitExtensions.Adding.cs:114 — Cql/CodeGeneration.NET/Toolkit/Extensions/ElmToolkitExtensions.Adding.cs:114-144 | Cql/Cql.Packaging/ResourcePackager.cs:42-113 — 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 copies of one member (3 members, 25+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 25+ corresponding lines) Cql/Cql.Runtime/Operators/CqlOperators.ArithmeticOperators.cs:107 — Cql/Cql.Runtime/Operators/CqlOperators.ArithmeticOperators.cs:107-132 | Cql/Cql.Runtime/Operators/CqlOperators.ArithmeticOperators.cs:495-519 | Cql/Cql.Runtime/Operators/CqlOperators.ArithmeticOperators.cs:779-803 — 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 (4 members, 19+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 19+ corresponding lines) Cql/Cql.CqlToElm/Visitors/BinaryExpressionVisitor.cs:32 — Cql/Cql.CqlToElm/Visitors/BinaryExpressionVisitor.cs:32-54 | Cql/Cql.CqlToElm/Visitors/BinaryExpressionVisitor.cs:114-138 | Cql/Cql.CqlToElm/Visitors/BinaryExpressionVisitor.cs:154-172 | Cql/Cql.CqlToElm/Visitors/BinaryExpressionVisitor.cs:176-194 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (34 corresponding lines) · ×1
  • Edited copy of a member (34 corresponding lines) Cql/Cql.Runtime/Conversion/UnitConverter.cs:147 — Cql/Cql.Runtime/Conversion/UnitConverter.cs:147-180 | Cql/Cql.Runtime/Conversion/UnitConverter.cs:182-220 — 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 (3 members, 23+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 23+ corresponding lines) Cql/CodeGeneration.NET/Toolkit/ElmToolkit.cs:110 — Cql/CodeGeneration.NET/Toolkit/ElmToolkit.cs:110-132 | Cql/Cql.CqlToElm/Toolkit/CqlToolkit.cs:96-120 | Cql/Cql.Packaging/Toolkit/PackagingToolkit.cs:101-127 — 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 (22 corresponding lines) · ×1
  • Edited copy of a member (22 corresponding lines) Cql/Cql.Runtime/Operators/CqlOperators.ArithmeticOperators.cs:625 — Cql/Cql.Runtime/Operators/CqlOperators.ArithmeticOperators.cs:625-649 | Cql/Cql.Runtime/Operators/CqlOperators.ArithmeticOperators.cs:651-672 — 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 copies of one member (3 members, 14+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 14+ corresponding lines) Cql/Cql.Runtime/Operators/CqlOperators.AggregateFunctions.cs:235 — Cql/Cql.Runtime/Operators/CqlOperators.AggregateFunctions.cs:235-248 | Cql/Cql.Runtime/Operators/CqlOperators.AggregateFunctions.cs:259-272 | Cql/Cql.Runtime/Operators/CqlOperators.AggregateFunctions.cs:275-288 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 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, 7+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 7+ corresponding lines) Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:1946 — Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:1946-1952 | Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:1955-1962 | Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:1964-1971 — 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 (4 corresponding lines) · ×1
  • Edited copy of a member (4 corresponding lines) Cql/Cql.Invocation/Toolkit/Internal/LibraryInvoker.6.0.cs:199 — Cql/Cql.Invocation/Toolkit/Internal/LibraryInvoker.6.0.cs:199-202 | Cql/Cql.Invocation/Toolkit/Internal/LibraryInvoker.6.0.cs:205-208 — 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.
D4 · Code Duplication · Edited copy of a member (5 corresponding lines) · ×1
  • Edited copy of a member (5 corresponding lines) Cql/Cql.Runtime/Operators/CqlOperators.CrossJoin.cs:100 — Cql/Cql.Runtime/Operators/CqlOperators.CrossJoin.cs:100-104 | Cql/Cql.Runtime/Operators/CqlOperators.CrossJoin.cs:115-119 — 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 · Edited copies of one member (3 members, 11+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 11+ corresponding lines) Cql/Cql.Runtime/Comparers/CqlCodeCqlComparer.cs:63 — Cql/Cql.Runtime/Comparers/CqlCodeCqlComparer.cs:63-73 | Cql/Cql.Runtime/Comparers/CqlCodeCqlEquivalentComparer.cs:23-33 | Cql/Cql.Runtime/Comparers/CqlCodeCqlEquivalentComparer.cs:44-54 — 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 copies of one member (3 members, 13+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 13+ corresponding lines) Cql/Cql.CqlToElm/Visitors/TerminalParsers.cs:29 — Cql/Cql.CqlToElm/Visitors/TerminalParsers.cs:29-41 | Cql/Cql.CqlToElm/Visitors/TerminalParsers.cs:44-56 | Cql/Cql.CqlToElm/Visitors/TerminalParsers.cs:58-70 — These 3 members are one piece of code written 3 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 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 5+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 5+ corresponding lines) Cql/Cql.Runtime/Operators/CqlOperators.ArithmeticOperators.cs:720 — Cql/Cql.Runtime/Operators/CqlOperators.ArithmeticOperators.cs:720-724 | Cql/Cql.Runtime/Operators/CqlOperators.ArithmeticOperators.cs:727-731 | Cql/Cql.Runtime/Operators/CqlOperators.ArithmeticOperators.cs:734-738 — 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 · Edited copies of one member (5 members, 12+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 12+ corresponding lines) Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:1431 — Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:1431-1442 | Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:1445-1456 | Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:1459-1470 | Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:1514-1525 | Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:1528-1539 — These 5 members are one piece of code written 5 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 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×1
  • Edited copy of a member (9 corresponding lines) Cql/Cql.CqlToElm/Visitors/BinaryExpressionVisitor.cs:142 — Cql/Cql.CqlToElm/Visitors/BinaryExpressionVisitor.cs:142-150 | Cql/Cql.CqlToElm/Visitors/BinaryExpressionVisitor.cs:218-226 — 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 · Edited copies of one member (4 members, 10+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 10+ corresponding lines) Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:73 — Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:73-82 | Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:155-164 | Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:1476-1485 | Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:1546-1555 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 10 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, 9+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 9+ corresponding lines) Cql/CodeGeneration.NET/Toolkit/ElmToolkit.cs:34 — Cql/CodeGeneration.NET/Toolkit/ElmToolkit.cs:34-42 | Cql/Cql.CqlToElm/Toolkit/CqlToolkit.cs:31-39 | Cql/Cql.Packaging/Toolkit/PackagingToolkit.cs:36-44 — 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 (7 corresponding lines) · ×1
  • Edited copy of a member (7 corresponding lines) Cql/Cql.CqlToElm/ElmFactory.cs:151 — Cql/Cql.CqlToElm/ElmFactory.cs:151-157 | Cql/Cql.CqlToElm/Visitors/LibraryVisitor.cs:241-249 — 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.
D4 · Code Duplication · Edited copy of a member (1 corresponding lines) · ×1
  • Edited copy of a member (1 corresponding lines) Cql/Cql.CqlToElm/Builtin/SystemFunction.cs:145 — Cql/Cql.CqlToElm/Builtin/SystemFunction.cs:145-145 | Cql/Elm/DebuggerDisplays.cs:72-72 — 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 (4 members, 7+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 7+ corresponding lines) Cql/PackagerCLI/Commands.CqlToFhir/CqlToFhirProgram.cs:39 — Cql/PackagerCLI/Commands.CqlToFhir/CqlToFhirProgram.cs:39-45 | Cql/PackagerCLI/Commands.ElmToFhir/ElmToFhirProgram.cs:283-289 | Cql/PackagerCLI/Commands.ExtractLibraryAttachments/ExtractLibraryAttachmentsProgram.cs:194-200 | Cql/PackagerCLI/Commands.ReplaceLibraryAttachments/ReplaceLibraryAttachmentsProgram.cs:199-205 — 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 · Duplicated block (91–92 lines × 2) · ×1
  • Duplicated block (91–92 lines × 2) Cql/PackagerCLI/Commands.CqlToFhir/CqlToFhirProgram.cs:155 — Cql/PackagerCLI/Commands.CqlToFhir/CqlToFhirProgram.cs:155-245 | Cql/PackagerCLI/Commands.ElmToFhir/ElmToFhirProgram.cs:99-190 — before extracting anything, compare `Cql/PackagerCLI/Commands.CqlToFhir/CqlToFhirProgram.cs` and `Cql/PackagerCLI/Commands.ElmToFhir/ElmToFhirProgram.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 168 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 (56 lines × 2) · ×1
  • Duplicated block (56 lines × 2) Cql/PackagerCLI/Commands.CqlToFhir/CqlToFhirProgram.cs:255 — Cql/PackagerCLI/Commands.CqlToFhir/CqlToFhirProgram.cs:255-310 | Cql/PackagerCLI/Commands.ElmToFhir/ElmToFhirProgram.cs:221-276 — before extracting anything, compare `Cql/PackagerCLI/Commands.CqlToFhir/CqlToFhirProgram.cs` and `Cql/PackagerCLI/Commands.ElmToFhir/ElmToFhirProgram.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 168 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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. Read the line range as the matched WINDOW rather than a finished unit: at `Cql/PackagerCLI/Commands.CqlToFhir/CqlToFhirProgram.cs:255` 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 (39–40 lines × 2) · ×1
  • Duplicated block (39–40 lines × 2) Cql/Iso8601/DateTimeIso8601.cs:185 — Cql/Iso8601/DateTimeIso8601.cs:185-224 | Cql/Iso8601/TimeIso8601.cs:160-198 — before extracting anything, compare `Cql/Iso8601/DateTimeIso8601.cs` and `Cql/Iso8601/TimeIso8601.cs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 129 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 `Cql/Iso8601/DateTimeIso8601.cs:185` 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 `hour` to `int?` in one and `int` 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 (36–38 lines × 2) · ×1
  • Duplicated block (36–38 lines × 2) Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:768 — Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:768-803 | Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:456-493 — 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 `Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:768` 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 (33 lines × 2) · ×1
  • Duplicated block (33 lines × 2) Cql/Iso8601/DateTimeIso8601.cs:37 — Cql/Iso8601/DateTimeIso8601.cs:37-69 | Cql/Iso8601/TimeIso8601.cs:24-56 — before extracting anything, compare `Cql/Iso8601/DateTimeIso8601.cs` and `Cql/Iso8601/TimeIso8601.cs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 129 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.
D4 · Code Duplication · Duplicated block (29 lines × 2) · ×1
  • Duplicated block (29 lines × 2) Cql/Iso8601/DateTimeIso8601.cs:385 — Cql/Iso8601/DateTimeIso8601.cs:385-413 | Cql/Iso8601/TimeIso8601.cs:286-314 — before extracting anything, compare `Cql/Iso8601/DateTimeIso8601.cs` and `Cql/Iso8601/TimeIso8601.cs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 129 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.
D4 · Code Duplication · Duplicated block (31 lines × 2) · ×1
  • Duplicated block (31 lines × 2) Cql/Cql.Abstractions/Primitives/CqlDate.cs:191 — Cql/Cql.Abstractions/Primitives/CqlDate.cs:191-221 | Cql/Cql.Abstractions/Primitives/CqlDateTime.cs:283-313 — 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.
D4 · Code Duplication · Duplicated block (23–26 lines × 2) · ×1
  • Duplicated block (23–26 lines × 2) Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:560 — Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:560-582 | Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:224-249 — 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 `Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:560` 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 (23–25 lines × 2) · ×1
  • Duplicated block (23–25 lines × 2) Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:705 — Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:705-727 | Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:385-409 — 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 `Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:705` 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 (21 lines × 3) · ×1
  • Duplicated block (21 lines × 3) Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:437 — Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:437-457 | Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:519-539 | Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:583-603 — 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 `Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:437` 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 (21–23 lines × 2) · ×1
  • Duplicated block (21–23 lines × 2) Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:630 — Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:630-650 | Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:302-324 — 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 `Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:630` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (21–22 lines × 2) · ×1
  • Duplicated block (21–22 lines × 2) Cql/Cql.Compiler/CodeBuilderContext.Operators.cs:109 — Cql/Cql.Compiler/CodeBuilderContext.Operators.cs:109-130 | Cql/Cql.Compiler/CodeBuilderContext.Operators.cs:150-170 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `e` to `Message` in one and `IncludedIn` 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 (20 lines × 6) · ×1
  • Duplicated block (20 lines × 6) Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:519 — Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:519-538 | Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:594-613 | Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:664-683 | Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:739-758 | Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:813-832 | Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:871-890 — all 6 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 (19–21 lines × 4) · ×1
  • Duplicated block (19–21 lines × 4) Cql/Cql.Abstractions/Primitives/CqlDateTime.cs:351 — Cql/Cql.Abstractions/Primitives/CqlDateTime.cs:351-371 | Cql/Cql.Abstractions/Primitives/CqlDateTime.cs:380-398 | Cql/Cql.Abstractions/Primitives/CqlDateTime.cs:412-432 | Cql/Cql.Abstractions/Primitives/CqlDateTime.cs:451-471 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Cql/Cql.Abstractions/Primitives/CqlDateTime.cs:351` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Cql/Cql.Abstractions/Primitives/CqlDateTime.cs:401` calls `CompareTemporalIntegers` and `Cql/Cql.Abstractions/Primitives/CqlDateTime.cs:372` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×1
  • Duplicated block (19 lines × 2) Cql/Iso8601/DateIso8601.cs:135 — Cql/Iso8601/DateIso8601.cs:135-153 | Cql/Iso8601/DateTimeIso8601.cs:262-280 — before extracting anything, compare `Cql/Iso8601/DateIso8601.cs` and `Cql/Iso8601/DateTimeIso8601.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 42 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 `Cql/Iso8601/DateIso8601.cs:135` 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 (17 lines × 2) · ×1
  • Duplicated block (17 lines × 2) Cql/Cql.CqlToElm/CoercionProvider.cs:82 — Cql/Cql.CqlToElm/CoercionProvider.cs:82-98 | Cql/Cql.CqlToElm/CoercionProvider.cs:131-147 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (17–20 lines × 2) · ×1
  • Duplicated block (17–20 lines × 2) Cql/Cql.CqlToElm/Scopes/SymbolTable.cs:97 — Cql/Cql.CqlToElm/Scopes/SymbolTable.cs:97-116 | Cql/Cql.CqlToElm/Scopes/SymbolTable.cs:196-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 `Cql/Cql.CqlToElm/Scopes/SymbolTable.cs:97` 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. 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–18 lines × 2) · ×1
  • Duplicated block (15–18 lines × 2) Cql/Cql.Compiler/CodeBuilderContext.Query.cs:768 — Cql/Cql.Compiler/CodeBuilderContext.Query.cs:768-782 | Cql/Cql.Compiler/CodeBuilderContext.Query.cs:792-809 — 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 `Cql/Cql.Compiler/CodeBuilderContext.Query.cs:768` 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–16 lines × 3) · ×1
  • Duplicated block (12–16 lines × 3) Cql/Cql.Compiler/CodeBuilderContext.Operators.cs:107 — Cql/Cql.Compiler/CodeBuilderContext.Operators.cs:107-122 | Cql/Cql.Compiler/CodeBuilderContext.Operators.cs:148-162 | Cql/Cql.Compiler/CodeBuilderContext.Operators.cs:267-278 — 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 `Cql/Cql.Compiler/CodeBuilderContext.Operators.cs:107` 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 `e` to `Message` in one and `IncludedIn` 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 (12 lines × 3) · ×1
  • Duplicated block (12 lines × 3) Cql/Cql.Abstractions/Primitives/CqlTime.cs:250 — Cql/Cql.Abstractions/Primitives/CqlTime.cs:250-261 | Cql/Cql.Abstractions/Primitives/CqlTime.cs:268-279 | Cql/Cql.Abstractions/Primitives/CqlTime.cs:292-303 — 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 `Cql/Cql.Abstractions/Primitives/CqlTime.cs:250` 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, `Cql/Cql.Abstractions/Primitives/CqlTime.cs:282` calls `CompareTemporalIntegers` and `Cql/Cql.Abstractions/Primitives/CqlTime.cs:262` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (12–13 lines × 4) · ×1
  • Duplicated block (12–13 lines × 4) Cql/CodeGeneration.NET/Toolkit/Extensions/ElmToolkitExtensions.Saving.cs:197 — Cql/CodeGeneration.NET/Toolkit/Extensions/ElmToolkitExtensions.Saving.cs:197-209 | Cql/CodeGeneration.NET/Toolkit/Extensions/ElmToolkitExtensions.Saving.cs:283-294 | Cql/Cql.CqlToElm/Toolkit/Extensions/CqlToolkitExtensions.Saving.cs:101-112 | Cql/Cql.Packaging/Toolkit/Extensions/PackagingToolkitExtensions.Saving.cs:144-155 — before extracting anything, compare `Cql/CodeGeneration.NET/Toolkit/Extensions/ElmToolkitExtensions.Saving.cs` and `Cql/Cql.CqlToElm/Toolkit/Extensions/CqlToolkitExtensions.Saving.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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. Read the line range as the matched WINDOW rather than a finished unit: at `Cql/CodeGeneration.NET/Toolkit/Extensions/ElmToolkitExtensions.Saving.cs:197` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–13 lines × 2) · ×1
  • Duplicated block (11–13 lines × 2) Cql/Iso8601/DateIso8601.cs:190 — Cql/Iso8601/DateIso8601.cs:190-200 | Cql/Iso8601/DateTimeIso8601.cs:415-427 — before extracting anything, compare `Cql/Iso8601/DateIso8601.cs` and `Cql/Iso8601/DateTimeIso8601.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 42 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 `Cql/Iso8601/DateIso8601.cs:190` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12 lines × 6) · ×1
  • Duplicated block (12 lines × 6) Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:558 — Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:558-569 | Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:628-639 | Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:703-714 | Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:222-234 | Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:300-311 | Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:383-394 — there are 6 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 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:558` 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 (9 lines × 2) · ×1
  • Duplicated block (9 lines × 2) Cql/Cql.Runtime/Operators/CqlOperators.ArithmeticOperators.cs:258 — Cql/Cql.Runtime/Operators/CqlOperators.ArithmeticOperators.cs:258-266 | Cql/Cql.Runtime/Operators/CqlOperators.ArithmeticOperators.cs:368-376 — 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 `Cql/Cql.Runtime/Operators/CqlOperators.ArithmeticOperators.cs:258` 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 (5 lines × 2) · ×1
  • Duplicated block (5 lines × 2) Cql/CodeGeneration.NET/CSharpEmitter.Print.cs:637 — Cql/CodeGeneration.NET/CSharpEmitter.Print.cs:637-641 | Cql/CodeGeneration.NET/CSharpEmitter.Print.cs:673-677 — 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 `Cql/CodeGeneration.NET/CSharpEmitter.Print.cs:637` 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 · Edited copy of a member (20 corresponding lines) · ×1
  • Edited copy of a member (20 corresponding lines) Examples/CqlSdkExamples/220 Load ELM from dir, Save C#,DLL,PDB to dir/Program.cs:20 — Examples/CqlSdkExamples/220 Load ELM from dir, Save C#,DLL,PDB to dir/Program.cs:20-40 | Examples/CqlSdkExamples/222 Load ELM from dir with C# namespace, Save C# to dir/Program.cs:19-38 — 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 copies of one member (3 members, 19+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 19+ corresponding lines) Examples/CqlSdkExamples/240 Package via CQL and ELM Toolkits, Save FHIR Resources to dir/Program.cs:21 — Examples/CqlSdkExamples/240 Package via CQL and ELM Toolkits, Save FHIR Resources to dir/Program.cs:21-44 | Examples/CqlSdkExamples/250 Package via CQL Toolkit, Save FHIR Resources to dir/Program.cs:20-38 | Examples/CqlSdkExamples/251 Package incl debug symbols via CQL Toolkit, Save FHIR Resources to dir/Program.cs:22-41 — 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.
D6 · Cohesion (LCOM4) · Low cohesion · ×1
  • Low cohesion: CqlOperators (LCOM4 68) Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:17 — CqlOperators's methods fall into 68 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 68 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.
D8 · Code Coverage · Coverage not measured · ×1
  • Coverage not measured — test suite did not build — Coverage NOT MEASURED: this repository did not build in our analyzer environment (a C#/MSBuild compiler error), so no coverage could be collected. It is excluded from the score rather than counted as a near-zero defect. We did not read WHERE the failing diagnostic is, so this does not claim the fault is in your test code — a repository written for an older SDK band can compile for you and not for us. Run `dotnet build` on this commit; if it succeeds, the gap is ours. Committing the Cobertura/OpenCover/lcov report your CI already produces also lets us measure real coverage without building anything.
IC1 · Incompleteness & stubs · Condition was already decided · ×1
  • Condition was already decided — an earlier guard makes this test constant Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.cs:1026 — Control only reaches here when `enumerator.MoveNext()` is true, because the guard on line 1022 exits otherwise. This test is therefore always false and everything it guards is unreachable. Implement the distinction that was intended, or delete the test.
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.
X18 · Disposal-pattern correctness · Disposable acquired into a field and never released · ×1
  • Disposable acquired into a field and never released Cql/Cql.CqlToElm/Toolkit/CqlToolkit.cs:42 — `_services` (line 42) holds a `CqlToolkitServices` that `CqlToolkit` acquires itself — every assignment to it is a call that opens or creates a new instance for the caller to own — and nothing in `CqlToolkit` ever releases it: the type is not `IDisposable`, declares no `Dispose`, and every other mention of `_services` 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 `CqlToolkit`. Implement `IDisposable` and release `_services` there, or take the instance from the caller so its owner ends it.
X18 · Disposal-pattern correctness · Disposable created into a field and never released · ×1
  • Disposable created into a field and never released Demo/CLI/LibraryRunner.cs:25 — `_writer` (line 25) holds a `StreamWriter` that `LibraryRunner` creates itself with `new`, and nothing in `LibraryRunner` ever releases it: the type is not `IDisposable`, declares no `Dispose`, and every other mention of `_writer` only reads through it. And `LibraryRunner` is not a process-lifetime owner: `new LibraryRunner(options)` (REDACTED line 50) creates one per call and drops it when the call returns, so each call strands one unreleased `StreamWriter` (a timer that keeps firing, a handle, a socket) until finalization. Implement `IDisposable`, release `_writer` there and dispose the owner at that call site — or keep one owner for the process instead of one per call.
X2 · Cancellation propagation · Async local function without CancellationToken · ×1
  • Async local function without CancellationToken: build Cql/Cql.Firely/ValueSetSource.cs:277 — Neither takes a CancellationToken nor reads the one of the function it sits in, while it calls something that takes one — this work can't be stopped early once started. Take the token, or pass on the enclosing one.
X29 · Per-element action decided by a fixed element · Per-element action decided by a fixed element · ×1
  • Per-element action decided by a fixed element Cql/Cql.Invocation/Toolkit/LibrarySetInvoker.cs:140 — This loop runs once per element of `declaringTypes`, and the statement it guards acts on the element it is on — `var readError = new CqlLibraryDeclaredByMoreThanOneTypeError( sameAssembly ? ...`. The test deciding whether that statement runs does not: `sameAssembly` reads `declaringTypes[0]`, a subscript that does not move, so whatever it answers for that one element it answers for ALL of them. One `if` names the same collection at two different subscripts — the fixed one at line 135, which is the contradiction: either the test was meant to be per-element, in which case every element that differs from the fixed one is handled wrongly and all in the same direction, or it really is one answer for the whole collection, in which case it is being re-asked on every pass and belongs above the loop. The `if` is in the wrong place under both readings. Give the test the loop variable, or hoist it out.
Minor — 119 finding(s)
D24 · Comment Value · redundant comment · ×36
  • redundant comment Cql/CodeGeneration.NET/CSharpEmitter.Print.cs:170 — "default ?? x => x / null_constant ?? x => x" repeats the code it sits on: 3 of its 3 words (default, null, constant) are already in `if ((coalesce.Left is CodeDefault || coalesce.Left is CodeConstant { Value: null }) && isNullableType)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Cql/CodeGeneration.NET/CacheKeyGenerator.cs:80 — "Combine all inputs: libraryIdentifier + definitionName + salt + version" repeats the code it sits on: 7 of its 8 words (inputs, library, identifier, definition, name, salt, version) are already in `var input = $"{libraryIdentifier}.{definitionName}.{_salt}.{version}";`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Cql/CodeGeneration.NET/LibrarySetCSharpCodeGenerator.LibraryWriter.cs:175 — "Assumption: type name will be Cql....Definition" repeats the code it sits on: 4 of its 5 words (type, name, cql, definition) are already in `Debug.Assert(definition.GetType().Name is { } name && name.StartsWith("Cql") && name.EndsWith("Definition"));`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Cql/CoreTests/ElmSerializerTests.cs:188 — "IncludeDef.mediaType has a default value of "application/elm+xml"" repeats the code it sits on: 9 of its 9 words (include, def, media, type, default, value, application, elm, xml) are already in `var includeDef = new IncludeDef();`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Cql/CoreTests/ElmSerializerTests.cs:213 — "CodeDef.accessLevel has a default value of AccessModifier.Public (enum)" repeats the code it sits on: 8 of its 9 words (code, def, access, level, default, value, public, enum) are already in `var codeDef = new CodeDef();`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Cql/CoreTests/ElmSerializerTests.cs:339 — "OperatorExpression is abstract" repeats the code it sits on: 3 of its 3 words (operator, expression, abstract) are already in `typeof(OperatorExpression).IsAbstract.Should().BeTrue();`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Cql/CoreTests/Fhir/SharedBundleIndexTests.cs:361 — "empty — no BundleDataSource" repeats the code it sits on: 4 of its 5 words (no, bundle, data, source) are already in `var nonBundleSource = new CompositeDataSource(); // empty — no BundleDataSource`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Cql/CoreTests/IntervalIntersectNullBoundaryTests.cs:38 — "Interval[1, 10] intersect Interval[5, null)" repeats the code it sits on: 4 of its 4 words (interval, 10, intersect, null) are already in `private static CqlInterval<int?>? ConformanceIntersection() =>`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Cql/CoreTests/ToolkitTests.cs:464 — "Act: Invoke the function with the large tuple" repeats the code it sits on: 4 of its 5 words (invoke, function, large, tuple) are already in `var result = processTupleFunction.Invoke(ctx, largeTuple9);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Cql/Cql.Compiler/CodeBuilderContext.Query.cs:379 — "@this is an element of what the query returns." repeats the code it sits on: 3 of its 3 words (element, query, returns) are already in `Elm.Element sortedElements = query.@return?.expression as Elm.Element`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Cql/Cql.Compiler/CqlOperatorsBinder.Specific.cs:86 — "Check if the element types are structurally compatible for union" repeats the code it sits on: 5 of its 6 words (check, element, types, compatible, union) are already in `if (ElmTupleTypeUtility.AreCompatibleForUnionOperation(leftListElementType, rightListElementType, _typeConverter))`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Cql/Cql.Compiler/Infrastructure/ConstructorInfos.cs:41 — "MethodInfo to ListOf<>()" repeats the code it sits on: 3 of its 3 words (method, info, list) are already in `private static MethodInfo GenericDefinitionMethodListOf { get; } =`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Cql/Cql.Compiler/Infrastructure/ElmTupleTypeUtility.cs:122 — "Check if the type converter knows how to convert between these types" repeats the code it sits on: 5 of its 6 words (check, type, converter, convert, types) are already in `if (typeConverter.CanConvert(leftPropType, rightPropType) || typeConverter.CanConvert(rightPropType, leftPropType))`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Cql/Cql.CqlToElm/CoercionProvider.cs:648 — "Propagate point-type conversion targets: Interval<X> → Interval<Y> for each Y in targets(X)" repeats the code it sits on: 5 of its 6 words (point, type, conversion, targets, interval) are already in `foreach (var pointTarget in GetImplicitConversionTargets(intervalFrom.pointType))`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Cql/Cql.CqlToElm/Visitors/BinaryExpressionVisitor.cs:30 — 6 comments in this file only repeat the code they sit on (lines 30, 64, 68, 73, 78, 216), for example "expressionTerm('+' | '-' | '&') expressionTerm #additionExpressionTerm". Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Cql/Cql.CqlToElm/Visitors/ConditionalExpressionVisitor.cs:16 — "| 'if' expression 'then' expression 'else' expression #ifThenElseExpressionTerm" repeats the code it sits on: 3 of its 3 words (expression, else, term) are already in `public override Expression VisitIfThenElseExpressionTerm([Antlr4.Runtime.Misc.NotNull] cqlParser.IfThenElseExpressionTer …`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Cql/Cql.CqlToElm/Visitors/ExpressionVisitor.cs:120 — ": ('List' ('<' typeSpecifier '>')?)? '{' (expression (',' expression)*)? '}'" repeats the code it sits on: 4 of its 4 words (list, type, specifier, expression) are already in `public override Expression VisitListSelector([Antlr4.Runtime.Misc.NotNull] cqlParser.ListSelectorContext context)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Cql/Cql.CqlToElm/Visitors/InvocationTermVisitor.cs:445 — "function : referentialIdentifier '(' paramList? ')'" repeats the code it sits on: 5 of its 5 words (function, referential, identifier, param, list) are already in `public override Expression VisitFunction([NotNull] cqlParser.FunctionContext context)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Cql/Cql.CqlToElm/Visitors/InvocationTermVisitor.cs:555 — "paramList : expression(',' expression)" repeats the code it sits on: 3 of its 3 words (param, list, expression) are already in `public Expression[] ParseParamList(cqlParser.ParamListContext? context) => context?.expression().Select(Visit).ToArray()`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Cql/Cql.CqlToElm/Visitors/LibraryVisitor.cs:147 — 6 comments in this file only repeat the code they sit on (lines 147, 161, 177, 192, 252, 412), for example "accessModifier? 'codesystem' identifier ':' codesystemId('version' versionSpecifier)?". Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Cql/Cql.CqlToElm/Visitors/LiteralVisitor.cs:296 — "| ('+' | '-') expressionTerm #polarityExpressionTerm" repeats the code it sits on: 3 of its 3 words (expression, term, polarity) are already in `public override Expression VisitPolarityExpressionTerm([Antlr4.Runtime.Misc.NotNull] cqlParser.PolarityExpressionTermCon …`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Cql/Cql.CqlToElm/Visitors/TerminalParsers.cs:92 — "pluralDateTimePrecision: 'years' | 'months' | 'weeks' | 'days' | 'hours' | 'minutes' | 'seconds' | 'milliseconds'" repeats the code it sits on: 12 of its 12 words (plural, date, time, precision, years, months, weeks, days, hours, minutes, seconds, milliseconds) are already in `public static DateTimePrecision Parse(this cqlParser.PluralDateTimePrecisionContext context) =>`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Cql/Cql.CqlToElm/Visitors/TerminalParsers.cs:107 — "pluralDateTimePrecision: 'year' | 'month' | 'week' | 'day' | 'hour' | 'minute' | 'second' | 'millisecond'" repeats the code it sits on: 11 of its 12 words (date, time, precision, year, month, week, day, hour, minute, second, millisecond) are already in `public static DateTimePrecision Parse(this cqlParser.DateTimePrecisionContext context) =>`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Cql/Cql.CqlToElm/Visitors/TerminalParsers.cs:263 — ": 'library' qualifiedIdentifier ('version' versionSpecifier)?" repeats the code it sits on: 5 of its 5 words (library, qualified, identifier, version, specifier) are already in `public static VersionedIdentifier Parse(this cqlParser.LibraryDefinitionContext context)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Cql/Cql.CqlToElm/Visitors/TypeSpecifierVisitor.cs:26 — ": 'Choice' '<' typeSpecifier (',' typeSpecifier)* '>'" repeats the code it sits on: 3 of its 3 words (choice, type, specifier) are already in `public override TypeSpecifier VisitChoiceTypeSpecifier([NotNull] cqlParser.ChoiceTypeSpecifierContext context)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • + 11 more in this group — see findings.md.
IC1 · Incompleteness & stubs · Commented-out code · ×27
  • Commented-out code Cql/Cql.Compiler/CodeBuilderContext.Operators.cs:614 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Cql/Cql.Compiler/CodeBuilderContext.Operators.cs:615 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Cql/Cql.Compiler/CodeBuilderContext.Query.cs:107 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Cql/Cql.Compiler/CodeBuilderContext.Query.cs:290 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Cql/Cql.Compiler/CodeBuilderContext.Query.cs:308 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Cql/Cql.Compiler/CodeBuilderContext.Query.cs:309 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Cql/Cql.Compiler/CodeBuilderContext.Query.cs:310 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Cql/Cql.Compiler/CodeBuilderContext.Query.cs:311 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Cql/Cql.Compiler/CodeBuilderContext.Query.cs:312 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Cql/Cql.Compiler/CodeBuilderContext.cs:139 — 8 consecutive lines of code sit inside a `/* … */` block — a block of code switched off rather than removed, which rots and confuses. Delete it (version control remembers).
  • Commented-out code Cql/Cql.Compiler/IdentifierNormalizer.cs:59 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Cql/Cql.Compiler/IdentifierNormalizer.cs:60 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Cql/Cql.Compiler/IdentifierNormalizer.cs:61 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Cql/Cql.Compiler/IdentifierNormalizer.cs:62 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Cql/Cql.Compiler/IdentifierNormalizer.cs:63 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Cql/Cql.Compiler/IdentifierNormalizer.cs:64 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Cql/Cql.Compiler/IdentifierNormalizer.cs:65 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Cql/Cql.Compiler/IdentifierNormalizer.cs:66 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Cql/Cql.Compiler/IdentifierNormalizer.cs:68 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Cql/Cql.Compiler/IdentifierNormalizer.cs:69 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Cql/Cql.Compiler/IdentifierNormalizer.cs:70 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Cql/Cql.Compiler/IdentifierNormalizer.cs:71 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Cql/Cql.Compiler/IdentifierNormalizer.cs:72 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Cql/Cql.Compiler/IdentifierNormalizer.cs:73 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Cql/Cql.Compiler/IdentifierNormalizer.cs:74 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • + 2 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×17
  • Duplicated predicate Cql/Iso8601/DateIso8601.cs:183 — `!parts.Success || parts.Captures.Count != 1 || parts.Captures[0].Length != stringValue.Length` appears character-identically in 3 files — Cql/Iso8601/DateIso8601.cs, Cql/Iso8601/DateTimeIso8601.cs, Cql/Iso8601/TimeIso8601.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 Cql/Iso8601/DateIso8601.cs:110 — `(month.Value == 4 || month.Value == 6 || month.Value == 9 || month.Value == 11) && day.Value > 30` appears character-identically in 2 files — Cql/Iso8601/DateIso8601.cs, Cql/Iso8601/DateTimeIso8601.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 Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:858 — `OverflowGuard.Add((decimal)listItem, perValue - 1) is not { } end || end > interval.high!.Value` appears character-identically in 2 files — Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs, Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.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 Cql/Iso8601/DateIso8601.cs:238 — `day.HasValue && precision > DateTimePrecision.Month` appears character-identically in 2 files — Cql/Iso8601/DateIso8601.cs, Cql/Iso8601/DateTimeIso8601.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 Cql/Cql.CqlToElm/Toolkit/Extensions/CqlToolkitExtensions.Saving.cs:105 — `found && !string.IsNullOrEmpty(relativePath)` appears character-identically in 3 files — Cql/CodeGeneration.NET/Toolkit/Extensions/ElmToolkitExtensions.Saving.cs, Cql/Cql.CqlToElm/Toolkit/Extensions/CqlToolkitExtensions.Saving.cs, Cql/Cql.Packaging/Toolkit/Extensions/PackagingToolkitExtensions.Saving.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 Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:801 — `high is not null && Comparer.Compare(high, highBoundary, null) <= 0` appears character-identically in 2 files — Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs, Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.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 Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:580 — `high is not null && Comparer.Compare(high, highInterval!, null) <= 0` appears character-identically in 2 files — Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs, Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.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 Cql/Iso8601/DateTimeIso8601.cs:498 — `minute.HasValue && precision > DateTimePrecision.Hour` appears character-identically in 2 files — Cql/Iso8601/DateTimeIso8601.cs, Cql/Iso8601/TimeIso8601.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 Cql/Iso8601/DateIso8601.cs:234 — `month.HasValue && precision > DateTimePrecision.Year` appears character-identically in 2 files — Cql/Iso8601/DateIso8601.cs, Cql/Iso8601/DateTimeIso8601.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 Cql/Iso8601/DateTimeIso8601.cs:506 — `ms.HasValue && precision > DateTimePrecision.Second` appears character-identically in 2 files — Cql/Iso8601/DateTimeIso8601.cs, Cql/Iso8601/TimeIso8601.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 Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:574 — `next is not null && Comparer.Compare(next, listItem, null) <= 0` appears character-identically in 2 files — Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs, Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.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 Cql/PackagerCLI/Commands.CqlToFhir/CqlToFhirProgram.cs:233 — `opt.PdbOutDir is not null && librariesWithDebugSymbols.Contains(libraryId)` appears character-identically in 2 files — Cql/PackagerCLI/Commands.CqlToFhir/CqlToFhirProgram.cs, Cql/PackagerCLI/Commands.ElmToFhir/ElmToFhirProgram.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 Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:767 — `per.unit is not null && Units.DatePrecisionToCqlUnits.Values.Contains(per.unit)` appears character-identically in 2 files — Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs, Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.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 Cql/Cql.Abstractions/Primitives/CqlDate.cs:197 — `precision == "week" || precision == "weeks"` appears character-identically in 2 files — Cql/Cql.Abstractions/Primitives/CqlDate.cs, Cql/Cql.Abstractions/Primitives/CqlDateTime.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 Cql/Iso8601/DateTimeIso8601.cs:502 — `second.HasValue && precision > DateTimePrecision.Minute` appears character-identically in 2 files — Cql/Iso8601/DateTimeIso8601.cs, Cql/Iso8601/TimeIso8601.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 Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:774 — `string.IsNullOrEmpty(per.unit) || per.unit == UCUMUnits.Unary` appears character-identically in 2 files — Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs, Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.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 Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs:778 — `usesDefaultDecimalUnit && (listItem.Scale > perScale || highBoundary.Scale > perScale)` appears character-identically in 2 files — Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs, Cql/Cql.Runtime/Operators/CqlOperators.ListOperators.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.
IC1 · Incompleteness & stubs · Disabled test · ×9
  • Disabled test Cql/CoreTests/FhirTypeConverterTests.cs:218 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test Cql/CoreTests/FhirTypeConverterTests.cs:240 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test Cql/CoreTests/FhirTypeConverterTests.cs:262 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test Cql/CoreTests/FhirTypeConverterTests.cs:309 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test Cql/CoreTests/FhirTypeConverterTests.cs:376 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test Cql/CoreTests/FhirTypeConverterTests.cs:401 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test Cql/CoreTests/FhirTypeConverterTests.cs:428 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test Cql/CoreTests/FhirTypeConverterTests.cs:454 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test Cql/CoreTests/ToOperatorTests.cs:351 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
D34 · Knowledge Freshness · Orphaned file · ×8
  • Orphaned file Cql/Cql.CqlToElm/Scopes/SymbolTable.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Cql/Cql.CqlToElm/Builtin/BuiltinModelProvider.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Cql/Cql.CqlToElm/Builtin/SystemFunction.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Cql/Cql.CqlToElm/Builtin/FunctionDefinitionBuilders.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Cql/Cql.CqlToElm/CqlToElmConverter.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Cql/Cql.Runtime/Conversion/ConversionConstants.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Cql/Cql.Runtime/Operators/CqlOperators.LogicalOperators.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Cql/Elm/DebuggerDisplays.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
AX6 · Interface segregation · Fat interface · ×3
  • Fat interface: ICqlOperators (503 members) Cql/Cql.Runtime/Operators/ICqlOperators.cs:21 — `ICqlOperators` declares 503 members: `Comparer`, `CreateValueSetFacade`, `Convert`, `Retrieve`, `Abs`, `Abs`, `Abs`, `Abs`, `Add`, `Add`, `Add`, `Add`, `Add`, `Add`, `Add`, `After`, `After`, `After`, `After`, `After`, `After`, `After`, `After`, `After`, `After`, `After`, `After`, `After`, `After`, `After`, `After`, `After`, `After`, `After`, `After`, `After`, `After`, `Age`, `AgeAt`, `Aggregate`, and 463 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 503 declarations carry 229 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 229 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: IcqlListener (358 members) Cql/Cql.Grammar/cqlListener.cs:39 — `IcqlListener` declares 358 members: `EnterDefinition`, `ExitDefinition`, `EnterLibrary`, `ExitLibrary`, `EnterLibraryDefinition`, `ExitLibraryDefinition`, `EnterUsingDefinition`, `ExitUsingDefinition`, `EnterIncludeDefinition`, `ExitIncludeDefinition`, `EnterLocalIdentifier`, `ExitLocalIdentifier`, `EnterAccessModifier`, `ExitAccessModifier`, `EnterParameterDefinition`, `ExitParameterDefinition`, `EnterCodesystemDefinition`, `ExitCodesystemDefinition`, `EnterValuesetDefinition`, `ExitValuesetDefinition`, `EnterCodesystems`, `ExitCodesystems`, `EnterCodesystemIdentifier`, `ExitCodesystemIdentifier`, `EnterLibraryIdentifier`, `ExitLibraryIdentifier`, `EnterCodeDefinition`, `ExitCodeDefinition`, `EnterConceptDefinition`, `ExitConceptDefinition`, `EnterCodeIdentifier`, `ExitCodeIdentifier`, `EnterCodesystemId`, `ExitCodesystemId`, `EnterValuesetId`, `ExitValuesetId`, `EnterVersionSpecifier`, `ExitVersionSpecifier`, `EnterCodeId`, `ExitCodeId`, and 318 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: IcqlVisitor<Result> (179 members) Cql/Cql.Grammar/cqlVisitor.cs:40 — `IcqlVisitor<Result>` declares 179 members: `VisitDefinition`, `VisitLibrary`, `VisitLibraryDefinition`, `VisitUsingDefinition`, `VisitIncludeDefinition`, `VisitLocalIdentifier`, `VisitAccessModifier`, `VisitParameterDefinition`, `VisitCodesystemDefinition`, `VisitValuesetDefinition`, `VisitCodesystems`, `VisitCodesystemIdentifier`, `VisitLibraryIdentifier`, `VisitCodeDefinition`, `VisitConceptDefinition`, `VisitCodeIdentifier`, `VisitCodesystemId`, `VisitValuesetId`, `VisitVersionSpecifier`, `VisitCodeId`, `VisitTypeSpecifier`, `VisitNamedTypeSpecifier`, `VisitModelIdentifier`, `VisitListTypeSpecifier`, `VisitIntervalTypeSpecifier`, `VisitTupleTypeSpecifier`, `VisitTupleElementDefinition`, `VisitChoiceTypeSpecifier`, `VisitStatement`, `VisitExpressionDefinition`, `VisitContextDefinition`, `VisitFluentModifier`, `VisitFunctionDefinition`, `VisitOperandDefinition`, `VisitFunctionBody`, `VisitQuerySource`, `VisitAliasedQuerySource`, `VisitAlias`, `VisitQueryInclusionClause`, `VisitWithClause`, and 139 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.
D16 · Bus Factor · Off-boarding risk · ×3
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 19 significant file(s) lose their only recent owner: Cql/Cql.Abstractions/Abstractions/Infrastructure/CSharpFormatter.cs, Cql/Cql.Invocation/Toolkit/LibrarySetInvokerPool.cs, Cql/Cql.Invocation/Toolkit/InvocationToolkit.cs, Cql/Cql.Invocation/Toolkit/LibrarySetInvoker.cs, Cql/Elm/Elm.cs, Cql/Cql.Abstractions/Abstractions/Infrastructure/EnumerableExtensions.cs, Cql/Elm/Serialization/PolymorphicObjectJsonConverter.cs, Cql/Cql.Packaging/ResourceFileName.cs (+11 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 11 significant file(s) lose their only recent owner: Cql/Cql.Runtime/Operators/CqlOperators.IntervalOperators.cs, Cql/Cql.Runtime/Operators/CqlOperators.IntervalBoundaries.cs, Cql/Cql.Compiler/CqlOperatorsBinder.Fusion.cs, Cql/Cql.Runtime/Operators/CqlOperators.FusedOperators.cs, Cql/Cql.CqlToElm/Toolkit/Internal/LibraryBuilderProvider.cs, Cql/Cql.Runtime/Comparers/CqlComparers.CqlRatioCqlComparer.cs, Cql/Cql.Firely/IndexedBundle.cs, Cql/Cql.Abstractions/Primitives/OverflowGuard.cs (+3 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 9 significant file(s) lose their only recent owner: Cql/Cql.Compiler/CodeBuilderContext.Narrowing.cs, Cql/CodeGeneration.NET/CSharpEmitter.cs, Cql/Cql.CqlToElm/IModelProviderExtensions.cs, Cql/Cql.Compiler/CodeBuilderContext.References.cs, Cql/Elm/LocatorExtensions.cs, Cql/Cql.CqlToElm/Visitors/ConditionalExpressionVisitor.cs, Cql/Cql.CqlToElm/Visitors/Visitor.cs, Cql/Cql.Compiler/CqlDefinition.cs (+1 more). Pair on, review, or document these before any departure.
D17 · Explicit Debt · ObsoleteWithoutCallers · ×2
  • ObsoleteWithoutCallers Cql/Cql.Runtime/Operators/CqlOperators.NullologicalOperators.cs:32 — [Obsolete] CoalesceValueTypes
  • ObsoleteWithoutCallers Cql/Cql.Runtime/Operators/ICqlOperators.cs:151 — [Obsolete] CoalesceValueTypes
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×2
  • Projects may be oversized for their cohesion Cql/Cql.Grammar/Cql.Grammar.csproj:1 — `Cql.Grammar` overshoots its size bounds (19540 LoC, 194 public types across 1 namespaces). 2 of 29 project(s) overshoot their size bounds, lowering Project Cohesion to 8.6/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 Cql/Cql.Runtime/Cql.Runtime.csproj:1 — `Cql.Runtime` overshoots its size bounds (13220 LoC, 46 public types across 11 namespaces). 2 of 29 project(s) overshoot their size bounds, lowering Project Cohesion to 8.6/10. Size alone is no reason to split a project: where its type references show a separable part, a Split row names it.
M4 · Documentation accuracy · README/code drift · ×2
  • README/code drift README.md:16 — README.md names .NET 8, but the projects target .NET 10. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/technical-readme.md:206 — docs/technical-readme.md names .NET 11, but the projects target .NET 10. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
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: an expiry limit — a declared maximum age / TTL after which the data is no longer kept, a scheduled purge / cleanup job (PurgeOlderThan / CleanupJob).
D34 · Knowledge Freshness · Orphaned files with no living knowledge · ×1
  • Orphaned files with no living knowledge — 8 of 270 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 270 of the 477 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: Cql/Cql.CqlToElm/Scopes/SymbolTable.cs, Cql/Cql.CqlToElm/Builtin/BuiltinModelProvider.cs, Cql/Cql.CqlToElm/Builtin/SystemFunction.cs, Cql/Cql.CqlToElm/Builtin/FunctionDefinitionBuilders.cs, Cql/Cql.CqlToElm/CqlToElmConverter.cs, Cql/Cql.Runtime/Conversion/ConversionConstants.cs, Cql/Cql.Runtime/Operators/CqlOperators.LogicalOperators.cs, Cql/Elm/DebuggerDisplays.cs. Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
P3 · Security & performance tooling · No SAST · ×1
  • No SAST — No static application security testing detected. For this repository's stack, add CodeQL's csharp pack, or a .NET security analyzer package (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 7 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
P3 · Security & performance tooling · Dependabot does not watch maven/gitsubmodule · ×1
  • Dependabot does not watch maven/gitsubmodule REDACTED:7 — `REDACTED` schedules updates, but no `package-ecosystem` entry covers `maven`, `gitsubmodule`, which this tree depends on — so those dependencies get no update pull requests and no advisory pressure, however complete the dep-scan credit looks. Add the missing entries to the `updates:` list.
X2 · Cancellation propagation · Not all async methods take a CancellationToken · ×1
  • Not all async methods take a CancellationToken — Only 0/6 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 — 24/25 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 — ~3.2 `!` suppressions per 1k syntax nodes — 905 suppression(s) across the 279216 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.
X7 · Silent fallback defaults · Silent fallback default in catch · ×1
  • Silent fallback default in catch tools/dqic_sync/compare_dqic_tests.py:120 — `git_log_for_test` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Minor — 14 finding(s)
D24 · Comment Value · doc comments repeat the names · ×10
  • doc comments repeat the names Cql/CodeGeneration.NET/CacheKeyGenerator.cs:20 — 4 of 122 documented parameters and 1 of 127 summaries in `CodeGeneration.NET` only repeat the member or parameter name (e.g. "The definition name." for `definitionName`). 4 documentation tag(s) are empty. Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names Cql/CoreTests/AggregateOperatorTests.cs:51 — 0 of 13 documented parameters and 2 of 489 summaries in `CoreTests` only repeat the member or parameter name (e.g. "The midpoint of and 1." for `MidpointOfMaxValueAndOne`). Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names Cql/Cql.Abstractions/Abstractions/CqlFunctionParameterAttribute.cs:19 — 17 of 222 documented parameters and 11 of 310 summaries in `Cql.Abstractions` only repeat the member or parameter name (e.g. "Initializes a new instance of the CqlFunctionParameterAttribute class." for `CqlFunctionParameterAttribute`). Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names Cql/Cql.Compiler/CqlContextBinder.cs:28 — 6 of 98 documented parameters and 3 of 213 summaries in `Cql.Compiler` only repeat the member or parameter name (e.g. "The name of the parameter." for `parameterName`). Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names Cql/Cql.CqlToElm/IModelProvider.cs:59 — 6 of 102 documented parameters and 10 of 173 summaries in `Cql.CqlToElm` only repeat the member or parameter name (e.g. "Gets all conversions from ." for `TryGetConversionFunctions`). 1 documentation tag(s) are empty. Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names REDACTED:49 — 2 of 40 documented parameters and 0 of 88 summaries in `Cql.Firely` only repeat the member or parameter name (e.g. "the model" for `model`). 8 documentation tag(s) are empty. Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names Cql/Cql.Invocation/Toolkit/CqlAssemblyInfo.cs:33 — 5 of 112 documented parameters and 10 of 200 summaries in `Cql.Invocation` only repeat the member or parameter name (e.g. "The assembly." for `assemblyBinary`). Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names REDACTED:28 — 9 of 84 documented parameters and 4 of 79 summaries in `Cql.Packaging` only repeat the member or parameter name (e.g. "the type resolver" for `typeResolver`). Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names Cql/Cql.Runtime/Conversion/UnitConverter.cs:74 — 6 of 171 documented parameters and 6 of 363 summaries in `Cql.Runtime` only repeat the member or parameter name (e.g. "The converted value." for `converted`). 3 documentation tag(s) are empty. Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names Cql/Elm/Elm.cs:53 — 2 of 30 documented parameters and 3 of 89 summaries in `Elm` only repeat the member or parameter name (e.g. "Gets the versioned library identifier." for `VersionedLibraryIdentifier`). 2 documentation tag(s) are empty. Delete the restating tags, or add what the name does not say.
D10 · Test Quality · Skipped (documented) · ×4
  • Skipped (documented): ToQuantity_OfAStringWithAUnitThatIsNotUcum_IsNull Cql/CoreTests/ToOperatorTests.cs:350 — Skipped with a documented reason — a deferral, not lazy debt: The unit designator is not yet checked against UCUM or the calendar duration keywords (#1782).
  • Skipped (documented): Convert_Grams_to_Kilograms Cql/CqlToElmTests/(tests)/ConvertTest.cs:69 — Skipped with a documented reason — a deferral, not lazy debt: Mass units are not yet defined and respective conversions not yet implemented, see UcumUnits.cs and UnitConverter.cs
  • Skipped (documented): CodeSystem_Local Cql/CqlToElmTests/(tests)/RefTest.cs:41 — Skipped with a documented reason — a deferral, not lazy debt: Will fix in https://github.com/FirelyTeam/firely-cql-sdk/issues/519
  • Skipped (documented): Tags_Containing_Quotes_Must_Be_Escaped_In_CSharp Cql/CqlToElmTests/(tests)/TagsTest.cs:16 — Skipped with a documented reason — a deferral, not lazy debt: The C# CQL-to-ELM does not support capturing annotation tags yet. Once that is ready, this test must be completed. It will be moved to CoreTests.AnnotationTagsTest.TestAttributesWithQuotes for the time being.

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-e1446c60d682462e9641926b81429246/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-e1446c60d682462e9641926b81429246/history-1.json --exit-code 0 --source .1artifacts/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-e1446c60d682462e9641926b81429246/history-2.json --exit-code 0 --source .16artifacts/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=2137" --report-format json --report-path /tmp/watchdog-gitleaks-e1446c60d682462e9641926b81429246/history-3.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-3.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-e1446c60d682462e9641926b81429246/tree.json --exit-code 0 --source .3artifacts/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 --exclude Cql/CoreTests/CSharp --exclude Demo/Measures.Authoring/CSharp --exclude Demo/Measures.Demo/CSharp --exclude Demo/Measures.dqm-content-qicore-2025/CSharp --exclude "Examples/CqlSdkExamples/230 Package CQL+ELM+C#+DLL from dirs, Save FHIR Resources to dir/input/cs" --exclude LibrarySets/RR23/CSharp --exclude LibrarySets/dqm-content-qicore-2025/Extracted/CSharp .97artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesnuget—nuget: not applicable — nuget: the solution did not restore on the analyzer's .NET SDK (an SDK/target-framework/restore mismatch, common for an older codebase), so there was no restored dependency graph to scan0—
D30 · Dependency Vulnerabilitiesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm . /tmp/codehealth-osv-sbom-67db19d35d2f44e4816e7517b917e3c10artifacts/raw/osv-scanner.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 97 file(s) — `Cql/CodeGeneration.NET/CSharpNamingConventions.cs`, `Cql/CodeGeneration.NET/LibrarySetCSharpCodeGenerator.DefinitionWriter.cs`, `Cql/CodeGeneration.NET/LibrarySetCSharpCodeGenerator.LibrarySetWriter.cs`, `Cql/CodeGeneration.NET/LibrarySetCSharpCodeGenerator.LibraryWriter.cs`, `Cql/CodeGeneration.NET/Toolkit/Internal/ElmToolkitScopedState.cs`, … (+92 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.0—
D37 · Vulnerability-disclosure Policydisclosure—disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm . /tmp/codehealth-osv-sbom-67db19d35d2f44e4816e7517b917e3c10artifacts/raw/osv-scanner.json

Run 01a1eb9a-0bd4-7a11-bb86-2cd7c6aabc6c · 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 — 6 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.

Date of birth — 4 field(s)
  • PatientTypeInfo._birthDateGetter Cql/Cql.Abstractions/Abstractions/PatientTypeInfo.cs:20
  • ContextInfo.birthDateElementField Cql/Cql.Model/modelinfo.cs:343
  • ContextInfo.birthDateElement Cql/Cql.Model/modelinfo.cs:379
  • CqlOperators._patientBirthDate Cql/Cql.Runtime/Operators/CqlOperators.ClinicalOperators2.cs:45
Name — 2 field(s)
  • ModelInfo.patientBirthDatePropertyNameField Cql/Cql.Model/modelinfo.cs:59
  • ModelInfo.patientBirthDatePropertyName Cql/Cql.Model/modelinfo.cs:216

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