Public report — Lean, published 5 Aug 2026. Concrete security findings (CVE IDs, secret matches, dependency versions) are hidden in this version; ask the repo owner for the full report.
Watchdog 05-08-2026 @ 10:37 UTC Public
Code Health Audit

QuantConnect/Lean

48% At Risk

Large · 476,945 LoC · 23 projects · rebuild ~5.1 person-years · weakest lens: Security (41%)

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

50/53dimensions tool-verifieddeterministic · confidence 1.0 · 3 LLM-assisted, advisory
952findings with an exact file:lineof 1009 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
53/98dimensions across the health lenses476945 LoC · 23 projects — wide & deep

Executive summary

Read through the Production lens — the standard calibration. *Green* means good enough to run in production. The score is absolute and comparable across repos.

QuantConnect/Lean carries serious gaps (48%). Several issues below can materially affect correctness, security, or the cost of changing it — and propagate to everything that depends on it.

It is strongest in Architecture (91%) — the structure is clean and changes stay contained.

Most urgent: a critical security exposure was detected (see the Security & Compliance lens). Treat it as a priority regardless of the overall grade.

The area that most needs attention is Security (41%) — exposure to security and compliance incidents is elevated. Code Health (43%) is the next concern — changes there are slower and more error-prone.

Leadership focus, highest impact first: Encrypt sensitive data at rest (ASP.NET Core Data Protection /… (Data Protection); Sync-over-async (deadlock risk) (Async correctness); Thread a CancellationToken through async methods so work stops… (Cancellation propagation).

For scale: Large (~476,945 production lines); rebuilding it from scratch would take roughly ~5.1 person-years (~3–10 engineers). Approximate, ±~30%.

It builds on a genuinely strong Architecture foundation (91%); the priorities above are the highest-leverage way to bring the rest up to that level.

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

Raise Security 41 → 70 (the Healthy floor) ⇒ headline 48 → ~54.

Code composition — where the lines go
Business logic 16%Plumbing 58%Tests 27%
Rebuild cost & value ~ Modeled — €250,000–€1,200,000
Cost to rebuild€250,000–€1,200,000 (2.5–7.8 person-years (4,144–13,025 h), ~3–10 engineers)
Domain complexityStandard — harder problems cost more per line
Quality factor0.7× (at 48% quality) — the last 20% of quality is most of the work
Size & shapeLarge · 66% boilerplate · 12% straight-line · 21% branching logic

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

How we model this: boilerplate at a scaffolding rate + logic × domain Standard (×1.1) — library/CLI, CQRS × a 0.7× quality factor, at €60–95/h; indicative, ±~30%. Indicative only — most sensitive to the hourly rate and the domain tier (both tunable in config).

Top priorities

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

1
Resolve the 1 NoWarnInCsproj repeated across 20 files finding(s) in Explicit Debt — start with QuantConnect.ToolBox.csproj.
+4.7 pts · Low effort · Explicit Debt
2
Resolve the 4 NoWarnInCsproj finding(s) in Explicit Debt — start with QuantConnect.Tests.csproj (2), QuantConnect.Algorithm.CSharp.csproj (2).
+4.7 pts · Low effort · Explicit Debt
3
Resolve the 8 EmptyCatchBlock finding(s) in Explicit Debt — start with CustomDataNIFTYAlgorithm.cs (2), BubbleAlgorithm.cs, WebSocketClientWrapper.cs.
+4.7 pts · Low effort · Explicit Debt

Diagnosis — what's actually going on

Value concentrated against a weak lens · High · Value at risk
This is a Large asset (~5.1 person-years to rebuild), and its weakest lens is Security at 41%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
Evidence: valuation: Large, ~5.1 person-years rebuild (476,945 LoC) · weakest lens: Security 41%
→ Direct remediation budget at Security first — highest risk-reduction per euro on an asset this size.
Highest-leverage move · Medium · Leverage
Of everything flagged, the best return on effort is: 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.). The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ 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.).

Architecture — module dependency graph

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

arch QuantConnect QuantConnect QuantConnect.Compression Compression QuantConnect->QuantConnect.Compression QuantConnect.Configuration Configuration QuantConnect->QuantConnect.Configuration QuantConnect.Logging Logging QuantConnect->QuantConnect.Logging QuantConnect.Algorithm Algorithm QuantConnect.Algorithm->QuantConnect QuantConnect.Algorithm->QuantConnect.Configuration QuantConnect.Indicators Indicators QuantConnect.Algorithm->QuantConnect.Indicators QuantConnect.Algorithm->QuantConnect.Logging QuantConnect.Algorithm.CSharp CSharp QuantConnect.Algorithm.CSharp->QuantConnect QuantConnect.Algorithm.CSharp->QuantConnect.Algorithm QuantConnect.Algorithm.Framework Framework QuantConnect.Algorithm.CSharp->QuantConnect.Algorithm.Framework QuantConnect.Algorithm.CSharp->QuantConnect.Indicators QuantConnect.Algorithm.Framework->QuantConnect QuantConnect.Algorithm.Framework->QuantConnect.Algorithm QuantConnect.Algorithm.Framework->QuantConnect.Indicators QuantConnect.AlgorithmFactory AlgorithmFactory QuantConnect.AlgorithmFactory->QuantConnect QuantConnect.AlgorithmFactory->QuantConnect.Algorithm QuantConnect.AlgorithmFactory->QuantConnect.Configuration QuantConnect.AlgorithmFactory->QuantConnect.Logging QuantConnect.Api Api QuantConnect.Api->QuantConnect QuantConnect.Api->QuantConnect.Configuration QuantConnect.Api->QuantConnect.Logging QuantConnect.Brokerages Brokerages QuantConnect.Brokerages->QuantConnect QuantConnect.Brokerages->QuantConnect.Api QuantConnect.Brokerages->QuantConnect.Compression QuantConnect.Brokerages->QuantConnect.Configuration QuantConnect.Brokerages->QuantConnect.Logging QuantConnect.Compression->QuantConnect.Logging QuantConnect.Configuration->QuantConnect.Logging QuantConnect.DownloaderDataProvider.Launcher Launcher QuantConnect.DownloaderDataProvider.Launcher->QuantConnect QuantConnect.DownloaderDataProvider.Launcher->QuantConnect.Configuration QuantConnect.Lean.Engine Engine QuantConnect.DownloaderDataProvider.Launcher->QuantConnect.Lean.Engine QuantConnect.DownloaderDataProvider.Launcher->QuantConnect.Logging QuantConnect.Indicators->QuantConnect QuantConnect.Indicators->QuantConnect.Logging QuantConnect.Lean.Engine->QuantConnect QuantConnect.Lean.Engine->QuantConnect.Algorithm QuantConnect.Lean.Engine->QuantConnect.Algorithm.CSharp QuantConnect.Lean.Engine->QuantConnect.AlgorithmFactory QuantConnect.Lean.Engine->QuantConnect.Api QuantConnect.Lean.Engine->QuantConnect.Brokerages QuantConnect.Lean.Engine->QuantConnect.Compression QuantConnect.Lean.Engine->QuantConnect.Configuration QuantConnect.Lean.Engine->QuantConnect.Indicators QuantConnect.Lean.Engine->QuantConnect.Logging QuantConnect.Lean.Launcher Launcher QuantConnect.Lean.Launcher->QuantConnect QuantConnect.Lean.Launcher->QuantConnect.Algorithm QuantConnect.Lean.Launcher->QuantConnect.Algorithm.CSharp QuantConnect.Lean.Launcher->QuantConnect.AlgorithmFactory QuantConnect.Lean.Launcher->QuantConnect.Api QuantConnect.Lean.Launcher->QuantConnect.Brokerages QuantConnect.Lean.Launcher->QuantConnect.Compression QuantConnect.Lean.Launcher->QuantConnect.Configuration QuantConnect.Lean.Launcher->QuantConnect.DownloaderDataProvider.Launcher QuantConnect.Lean.Launcher->QuantConnect.Indicators QuantConnect.Lean.Launcher->QuantConnect.Lean.Engine QuantConnect.Lean.Launcher->QuantConnect.Logging QuantConnect.Messaging Messaging QuantConnect.Lean.Launcher->QuantConnect.Messaging QuantConnect.Optimizer.Launcher Launcher QuantConnect.Lean.Launcher->QuantConnect.Optimizer.Launcher QuantConnect.Queues Queues QuantConnect.Lean.Launcher->QuantConnect.Queues QuantConnect.Research Research QuantConnect.Lean.Launcher->QuantConnect.Research QuantConnect.Messaging->QuantConnect QuantConnect.Messaging->QuantConnect.Configuration QuantConnect.Messaging->QuantConnect.Logging QuantConnect.Optimizer Optimizer QuantConnect.Optimizer->QuantConnect QuantConnect.Optimizer->QuantConnect.Configuration QuantConnect.Optimizer->QuantConnect.Logging QuantConnect.Optimizer.Launcher->QuantConnect QuantConnect.Optimizer.Launcher->QuantConnect.Configuration QuantConnect.Optimizer.Launcher->QuantConnect.Logging QuantConnect.Optimizer.Launcher->QuantConnect.Optimizer QuantConnect.Queues->QuantConnect QuantConnect.Queues->QuantConnect.Brokerages QuantConnect.Queues->QuantConnect.Configuration QuantConnect.Queues->QuantConnect.Logging QuantConnect.Report Report QuantConnect.Report->QuantConnect QuantConnect.Report->QuantConnect.Algorithm QuantConnect.Report->QuantConnect.Api QuantConnect.Report->QuantConnect.Brokerages QuantConnect.Report->QuantConnect.Configuration QuantConnect.Report->QuantConnect.Lean.Engine QuantConnect.Report->QuantConnect.Logging QuantConnect.Report->QuantConnect.Messaging QuantConnect.Research->QuantConnect QuantConnect.Research->QuantConnect.Algorithm QuantConnect.Research->QuantConnect.Algorithm.Framework QuantConnect.Research->QuantConnect.Api QuantConnect.Research->QuantConnect.Configuration QuantConnect.Research->QuantConnect.Indicators QuantConnect.Research->QuantConnect.Lean.Engine QuantConnect.Research->QuantConnect.Logging QuantConnect.Research->QuantConnect.Queues __more__ +2 more projects

Architecture — module dependency matrix

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

…nect.Data.Fundamental…antConnect.Scheduling…ect.Securities.Future….Securities.PositionsQuantConnect.OrdersQuantConnect.Util…rtfolio.SignalExports…nnect.Orders.Slippage…antConnect.StatisticsQuantConnect.PacketsQuantConnect.PythonQuantConnect.Commands…tConnect.Orders.Fills…ect.Securities.Option…antConnect.InterfacesQuantConnect.Api…antConnect.Brokerages…antConnect.Securities…ct.Data.Consolidators…antConnect.Indicators…ntConnect.Data.Market…onnect.Data.AuxiliaryQuantConnect.Data…ata.UniverseSelection…m.Framework.Portfolio…m.Framework.Selection…m.Framework.ExecutionQuantConnect.Algorithm…ithm.Framework.AlphasQuantConnect…nect.Algorithm.CSharp…gorithm.CSharp.Alphas…ctory.Python.Wrappers…sis.Analyses.Messages…e.TransactionHandlers…t.Lean.Engine.Results…DataFeeds.Enumerators…Lean.Engine.DataFeeds…ntConnect.Lean.EngineQuantConnect.Report…nect.Data.Fundamental1…antConnect.Scheduling2…ect.Securities.Future3….Securities.Positions4QuantConnect.Orders5QuantConnect.Util6…rtfolio.SignalExports7…nnect.Orders.Slippage8…antConnect.Statistics9QuantConnect.Packets10QuantConnect.Python11QuantConnect.Commands12…tConnect.Orders.Fills13…ect.Securities.Option14…antConnect.Interfaces15QuantConnect.Api16…antConnect.Brokerages17…antConnect.Securities18…ct.Data.Consolidators19…antConnect.Indicators20…ntConnect.Data.Market21…onnect.Data.Auxiliary22QuantConnect.Data23…ata.UniverseSelection24…m.Framework.Portfolio25…m.Framework.Selection26…m.Framework.Execution27QuantConnect.Algorithm28…ithm.Framework.Alphas29QuantConnect30…nect.Algorithm.CSharp31…gorithm.CSharp.Alphas32…ctory.Python.Wrappers33…sis.Analyses.Messages34…e.TransactionHandlers35…t.Lean.Engine.Results36…DataFeeds.Enumerators37…Lean.Engine.DataFeeds38…ntConnect.Lean.Engine39QuantConnect.Report4094165341292292197132131252191251412252115138135627111121121359441241712535534523137131219271163217411135721315120111113922251013731921431112111210013321118334821232111216136268148211717816316636301213147530152223321255431812589411112225284892315811152142139123617163121251294261711212212141421451312142113182102512101420314473131112117431919424173413251221283755013106191381102562124139363123165911151282212622261131212111465421111022317361112310181213341142323167217411241112889111311026428594453123342235573211825+602 more modules (most-connected shown)

At a glance — Code Health · 43% · Weak · gated by X1, X5

At a glance — Architecture · 91% · Exemplary

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

At a glance — Readiness · 60% · Adequate

At a glance — Security · 41% · Weak · gated by D28, D29, D36, C1

At a glance — Performance · 65% · Adequate

Security & Compliance — OWASP Top-10 mapping

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

OWASP categoryFindingsSeverity
A03:2021 — Injection17High / Critical
A02:2021 — Cryptographic Failures7High / Critical
A06:2021 — Vulnerable & Outdated Components7High / Critical
A05:2021 — Security Misconfiguration7High / Critical

Roadmap

First, secure sensitive data by encrypting it at rest and managing keys in a vault, while reviewing all MD5 and SHA1 usage to replace weak hashes with stronger alternatives. Next, address the seven instances of sync-over-async code that risk deadlocks, and ensure all async methods properly propagate cancellation tokens to allow work to stop promptly. Finally, enable nullable reference types across all projects and resolve the resulting warnings instead of suppressing them.

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

Do thisHelpsEffortDimension
Resolve the 1 NoWarnInCsproj repeated across 20 files finding(s) in Explicit Debt — start with QuantConnect.ToolBox.csproj.+4.7 ptsLowExplicit Debt
Resolve the 4 NoWarnInCsproj finding(s) in Explicit Debt — start with QuantConnect.Tests.csproj (2), QuantConnect.Algorithm.CSharp.csproj (2).+4.7 ptsLowExplicit Debt
Resolve the 8 EmptyCatchBlock finding(s) in Explicit Debt — start with CustomDataNIFTYAlgorithm.cs (2), BubbleAlgorithm.cs, WebSocketClientWrapper.cs.+4.7 ptsLowExplicit Debt
Resolve the 6 Secret finding(s) in Secrets (history) — start with config.json (4), CustomDataAutomaticSeedRegressionAlgorithm.cs, CustomDataRegressionAlgorithm.cs.+3.9 ptsLowSecrets (history)
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.).+7.1 ptsMediumData Protection
Sync-over-async (deadlock risk)+6.1 ptsMediumAsync correctness
Thread a CancellationToken through async methods so work stops promptly on cancellation.+6.1 ptsMediumCancellation propagation
Enable <Nullable>enable</Nullable> across all projects and resolve warnings rather than suppressing with `!`.+6.1 ptsMediumNullable reference types

File quality

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

FileScoreBandWorst signal
Algorithm.CSharp/BubbleAlgorithm.cs2.3SlopExplicit Debt: EmptyCatchBlock
Dockerfile2.7SlopIaC & Container Security: High IaC: DS-0002
Algorithm.CSharp/CustomDataNIFTYAlgorithm.cs4.6MixedExplicit Debt: EmptyCatchBlock
Engine/Results/LiveTradingResultHandler.cs5.6MixedCyclomatic Complexity: LiveTradingResultHandler.Update (cyclomatic 23)
Configuration/Config.cs5.7MixedStatic Analysis (SAST): Medium: unsafe-path-combine
Algorithm.CSharp/CustomDataAutomaticSeedRegressionAlgorithm.cs5.7MixedSecrets (history): Secret: generic-api-key
Launcher/config.json5.8MixedSecrets (history): Secret: generic-api-key
.github/workflows/benchmarks.yml5.8MixedStatic Analysis (SAST): High: github-actions-mutable-action-tag
Engine/AlgorithmManager.cs6.0MixedExplicit Debt: TodoComment
Algorithm/QCAlgorithm.Trading.cs6.0MixedExplicit Debt: TodoComment
Engine/TransactionHandlers/BrokerageTransactionHandler.cs6.0MixedExplicit Debt: TodoComment
Engine/DataFeeds/UniverseSelection.cs6.0MixedExplicit Debt: TodoComment
Brokerages/Backtesting/BacktestingBrokerage.cs6.0MixedExplicit Debt: TodoComment
Algorithm/QCAlgorithm.History.cs6.0MixedExplicit Debt: TodoComment
Engine/DataFeeds/SubscriptionDataReader.cs6.0MixedExplicit Debt: TodoComment
Common/Orders/Fees/InteractiveBrokersFeeModel.cs6.0MixedExplicit Debt: BarePragmaDisable
Engine/DataFeeds/Enumerators/FillForwardEnumerator.cs6.0MixedExplicit Debt: TodoComment
Common/Orders/Fills/EquityFillModel.cs6.0MixedExplicit Debt: TodoComment
Algorithm/QCAlgorithm.Universe.cs6.0MixedExplicit Debt: ObsoleteWithCallers
Common/Extensions.cs6.0MixedExplicit Debt: TodoComment

Methodology & how to trust this report

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

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

What we checked — 53 dimensions across the health lenses
D1D2D3D4D5D6D9D10D12D13D14D15D16D17D18D20D21D24D26D27D28D29D30D31D34D35D36D39AX10AX3AX5AX6AX8C1C4GD1IC1M1M2M3M4P1P10P3P4PF1PF2PF3S1X1X2X3X5

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, 952 of 1009 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
  2. Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
  3. Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.

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

Tools & methods

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

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

Every finding is locatable in findings.md. Run 019fd180-217b-7230-a484-acab851a294c.

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.

  • D19 Documentation Quality — LLM provider failed — The model provider returned an unusable result, so this LLM-assisted dimension fell back to a measurement gap (confidence 0) rather than a penalty. Re-run with a reachable provider to score it.

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

Limitations & what we did not check

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

Per-dimension blind spots

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

  • 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 (jscpd) — 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.
  • D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • 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.
  • D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
  • D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
  • D24 Comment Value: Comment value (WHY vs WHAT) is an LLM judgement over a bounded sample — it is advisory and cannot weigh a comment against the precise code change it was written to explain.
  • 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 the advisory database — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen.
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • 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.
  • 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: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".

The LLM boundary

LLM-set scores this run (4): D20, D21, D24, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score (documentation, ADR quality, naming, comment value, onboarding) — D25 sets the ADR-conformance fraction over sampled code, D22 judges API accuracy over a sample. These are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.

Dimensions

D1 · Cyclomatic Complexity6.0 / 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: DocumentedVerifiedPrevented · effective 6.0 / 10 · rule-coverage 100% · ceiling Prevented

128 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was Exchanges.GetPrimaryExchange at 106. A further 8 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 BrokerageModel.Create at 37 — they are counted neither in the figure above nor in this dimension's score.

Exchanges.GetPrimaryExchange (cyclomatic 106)Common/Global.cs:1028
LeanData.GenerateLine (cyclomatic 100)Common/Util/LeanData.cs:90
AlgorithmManager.Run (cyclomatic 70)Engine/AlgorithmManager.cs:120
TimeSliceFactory.Create (cyclomatic 64)Engine/DataFeeds/TimeSliceFactory.cs:89
OptionStrategyPositionGroupBuyingPowerModel.GetMaintenanceMargin (cyclomatic 47)Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs:50

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

What to do

  1. Resolve the 1 Exchanges.GetPrimaryExchange (cyclomatic 106) finding(s) in Cyclomatic Complexity — start with Global.cs. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 LeanData.GenerateLine (cyclomatic 100) finding(s) in Cyclomatic Complexity — start with LeanData.cs. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 AlgorithmManager.Run (cyclomatic 70) finding(s) in Cyclomatic Complexity — start with AlgorithmManager.cs. — One of this dimension's main actionable groups (1 warning-level).
  4. Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D2 · Cognitive Complexity5.3 / 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: DocumentedVerifiedPrevented · effective 5.3 / 10 · rule-coverage 100% · ceiling Prevented

258 method(s) exceeded the cognitive complexity threshold of 15; the worst was LeanData.GenerateLine at 187.

LeanData.GenerateLine (cognitive 187)Common/Util/LeanData.cs:90
TimeSliceFactory.Create (cognitive 182)Engine/DataFeeds/TimeSliceFactory.cs:89
AlgorithmManager.Run (cognitive 173)Engine/AlgorithmManager.cs:120
SubscriptionSynchronizer.Sync (cognitive 106)Engine/DataFeeds/SubscriptionSynchronizer.cs:88
RandomDataGenerator.Run (cognitive 85)ToolBox/RandomDataGenerator/RandomDataGenerator.cs:50

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

What to do

  1. Resolve the 1 LeanData.GenerateLine (cognitive 187) finding(s) in Cognitive Complexity — start with LeanData.cs. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 TimeSliceFactory.Create (cognitive 182) finding(s) in Cognitive Complexity — start with TimeSliceFactory.cs. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 AlgorithmManager.Run (cognitive 173) finding(s) in Cognitive Complexity — start with AlgorithmManager.cs. — One of this dimension's main actionable groups (1 warning-level).
  4. Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D3 · God Classes9.7 / 10Exemplary✓ 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: DocumentedVerifiedPrevented · effective 9.7 / 10 · rule-coverage 100% · ceiling Prevented

36 god class(es) detected.

TooManyMethods: QCAlgorithm · ×22Algorithm/QCAlgorithm.Indicators.cs:0
FileTooLong: Algorithm/QCAlgorithm.Indicators.cs · ×11Algorithm/QCAlgorithm.Indicators.cs:0
ClassTooLong: FillModel · ×3Common/Orders/Fills/FillModel.cs:0

✓ On the Gold path — maintain.

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

D4 · Code Duplication9.8 / 10Exemplary✓ Tool-verified

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

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

Maturity: DocumentedVerifiedPrevented · effective 9.8 / 10 · rule-coverage 100% · ceiling Verified

216 duplicated block group(s) detected.

Duplicated block (10 lines × 2) · ×20Common/Data/Auxiliary/CorporateFactorProvider.cs:113
Duplicated block (11 lines × 2) · ×19Common/Brokerages/AlpacaBrokerageModel.cs:86
Duplicated block (9 lines × 2) · ×16Common/Scheduling/DateRules.cs:617
Duplicated block (13 lines × 2) · ×15Engine/DataFeeds/Enumerators/LiveDividendEventProvider.cs:37
Duplicated block (14 lines × 2) · ×13Common/Brokerages/FxcmBrokerageModel.cs:78

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

✓ On the Gold path — maintain.

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

D5 · Coupling8.6 / 10Strong✓ 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: DocumentedVerifiedPrevented · effective 8.6 / 10 · rule-coverage 100% · ceiling Prevented

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

Off the main sequence: QuantConnect.Configuration · ×4

What to do

  1. Resolve the 4 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (4 warning-level).
  2. Enforce Coupling in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

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

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

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

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

Maturity: DocumentedVerifiedPrevented · effective 9.9 / 10 · rule-coverage 100% · ceiling Verified

12 of 1114 classes have LCOM4 above 3.

Low cohesion: QuantBook (LCOM4 13) · ×12Research/QuantBook.cs:48

✓ On the Gold path — maintain.

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

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

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

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

Maturity: DocumentedVerifiedPrevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

5004 test methods: 5004 unit, 0 integration, 0 BDD, 0 e2e.

✓ On the Gold path — maintain.

Detailed fixes: d9_recommendation.md.

D10 · Test Quality10.0 / 10Exemplary✓ 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: DocumentedVerifiedPrevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

7 skipped (7 with a documented reason), 4 zero-assertion, 1 mock references across 5004 tests.

No assertions (empty test): ComparesAgainstExternalData · ×4Tests/Indicators/OptionBaseIndicatorTests.cs:442
Skipped (documented): FindsFactorFilesWithErrors · ×7Tests/Common/Data/Auxiliary/LocalDiskFactorFileProviderTests.cs:60
Mock framework: Moq

✓ On the Gold path — maintain.

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

D12 · Dependency Hygiene5.8 / 10Adequate✓ Tool-verified

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

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

Maturity: DocumentedVerifiedPrevented · effective 5.8 / 10 · rule-coverage 100% · ceiling Verified

21 outdated, 1 vulnerable, 1 deprecated packages.

Vulnerable: DotNetZip
Deprecated: DotNetZip
Outdated: Newtonsoft.Json · ×21

What to do

  1. Resolve the 1 Vulnerable finding(s) in Dependency Hygiene. — One of this dimension's main actionable groups (1 issue-level).
  2. Resolve the 1 Deprecated finding(s) in Dependency Hygiene. — One of this dimension's main actionable groups (1 warning-level).
  3. Enforce Dependency Hygiene in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

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

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

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

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

Maturity: DocumentedVerifiedPrevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

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

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

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

Maturity: DocumentedVerifiedPrevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Verified

0 of 33 packages use a banned license.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots9.8 / 10Exemplary✓ 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: DocumentedVerifiedPrevented · effective 9.8 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: Common/Util/LeanData.cs (3×100=300); Engine/TransactionHandlers/BrokerageTransactionHandler.cs (4×38=152); Common/Brokerages/IBrokerageModel.cs (4×37=148)

Hotspot: Common/Util/LeanData.cs · ×10Common/Util/LeanData.cs

✓ On the Gold path — maintain.

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

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

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

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

Maturity: DocumentedVerifiedPrevented · effective 9.5 / 10 · rule-coverage 100% · ceiling Documented

108 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is Compression/Compression.cs.

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

✓ On the Gold path — maintain.

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

D17 · Explicit Debt9.5 / 10Exemplary✓ 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: DocumentedVerifiedPrevented · effective 9.5 / 10 · rule-coverage 100% · ceiling Prevented

272 deducted debt markers + 9 dead symbols across 476375 LoC (0.2/KLoC) → score 9.5.

EmptyCatchBlock · ×8Algorithm.CSharp/BubbleAlgorithm.cs:276
NoWarnInCsproj · ×4Tests/QuantConnect.Tests.csproj:15
NoWarnInCsproj repeated across 20 filesToolBox/QuantConnect.ToolBox.csproj:15
TodoComment · ×70Algorithm.CSharp/AddRemoveOptionUniverseRegressionAlgorithm.cs:74
ObsoleteWithCallers · ×55Algorithm.Framework/Selection/FundamentalUniverseSelectionModel.cs:121

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

✓ On the Gold path — maintain.

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

D18 · Solution Shape10.0 / 10Exemplary✓ 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: DocumentedVerifiedPrevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

23 projects, 3498 source files, 648588 hand-written lines of code (476375 production / 172213 test), 166 inter-project edges.

✓ On the Gold path — maintain.

Detailed fixes: d18_recommendation.md.

D20 · ADR Quality / 10Critical◐ Sampled · advisory

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

Method: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.

Maturity: DocumentedVerifiedPrevented · effective Critical / 10 · rule-coverage 100% · ceiling Documented

No architecture decision records were found.

No ADRs found

What to do

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

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

D21 · Naming Consistency / 10Exemplary◐ Sampled · advisory

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

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

Maturity: DocumentedVerifiedPrevented · effective Exemplary / 10 · rule-coverage 100% · ceiling Verified

0 naming inconsistencies across 200 sampled symbols.

✓ On the Gold path — maintain.

Detailed fixes: d21_recommendation.md.

D24 · Comment Value / 10Weak◐ Sampled · advisory

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

Method: Judged by language model at low temperature (0.0-0.1) on deterministically sampled inline comments with surrounding code; findings verified back to sampled comments by substring match. Advisory, sampled.

Maturity: DocumentedVerifiedPrevented · effective Weak / 10 · rule-coverage 100% · ceiling Documented

10 valuable / 2 redundant across 200 sampled comments; 2 shown with locations.

redundant comment · ×2Algorithm.CSharp/BasicPythonIntegrationTemplateAlgorithm.cs:28

What to do

  1. Resolve the 2 redundant comment finding(s) in Comment Value — start with BasicPythonIntegrationTemplateAlgorithm.cs, LiveFeaturesAlgorithm.cs. — One of this dimension's main actionable groups (2 recommendation-level).

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

D26 · Project Cohesion6.5 / 10Adequate✓ Tool-verified

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

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

Maturity: DocumentedVerifiedPrevented · effective 6.5 / 10 · rule-coverage 100% · ceiling Documented

4 of 23 projects flagged as possibly oversized/incoherent.

Split QuantConnect.Lean.Engine
Split QuantConnect.Algorithm.CSharp

What to do

  1. Resolve the 1 Split QuantConnect.Lean.Engine finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).
  2. Resolve the 1 Split QuantConnect.Algorithm.CSharp finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).

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

D27 · Navigability5.2 / 10Adequate✓ 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.

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

Maturity: DocumentedVerifiedPrevented · effective 5.2 / 10 · rule-coverage 100% · ceiling Documented

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

What to do

  1. Improve Navigability — currently 5.2/10. — 81 % of calls cross a namespace and 16 % go through an interface, but 80 % of collaborators are co-located — so a call's collaborators sit together and tracing stays easy. Baseline: large — vertical-slice locality expected.

Detailed fixes: d27_recommendation.md.

D28 · Secrets (history)2.0 / 10Critical✓ Tool-verified

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

Method: Git-history secret scan via gitleaks detect over full history in an isolated checkout; each match flagged High. Exhaustive; degrades cleanly when tool absent.

Maturity: DocumentedVerifiedPrevented · effective 2.0 / 10 · rule-coverage 100% · ceiling Documented

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

Secret: generic-api-key · ×6Algorithm.CSharp/CustomDataAutomaticSeedRegressionAlgorithm.cs:176detected by gitleaks finding
Rotate the exposed credentials — git history can't be un-committed

What to do

  1. Resolve the 6 Secret finding(s) in Secrets (history) — start with config.json (4), CustomDataAutomaticSeedRegressionAlgorithm.cs, CustomDataRegressionAlgorithm.cs. — One of this dimension's main actionable groups (6 issue-level).
  2. Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).

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

D29 · Static Analysis (SAST)2.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: DocumentedVerifiedPrevented · effective 2.1 / 10 · rule-coverage 100% · ceiling Documented

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

High: github-actions-mutable-action-tag · ×6.github/workflows/benchmarks.yml:23detected by semgrep finding
Medium: unsafe-path-combine · ×10Configuration/Config.cs:350detected by semgrep finding
Low: httpsconnection-detectedfind_datasource_repos.py:44detected by semgrep finding

What to do

  1. Resolve the 10 Medium finding(s) in Static Analysis (SAST) — start with FutureMarginBuyingPowerModelTests.cs (4), Config.cs, DeltaTests.cs. — One of this dimension's main actionable groups (10 warning-level).
  2. Resolve the 6 High finding(s) in Static Analysis (SAST) — start with benchmarks.yml (2), gh-actions.yml, rebase-org-branches.yml. — One of this dimension's main actionable groups (6 issue-level).
  3. Resolve the 1 Low finding(s) in Static Analysis (SAST) — start with find_datasource_repos.py. — One of this dimension's main actionable groups (1 recommendation-level).

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

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

What it measures: Whether any dependencies have known published vulnerabilities (CVEs), direct or transitive.

Method: NuGet CVE scan via dotnet list package --vulnerable including transitive; severity tally (Critical/High/Medium/Low) to 0-10 tight normalizer. Exhaustive, deterministic; degrades when absent.

Maturity: DocumentedVerifiedPrevented · effective 5.9 / 10 · rule-coverage 100% · ceiling Documented

7 vulnerable package(s): 1 critical, 4 high, 2 medium, 0 low.

High CVE: DotNetZip 1.16.0 · ×4detected by dotnet list package --vulnerable
Critical CVE: System.Drawing.Common 4.7.0detected by dotnet list package --vulnerable
Medium CVE: System.Private.ServiceModel 4.4.0 · ×2detected by dotnet list package --vulnerable

What to do

  1. Resolve the 4 High CVE finding(s) in Dependency Vulnerabilities. — One of this dimension's main actionable groups (4 issue-level).
  2. Resolve the 1 Critical CVE finding(s) in Dependency Vulnerabilities. — One of this dimension's main actionable groups (1 issue-level).
  3. Resolve the 2 Medium CVE finding(s) in Dependency Vulnerabilities. — One of this dimension's main actionable groups (2 warning-level).

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

D31 · IaC & Container Security9.1 / 10Exemplary✓ Tool-verified

What it measures: Whether Dockerfiles / Terraform / Kubernetes config follow security best practices.

Method: IaC/container misconfiguration scan via trivy config (Dockerfile/Terraform/K8s/Helm/CloudFormation); severity rules to 0-10 moderate normalizer. NotApplicable without manifests. Exhaustive, deterministic.

Maturity: DocumentedVerifiedPrevented · effective 9.1 / 10 · rule-coverage 100% · ceiling Documented

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

High IaC: DS-0002 · ×2Dockerfiledetected by trivy finding
Medium IaC: CKV_DOCKER_6 · ×2Dockerfile:9detected by trivy finding
Low IaC: DS-0001 · ×3.devcontainer/Dockerfiledetected by trivy finding

✓ On the Gold path — maintain.

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

D34 · Knowledge Freshness7.2 / 10Strong✓ 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: DocumentedVerifiedPrevented · effective 7.2 / 10 · rule-coverage 100% · ceiling Documented

732 of 2878 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is Algorithm.CSharp/StressSymbols.cs.

Orphaned knowledge · ×18Algorithm.CSharp/StressSymbols.cs
Further orphaned files (smaller)

What to do

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

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

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

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

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

Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling; coupling through a build step, config, or non-source file isn't seen.

Maturity: DocumentedVerifiedPrevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: BlackLittermanOptimizationPortfolioConstructionModel.py↔MeanVarianceOptimizationPortfolioConstructionModel.py 60%

Change coupling: BlackLittermanOptimizationPortfolioConstructionModel.py ↔ MeanVarianceOptimizationPortfolioConstructionModel.pyAlgorithm.Framework/Portfolio/BlackLittermanOptimizationPortfolioConstructionModel.py

✓ On the Gold path — maintain.

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

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

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

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

Maturity: DocumentedVerifiedPrevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

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

Unpinned build actions
Workflow token permissions not restricted
No build provenance
No artifact signing
No SBOM

What to do

  1. Resolve the 1 Unpinned build actions finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 Workflow token permissions not restricted finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 No build provenance 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.

D39 · IL Efficiency9.8 / 10Exemplary✓ Tool-verified

Method: IL instruction count per method, read from the BUILT first-party assemblies via Mono.Cecil (the target is compiled on a deep run); scored on the fraction of methods whose emitted IL body exceeds the size threshold. Sees compiler-generated bloat source can't; not-applicable when the target fails to build. Deterministic.

Maturity: DocumentedVerifiedPrevented · effective 9.8 / 10 · rule-coverage 100% · ceiling Verified

117 of 11377 first-party methods have an oversized IL body.

IL efficiency: 117 authored method(s) exceed the IL budgetAlgorithm.CSharp/CapacityTests/EmaPortfolioRebalance100.cs:33

✓ On the Gold path — maintain.

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

Frontend & cross-cutting dimensions

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

AX10 · Code composition9.0 / 10Strong✓ Tool-verified

Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified.

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

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

What to do

  • The domain core is a small share of production code — check that business logic isn't leaking into the application/infrastructure layers (a thin domain is the anemic-domain smell).
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.

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

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

Method: Roslyn scan: public interface member counts; fat-interface threshold (over 15 members) flagged per type. Deterministic, type-level.

  • `IResultHandler` declares 21 members. 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. — IResultHandler.cs:34
  • `IBrokerageModel` declares 18 members. 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. — IBrokerageModel.cs:34
  • `IAlgorithm` declares 124 members. 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. — IAlgorithm.cs:52
  • `IAlgorithmSettings` declares 19 members. 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. — IAlgorithmSettings.cs:24
  • `IApi` declares 57 members. 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. — IApi.cs:31
  • `IBrokerage` declares 23 members. 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. — IBrokerage.cs:29

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 Retention9.0 / 10Exemplary✓ Tool-verified

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

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

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

What to do

  • Complete the data-lifecycle story: an expiry limit (a declared maximum age for the stored data — a retention-age setting, or a store-level TTL where your storage offers one), a scheduled purge/cleanup job that enforces it, and a documented retention period covering the personal data.
GD1 · Unfinished & placeholder code9.9 / 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. (×25) — DataManager.cs:194, AuxiliaryDataEnumerator.cs:135, EnqueueableEnumerator.cs:179, …

What to do

  • Finish or delete NotImplementedException stubs and replace placeholder literals before shipping.
IC1 · Incompleteness & stubs7.5 / 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, skeleton types), not keyword-gated. Deterministic, code-shape heuristic.

  • `GetAlphaWeight` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — AlphaStreamsPortfolioConstructionModel.cs:32
  • `CanConvert` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. (×3) — DefaultConverter.cs:55, SymbolValueJsonConverter.cs:65, NullStringValueConverter.cs:66
  • `ReadJson` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — SymbolValueJsonConverter.cs:53
  • `WriteJson` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. (×3) — NullStringValueConverter.cs:35, NullResultValueTypeJsonConverter.cs:114, OrderTypeNormalizingJsonConverter.cs:74
  • A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers). (×21) — AddUniverseSelectionModelCoarseAlgorithm.cs:42, AlgorithmModeAndDeploymentTargetAlgorithm.cs:51, AlgorithmModeAndDeploymentTargetAlgorithm.cs:52, …
  • `Rebalance` has an empty body — confirm it's an intentional no-op and not an unfinished method. — ScheduledEventsBenchmark.cs:38

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)7.0 / 10Strong✓ Tool-verified

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

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

What to do

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

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

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

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

What to do

  • Record significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree with `NNNN-title.md` names is the most discoverable form).
M3 · Folder & project structure8.0 / 10Strong✓ Tool-verified

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

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

  • Production code isn't grouped under a src/ folder — application code, tests and tooling are mixed at the repository root.

What to do

  • Group production code under src/ (or split deliberately, e.g. backend/ + frontend/) so production and tooling code aren't mixed at the root.
M4 · Documentation accuracy10.0 / 10Exemplary◐ Sampled · advisory

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

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

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

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

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

P10 · Library API & versioning6.0 / 10Adequate✓ Tool-verified

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

Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries. Exhaustive, deterministic.

  • 3836/4082 types (94%) are public. For a library, every public type is a stability contract — make internal-by-default and expose only the intended API.

What to do

  • Make types internal by default; expose only the deliberate public API so internals can change without breaking consumers.
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.

What to do

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

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

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

What to do

  • Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.
PF1 · Benchmark discipline8.0 / 10Strong✓ Tool-verified

Readiness · Performance — Whether the library 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 — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.

PF2 · Allocation hygiene6.0 / 10Adequate✓ Tool-verified

Readiness · Performance — Whether the code is written to minimise allocations so it doesn't pressure its host's memory manager — buffer/slice views over copies, object pooling, stack or value-type allocation, and buffer writers. Reward-only: credited where present, never penalised where a simpler style is fine.

Method: Production-source scan: density (per 1k LoC) of allocation-aware APIs — Span/Memory, ArrayPool/ObjectPool, stackalloc, ValueTask, value-type structs, IBufferWriter, string.Create, SkipLocalsInit. Reward-only. Deterministic, syntax/text detection.

What to do

  • Raise allocation-aware density on the hot paths — currently 9 use(s) across 477,033 production line(s) (~0.0/1k). More Span/Memory, pooling (ArrayPool/ObjectPool), stackalloc and ValueTask on the allocation-heavy paths climbs this toward 10.
PF3 · Async & latency hygiene6.0 / 10Adequate✓ Tool-verified

Readiness · Performance — Whether asynchronous code keeps its host responsive — a library awaits with ConfigureAwait(false) (so it never captures and stalls the host's context) and avoids sync-over-async blocking (.Wait()/.GetAwaiter().GetResult()) that wastes threads and risks deadlock.

Method: Production-source scan: sync-over-async blocking (.Wait()/.GetAwaiter().GetResult()) counted everywhere, and — for a library with ≥5 awaits — the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.

  • 10 blocking call(s) on async work (.Wait()/.GetAwaiter().GetResult()) — these waste a thread and can deadlock in a consumer with a synchronization context.

What to do

  • Make the call chain async end-to-end and await it — never block on a Task with .Wait()/.GetAwaiter().GetResult() in library code.
S1 · Cryptographic Hygiene8.0 / 10Strong✓ Tool-verified

Other · Security — Cryptographic hygiene (weak hash/cipher, password key-derivation). This codebase has no web surface, so transport/header/cookie/CSRF controls are N/A and only crypto is scored.

Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. Deterministic.

  • MD5/SHA1 is constructed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ for content integrity, or a KDF (PBKDF2/Argon2/BCrypt) for password storage. If it only derives a non-security identifier (a cache key, a file or mutex name), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as `System.IO.Hashing.XxHash64`/`Crc32` says it in code — since the algorithm alone cannot distinguish the two uses. — Extensions.cs:2427

What to do

  • Review each MD5/SHA1 use by what it protects: replace it with SHA-256+ (or a KDF for passwords) where the digest is security-relevant, and switch it to a non-cryptographic hash (`System.IO.Hashing.XxHash64`/`Crc32`) where it only derives an identifier such as a cache key or a mutex name.
X1 · Async correctness1.6 / 10Critical✓ Tool-verified

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

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

  • Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process. (×7) — LeanDataWriter.cs:184, Extensions.cs:3460, Extensions.cs:3470, …

What to do

  • Sync-over-async (deadlock risk)
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.

  • Only 0/7 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. (×6) — Compression.cs:251, Compression.cs:313, Compression.cs:327, …
  • No CancellationToken parameter — the body observes an ambient token instead (a field or a context object), so the work does stop on cancellation, but a caller cannot cancel this call independently of the owner that created that token. — ApiConnection.cs:234

What to do

  • Thread a CancellationToken through async methods so work stops promptly on cancellation.
X3 · Exception handling7.4 / 10Strong✓ Tool-verified

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

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

  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×7) — HistoryProviderManager.cs:171, CurrencyPairUtil.cs:56, DateTimeJsonConverter.cs:91, …
  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. On a teardown path letting it propagate is not an option (throwing out of `Dispose()` masks the failure already in flight and abandons the rest of the cleanup), so make the swallow deliberate instead: narrow the catch to the exception this release can actually raise, and record it through whatever this codebase already uses to report problems — or, if it truly cannot matter, say why in a comment on the catch. — WebSocketClientWrapper.cs:130

What to do

  • Swallowed exception (empty catch)
X5 · Nullable reference types2.4 / 10Critical✓ 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.

  • 1/22 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.

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 Health43%Weak — gated by X1, X5Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture91%ExemplaryStrongest area.
Maturity61%Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness60%AdequateAcceptable, with room to improve.
Security41%Weak — gated by D28, D29, D36, C1Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance65%AdequateAcceptable, with room to improve.
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 user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
  • AC2 Forms & labels — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
  • AC3 Page structure — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
  • AC4 Keyboard semantics — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
  • AC5 ARIA correctness — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
  • AC6 Visual & motion safety — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
  • AC7 A11y enforcement — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
  • AX1 Captive dependencies — no DI registrations detected
  • AX2 Stateful singletons — no singleton implementations detected
  • AX4 Dependency direction — not applicable to a CQRS architecture (the inward-dependency rule is for layered/clean styles)
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • 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.
  • 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.
  • D11 Test Reliability — Test runner surfaced no tests
  • D19 Documentation Quality — LLM evaluation failed
  • D22 Internal API Consistency — No exposed public API
  • D23 Boundary Type-Coupling — Bounded contexts not declared
  • D25 ADR Conformance — no ADRs to check
  • D32 Data Compliance (PII/GDPR) — No PII/GDPR-handling patterns detected (p/gdpr ruleset) — no data-compliance surface to assess.
  • D33 JS/npm Dependency Vulnerabilities — No JS/npm manifest or lockfile found outside build output (package.json, package-lock.json, yarn.lock, pnpm-lock.yaml, bun.lockb); no JS dependencies to scan.
  • 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.
  • D38 OSV Dependency Vulnerabilities — No supported non-.NET dependency lockfile found outside build output (npm package-lock/yarn/pnpm/bun, Go go.mod, Rust Cargo.lock, Maven pom.xml, Gradle lockfiles, Python requirements.txt/poetry.lock/Pipfile.lock/pdm.lock, PHP composer.lock, Ruby Gemfile.lock, Elixir mix.lock, Dart pubspec.lock, Swift Package.resolved); nothing for OSV to scan. A NuGet-only repo stays NotApplicable — .NET CVEs are D30's domain.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D7 Architectural Integrity — no checkable ADRs and no dependency cycles — architectural integrity not assessed
  • D8 Code Coverage — Coverage not measured — test suite did not build
  • DM1 Domain Modelling — not scored — this repository shows none of the 3 signals this check looks for
  • ED1 Event-Driven — applicable but not scored (2 of 3 signals for this style — below the bar we score at): a message-bus package; 2 CQRS handler(s)
  • 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 check looks for
  • P12 CI test-gate honesty — 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.
  • 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.
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
  • P6 Release Hygiene — not evidenced — no changelog, version stamp or semver release tag in the repo
  • 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 — no coverage report found on disk — produce a coverage report in a standard format (Cobertura — `dotnet test --collect:"XPlat Code Coverage"` with a `coverlet.collector` PackageReference) into the repo working tree before the scan — a CI step is the usual place, since the artefact is commonly gitignored, or wire coverage collection into CI, to enable this cross-layer check
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X6 Hand-rolled structured-format parsing — Reported, not scored — this card publishes what it found rather than grading it. Its content is the findings and the key metric above.
  • X7 Silent fallback defaults — Reported, not scored — this card publishes what it found rather than grading it. Its content is the findings and the key metric above.

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.

Issue — 55 finding(s)
D34 · Knowledge Freshness · Orphaned knowledge · ×18
  • Orphaned knowledge Algorithm.CSharp/StressSymbols.cs — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge Common/Data/Fundamental/Generated/IncomeStatement.cs — No living knowledge remains for this large file — its last meaningful change has decayed away. It is machine-generated, though, so the knowledge that decayed is the GENERATOR's: a read-through of this file teaches only what its inputs already say, and a test written against it is overwritten the next time it is regenerated. Schedule the read-through against the generator and the sources it reads instead, and keep this file out of review.
  • Orphaned knowledge Algorithm/CandlestickPatterns.cs — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge Common/Data/Fundamental/AssetClassificationHelper.cs — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge Common/Symbol.cs — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge Common/Time.cs — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge Common/Algorithm/Framework/Alphas/Insight.cs — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge Algorithm.CSharp/OrderTicketDemoAlgorithm.cs — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge Common/Securities/Option/StrategyMatcher/OptionPositionCollection.cs — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge Brokerages/Backtesting/BacktestingBrokerage.cs — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge Common/Data/Custom/Intrinio/EconomicDataSources.cs — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge Algorithm.CSharp/OpeningBreakoutAlgorithm.cs — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge Common/Statistics/StatisticsBuilder.cs — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge Common/Data/SubscriptionDataConfig.cs — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge Report/PortfolioLooper/PortfolioLooper.cs — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge Common/Securities/LocalMarketHours.cs — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge Engine/Results/RegressionResultHandler.cs — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge Common/Data/BaseData.cs — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
D17 · Explicit Debt · EmptyCatchBlock · ×8
  • EmptyCatchBlock Algorithm.CSharp/BubbleAlgorithm.cs:276 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Narrow the catch to the exception you actually expect, record it through whatever this codebase already uses to report problems, or — where swallowing really is correct, as it often is on a teardown/dispose path where throwing would mask the original failure — write down WHY in a comment on the catch. The comment has to give the reason: a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all and leaves this row in place. Any of the three makes the decision reviewable; all three clear this row.
  • EmptyCatchBlock Algorithm.CSharp/CustomDataNIFTYAlgorithm.cs:192 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Narrow the catch to the exception you actually expect, record it through whatever this codebase already uses to report problems, or — where swallowing really is correct, as it often is on a teardown/dispose path where throwing would mask the original failure — write down WHY in a comment on the catch. The comment has to give the reason: a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all and leaves this row in place. Any of the three makes the decision reviewable; all three clear this row.
  • EmptyCatchBlock Algorithm.CSharp/CustomDataNIFTYAlgorithm.cs:256 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Narrow the catch to the exception you actually expect, record it through whatever this codebase already uses to report problems, or — where swallowing really is correct, as it often is on a teardown/dispose path where throwing would mask the original failure — write down WHY in a comment on the catch. The comment has to give the reason: a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all and leaves this row in place. Any of the three makes the decision reviewable; all three clear this row.
  • EmptyCatchBlock Brokerages/WebSocketClientWrapper.cs:130 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Narrow the catch to the exception you actually expect, record it through whatever this codebase already uses to report problems, or — where swallowing really is correct, as it often is on a teardown/dispose path where throwing would mask the original failure — write down WHY in a comment on the catch. The comment has to give the reason: a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all and leaves this row in place. Any of the three makes the decision reviewable; all three clear this row.
  • EmptyCatchBlock Common/Util/CurrencyPairUtil.cs:56 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Narrow the catch to the exception you actually expect, record it through whatever this codebase already uses to report problems, or — where swallowing really is correct, as it often is on a teardown/dispose path where throwing would mask the original failure — write down WHY in a comment on the catch. The comment has to give the reason: a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all and leaves this row in place. Any of the three makes the decision reviewable; all three clear this row.
  • EmptyCatchBlock Common/Util/DateTimeJsonConverter.cs:91 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Narrow the catch to the exception you actually expect, record it through whatever this codebase already uses to report problems, or — where swallowing really is correct, as it often is on a teardown/dispose path where throwing would mask the original failure — write down WHY in a comment on the catch. The comment has to give the reason: a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all and leaves this row in place. Any of the three makes the decision reviewable; all three clear this row.
  • EmptyCatchBlock Engine/HistoricalData/HistoryProviderManager.cs:171 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Narrow the catch to the exception you actually expect, record it through whatever this codebase already uses to report problems, or — where swallowing really is correct, as it often is on a teardown/dispose path where throwing would mask the original failure — write down WHY in a comment on the catch. The comment has to give the reason: a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all and leaves this row in place. Any of the three makes the decision reviewable; all three clear this row.
  • EmptyCatchBlock Logging/Log.cs:294 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Narrow the catch to the exception you actually expect, record it through whatever this codebase already uses to report problems, or — where swallowing really is correct, as it often is on a teardown/dispose path where throwing would mask the original failure — write down WHY in a comment on the catch. The comment has to give the reason: a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all and leaves this row in place. Any of the three makes the decision reviewable; all three clear this row.
D28 · Secrets (history) · Secret · ×6
  • Secret: generic-api-key Algorithm.CSharp/CustomDataAutomaticSeedRegressionAlgorithm.cs:176 — matched rule 'generic-api-key'
  • Secret: generic-api-key Algorithm.CSharp/CustomDataRegressionAlgorithm.cs:223 — matched rule 'generic-api-key'
  • Secret: generic-api-key Launcher/config.json:150 — matched rule 'generic-api-key'
  • Secret: generic-api-key Launcher/config.json:160 — matched rule 'generic-api-key'
  • Secret: generic-api-key QuantConnect.ToolBox/OandaDownloader/config.json:7 — matched rule 'generic-api-key'
  • Secret: generic-api-key QuantConnect.OandaDownloader/config.json:7 — matched rule 'generic-api-key'
D29 · Static Analysis (SAST) · High · ×6
  • High: github-actions-mutable-action-tag .github/workflows/benchmarks.yml:23 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v2`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v2 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/benchmarks.yml:26 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v2`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v2 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/gh-actions.yml:25 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v2`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v2 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/rebase-org-branches.yml:15 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v2`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v2 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/report-generator.yml:22 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v2`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v2 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/virtual-environments.yml:22 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v2`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v2 --jq .sha`.
D10 · Test Quality · No assertions (empty test) · ×4
  • No assertions (empty test): ComparesAgainstExternalData Tests/Indicators/OptionBaseIndicatorTests.cs:442 — Test method has an empty body — it asserts nothing and exercises no code.
  • No assertions (empty test): ComparesAgainstExternalDataAfterReset Tests/Indicators/OptionBaseIndicatorTests.cs:448 — Test method has an empty body — it asserts nothing and exercises no code.
  • No assertions (empty test): AcceptsRenkoBarsAsInput Tests/Indicators/PythonIndicatorTests.cs:503 — Test method has an empty body — it asserts nothing and exercises no code.
  • No assertions (empty test): AcceptsVolumeRenkoBarsAsInput Tests/Indicators/PythonIndicatorTests.cs:512 — Test method has an empty body — it asserts nothing and exercises no code.
D17 · Explicit Debt · NoWarnInCsproj · ×4
  • NoWarnInCsproj Tests/QuantConnect.Tests.csproj:15 — CA1707 — 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 Tests/QuantConnect.Tests.csproj:15 — IDE0066 — 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 Algorithm.CSharp/QuantConnect.Algorithm.CSharp.csproj:13 — 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.
  • NoWarnInCsproj Algorithm.CSharp/QuantConnect.Algorithm.CSharp.csproj:13 — CA1002 — 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.
D30 · Dependency Vulnerabilities · High CVE · ×4
  • High CVE: DotNetZip 1.16.0 — DotNetZip 1.16.0 (transitive) has a High advisory; affects 20 projects — one upgrade fixes all. https://github.com/advisories/[GHSA redacted]
  • High CVE: System.Net.Http.WinHttpHandler 4.4.0 — System.Net.Http.WinHttpHandler 4.4.0 (transitive) has a High advisory; affects 4 projects — one upgrade fixes all. https://github.com/advisories/[GHSA redacted]
  • High CVE: System.Private.ServiceModel 4.4.0 — System.Private.ServiceModel 4.4.0 (transitive) has a High advisory; affects 4 projects — one upgrade fixes all. https://github.com/advisories/[GHSA redacted]
  • High CVE: System.ServiceModel.Primitives 4.4.0 — System.ServiceModel.Primitives 4.4.0 (transitive) has a High advisory; affects 4 projects — one upgrade fixes all. https://github.com/advisories/[GHSA redacted]
D31 · IaC & Container Security · High IaC · ×2
  • High IaC: DS-0002 Dockerfile — Image user should not be 'root' A container that starts as root runs your process with root's capabilities inside the namespace, so a compromise of the process starts from there. The step: create an unprivileged account in the image (`RUN useradd -r -M app` — or whatever this base image's account tooling is, `adduser` and `useradd` are not both present everywhere`), give it ownership of the paths the process writes at runtime (`COPY --chown=` on those layers, or a `RUN chown -R`), and end the final stage with `USER app` so it is the default at start. Build stages that only compile can stay root; it is the stage that RUNS that needs the account. If the process genuinely requires root — it manages the container runtime, ptraces another process or opens raw devices — say so here rather than making a change that breaks it.
  • High IaC: DS-0022 Dockerfile — Deprecated MAINTAINER used
D12 · Dependency Hygiene · Vulnerable · ×1
  • Vulnerable: DotNetZip — DotNetZip 1.16.0 — High severity. https://github.com/advisories/[GHSA redacted]
D17 · Explicit Debt · NoWarnInCsproj repeated across 20 files · ×1
  • NoWarnInCsproj repeated across 20 files ToolBox/QuantConnect.ToolBox.csproj:15 — The identical NoWarnInCsproj (`CA1062`) 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.)
D30 · Dependency Vulnerabilities · Critical CVE · ×1
  • Critical CVE: System.Drawing.Common 4.7.0 — System.Drawing.Common 4.7.0 (transitive) has a Critical advisory; affects 20 projects — one upgrade fixes all. https://github.com/advisories/[GHSA redacted]
Warning — 853 finding(s)
D17 · Explicit Debt · TodoComment · ×70
  • TodoComment Algorithm.CSharp/AddRemoveOptionUniverseRegressionAlgorithm.cs:74 — // TODO : In fact, we're unable to properly detect whether or not we auto-added or it was manually added — 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 Algorithm.CSharp/RegressionTests/Universes/ETFConstituentUniverseCompositeDelistingRegressionAlgorithm.cs:118 — // TODO: shouldn't be sending AAPL as a removed security since it was added by another universe — 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 Algorithm/QCAlgorithm.History.cs:963 — // TODO: This is a patch to fix the issue with the Slice.GetImpl method returning only the last tick — 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 Algorithm/QCAlgorithm.Python.cs:317 — // TODO: to be removed when https://github.com/QuantConnect/pythonnet/issues/62 is solved
  • TodoComment Algorithm/QCAlgorithm.Python.cs:680 — // TODO: to be removed when https://github.com/QuantConnect/pythonnet/issues/62 is solved
  • TodoComment Algorithm/QCAlgorithm.Python.cs:731 — // TODO: to be removed when https://github.com/QuantConnect/pythonnet/issues/62 is solved
  • TodoComment Algorithm/QCAlgorithm.Python.cs:746 — // TODO: to be removed when https://github.com/QuantConnect/pythonnet/issues/62 is solved
  • TodoComment Algorithm/QCAlgorithm.Python.cs:760 — // TODO: to be removed when https://github.com/QuantConnect/pythonnet/issues/62 is solved
  • TodoComment Algorithm/QCAlgorithm.Trading.cs:1058 — // todo: Left here for now but should review — 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 Brokerages/Backtesting/BacktestingBrokerage.cs:349 — // TODO : This check can be removed in April, 2019 -- a 6-month window to upgrade (also, suspect small % of users, if any are impacted) — 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 Common/Brokerages/BybitBrokerageModel.cs:108 — //todo default conversion? — 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 Common/Brokerages/dYdXBrokerageModel.cs:100 — //todo default conversion? — 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 Common/Data/Market/OptionContract.cs:305 — // TODO: Null check required for FOPs: since OptionUniverse does not support FOPs, — 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 Common/Data/UniverseSelection/ContinuousContractUniverse.cs:86 — // TODO: this won't work with async universe selection — 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 Common/Data/UniverseSelection/UniverseExtensions.cs:90 — // TODO looks like we can just replace this for Symbol.Create? — 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 Common/Extensions.cs:3899 — // TODO: see related issue https://github.com/QuantConnect/Lean/issues/6964 which would avoid the need for this
  • TodoComment Common/Orders/Fees/ExanteFeeModel.cs:125 — // ToDo: clarify the value for different exchanges — 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 Common/Orders/Fills/EquityFillModel.cs:417 — // TODO: Add separate DepthLimited fill partial order quantities based on tick quantity / bar.Volume available. — 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 Common/Orders/Fills/EquityFillModel.cs:436 — // TODO: Add separate DepthLimited fill partial order quantities based on tick quantity / bar.Volume available. — 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 Common/Orders/OptionExercise/DefaultExerciseModel.cs:58 — // TODO : Support Manual Exercise of OTM contracts [ inTheMoney = false ] — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment Common/Python/PandasData.cs:211 — // TODO field/property.GetValue is expensive — 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 Common/Securities/BuyingPowerModel.cs:512 — // TODO: Can this be smarter about its adjustment, instead of just stepping by lotsize? — 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 Common/Securities/BuyingPowerParameters.cs:61 — // TODO: Properly account for 'currency' - not accounted for currently as only performing mechanical refactoring — 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 Common/Securities/Cash.cs:270 — // TODO: remove once dydx SPOT market will be imlemented — 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 Common/Securities/Future/FuturesExpiryFunctions.cs:1699 — // TODO: Might need singapore calendar — 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.
  • + 45 more in this group — see findings.md.
D17 · Explicit Debt · ObsoleteWithCallers · ×55
  • ObsoleteWithCallers Algorithm.Framework/Selection/FundamentalUniverseSelectionModel.cs:121 — [Obsolete] .ctor
  • ObsoleteWithCallers Algorithm.Framework/Selection/FundamentalUniverseSelectionModel.cs:132 — [Obsolete] .ctor
  • ObsoleteWithCallers Common/Chart.cs:67 — [Obsolete] .ctor
  • ObsoleteWithCallers Algorithm.Framework/Selection/FundamentalUniverseSelectionModel.cs:226 — [Obsolete] SelectCoarse
  • ObsoleteWithCallers Algorithm.Framework/Selection/FundamentalUniverseSelectionModel.cs:244 — [Obsolete] SelectFine
  • ObsoleteWithCallers Algorithm/QCAlgorithm.History.cs:783 — [Obsolete] GetLastKnownPrice
  • ObsoleteWithCallers Algorithm/QCAlgorithm.History.cs:798 — [Obsolete] GetLastKnownPrice
  • ObsoleteWithCallers Algorithm/QCAlgorithm.Indicators.cs:62 — [Obsolete] EnableAutomaticIndicatorWarmUp
  • ObsoleteWithCallers Algorithm/QCAlgorithm.Trading.cs:1428 — [Obsolete] Liquidate
  • ObsoleteWithCallers Algorithm/QCAlgorithm.Universe.cs:460 — [Obsolete] AddUniverse
  • ObsoleteWithCallers Algorithm/QCAlgorithm.cs:488 — [Obsolete] OptionChainProvider
  • ObsoleteWithCallers Algorithm/QCAlgorithm.cs:497 — [Obsolete] FutureChainProvider
  • ObsoleteWithCallers Algorithm/QCAlgorithm.cs:1181 — [Obsolete] OnEndOfDay
  • ObsoleteWithCallers AlgorithmFactory/Python/Wrappers/AlgorithmPythonWrapper.cs:844 — [Obsolete] OnEndOfDay
  • ObsoleteWithCallers Common/Interfaces/IAlgorithm.cs:593 — [Obsolete] OnEndOfDay
  • ObsoleteWithCallers Api/ApiConnection.cs:46 — [Obsolete] Client
  • ObsoleteWithCallers Common/Algorithm/Framework/Alphas/Serialization/SerializedInsight.cs:49 — [Obsolete] GeneratedTime
  • ObsoleteWithCallers Common/Brokerages/BrokerageName.cs:69 — [Obsolete] GDAX
  • ObsoleteWithCallers Common/Brokerages/GDAXBrokerageModel.cs:23 — [Obsolete] GDAXBrokerageModel
  • ObsoleteWithCallers Common/Chart.cs:38 — [Obsolete] ChartType
  • ObsoleteWithCallers Common/Data/Custom/AlphaStreams/PlaceHolder.cs:23 — [Obsolete] PlaceHolder
  • ObsoleteWithCallers Common/Data/Custom/Tiingo/TiingoDailyData.cs:25 — [Obsolete] TiingoDailyData
  • ObsoleteWithCallers Common/Data/Fundamental/FundamentalUniverse.cs:27 — [Obsolete] Fundamentals
  • ObsoleteWithCallers Common/Data/Market/RenkoBar.cs:28 — [Obsolete] End
  • ObsoleteWithCallers Common/Data/UniverseSelection/ETFConstituentUniverse.cs:28 — [Obsolete] ETFConstituentData
  • + 30 more in this group — see findings.md.
D3 · God Classes · TooManyMethods · ×22
  • TooManyMethods: QCAlgorithm Algorithm/QCAlgorithm.Indicators.cs:0 — TooManyMethods — 5315 significant lines (blank, comment-only and punctuation-only lines excluded), 700 methods, declared across 9 files: Algorithm/QCAlgorithm.Indicators.cs (221), Algorithm/QCAlgorithm.cs (165), Algorithm/QCAlgorithm.Python.cs (92), Algorithm/QCAlgorithm.Trading.cs (75), +5 more file(s). 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: AlgorithmPythonWrapper AlgorithmFactory/Python/Wrappers/AlgorithmPythonWrapper.cs:0 — TooManyMethods — 338 significant lines (blank, comment-only and punctuation-only lines excluded), 82 methods. 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: Api Api/Api.cs:0 — TooManyMethods — 506 significant lines (blank, comment-only and punctuation-only lines excluded), 74 methods. 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: ConstituentUniverseDefinitions Algorithm/ConstituentUniverseDefinitions.cs:0 — TooManyMethods — 292 significant lines (blank, comment-only and punctuation-only lines excluded), 73 methods. 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: CandlestickPatterns Algorithm/CandlestickPatterns.cs:0 — TooManyMethods — 309 significant lines (blank, comment-only and punctuation-only lines excluded), 62 methods. 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: IndicatorBase Indicators/IndicatorBase.Operators.cs:0 — TooManyMethods — 176 significant lines (blank, comment-only and punctuation-only lines excluded), 58 methods, declared across 2 files: Indicators/IndicatorBase.Operators.cs (49), Indicators/IndicatorBase.cs (9). 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: Security Common/Securities/Security.cs:0 — TooManyMethods — 424 significant lines (blank, comment-only and punctuation-only lines excluded), 53 methods. 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: OptionFilterUniverse Common/Securities/Option/OptionFilterUniverse.cs:0 — TooManyMethods — 356 significant lines (blank, comment-only and punctuation-only lines excluded), 53 methods. 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: BaseResultsHandler Engine/Results/BaseResultsHandler.cs:0 — TooManyMethods — 435 significant lines (blank, comment-only and punctuation-only lines excluded), 52 methods. 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: LeanData Common/Util/LeanData.cs:0 — TooManyMethods — 807 significant lines (blank, comment-only and punctuation-only lines excluded), 51 methods. 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: BrokerageTransactionHandler Engine/TransactionHandlers/BrokerageTransactionHandler.cs:0 — TooManyMethods — 820 significant lines (blank, comment-only and punctuation-only lines excluded), 50 methods. 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: OptionStrategies Common/Securities/Option/OptionStrategies.cs:0 — TooManyMethods — 418 significant lines (blank, comment-only and punctuation-only lines excluded), 46 methods. 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: LiveTradingResultHandler Engine/Results/LiveTradingResultHandler.cs:0 — TooManyMethods — 566 significant lines (blank, comment-only and punctuation-only lines excluded), 41 methods. 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: Compression Compression/Compression.cs:0 — TooManyMethods — 380 significant lines (blank, comment-only and punctuation-only lines excluded), 41 methods. 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: DateRules Common/Scheduling/DateRules.cs:0 — TooManyMethods — 199 significant lines (blank, comment-only and punctuation-only lines excluded), 40 methods. 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: TradeBar Common/Data/Market/TradeBar.cs:0 — TooManyMethods — 312 significant lines (blank, comment-only and punctuation-only lines excluded), 39 methods. 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: Symbol Common/Symbol.cs:0 — TooManyMethods — 297 significant lines (blank, comment-only and punctuation-only lines excluded), 39 methods. 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: QuantBook Research/QuantBook.cs:0 — TooManyMethods — 480 significant lines (blank, comment-only and punctuation-only lines excluded), 38 methods. 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: SecurityIdentifier Common/SecurityIdentifier.cs:0 — TooManyMethods — 385 significant lines (blank, comment-only and punctuation-only lines excluded), 38 methods. 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: Time Common/Time.cs:0 — TooManyMethods — 234 significant lines (blank, comment-only and punctuation-only lines excluded), 34 methods. 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: SecurityTransactionManager Common/Securities/SecurityTransactionManager.cs:0 — TooManyMethods — 163 significant lines (blank, comment-only and punctuation-only lines excluded), 34 methods. 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: Brokerage Brokerages/Brokerage.cs:0 — TooManyMethods — 265 significant lines (blank, comment-only and punctuation-only lines excluded), 33 methods. 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.
D17 · Explicit Debt · BarePragmaDisable · ×20
  • BarePragmaDisable AlgorithmFactory/Loader.cs:385 — #pragma warning disable CS1574 — the disable has no matching restore, 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. Close it with the matching restore directive immediately after the construct it covers, or fix the cause and drop the directive entirely.
  • BarePragmaDisable Common/CapacityEstimate.cs:115 — #pragma warning disable CS1574 — the disable has no matching restore, 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. Close it with the matching restore directive immediately after the construct it covers, or fix the cause and drop the directive entirely.
  • BarePragmaDisable Common/Interfaces/IApi.cs:204 — #pragma warning disable CS1574 — the disable has no matching restore, 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. Close it with the matching restore directive immediately after the construct it covers, or fix the cause and drop the directive entirely.
  • BarePragmaDisable Common/Interfaces/IApi.cs:230 — #pragma warning disable CS1574 — the disable has no matching restore, 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. Close it with the matching restore directive immediately after the construct it covers, or fix the cause and drop the directive entirely.
  • BarePragmaDisable Common/Interfaces/IRegressionResearchDefinition.cs:23 — #pragma warning disable CS1574 — the disable has no matching restore, 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. Close it with the matching restore directive immediately after the construct it covers, or fix the cause and drop the directive entirely.
  • BarePragmaDisable Common/Optimizer/Parameters/OptimizationStepParameter.cs:44 — #pragma warning disable CS1574 — the disable has no matching restore, 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. Close it with the matching restore directive immediately after the construct it covers, or fix the cause and drop the directive entirely.
  • BarePragmaDisable Common/Brokerages/CoinbaseBrokerageModel.cs:234 — #pragma warning disable CA1062 — the disable has no matching restore, 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. Close it with the matching restore directive immediately after the construct it covers, or fix the cause and drop the directive entirely.
  • BarePragmaDisable Common/Data/DataQueueHandlerSubscriptionManager.cs:113 — #pragma warning disable CA1309 — the disable has no matching restore, 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. Close it with the matching restore directive immediately after the construct it covers, or fix the cause and drop the directive entirely.
  • BarePragmaDisable Common/Data/Fundamental/AssetClassificationHelper.cs:79 — #pragma warning disable 1591 — the disable has no matching restore, 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. Close it with the matching restore directive immediately after the construct it covers, or fix the cause and drop the directive entirely.
  • BarePragmaDisable Messaging/EventMessagingHandler.cs:71 — #pragma warning disable 1591 — the disable has no matching restore, 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. Close it with the matching restore directive immediately after the construct it covers, or fix the cause and drop the directive entirely.
  • BarePragmaDisable Common/Data/Fundamental/FundamentalProperty.cs:24 — #pragma warning disable CS1591, CA1707 — the disable has no matching restore, 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. Close it with the matching restore directive immediately after the construct it covers, or fix the cause and drop the directive entirely.
  • BarePragmaDisable Common/Orders/Fees/InteractiveBrokersFeeModel.cs:35 — #pragma warning disable CS1570 — the disable has no matching restore, 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. Close it with the matching restore directive immediately after the construct it covers, or fix the cause and drop the directive entirely.
  • BarePragmaDisable Common/Securities/Future/Futures.cs:1434 — #pragma warning disable CS1570 — the disable has no matching restore, 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. Close it with the matching restore directive immediately after the construct it covers, or fix the cause and drop the directive entirely.
  • BarePragmaDisable Common/Securities/Future/Futures.cs:1478 — #pragma warning disable CS1570 — the disable has no matching restore, 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. Close it with the matching restore directive immediately after the construct it covers, or fix the cause and drop the directive entirely.
  • BarePragmaDisable Tests/Common/Data/SliceTests.cs:789 — #pragma warning disable CA1829 — the disable has no matching restore, 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. Close it with the matching restore directive immediately after the construct it covers, or fix the cause and drop the directive entirely.
  • BarePragmaDisable Tests/Common/Orders/Fills/PartialMarketFillModelTests.cs:104 — # pragma warning disable CA2000 — the disable has no matching restore, 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. Close it with the matching restore directive immediately after the construct it covers, or fix the cause and drop the directive entirely.
  • BarePragmaDisable Tests/Engine/DataFeeds/SubscriptionCollectionTests.cs:411 — # pragma warning disable CA2000 — the disable has no matching restore, 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. Close it with the matching restore directive immediately after the construct it covers, or fix the cause and drop the directive entirely.
  • BarePragmaDisable Tests/Engine/DataFeeds/SubscriptionSynchronizerTests.cs:98 — # pragma warning disable CA2000 — the disable has no matching restore, 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. Close it with the matching restore directive immediately after the construct it covers, or fix the cause and drop the directive entirely.
  • BarePragmaDisable Tests/Engine/DataFeeds/SubscriptionTests.cs:185 — # pragma warning disable CA2000 — the disable has no matching restore, 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. Close it with the matching restore directive immediately after the construct it covers, or fix the cause and drop the directive entirely.
  • BarePragmaDisable Tests/Engine/DataProviders/ApiDataProviderTests.cs:172 — # pragma warning disable CA2000 — the disable has no matching restore, 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. Close it with the matching restore directive immediately after the construct it covers, or fix the cause and drop the directive entirely.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×20
  • Duplicated block (10 lines × 2) Common/Data/Auxiliary/CorporateFactorProvider.cs:113 — Common/Data/Auxiliary/CorporateFactorProvider.cs:113-122 | Common/Data/Auxiliary/CorporateFactorProvider.cs:150-159 — both copies are in the same file, so extract the 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 `Common/Data/Auxiliary/CorporateFactorProvider.cs:113` 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) Common/Util/LeanData.cs:116 — Common/Util/LeanData.cs:116-125 | Common/Util/LeanData.cs:132-141 — both copies are in the same file, so extract the 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 `Common/Util/LeanData.cs:116` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) Indicators/CandlestickPatterns/Hikkake.cs:79 — Indicators/CandlestickPatterns/Hikkake.cs:79-88 | Indicators/CandlestickPatterns/Hikkake.cs:109-118 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/Hikkake.cs:79` 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) Indicators/CandlestickPatterns/InvertedHammer.cs:119 — Indicators/CandlestickPatterns/InvertedHammer.cs:119-128 | Indicators/CandlestickPatterns/ShootingStar.cs:120-129 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) Algorithm.CSharp/AddAlphaModelAlgorithm.cs:50 — Algorithm.CSharp/AddAlphaModelAlgorithm.cs:50-59 | Algorithm.CSharp/InsightTagAlphaRegressionAlgorithm.cs:48-58 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
  • Duplicated block (10 lines × 2) Algorithm.CSharp/AutomaticIndicatorWarmupDataTypeRegressionAlgorithm.cs:44 — Algorithm.CSharp/AutomaticIndicatorWarmupDataTypeRegressionAlgorithm.cs:44-53 | Algorithm.CSharp/AutomaticIndicatorWarmupDataTypeRegressionAlgorithm.cs:71-81 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) Algorithm.CSharp/BasicTemplateOptionsAlgorithm.cs:41 — Algorithm.CSharp/BasicTemplateOptionsAlgorithm.cs:41-51 | Algorithm.CSharp/NonDynamicOptionsFilterRegressionAlgorithm.cs:38-47 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/BasicTemplateOptionsAlgorithm.cs:41` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (10 lines × 2) Algorithm.CSharp/CoarseFineFundamentalComboAlgorithm.cs:112 — Algorithm.CSharp/CoarseFineFundamentalComboAlgorithm.cs:112-121 | Algorithm.CSharp/CoarseFineFundamentalRegressionAlgorithm.cs:136-145 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/CoarseFineFundamentalComboAlgorithm.cs:112` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) Algorithm.CSharp/CoveredCallComboLimitOrderAlgorithm.cs:37 — Algorithm.CSharp/CoveredCallComboLimitOrderAlgorithm.cs:37-46 | Algorithm.CSharp/OptionEquityBaseStrategyRegressionAlgorithm.cs:36-46 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/CoveredCallComboLimitOrderAlgorithm.cs:37` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (10 lines × 2) Algorithm.CSharp/FutureOptionCallITMExpiryRegressionAlgorithm.cs:115 — Algorithm.CSharp/FutureOptionCallITMExpiryRegressionAlgorithm.cs:115-124 | Algorithm.CSharp/FutureOptionPutITMExpiryRegressionAlgorithm.cs:116-125 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/FutureOptionCallITMExpiryRegressionAlgorithm.cs:115` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) Algorithm.CSharp/IndexOptionCallITMExpiryRegressionAlgorithm.cs:113 — Algorithm.CSharp/IndexOptionCallITMExpiryRegressionAlgorithm.cs:113-122 | Algorithm.CSharp/IndexOptionPutITMExpiryRegressionAlgorithm.cs:110-119 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/IndexOptionCallITMExpiryRegressionAlgorithm.cs:113` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) Algorithm.CSharp/NakedShortOptionStrategyOverMarginAlgorithm.cs:45 — Algorithm.CSharp/NakedShortOptionStrategyOverMarginAlgorithm.cs:45-54 | Algorithm.CSharp/OptionStrategyFactoryMethodsBaseAlgorithm.cs:41-50 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
  • Duplicated block (10 lines × 2) Algorithm.CSharp/OptionEquityBearCallLadderRegressionAlgorithm.cs:54 — Algorithm.CSharp/OptionEquityBearCallLadderRegressionAlgorithm.cs:54-63 | Algorithm.CSharp/OptionEquityBullPutLadderRegressionAlgorithm.cs:54-63 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
  • Duplicated block (10 lines × 2) Algorithm.CSharp/OptionEquityBearPutLadderRegressionAlgorithm.cs:55 — Algorithm.CSharp/OptionEquityBearPutLadderRegressionAlgorithm.cs:55-64 | Algorithm.CSharp/OptionEquityBullCallLadderRegressionAlgorithm.cs:55-64 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
  • Duplicated block (10 lines × 2) Algorithm.CSharp/OptionEquityBearPutSpreadRegressionAlgorithm.cs:36 — Algorithm.CSharp/OptionEquityBearPutSpreadRegressionAlgorithm.cs:36-45 | Algorithm.CSharp/OptionEquityBullPutSpreadRegressionAlgorithm.cs:36-45 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/OptionEquityBearPutSpreadRegressionAlgorithm.cs:36` 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) Algorithm.CSharp/OptionEquityCallCalendarSpreadRegressionAlgorithm.cs:44 — Algorithm.CSharp/OptionEquityCallCalendarSpreadRegressionAlgorithm.cs:44-53 | Algorithm.CSharp/OptionEquityPutCalendarSpreadRegressionAlgorithm.cs:44-53 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/OptionEquityCallCalendarSpreadRegressionAlgorithm.cs:44` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) Algorithm.CSharp/RiskParityPortfolioAlgorithm.cs:32 — Algorithm.CSharp/RiskParityPortfolioAlgorithm.cs:32-41 | Algorithm.CSharp/RiskParityPortfolioWeightsCheckAlgorithm.cs:35-44 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/RiskParityPortfolioAlgorithm.cs:32` 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) Algorithm.CSharp/SectorExposureRiskFrameworkAlgorithm.cs:37 — Algorithm.CSharp/SectorExposureRiskFrameworkAlgorithm.cs:37-46 | Algorithm.CSharp/SectorWeightingFrameworkAlgorithm.cs:39-48 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/SectorExposureRiskFrameworkAlgorithm.cs:37` 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) Algorithm.CSharp/StandardDeviationExecutionModelRegressionAlgorithm.cs:35 — Algorithm.CSharp/StandardDeviationExecutionModelRegressionAlgorithm.cs:35-44 | Algorithm.CSharp/VolumeWeightedAveragePriceExecutionModelRegressionAlgorithm.cs:36-45 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/StandardDeviationExecutionModelRegressionAlgorithm.cs:35` 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) Report/ReportElements/LeverageUtilizationReportElement.cs:64 — Report/ReportElements/LeverageUtilizationReportElement.cs:64-73 | Report/ReportElements/RollingSharpeReportElement.cs:65-74 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Report/ReportElements/LeverageUtilizationReportElement.cs:64` 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 lines × 2) · ×19
  • Duplicated block (11 lines × 2) Common/Brokerages/AlpacaBrokerageModel.cs:86 — Common/Brokerages/AlpacaBrokerageModel.cs:86-96 | Common/Brokerages/WebullBrokerageModel.cs:105-115 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Common/Brokerages/AlpacaBrokerageModel.cs:86` 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) Common/Brokerages/BloombergFixBrokerageModel.cs:65 — Common/Brokerages/BloombergFixBrokerageModel.cs:65-75 | Common/Brokerages/TerminalLinkBrokerageModel.cs:59-69 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Common/Brokerages/BloombergFixBrokerageModel.cs:65` 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) Common/Brokerages/SamcoBrokerageModel.cs:165 — Common/Brokerages/SamcoBrokerageModel.cs:165-175 | Common/Brokerages/ZerodhaBrokerageModel.cs:161-171 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
  • Duplicated block (11 lines × 2) Common/Orders/Fills/EquityFillModel.cs:785 — Common/Orders/Fills/EquityFillModel.cs:785-795 | Common/Orders/Fills/EquityFillModel.cs:894-904 — both copies are in the same file, so extract the 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 `Common/Orders/Fills/EquityFillModel.cs:785` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) Common/Orders/Fills/FillModel.cs:854 — Common/Orders/Fills/FillModel.cs:854-864 | Common/Orders/Fills/FillModel.cs:913-923 — both copies are in the same file, so extract the 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 `Common/Orders/Fills/FillModel.cs:854` 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) Indicators/CandlestickPatterns/HikkakeModified.cs:101 — Indicators/CandlestickPatterns/HikkakeModified.cs:101-111 | Indicators/CandlestickPatterns/HikkakeModified.cs:146-156 — both copies are in the same file, so extract the 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 `Indicators/CandlestickPatterns/HikkakeModified.cs:101` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) Indicators/CandlestickPatterns/MatHold.cs:107 — Indicators/CandlestickPatterns/MatHold.cs:107-117 | Indicators/CandlestickPatterns/RiseFallThreeMethods.cs:90-100 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/MatHold.cs:107` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) Indicators/Rho.cs:219 — Indicators/Rho.cs:219-229 | Indicators/Vega.cs:219-229 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/Rho.cs:219` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) Algorithm.CSharp/AddUniverseSelectionModelAlgorithm.cs:36 — Algorithm.CSharp/AddUniverseSelectionModelAlgorithm.cs:36-46 | Algorithm.CSharp/AddUniverseSelectionModelCoarseAlgorithm.cs:36-50 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/AddUniverseSelectionModelAlgorithm.cs:36` 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) Algorithm.CSharp/BasicTemplateContinuousFutureAlgorithm.cs:77 — Algorithm.CSharp/BasicTemplateContinuousFutureAlgorithm.cs:77-87 | Algorithm.CSharp/BasicTemplateContinuousFutureWithExtendedMarketAlgorithm.cs:88-98 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/BasicTemplateContinuousFutureAlgorithm.cs:77` 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) Algorithm.CSharp/BasicTemplateOptionStrategyAlgorithm.cs:66 — Algorithm.CSharp/BasicTemplateOptionStrategyAlgorithm.cs:66-76 | Algorithm.CSharp/BasicTemplateOptionTradesAlgorithm.cs:59-70 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/BasicTemplateOptionStrategyAlgorithm.cs:66` 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) Algorithm.CSharp/FutureOptionCallITMExpiryRegressionAlgorithm.cs:62 — Algorithm.CSharp/FutureOptionCallITMExpiryRegressionAlgorithm.cs:62-72 | Algorithm.CSharp/FutureOptionCallOTMExpiryRegressionAlgorithm.cs:68-79 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/FutureOptionCallITMExpiryRegressionAlgorithm.cs:62` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) Algorithm.CSharp/FutureOptionShortCallITMExpiryRegressionAlgorithm.cs:63 — Algorithm.CSharp/FutureOptionShortCallITMExpiryRegressionAlgorithm.cs:63-73 | Algorithm.CSharp/FutureOptionShortCallOTMExpiryRegressionAlgorithm.cs:64-74 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/FutureOptionShortCallITMExpiryRegressionAlgorithm.cs:63` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) Algorithm.CSharp/IndexOptionCallITMExpiryRegressionAlgorithm.cs:60 — Algorithm.CSharp/IndexOptionCallITMExpiryRegressionAlgorithm.cs:60-70 | Algorithm.CSharp/IndexOptionCallOTMExpiryRegressionAlgorithm.cs:65-75 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/IndexOptionCallITMExpiryRegressionAlgorithm.cs:60` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) Algorithm.CSharp/LimitOrdersAreFilledAfterHoursForFuturesRegressionAlgorithm.cs:41 — Algorithm.CSharp/LimitOrdersAreFilledAfterHoursForFuturesRegressionAlgorithm.cs:41-51 | Algorithm.CSharp/MarketOrdersAreSupportedOnExtendedHoursForFuturesRegressionAlgorithm.cs:36-46 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/LimitOrdersAreFilledAfterHoursForFuturesRegressionAlgorithm.cs:41` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (11 lines × 2) Algorithm.CSharp/OptionEquityCallButterflyRegressionAlgorithm.cs:40 — Algorithm.CSharp/OptionEquityCallButterflyRegressionAlgorithm.cs:40-50 | Algorithm.CSharp/OptionEquityShortButterflyCallRegressionAlgorithm.cs:40-50 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/OptionEquityCallButterflyRegressionAlgorithm.cs:40` 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) Algorithm.CSharp/OptionEquityJellyRollRegressionAlgorithm.cs:38 — Algorithm.CSharp/OptionEquityJellyRollRegressionAlgorithm.cs:38-48 | Algorithm.CSharp/OptionEquityShortJellyRollRegressionAlgorithm.cs:38-48 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/OptionEquityJellyRollRegressionAlgorithm.cs:38` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) Algorithm.CSharp/OptionEquityPutButterflyRegressionAlgorithm.cs:40 — Algorithm.CSharp/OptionEquityPutButterflyRegressionAlgorithm.cs:40-50 | Algorithm.CSharp/OptionEquityShortButterflyPutRegressionAlgorithm.cs:40-50 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/OptionEquityPutButterflyRegressionAlgorithm.cs:40` 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) Algorithm.CSharp/OptionShortCallMarginCallEventsAlgorithm.cs:35 — Algorithm.CSharp/OptionShortCallMarginCallEventsAlgorithm.cs:35-45 | Algorithm.CSharp/SingleOptionPositionGroupBuyingPowerModelRegressionAlgorithm.cs:37-47 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/OptionShortCallMarginCallEventsAlgorithm.cs:35` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×16
  • Duplicated block (9 lines × 2) Common/Scheduling/DateRules.cs:617 — Common/Scheduling/DateRules.cs:617-625 | Common/Scheduling/DateRules.cs:668-676 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Common/Scheduling/DateRules.cs:617` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 2) Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs:511 — Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs:511-520 | Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs:529-537 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) Indicators/CandlestickPatterns/IdenticalThreeCrows.cs:80 — Indicators/CandlestickPatterns/IdenticalThreeCrows.cs:80-88 | Indicators/CandlestickPatterns/ThreeWhiteSoldiers.cs:89-97 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/IdenticalThreeCrows.cs:80` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) Indicators/CandlestickPatterns/IdenticalThreeCrows.cs:102 — Indicators/CandlestickPatterns/IdenticalThreeCrows.cs:102-110 | Indicators/CandlestickPatterns/ThreeBlackCrows.cs:93-101 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
  • Duplicated block (9 lines × 2) Algorithm.CSharp/BasicTemplateOptionsFrameworkAlgorithm.cs:53 — Algorithm.CSharp/BasicTemplateOptionsFrameworkAlgorithm.cs:53-61 | Algorithm.CSharp/OptionChainSubscriptionRemovalRegressionAlgorithm.cs:61-69 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/BasicTemplateOptionsFrameworkAlgorithm.cs:53` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) Algorithm.CSharp/CoarseFineFundamentalRegressionAlgorithm.cs:100 — Algorithm.CSharp/CoarseFineFundamentalRegressionAlgorithm.cs:100-109 | Algorithm.CSharp/UniverseSelectionRegressionAlgorithm.cs:84-92 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/CoarseFineFundamentalRegressionAlgorithm.cs:100` 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.
  • Duplicated block (9 lines × 2) Algorithm.CSharp/ComboOrderAlgorithm.cs:53 — Algorithm.CSharp/ComboOrderAlgorithm.cs:53-61 | Algorithm.CSharp/ComboOrderTicketDemoAlgorithm.cs:42-50 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/ComboOrderAlgorithm.cs:53` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) Algorithm.CSharp/CustomDataBitcoinAlgorithm.cs:174 — Algorithm.CSharp/CustomDataBitcoinAlgorithm.cs:174-182 | Algorithm.CSharp/LiveFeaturesAlgorithm.cs:229-237 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/CustomDataBitcoinAlgorithm.cs:174` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) Algorithm.CSharp/HourMarketOrderFillsAtBarCloseRegressionAlgorithm.cs:53 — Algorithm.CSharp/HourMarketOrderFillsAtBarCloseRegressionAlgorithm.cs:53-61 | Algorithm.CSharp/RestingMarketOrderFillsAtBarOpenRegressionAlgorithm.cs:60-68 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/HourMarketOrderFillsAtBarCloseRegressionAlgorithm.cs:53` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) Algorithm.CSharp/IndexOptionBearCallSpreadAlgorithm.cs:54 — Algorithm.CSharp/IndexOptionBearCallSpreadAlgorithm.cs:54-62 | Algorithm.CSharp/IndexOptionBullCallSpreadAlgorithm.cs:54-62 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
  • Duplicated block (9 lines × 2) Algorithm.CSharp/IndexOptionCallButterflyAlgorithm.cs:32 — Algorithm.CSharp/IndexOptionCallButterflyAlgorithm.cs:32-40 | Algorithm.CSharp/IndexOptionPutButterflyAlgorithm.cs:32-40 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/IndexOptionCallButterflyAlgorithm.cs:32` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) Algorithm.CSharp/IndexOptionPutOTMExpiryRegressionAlgorithm.cs:49 — Algorithm.CSharp/IndexOptionPutOTMExpiryRegressionAlgorithm.cs:49-57 | Algorithm.CSharp/IndexOptionShortPutOTMExpiryRegressionAlgorithm.cs:46-54 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/IndexOptionPutOTMExpiryRegressionAlgorithm.cs:49` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) Algorithm.CSharp/LongAndShortCallCalendarSpreadStrategiesAlgorithm.cs:42 — Algorithm.CSharp/LongAndShortCallCalendarSpreadStrategiesAlgorithm.cs:42-50 | Algorithm.CSharp/LongAndShortPutCalendarSpreadStrategiesAlgorithm.cs:42-50 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/LongAndShortCallCalendarSpreadStrategiesAlgorithm.cs:42` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) Algorithm.CSharp/MarketOnCloseOrderFillsOnCloseTradeWithTickResolutionAlgorithm.cs:33 — Algorithm.CSharp/MarketOnCloseOrderFillsOnCloseTradeWithTickResolutionAlgorithm.cs:33-41 | Algorithm.CSharp/MarketOnOpenOrderFillsOnOpenTradeWithTickResolutionAlgorithm.cs:33-41 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/MarketOnCloseOrderFillsOnCloseTradeWithTickResolutionAlgorithm.cs:33` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 2) Algorithm.CSharp/OptionEquityStrategyMatcherRegressionAlgorithm.cs:88 — Algorithm.CSharp/OptionEquityStrategyMatcherRegressionAlgorithm.cs:88-96 | Algorithm.CSharp/OptionEquityStrategyMatcherRegressionAlgorithm.cs:99-107 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) Algorithm.CSharp/OptionPriceModelForSupportedAmericanOptionRegressionAlgorithm.cs:28 — Algorithm.CSharp/OptionPriceModelForSupportedAmericanOptionRegressionAlgorithm.cs:28-36 | Algorithm.CSharp/OptionPriceModelForUnsupportedAmericanOptionRegressionAlgorithm.cs:28-36 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/OptionPriceModelForSupportedAmericanOptionRegressionAlgorithm.cs:28` 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 (13 lines × 2) · ×15
  • Duplicated block (13 lines × 2) Engine/DataFeeds/Enumerators/LiveDividendEventProvider.cs:37 — Engine/DataFeeds/Enumerators/LiveDividendEventProvider.cs:37-49 | Engine/DataFeeds/Enumerators/LiveSplitEventProvider.cs:37-49 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Engine/DataFeeds/Enumerators/LiveDividendEventProvider.cs:37` 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) Common/Securities/BuyingPowerModel.cs:147 — Common/Securities/BuyingPowerModel.cs:147-159 | Common/Securities/Future/FutureMarginModel.cs:131-143 — 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 `Common/Securities/BuyingPowerModel.cs:147` 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 that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (13 lines × 2) Common/Util/LeanData.cs:705 — Common/Util/LeanData.cs:705-717 | Common/Util/LeanData.cs:733-745 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Common/Util/LeanData.cs:705` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) Indicators/CandlestickPatterns/EveningStar.cs:128 — Indicators/CandlestickPatterns/EveningStar.cs:128-140 | Indicators/CandlestickPatterns/UpsideGapTwoCrows.cs:112-124 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/EveningStar.cs:128` 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 (13 lines × 2) Indicators/CandlestickPatterns/MatHold.cs:140 — Indicators/CandlestickPatterns/MatHold.cs:140-152 | Indicators/CandlestickPatterns/RiseFallThreeMethods.cs:121-133 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/MatHold.cs:140` 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) Indicators/CandlestickPatterns/StalledPattern.cs:106 — Indicators/CandlestickPatterns/StalledPattern.cs:106-118 | Indicators/CandlestickPatterns/ThreeLineStrike.cs:77-89 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/StalledPattern.cs:106` 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.
  • Duplicated block (13 lines × 2) Indicators/CandlestickPatterns/TwoCrows.cs:78 — Indicators/CandlestickPatterns/TwoCrows.cs:78-90 | Indicators/CandlestickPatterns/UpsideGapTwoCrows.cs:88-101 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/TwoCrows.cs:78` 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 (13 lines × 2) Algorithm.CSharp/BacktestingBrokerageRegressionAlgorithm.cs:267 — Algorithm.CSharp/BacktestingBrokerageRegressionAlgorithm.cs:267-279 | Algorithm.CSharp/CustomModelsAlgorithm.cs:100-112 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/BacktestingBrokerageRegressionAlgorithm.cs:267` 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) Algorithm.CSharp/BaseFrameworkRegressionAlgorithm.cs:39 — Algorithm.CSharp/BaseFrameworkRegressionAlgorithm.cs:39-51 | Algorithm.CSharp/PearsonCorrelationPairsTradingAlphaModelFrameworkAlgorithm.cs:38-50 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/BaseFrameworkRegressionAlgorithm.cs:39` 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) Algorithm.CSharp/BasicTemplateFuturesAlgorithm.cs:56 — Algorithm.CSharp/BasicTemplateFuturesAlgorithm.cs:56-68 | Algorithm.CSharp/BasicTemplateFuturesWithExtendedMarketAlgorithm.cs:56-68 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
  • Duplicated block (13 lines × 2) Algorithm.CSharp/BasicTemplateMultiAssetAlgorithm.cs:111 — Algorithm.CSharp/BasicTemplateMultiAssetAlgorithm.cs:111-124 | Algorithm.CSharp/BasicTemplateOptionTradesAlgorithm.cs:62-74 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
  • Duplicated block (13 lines × 2) Algorithm.CSharp/ForexInternalFeedOnDataHigherResolutionRegressionAlgorithm.cs:82 — Algorithm.CSharp/ForexInternalFeedOnDataHigherResolutionRegressionAlgorithm.cs:82-94 | Algorithm.CSharp/ForexInternalFeedOnDataSameResolutionRegressionAlgorithm.cs:82-94 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/ForexInternalFeedOnDataHigherResolutionRegressionAlgorithm.cs:82` 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 (13 lines × 2) Algorithm.CSharp/IndexOptionCallCalendarSpreadAlgorithm.cs:56 — Algorithm.CSharp/IndexOptionCallCalendarSpreadAlgorithm.cs:56-68 | Algorithm.CSharp/IndexOptionPutCalendarSpreadAlgorithm.cs:62-74 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/IndexOptionCallCalendarSpreadAlgorithm.cs:56` 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 (13 lines × 2) Algorithm.CSharp/OptionChainConsistencyRegressionAlgorithm.cs:42 — Algorithm.CSharp/OptionChainConsistencyRegressionAlgorithm.cs:42-54 | Algorithm.CSharp/OptionExerciseAssignRegressionAlgorithm.cs:42-54 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
  • Duplicated block (13 lines × 2) Algorithm.CSharp/PortfolioRebalanceOnCustomFuncRegressionAlgorithm.cs:42 — Algorithm.CSharp/PortfolioRebalanceOnCustomFuncRegressionAlgorithm.cs:42-57 | Algorithm.CSharp/PortfolioRebalanceOnDateRulesRegressionAlgorithm.cs:46-58 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
D17 · Explicit Debt · CommentedOutCode · ×13
  • CommentedOutCode Algorithm.CSharp/BrokerageModelAlgorithm.cs:45 — 3 consecutive commented-code lines
  • CommentedOutCode Algorithm.CSharp/BubbleAlgorithm.cs:65 — 3 consecutive commented-code lines
  • CommentedOutCode Algorithm.CSharp/BubbleAlgorithm.cs:70 — 3 consecutive commented-code lines
  • CommentedOutCode Tests/Algorithm/AlgorithmSetHoldingsTests.cs:193 — 3 consecutive commented-code lines
  • CommentedOutCode Tests/Algorithm/AlgorithmSetHoldingsTests.cs:239 — 3 consecutive commented-code lines
  • CommentedOutCode Tests/Common/Util/MarketHoursDatabaseJsonConverterTests.cs:301 — 3 consecutive commented-code lines
  • CommentedOutCode Algorithm.CSharp/CustomDataNIFTYAlgorithm.cs:97 — 4 consecutive commented-code lines
  • CommentedOutCode Tests/Engine/Results/BacktestingResultHandlerTests.cs:84 — 4 consecutive commented-code lines
  • CommentedOutCode Algorithm.CSharp/HistoryAlgorithm.cs:109 — 6 consecutive commented-code lines
  • CommentedOutCode Tests/Common/Securities/SecurityPortfolioManagerTests.cs:289 — 6 consecutive commented-code lines
  • CommentedOutCode Tests/Algorithm/AlgorithmSetHoldingsTests.cs:135 — 9 consecutive commented-code lines
  • CommentedOutCode Tests/Algorithm/AlgorithmSetHoldingsTests.cs:178 — 7 consecutive commented-code lines
  • CommentedOutCode Tests/Algorithm/AlgorithmSetHoldingsTests.cs:224 — 7 consecutive commented-code lines
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×13
  • Duplicated block (14 lines × 2) Common/Brokerages/FxcmBrokerageModel.cs:78 — Common/Brokerages/FxcmBrokerageModel.cs:78-91 | Common/Brokerages/OandaBrokerageModel.cs:83-96 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Common/Brokerages/FxcmBrokerageModel.cs:78` 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 (14 lines × 2) Common/Orders/Fills/EquityFillModel.cs:755 — Common/Orders/Fills/EquityFillModel.cs:755-768 | Common/Orders/Fills/EquityFillModel.cs:864-877 — both copies are in the same file, so extract the 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 `Common/Orders/Fills/EquityFillModel.cs:755` 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 (14 lines × 2) Indicators/CandlestickPatterns/DojiStar.cs:105 — Indicators/CandlestickPatterns/DojiStar.cs:105-118 | Indicators/CandlestickPatterns/HaramiCross.cs:101-114 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) Indicators/CandlestickPatterns/Hikkake.cs:114 — Indicators/CandlestickPatterns/Hikkake.cs:114-127 | Indicators/CandlestickPatterns/HikkakeModified.cs:152-165 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/Hikkake.cs:114` 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 (14 lines × 2) Indicators/CandlestickPatterns/IdenticalThreeCrows.cs:121 — Indicators/CandlestickPatterns/IdenticalThreeCrows.cs:121-134 | Indicators/CandlestickPatterns/ThreeWhiteSoldiers.cs:146-159 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
  • Duplicated block (14 lines × 2) Indicators/CandlestickPatterns/MatchingLow.cs:88 — Indicators/CandlestickPatterns/MatchingLow.cs:88-101 | Indicators/CandlestickPatterns/StickSandwich.cs:95-108 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/MatchingLow.cs:88` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) Indicators/CandlestickPatterns/MorningDojiStar.cs:111 — Indicators/CandlestickPatterns/MorningDojiStar.cs:111-124 | Indicators/CandlestickPatterns/UniqueThreeRiver.cs:84-97 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/MorningDojiStar.cs:111` 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 (14 lines × 2) Algorithm.CSharp/ConstituentsUniverseImmediateSelectionRegressionAlgorithm.cs:38 — Algorithm.CSharp/ConstituentsUniverseImmediateSelectionRegressionAlgorithm.cs:38-52 | Algorithm.CSharp/ConstituentsUniverseRegressionAlgorithm.cs:39-52 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/ConstituentsUniverseImmediateSelectionRegressionAlgorithm.cs:38` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) Algorithm.CSharp/CustomDataUniverseRegressionAlgorithm.cs:49 — Algorithm.CSharp/CustomDataUniverseRegressionAlgorithm.cs:49-62 | Algorithm.CSharp/CustomDataUniverseScheduledRegressionAlgorithm.cs:47-60 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/CustomDataUniverseRegressionAlgorithm.cs:49` 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 (14 lines × 2) Algorithm.CSharp/IndexOptionShortCallITMExpiryRegressionAlgorithm.cs:47 — Algorithm.CSharp/IndexOptionShortCallITMExpiryRegressionAlgorithm.cs:47-60 | Algorithm.CSharp/IndexOptionShortPutITMExpiryRegressionAlgorithm.cs:46-59 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
  • Duplicated block (14 lines × 2) Algorithm.CSharp/OptionRenameDailyRegressionAlgorithm.cs:113 — Algorithm.CSharp/OptionRenameDailyRegressionAlgorithm.cs:113-131 | Algorithm.CSharp/OptionRenameRegressionAlgorithm.cs:105-118 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/OptionRenameDailyRegressionAlgorithm.cs:113` 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 (14 lines × 2) Algorithm.CSharp/WarmupLowerResolutionOptionRegressionAlgorithm.cs:100 — Algorithm.CSharp/WarmupLowerResolutionOptionRegressionAlgorithm.cs:100-113 | Algorithm.CSharp/WarmupOptionResolutionRegressionAlgorithm.cs:34-47 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/WarmupLowerResolutionOptionRegressionAlgorithm.cs:100` 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 (14 lines × 2) Algorithm.Framework/Execution/StandardDeviationExecutionModel.cs:125 — Algorithm.Framework/Execution/StandardDeviationExecutionModel.cs:125-138 | Algorithm.Framework/Execution/VolumeWeightedAveragePriceExecutionModel.cs:110-123 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.Framework/Execution/StandardDeviationExecutionModel.cs:125` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×12
  • Duplicated block (12 lines × 2) Algorithm/Execution/ImmediateExecutionModel.cs:46 — Algorithm/Execution/ImmediateExecutionModel.cs:46-58 | Algorithm.CSharp/ExecutionModelOrderEventsRegressionAlgorithm.cs:90-101 — 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 `Algorithm/Execution/ImmediateExecutionModel.cs:46` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (12 lines × 2) Common/Brokerages/BybitBrokerageModel.cs:127 — Common/Brokerages/BybitBrokerageModel.cs:127-138 | Common/Brokerages/CoinbaseBrokerageModel.cs:134-145 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Common/Brokerages/BybitBrokerageModel.cs:127` 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) Common/Orders/Fills/EquityFillModel.cs:606 — Common/Orders/Fills/EquityFillModel.cs:606-617 | Common/Orders/Fills/FillModel.cs:808-819 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) Algorithm.CSharp/AddBetaIndicatorNewAssetsRegressionAlgorithm.cs:78 — Algorithm.CSharp/AddBetaIndicatorNewAssetsRegressionAlgorithm.cs:78-89 | Algorithm.CSharp/AddBetaIndicatorRegressionAlgorithm.cs:75-86 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
  • Duplicated block (12 lines × 2) Algorithm.CSharp/BacktestingBrokerageRegressionAlgorithm.cs:92 — Algorithm.CSharp/BacktestingBrokerageRegressionAlgorithm.cs:92-103 | Algorithm.CSharp/OptionExerciseAssignRegressionAlgorithm.cs:74-85 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/BacktestingBrokerageRegressionAlgorithm.cs:92` 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) Algorithm.CSharp/BasicTemplateCryptoAlgorithm.cs:42 — Algorithm.CSharp/BasicTemplateCryptoAlgorithm.cs:42-69 | Algorithm.CSharp/StartingCapitalRegressionAlgorithm.cs:34-45 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/BasicTemplateCryptoAlgorithm.cs:42` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) Algorithm.CSharp/BasicTemplateSPXWeeklyIndexOptionsAlgorithm.cs:75 — Algorithm.CSharp/BasicTemplateSPXWeeklyIndexOptionsAlgorithm.cs:75-86 | Algorithm.CSharp/OptionResolutionRegressionAlgorithm.cs:64-75 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/BasicTemplateSPXWeeklyIndexOptionsAlgorithm.cs:75` 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) Algorithm.CSharp/IndexOptionBearPutSpreadAlgorithm.cs:43 — Algorithm.CSharp/IndexOptionBearPutSpreadAlgorithm.cs:43-54 | Algorithm.CSharp/IndexOptionBullPutSpreadAlgorithm.cs:43-54 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/IndexOptionBearPutSpreadAlgorithm.cs:43` 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) Algorithm.CSharp/LongAndShortButterflyCallStrategiesAlgorithm.cs:40 — Algorithm.CSharp/LongAndShortButterflyCallStrategiesAlgorithm.cs:40-51 | Algorithm.CSharp/LongAndShortButterflyPutStrategiesAlgorithm.cs:40-51 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/LongAndShortButterflyCallStrategiesAlgorithm.cs:40` 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) Algorithm.CSharp/SecurityInitializationOnReAdditionForEquityRegressionAlgorithm.cs:48 — Algorithm.CSharp/SecurityInitializationOnReAdditionForEquityRegressionAlgorithm.cs:48-59 | Algorithm.CSharp/SecurityInitializationOnReAdditionForUniverseSelectionRegressionAlgorithm.cs:48-59 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/SecurityInitializationOnReAdditionForEquityRegressionAlgorithm.cs:48` 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) Algorithm.CSharp/WarmupLowerResolutionOptionRegressionAlgorithm.cs:65 — Algorithm.CSharp/WarmupLowerResolutionOptionRegressionAlgorithm.cs:65-76 | Algorithm.CSharp/WarmupOptionRegressionAlgorithm.cs:54-68 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/WarmupLowerResolutionOptionRegressionAlgorithm.cs:65` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (12 lines × 2) Algorithm.Framework/Portfolio/MeanVarianceOptimizationPortfolioConstructionModel.cs:317 — Algorithm.Framework/Portfolio/MeanVarianceOptimizationPortfolioConstructionModel.cs:317-328 | Algorithm.Framework/Portfolio/RiskParityPortfolioConstructionModel.cs:249-260 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.Framework/Portfolio/MeanVarianceOptimizationPortfolioConstructionModel.cs:317` 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.
D6 · Cohesion (LCOM4) · Low cohesion · ×12
  • Low cohesion: QuantBook (LCOM4 13) Research/QuantBook.cs:48 — QuantBook's methods form 13 groups that share no state and don't call each other — a sign it may have several responsibilities. Review whether it splits into focused classes.
  • Low cohesion: Security (LCOM4 11) Common/Securities/Security.cs:47 — Security's methods form 11 groups that share no state and don't call each other — a sign it may have several responsibilities. Review whether it splits into focused classes.
  • Low cohesion: Brokerage (LCOM4 9) Brokerages/Brokerage.cs:39 — Brokerage's methods form 9 groups that share no state and don't call each other — a sign it may have several responsibilities. Review whether it splits into focused classes.
  • Low cohesion: Option (LCOM4 8) Common/Securities/Option/Option.cs:38 — Option's methods form 8 groups that share no state and don't call each other — a sign it may have several responsibilities. Review whether it splits into focused classes.
  • Low cohesion: DefaultBrokerageModel (LCOM4 7) Common/Brokerages/DefaultBrokerageModel.cs:39 — DefaultBrokerageModel's methods form 7 groups that share no state and don't call each other — a sign it may have several responsibilities. Review whether it splits into focused classes.
  • Low cohesion: PythonData (LCOM4 7) Common/Python/PythonData.cs:27 — PythonData's methods form 7 groups that share no state and don't call each other — a sign it may have several responsibilities. Review whether it splits into focused classes.
  • Low cohesion: SecurityHolding (LCOM4 6) Common/Securities/SecurityHolding.cs:24 — SecurityHolding's methods form 6 groups that share no state and don't call each other — a sign it may have several responsibilities. Review whether it splits into focused classes.
  • Low cohesion: UniverseSelectionRegressionAlgorithm (LCOM4 4) Algorithm.CSharp/UniverseSelectionRegressionAlgorithm.cs:31 — UniverseSelectionRegressionAlgorithm's methods form 4 groups that share no state and don't call each other — a sign it may have several responsibilities. Review whether it splits into focused classes.
  • Low cohesion: KrakenBrokerageModel (LCOM4 4) Common/Brokerages/KrakenBrokerageModel.cs:30 — KrakenBrokerageModel's methods form 4 groups that share no state and don't call each other — a sign it may have several responsibilities. Review whether it splits into focused classes.
  • Low cohesion: SamcoBrokerageModel (LCOM4 4) Common/Brokerages/SamcoBrokerageModel.cs:31 — SamcoBrokerageModel's methods form 4 groups that share no state and don't call each other — a sign it may have several responsibilities. Review whether it splits into focused classes.
  • Low cohesion: BaseData (LCOM4 4) Common/Data/BaseData.cs:33 — BaseData's methods form 4 groups that share no state and don't call each other — a sign it may have several responsibilities. Review whether it splits into focused classes.
  • Low cohesion: LiveTradingResultHandler (LCOM4 4) Engine/Results/LiveTradingResultHandler.cs:45 — LiveTradingResultHandler's methods form 4 groups that share no state and don't call each other — a sign it may have several responsibilities. Review whether it splits into focused classes.
D3 · God Classes · FileTooLong · ×11
  • FileTooLong: Algorithm/QCAlgorithm.Indicators.cs Algorithm/QCAlgorithm.Indicators.cs:0 — FileTooLong — 1520 significant lines (blank, comment-only and punctuation-only lines excluded). 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: Algorithm/QCAlgorithm.cs Algorithm/QCAlgorithm.cs:0 — FileTooLong — 1346 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the res...

    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.