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

QuantConnect/Lean

Measured 12 November 2026, 00:58 UTC, at code version 655ac6d

Code coverage is not measured: No coverage collector is wired up.

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

CAI score 44out of 100 At risk Down 1 since the last survey

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

A very large codebase: 544,519 lines of product code in 23 projects, tests not counted · Estimated rebuild effort: about 5.1 person-years · Weakest lens: Code Health, 39

Findings by how serious they are

148 critical 2098 serious 1389 minor

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

This survey was produced by

Assert small markCanine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
12 November 2026, 00:58 UTC

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

A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.

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

73of 73 dimensions measured by tools.
3592of 3635 findings point to an exact file and line, so you can open each one in the code. The other 43 concern the repository as a whole, such as missing documentation.
73dimensions across 6 lenses, read from 544,519 lines of product code in 23 projects.
Chapters

Executive summary

QuantConnect/Lean is rated At risk because critical security findings are open. It scores 44 out of 100, which the At risk rating leaves unchanged.

Code Health, at 39, is the weakest lens, level with Security and Compliance, and counts most in the score. The best first steps are fixing the silenced warnings and encrypting the sensitive stored data and keeping its keys in a vault, each worth about 5 points. Raising Code Health to 70 would lift the score to about 50.

Twenty-one pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Nine passwords or keys are open to anyone who can read the repository, and thirty-three errors are caught and ignored, so failures can go unnoticed. Pinning each tool to an exact version, replacing each exposed password or key and handling or logging the ignored errors would close these risks. Fixing the weaknesses the scanner points to would fix the nine security weaknesses in the code, and updating the vulnerable packages would deal with the five packages with a known security hole. The 35 data fields that are written but never read need removing.

The product code is 544,519 lines, about €740,000 to rebuild.

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

How the score is built: what each lens counts for The lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Code Health 39 · counts for 46%Security and Compliance 39 · counts for 25%Production Readiness 54 · counts for 14%Maturity 60 · counts for 8%Architecture 66 · counts for 4%Performance 69 · counts for 2%

If Code Health rose from 39 to 70, the lowest score rated Strong, the score would rise from 44 to about 50.

Code composition: what the lines of code are
Business logic 21%Supporting code 41%Tests 39%
New since the last survey: 518 findings

These 518 critical or serious findings weren't in the previous survey, on 23 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.

  • Cyclomatic Complexity · ObjectStoreHelpersRegressionAlgorithm.on_end_of_algorithm (cyclomatic 20) Algorithm.Python/ObjectStoreHelpersRegressionAlgorithm.py
  • Cyclomatic Complexity · EtoroBrokerageModel.CanSubmitContingentOrder (cyclomatic 18) Common/Brokerages/EtoroBrokerageModel.cs
  • Cyclomatic Complexity · EulerSearchOptimizationStrategy.PushNewResults (cyclomatic 17) Optimizer/Strategies/EulerSearchOptimizationStrategy.cs
  • Cyclomatic Complexity · EtoroBrokerageModel.CanSubmitOrder (cyclomatic 16) Common/Brokerages/EtoroBrokerageModel.cs
  • Cyclomatic Complexity · Program.Main (cyclomatic 16) Report/Program.cs
  • Cognitive Complexity · BrokerageTransactionHandler.SyncOptionHoldings (cognitive 27) Engine/TransactionHandlers/BrokerageTransactionHandler.cs
  • Cognitive Complexity · ObjectStoreHelpersRegressionAlgorithm.on_end_of_algorithm (cognitive 19) Algorithm.Python/ObjectStoreHelpersRegressionAlgorithm.py
  • Cognitive Complexity · EtoroBrokerageModel.CanSubmitContingentOrder (cognitive 16) Common/Brokerages/EtoroBrokerageModel.cs
  • God Classes · TooManyMethods: ObjectStore Common/Storage/ObjectStore.cs
  • Code Duplication · Members sharing a duplicated core (10 members, 50+ identical tokens) Common/Brokerages/AxosClearingBrokerageModel.cs
  • Code Duplication · Edited copy of a member (75 corresponding lines) Algorithm.Python/BasicTemplateCryptoFutureAlgorithm.py
  • Code Duplication · Edited copy of a member (60 corresponding lines) Algorithm.CSharp/FutureOptionCallITMGreeksExpiryRegressionAlgorithm.cs
  • Code Duplication · Edited copy of a member (68 corresponding lines) Algorithm.CSharp/UpdateOrderLiveTestAlgorithm.cs
  • Code Duplication · Edited copy of a member (79 corresponding lines) Common/Orders/Fills/EquityFillModel.cs
  • Code Duplication · Edited copies of one member (3 members, 55+ corresponding lines) Common/Orders/Fills/EquityFillModel.cs
  • Code Duplication · Edited copy of a member (50 corresponding lines) Common/Messages/Messages.Orders.cs
  • Code Duplication · Edited copy of a member (42 corresponding lines) Common/Securities/Option/OptionFilterUniverse.cs
  • Code Duplication · Edited copy of a member (33 corresponding lines) Algorithm.Python/IndexOptionCallButterflyAlgorithm.py
  • Code Duplication · Edited copy of a member (22 corresponding lines) Algorithm.Python/IndexOptionShortCallITMExpiryRegressionAlgorithm.py
  • Code Duplication · Edited copy of a member (35 corresponding lines) Algorithm.Python/ComboOrderTicketDemoAlgorithm.py
  • Code Duplication · Edited copies of one member (3 members, 27+ corresponding lines) Algorithm.Python/IronCondorStrategyAlgorithm.py
  • Code Duplication · Edited copy of a member (55 corresponding lines) Common/Orders/Fills/FillModel.cs
  • Code Duplication · Edited copy of a member (54 corresponding lines) Common/Orders/Fills/FillModel.cs
  • Code Duplication · Edited copy of a member (38 corresponding lines) Common/Brokerages/AlpacaBrokerageModel.cs
  • Code Duplication · Edited copies of one member (3 members, 45+ corresponding lines) Indicators/CandlestickPatterns/InNeck.cs
  • Code Duplication · Edited copy of a member (62 corresponding lines) Common/Orders/Fills/EquityFillModel.cs
  • Code Duplication · Edited copy of a member (29 corresponding lines) Algorithm.Python/FutureOptionDailyRegressionAlgorithm.py
  • Code Duplication · Edited copies of one member (3 members, 49+ corresponding lines) Algorithm.Python/OrderTicketDemoAlgorithm.py
  • Code Duplication · Edited copy of a member (62 corresponding lines) Algorithm.CSharp/OptionRenameDailyRegressionAlgorithm.cs
  • Code Duplication · Edited copy of a member (26 corresponding lines) Algorithm.Python/BasicTemplateContinuousFutureAlgorithm.py
  • Code Duplication · Edited copy of a member (41 corresponding lines) Indicators/CandlestickPatterns/DojiStar.cs
  • Code Duplication · Edited copies of one member (4 members, 28+ corresponding lines) Algorithm/QCAlgorithm.Python.cs
  • Code Duplication · Edited copy of a member (39 corresponding lines) Algorithm.CSharp/OptionEquityCoveredCallRegressionAlgorithm.cs
  • Code Duplication · Edited copy of a member (24 corresponding lines) Algorithm/QCAlgorithm.Python.cs
  • Code Duplication · Edited copy of a member (25 corresponding lines) Algorithm.Python/FutureUniverseHistoryRegressionAlgorithm.py
  • Code Duplication · Edited copy of a member (54 corresponding lines) Algorithm.CSharp/OrderTicketDemoAlgorithm.cs
  • Code Duplication · Edited copy of a member (20 corresponding lines) Algorithm.Python/AddFutureOptionContractDataStreamingRegressionAlgorithm.py
  • Code Duplication · Edited copy of a member (36 corresponding lines) Indicators/CandlestickPatterns/ClosingMarubozu.cs
  • Code Duplication · Edited copies of one member (3 members, 93+ corresponding lines) Algorithm.CSharp/BasicTemplateCryptoFutureAlgorithm.cs
  • Code Duplication · Edited copy of a member (38 corresponding lines) Algorithm.Framework/Alphas/HistoricalReturnsAlphaModel.cs
  • Code Duplication · Edited copy of a member (36 corresponding lines) Algorithm.CSharp/BasicTemplateContinuousFutureAlgorithm.cs
  • Code Duplication · Edited copy of a member (19 corresponding lines) Algorithm.Python/LongAndShortButterflyCallStrategiesAlgorithm.py
  • Code Duplication · Edited copy of a member (36 corresponding lines) Algorithm.Framework/Portfolio/MeanVarianceOptimizationPortfolioConstructionModel.cs
  • Code Duplication · Edited copy of a member (36 corresponding lines) Indicators/CandlestickPatterns/DragonflyDoji.cs
  • Code Duplication · Edited copies of one member (3 members, 54+ corresponding lines) Algorithm.CSharp/ContinuousBackMonthRawFutureRegressionAlgorithm.cs
  • Code Duplication · Edited copy of a member (17 corresponding lines) Algorithm.Python/FutureOptionCallITMExpiryRegressionAlgorithm.py
  • Code Duplication · Edited copy of a member (36 corresponding lines) Indicators/CandlestickPatterns/LongLineCandle.cs
  • Code Duplication · Edited copy of a member (54 corresponding lines) Algorithm.CSharp/SetAccountCurrencyCashBuyingPowerModelRegressionAlgorithm.cs
  • Code Duplication · Edited copy of a member (25 corresponding lines) Algorithm.Python/PythonDictionaryFeatureRegressionAlgorithm.py
  • Code Duplication · Edited copy of a member (18 corresponding lines) Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs
  • Code Duplication · Edited copy of a member (36 corresponding lines) Indicators/CandlestickPatterns/HighWaveCandle.cs
  • Code Duplication · Edited copy of a member (33 corresponding lines) Indicators/CandlestickPatterns/MatchingLow.cs
  • Code Duplication · Edited copy of a member (20 corresponding lines) Algorithm.Python/FutureOptionCallITMExpiryRegressionAlgorithm.py
  • Code Duplication · Edited copy of a member (36 corresponding lines) Algorithm.CSharp/SetAccountCurrencyCashBuyingPowerModelRegressionAlgorithm.cs
  • Code Duplication · Edited copy of a member (15 corresponding lines) Algorithm.Python/LongAndShortCallCalendarSpreadStrategiesAlgorithm.py
  • Code Duplication · Edited copies of one member (7 members, 33+ corresponding lines) Algorithm.CSharp/OptionEquityBearCallSpreadRegressionAlgorithm.cs
  • Code Duplication · Edited copy of a member (20 corresponding lines) Algorithm.CSharp/LongAndShortCallCalendarSpreadStrategiesAlgorithm.cs
  • Code Duplication · Edited copy of a member (14 corresponding lines) Algorithm.Python/LongAndShortCallCalendarSpreadStrategiesAlgorithm.py
  • Code Duplication · Edited copy of a member (30 corresponding lines) Algorithm.CSharp/BacktestingBrokerageRegressionAlgorithm.cs
  • Code Duplication · Edited copy of a member (39 corresponding lines) Common/BinaryComparisonExtensions.cs
  • Code Duplication · Edited copy of a member (20 corresponding lines) Algorithm.Python/AddAlphaModelAlgorithm.py
  • Code Duplication · Edited copy of a member (36 corresponding lines) Common/Orders/ContingentOrderExtensions.cs
  • Code Duplication · Edited copy of a member (22 corresponding lines) Algorithm.CSharp/BaseFrameworkRegressionAlgorithm.cs
  • Code Duplication · Edited copy of a member (31 corresponding lines) Common/Securities/Option/StrategyMatcher/OptionPositionCollection.cs
  • Code Duplication · Edited copy of a member (21 corresponding lines) Algorithm.CSharp/OptionAssignmentRegressionAlgorithm.cs
  • Code Duplication · Edited copy of a member (13 corresponding lines) Common/Scheduling/DateRules.cs
  • Code Duplication · Edited copy of a member (19 corresponding lines) Algorithm.Python/BaseFrameworkRegressionAlgorithm.py
  • Code Duplication · Edited copy of a member (41 corresponding lines) Algorithm.CSharp/ForexInternalFeedOnDataHigherResolutionRegressionAlgorithm.cs
  • Code Duplication · Edited copy of a member (18 corresponding lines) Common/Scheduling/TimeRules.cs
  • Code Duplication · Edited copy of a member (29 corresponding lines) Algorithm.CSharp/Alphas/GreenblattMagicFormulaAlpha.cs
  • Code Duplication · Edited copies of one member (4 members, 18+ corresponding lines) Algorithm.Python/IndexOptionBearCallSpreadAlgorithm.py
  • Code Duplication · Edited copy of a member (27 corresponding lines) Common/Data/Market/TradeBar.cs
  • Code Duplication · Edited copies of one member (4 members, 19+ corresponding lines) Algorithm.CSharp/IndexOptionBearCallSpreadAlgorithm.cs
  • Code Duplication · Edited copy of a member (33 corresponding lines) Algorithm.CSharp/ConvertToFrameworkAlgorithm.cs
  • Code Duplication · Edited copy of a member (40 corresponding lines) Algorithm.Python/Collective2PortfolioSignalExportDemonstrationAlgorithm.py
  • Code Duplication · Edited copy of a member (25 corresponding lines) Algorithm.Python/BasicTemplateCryptoFutureAlgorithm.py
  • Code Duplication · Edited copy of a member (10 corresponding lines) Algorithm.Python/CustomModelsAlgorithm.py
  • Code Duplication · Edited copy of a member (12 corresponding lines) Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs
  • Code Duplication · Edited copy of a member (14 corresponding lines) Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs
  • Code Duplication · Edited copy of a member (27 corresponding lines) Algorithm.CSharp/BasicTemplateOptionStrategyAlgorithm.cs
  • Code Duplication · Edited copy of a member (37 corresponding lines) Engine/RealTime/ScheduledEventFactory.cs
  • Code Duplication · Edited copy of a member (36 corresponding lines) Algorithm.Framework/Execution/StandardDeviationExecutionModel.cs
  • Code Duplication · Edited copy of a member (26 corresponding lines) Algorithm.Framework/Alphas/HistoricalReturnsAlphaModel.py
  • Code Duplication · Edited copy of a member (16 corresponding lines) Algorithm.Python/HistoryWithDifferentContinuousContractDepthOffsetsRegressionAlgorithm.py
  • Code Duplication · Edited copy of a member (24 corresponding lines) Indicators/CandlestickPatterns/Engulfing.cs
  • Code Duplication · Edited copy of a member (48 corresponding lines) Indicators/ParabolicStopAndReverseExtended.cs
  • Code Duplication · Edited copy of a member (17 corresponding lines) Algorithm.CSharp/AddAndRemoveOptionContractRegressionAlgorithm.cs
  • Code Duplication · Edited copies of one member (3 members, 17+ corresponding lines) Algorithm.CSharp/SpreadExecutionModelRegressionAlgorithm.cs
  • Code Duplication · Edited copy of a member (38 corresponding lines) Algorithm.CSharp/OptionUniverseFilterOptionsDataLinqRegressionAlgorithm.cs
  • Code Duplication · Edited copy of a member (22 corresponding lines) Algorithm.CSharp/IndicatorBasedOptionPricingModelRegressionAlgorithm.cs
  • Code Duplication · Edited copy of a member (34 corresponding lines) Algorithm.Framework/Portfolio/BlackLittermanOptimizationPortfolioConstructionModel.py
  • Code Duplication · Edited copy of a member (29 corresponding lines) Common/Orders/Fees/InteractiveBrokersFeeModel.cs
  • Code Duplication · Edited copy of a member (29 corresponding lines) Algorithm.CSharp/BasicTemplateSPXWeeklyIndexOptionsStrategyAlgorithm.cs
  • Code Duplication · Edited copy of a member (32 corresponding lines) Algorithm.CSharp/WarmupLowerResolutionOptionRegressionAlgorithm.cs
  • Code Duplication · Edited copy of a member (16 corresponding lines) Algorithm.Python/ETFConstituentUniverseCompositeDelistingRegressionAlgorithm.py
  • Code Duplication · Edited copy of a member (33 corresponding lines) REDACTED
  • Code Duplication · Edited copy of a member (21 corresponding lines) Algorithm.Python/BasicTemplateFuturesAlgorithm.py
  • Code Duplication · Edited copy of a member (21 corresponding lines) Algorithm.Python/BasicTemplateIndexAlgorithm.py
  • Code Duplication · Edited copy of a member (42 corresponding lines) Algorithm.CSharp/EuropeanOptionsCannotBeExercisedBeforeExpiryRegressionAlgorithm.cs
  • Code Duplication · Edited copy of a member (28 corresponding lines) Algorithm.Framework/Execution/StandardDeviationExecutionModel.py

We compare every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.

Fixed since the last survey: 42 findings

These 42 critical or serious findings were in the previous survey, on 23 October 2026, and are gone from this one.

  • Cognitive Complexity · MarketProfile.CalculateValueArea (cognitive 18) Indicators/MarketProfile.cs
  • Code Duplication · Edited copy of a member (17 corresponding lines) Algorithm.Python/FutureContractsExtendedMarketHoursRegressionAlgorithm.py
  • Code Duplication · Members sharing a duplicated core (10 members, 50+ identical tokens) Common/Brokerages/AxosClearingBrokerageModel.cs
  • Code Duplication · Duplicated block (7 lines × 2) ToolBox/RandomDataGenerator/RandomDataGeneratorSettings.cs
  • Code Duplication · Duplicated block (9 lines × 2) Algorithm.Python/ManuallySetMarketHoursAndSymbolPropertiesDatabaseEntriesAlgorithm.py
  • Code Duplication · Duplicated block (7 lines × 2) Algorithm.Python/FutureContractsExtendedMarketHoursRegressionAlgorithm.py
  • Cohesion (LCOM4) · Low cohesion: Security (LCOM4 11) Common/Securities/Security.cs
  • Cohesion (LCOM4) · Low cohesion: Option (LCOM4 8) Common/Securities/Option/Option.cs
  • Code Coverage · Coverage not measured — no coverage collector is wired up
  • Test Quality · No assertions: SetJob Tests/Engine/DataFeeds/DataQueueHandlerManagerTests.cs
  • Dependency Hygiene · Vulnerable: DotNetZip
  • Churn × Complexity Hotspots · Hotspot: Engine/AlgorithmManager.cs Engine/AlgorithmManager.cs
  • Explicit Debt · ObsoleteWithCallers Common/Brokerages/BrokerageName.cs
  • Explicit Debt · NoWarnInCsproj repeated across 20 files ToolBox/QuantConnect.ToolBox.csproj
  • Supply-chain Provenance & Signing · Workflow token permissions not restricted REDACTED
  • Supply-chain Provenance & Signing · Workflow token permissions not restricted REDACTED
  • Supply-chain Provenance & Signing · Workflow token permissions not restricted REDACTED
  • Supply-chain Provenance & Signing · Workflow token permissions not restricted REDACTED
  • Supply-chain Provenance & Signing · Workflow token permissions not restricted REDACTED
  • Supply-chain Provenance & Signing · Workflow token permissions not restricted REDACTED
  • Supply-chain Provenance & Signing · Workflow token permissions not restricted REDACTED
  • Supply-chain Provenance & Signing · Workflow token permissions not restricted REDACTED
  • Supply-chain Provenance & Signing · Workflow token permissions not restricted REDACTED
  • Nullable reference types · Symbol treated as nullable, then dereferenced unguarded Algorithm.CSharp/BasicTemplateFuturesWithExtendedMarketAlgorithm.cs
  • Nullable reference types · Symbol treated as nullable, then dereferenced unguarded Algorithm.CSharp/ClassicRenkoConsolidatorWithFuturesAndDefaultTickTypeRegressionAlgorithm.cs
  • Nullable reference types · Symbol treated as nullable, then dereferenced unguarded Algorithm.CSharp/ClassicRenkoConsolidatorWithFuturesQuoteTickTypeRegressionAlgorithm.cs
  • Nullable reference types · Symbol treated as nullable, then dereferenced unguarded Algorithm.CSharp/ClassicRenkoConsolidatorWithFuturesTickTypesRegressionAlgorithm.cs
  • Nullable reference types · Symbol treated as nullable, then dereferenced unguarded Algorithm.CSharp/CustomDataZipFileEntryNamesRegressionAlgorithm.cs
  • Nullable reference types · Symbol treated as nullable, then dereferenced unguarded Algorithm.CSharp/FuturesAndFuturesOptionsExpiryTimeAndLiquidationRegressionAlgorithm.cs
  • Nullable reference types · Symbol treated as nullable, then dereferenced unguarded Algorithm.CSharp/HSIFutureHourRegressionAlgorithm.cs
  • Nullable reference types · Symbol treated as nullable, then dereferenced unguarded Algorithm.CSharp/IndicatorBasedOptionPricingModelRegressionAlgorithm.cs
  • Nullable reference types · Symbol treated as nullable, then dereferenced unguarded Algorithm.CSharp/IndicatorVolatilityModelAlgorithm.cs
  • Nullable reference types · Symbol treated as nullable, then dereferenced unguarded Algorithm.CSharp/RegisterIndicatorRegressionAlgorithm.cs
  • Nullable reference types · Symbol treated as nullable, then dereferenced unguarded Algorithm.CSharp/SecurityCustomPropertiesAlgorithm.cs
  • Nullable reference types · Symbol treated as nullable, then dereferenced unguarded Algorithm.CSharp/SetHoldingsFutureRegressionAlgorithm.cs
  • Nullable reference types · Symbol treated as nullable, then dereferenced unguarded Algorithm.CSharp/StrictEndTimeLowerResolutionFillForwardRegressionAlgorithm.cs
  • Nullable reference types · Symbol treated as nullable, then dereferenced unguarded ToolBox/AlgoSeekFuturesConverter/AlgoSeekFuturesConverter.cs
  • Nullable reference types · Symbol treated as nullable, then dereferenced unguarded Research/QuantBook.cs
  • Nullable reference types · Symbol treated as nullable, then dereferenced unguarded Research/QuantBook.cs
  • Nullable reference types · Symbol treated as nullable, then dereferenced unguarded Algorithm.Framework/NotifiedSecurityChanges.cs
  • Nullable reference types · Symbol treated as nullable, then dereferenced unguarded REDACTED
  • Nullable reference types · Symbol treated as nullable, then dereferenced unguarded Optimizer/Analysis/OptimizationAnalyzer.cs
Rebuild cost: about €740,000 · Estimate
Cost to rebuild€240,000 to €1,200,000, for 4,066 to 13,011 hours of work, about 5.1 person-years for 3 to 10 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.7 at a score of 44. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeVery large: 544,519 lines of product code
Comment linesThe estimate prices 332,549 lines. Comment lines count towards the size of 544,519 lines but aren't priced as work.
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

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

Top priorities

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

1
Resolve the 4 NoWarnInCsproj finding(s) in Explicit Debt — start with QuantConnect.Algorithm.CSharp.csproj (2), QuantConnect.Tests.csproj (2).
Raises the score by about 5 points · Low effort · Explicit Debt
2
Encrypt sensitive data at rest (ASP.NET Core Data Protection / column encryption) and manage keys in a vault.
Skip if delegated to infra (Postgres TDE, KMS, etc.).
Raises the score by about 5 points · Medium effort · Data Protection
3
Resolve the 8 REDACTED finding(s) in Secrets (history) — start with REDACTED (4), REDACTED, REDACTED.
Raises the score by about 3 points · Low effort · Secrets (history)

Diagnosis: what the measurements show together

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

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

Architecture — module dependency graph

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

arch 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: which parts of the code depend on which

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

637 modules, with 810 dependencies between them. 5 loops run through 67 of the modules, marked above the diagonal.

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

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 Algorithm.Python.OptionStrategyFactoryMethodsBaseAlgorithm2 QuantConnect.Orders.Fills3 QuantConnect.Orders.Slippage4 QuantConnect.Securities.Future5 QuantConnect.Securities.Positions6 QuantConnect.Util7 QuantConnect.Securities.Option8 QuantConnect.Statistics9 QuantConnect.Packets10 QuantConnect.Brokerages11 QuantConnect.Securities12 QuantConnect.Orders13 QuantConnect.Scheduling14 QuantConnect.Api15 QuantConnect.Commands16 QuantConnect.Interfaces17 QuantConnect.Algorithm.Framework.Portfolio.SignalExports18 QuantConnect.Python19 QuantConnect.Indicators20 QuantConnect.Data.Consolidators21 QuantConnect.Data.Market22 QuantConnect.Data.Auxiliary23 QuantConnect.Data24 QuantConnect.Data.UniverseSelection25 QuantConnect.Algorithm.Framework.Portfolio26 QuantConnect.Algorithm.Framework.Selection27 QuantConnect.Algorithm.Framework.Execution28 QuantConnect.Algorithm29 QuantConnect.Algorithm.Framework.Alphas30 QuantConnect31 QuantConnect.Algorithm.CSharp32 QuantConnect.Algorithm.CSharp.Alphas33 QuantConnect.AlgorithmFactory.Python.Wrappers34 QuantConnect.Lean.Engine.Results.Analysis.Analyses.Messages35 QuantConnect.Lean.Engine.TransactionHandlers36 QuantConnect.Lean.Engine.Results37 QuantConnect.Lean.Engine.DataFeeds.Enumerators38 QuantConnect.Lean.Engine.DataFeeds39 QuantConnect.Lean.Engine40 QuantConnect.Report
1 Algorithm.Python.OptionStrategyFactoryMethodsBaseAlgorithm
2 QuantConnect.Orders.Fills6281132
3 QuantConnect.Orders.Slippage7621111
4 QuantConnect.Securities.Future302219
5 QuantConnect.Securities.Positions1357115
6 QuantConnect.Util124252116
7 QuantConnect.Securities.Option11175743121315120
8 QuantConnect.Statistics1221135
9 QuantConnect.Packets449124
10 QuantConnect.Brokerages2313861171123487
11 QuantConnect.Securities11222132161315288155
12 QuantConnect.Orders12121229129
13 QuantConnect.Scheduling1249
14 QuantConnect.Api11112112
15 QuantConnect.Commands311219
16 QuantConnect.Interfaces112391014121272173192144
17 QuantConnect.Algorithm.Framework.Portfolio.SignalExports311835
18 QuantConnect.Python5235341751253137
19 QuantConnect.Indicators6311663631
20 QuantConnect.Data.Consolidators31181810
21 QuantConnect.Data.Market129111147530
22 QuantConnect.Data.Auxiliary2152233
23 QuantConnect.Data2152534181259
24 QuantConnect.Data.UniverseSelection1123415152848
25 QuantConnect.Algorithm.Framework.Portfolio193258111521
26 QuantConnect.Algorithm.Framework.Selection923112361716
27 QuantConnect.Algorithm.Framework.Execution2312151294
28 QuantConnect.Algorithm1222414761212111462131314211318
29 QuantConnect.Algorithm.Framework.Alphas1025212101420
30 QuantConnect114321374349311111919424
31 QuantConnect.Algorithm.CSharp913413237131072722556213319116256411310112634181674
32 QuantConnect.Algorithm.CSharp.Alphas151128221262226
33 QuantConnect.AlgorithmFactory.Python.Wrappers111246312111154211110
34 QuantConnect.Lean.Engine.Results.Analysis.Analyses.Messages2
35 QuantConnect.Lean.Engine.TransactionHandlers36237111123
36 QuantConnect.Lean.Engine.Results58133410151141252
37 QuantConnect.Lean.Engine.DataFeeds.Enumerators37162174112411
38 QuantConnect.Lean.Engine.DataFeeds128113189110264286045
39 QuantConnect.Lean.Engine5331234223
40 QuantConnect.Report5357211825
Uses a module listed above itPart of a loopThe module itself
1 Algorithm.Python.OptionStrategyFactoryMethodsBaseAlgorithm2 QuantConnect.Orders.Fills3 QuantConnect.Orders.Slippage4 QuantConnect.Securities.Future5 QuantConnect.Securities.Positions6 QuantConnect.Util7 QuantConnect.Securities.Option8 QuantConnect.Statistics9 QuantConnect.Packets10 QuantConnect.Brokerages11 QuantConnect.Securities12 QuantConnect.Orders13 QuantConnect.Scheduling14 QuantConnect.Api15 QuantConnect.Commands16 QuantConnect.Interfaces17 QuantConnect.Algorithm.Framework.Portfolio.SignalExports18 QuantConnect.Python19 QuantConnect.Indicators20 QuantConnect.Data.Consolidators21 QuantConnect.Data.Market22 QuantConnect.Data.Auxiliary23 QuantConnect.Data24 QuantConnect.Data.UniverseSelection25 QuantConnect.Algorithm.Framework.Portfolio26 QuantConnect.Algorithm.Framework.Selection27 QuantConnect.Algorithm.Framework.Execution28 QuantConnect.Algorithm29 QuantConnect.Algorithm.Framework.Alphas30 QuantConnect31 QuantConnect.Algorithm.CSharp32 QuantConnect.Algorithm.CSharp.Alphas33 QuantConnect.AlgorithmFactory.Python.Wrappers34 QuantConnect.Lean.Engine.Results.Analysis.Analyses.Messages35 QuantConnect.Lean.Engine.TransactionHandlers36 QuantConnect.Lean.Engine.Results37 QuantConnect.Lean.Engine.DataFeeds.Enumerators38 QuantConnect.Lean.Engine.DataFeeds39 QuantConnect.Lean.Engine40 QuantConnect.ReportAlgorithm.Python.OptionStrategyFactoryMethodsBaseAlgorithm1QuantConnect.Orders.Fills2QuantConnect.Orders.Slippage3QuantConnect.Securities.Future4QuantConnect.Securities.Positions5QuantConnect.Util6QuantConnect.Securities.Option7QuantConnect.Statistics8QuantConnect.Packets9QuantConnect.Brokerages10QuantConnect.Securities11QuantConnect.Orders12QuantConnect.Scheduling13QuantConnect.Api14QuantConnect.Commands15QuantConnect.Interfaces16QuantConnect.Algorithm.Framework.Portfolio.SignalExports17QuantConnect.Python18QuantConnect.Indicators19QuantConnect.Data.Consolidators20QuantConnect.Data.Market21QuantConnect.Data.Auxiliary22QuantConnect.Data23QuantConnect.Data.UniverseSelection24QuantConnect.Algorithm.Framework.Portfolio25QuantConnect.Algorithm.Framework.Selection26QuantConnect.Algorithm.Framework.Execution27QuantConnect.Algorithm28QuantConnect.Algorithm.Framework.Alphas29QuantConnect30QuantConnect.Algorithm.CSharp31QuantConnect.Algorithm.CSharp.Alphas32QuantConnect.AlgorithmFactory.Python.Wrappers33QuantConnect.Lean.Engine.Results.Analysis.Analyses.Messages34QuantConnect.Lean.Engine.TransactionHandlers35QuantConnect.Lean.Engine.Results36QuantConnect.Lean.Engine.DataFeeds.Enumerators37QuantConnect.Lean.Engine.DataFeeds38QuantConnect.Lean.Engine39QuantConnect.Report40628113276211113022191357115124252116111757431213151201221135449124231386117112348711222132161315288155121212291291249111121123112191123910141212721731921443118355235341751253137631166363131181810129111147530215223321525341812591123415152848193258111521923112361716231215129412224147612121114621313142113181025212101420114321374349311111919424913413237131072722556213319116256411310112634181674151128221262226111246312111154211110236237111123581334101511412523716217411241112811318911026428604553312342235357211825+597 more modules (most-connected shown)

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

At a glance — Architecture · 66% · Adequate · gated by AX2 ·

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

At a glance — Readiness · 54% · Adequate · gated by P7 ·

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

At a glance — Performance · 69% · Adequate ·

Security & Compliance — OWASP Top-10 mapping

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

OWASP categoryFindingsSeverity
A05:2025 — Injection47High / Critical
A03:2025 — Software Supply Chain Failures19High / Critical
A07:2025 — Authentication Failures10High / Critical
A02:2025 — Security Misconfiguration9High / Critical

Roadmap

Top priorities: Encrypt sensitive data at rest (ASP.NET Core Data Protection / column encryption) and manage keys in a vault. Skip if delegated to infra (Postgres TDE, KMS, etc.); Resolve the 33 EmptyCatchBlock finding(s) in Explicit Debt — start with REDACTED (2), CustomDataBitcoinAlgorithm.cs (2), CustomDataNIFTYAlgorithm.cs (2); Resolve the 35 WriteOnlyPrivateField finding(s) in Explicit Debt — start with IndicatorSuiteAlgorithm.cs (3), HistoryWithCustomDataSourceRegressionAlgorithm.cs (2), AssetAllocationReportElement.cs (2).

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

Do thisHelpsEffortDimension
Resolve the 4 NoWarnInCsproj finding(s) in Explicit Debt — start with QuantConnect.Algorithm.CSharp.csproj (2), QuantConnect.Tests.csproj (2).+4.6 ptsLowExplicit Debt
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.).+5.3 ptsMediumData Protection
Resolve the 8 REDACTED finding(s) in Secrets (history) — start with REDACTED (4), REDACTED, REDACTED.+2.6 ptsLowSecrets (history)
Resolve the 33 EmptyCatchBlock finding(s) in Explicit Debt — start with REDACTED (2), CustomDataBitcoinAlgorithm.cs (2), CustomDataNIFTYAlgorithm.cs (2).+4.6 ptsMediumExplicit Debt
Resolve the 35 WriteOnlyPrivateField finding(s) in Explicit Debt — start with IndicatorSuiteAlgorithm.cs (3), HistoryWithCustomDataSourceRegressionAlgorithm.cs (2), AssetAllocationReportElement.cs (2).+4.6 ptsMediumExplicit Debt
Sync-over-async (deadlock risk) through `.Result`+3.5 ptsMediumAsync correctness
Resolve the 5 No assertions (empty test) finding(s) in Test Quality — start with OptionBaseIndicatorTests.cs (2), PythonIndicatorTests.cs (2), ClassicRangeConsolidatorTests.cs.+1.6 ptsLowTest Quality
Resolve the 5 Outdated finding(s) in Dependency Hygiene — start with QuantConnect.Logging.csproj, QuantConnect.Report.csproj, QuantConnect.Brokerages.csproj.+1.4 ptsLowDependency Hygiene

File quality

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

FileScoreBandWorst signal
REDACTED0.7SlopSecrets (history): REDACTED: REDACTED
Research/QuantBook.cs1.0SlopExplicit Debt: WriteOnlyPrivateField
REDACTED2.0SlopIaC & Container Security: High IaC: REDACTED
REDACTED2.1SlopSecrets (history): REDACTED: REDACTED
Algorithm.CSharp/BubbleAlgorithm.cs2.3SlopExplicit Debt: EmptyCatchBlock
Common/Extensions.cs2.4SlopExplicit Debt: EmptyCatchBlock
REDACTED2.4SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.7SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.8SlopDependency Vulnerabilities: Critical CVE: REDACTED
Engine/DataFeeds/LiveTradingDataFeed.cs3.4SlopExplicit Debt: EmptyCatchBlock
Messaging/EventMessagingHandler.cs3.6SlopExplicit Debt: WriteOnlyPrivateField
Algorithm.CSharp/CustomDataBitcoinAlgorithm.cs3.6SlopExplicit Debt: EmptyCatchBlock
REDACTED3.7SlopExplicit Debt: EmptyCatchBlock
REDACTED3.7SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.7SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.7SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.7SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.7SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.7SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.7SlopStatic Analysis (SAST): High: REDACTED

How the grades work

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

Critical — 148

A definite problem that already costs you something and drags the score down: a missing authorisation check, a dependency with a known exploit, a build that does not reproduce. Failure here tends to cause failures elsewhere.

Serious — 2098

Likely wrong, but not failing yet. It degrades the codebase over a longer horizon and can cause failures elsewhere — not urgent this week, not something to carry for two years either.

Minor — 1389

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

Could not be resolved — 6

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

Methodology & how to trust this report

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

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

What we checked — 73 dimensions across the health lenses
D1D2D3D4D5D6D10D12D13D14D15D16D17D18D19D20D21D24D26D27D28D29D30D31D34D35D36D43D44AX10AX2AX3AX5AX6AX8C1C4GD1IC1M1M2M3M4P1P10P3P4P6P7PF1PF3S1X1X12X13X16X18X19X2X20X21X22X23X24X25X26X27X28X29X3X30X32X5

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

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

Tools & methods

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

MethodBacksVersionEvaluator
Roslyn static analysisComplexity, cohesion, coupling, dead code, API surface, layering5.3.0✓ deterministic
Native secret scannerHardcoded secrets / credentials1.0.0✓ deterministic
Canine Code Analyzer duplication detector (in-process)Code duplication1.0.0✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.400✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.400✓ deterministic
git / LibGit2SharpChurn hotspots, knowledge concentration, history2.43.0 · 0.31.0✓ deterministic
gitleaks · semgrep · trivy · checkovSecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3 · 3.2.533✓ deterministic

Every finding is locatable in findings.md. Run 01a1cd43-399d-78d2-b9b9-22f438ee3f04.

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

Run transparency — what happened this run

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

  • D8 Code Coverage — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. Coverage NOT MEASURED: `--collect:"XPlat Code Coverage"` names a data collector that ships in the `coverlet.collector` package, and this repository wires up none — no test project references it and no runsettings declares one. The absence of coverage here is therefore not evidence about the suite or about our analyzer environment: without a collector, `--collect` produces nothing even from a suite that builds and passes. Add a `coverlet.collector` PackageReference to the test project(s) (or commit the Cobertura/OpenCover/lcov report your CI produces) and real coverage will be measured. It is excluded from the score rather than counted as a near-zero defect. You can widen what we reach: add the `coverlet.collector` package to the test projects to enable coverage (or commit the Cobertura/OpenCover/lcov report your CI produces).
  • D10 Test Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 5,641 test(s) behind this row are the ones the C# collector could read, and this repository also carries at least 14 test source file(s) (.py) that it cannot: it parses C# syntax and matches C# test attributes, so a vitest/jest/JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
  • D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability not scored — the test tier(s) ran but surfaced none of this repository's 5641 test method(s) to the runner, so flakiness couldn't be exercised. This is an analysis-environment limitation, not a finding about the tests.
  • D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
  • D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
  • D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. D21's deterministic naming rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
  • D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D22 Internal API Consistency — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. The loaded project set declares no packable project and no `.Contracts` project, so there is no intentionally-exposed surface for API consistency to be judged over.
  • D23 Boundary Type-Coupling — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Large codebase (511,145 production LoC in the .NET projects) with no declared bounded contexts — cross-boundary type coupling is unassessed Bounded contexts cannot be inferred from a codebase that is not physically organised by them (D-321), so with none declared there are no boundaries for the coupling pass to measure across. You can widen what we reach: name this codebase's bounded contexts (≥2 module groups, e.g. per subsystem) so cross-boundary type coupling can be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
  • D28 Secrets (history) — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. D28's config-credential rule (WD-SECRET-0002) parses each committed `.json` config as a document and reads credential-named values; `Data/alternative/alphastreams/portfoliostate/623b06b231eb1cc1aa3643a46/20180404.json`, `Data/alternative/alphastreams/portfoliostate/9fc8ef73792331b11dbd5429a/20180404.json` did not parse (JSON5, a template, several concatenated documents), so a credential bound there is UNMEASURED by that rule. gitleaks still scanned the same files as text.
  • D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `Common/Analysis.cs`, `Common/Data/UniverseSelection/BackupUniverseFileDataProvider.cs`, `Engine/Results/Analysis/Analyses/CrisisEventsAnalysis.cs`, `Engine/Results/Analysis/Analyses/InsightsEmittedForDelistedSecuritiesAnalysis.cs`, `Engine/Results/Analysis/Analyses/MarginCallsAnalysis.cs`, … (+48 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
  • AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via ToolchainServer (.). the service exited before it opened a port — `/tmp/wd-venv/bin/python -m flask --app 'Algorithm.Python.CustomSignalExportDemonstrationAlgorithm:app' run --host 127.0.0.1 --port 5000`: Usage: python -m flask run [OPTIONS] Try 'python -m flask run --help' for help. Error: Could not import 'Algorithm.Python.CustomSignalExportDemonstrationAlgorithm'.; runtime evidence skipped (launch chosen because Algorithm.Python/CustomSignalExportDemonstrationAlgorithm.py defines the Flask application 'app' at module level).
  • ED5 Idempotency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Idempotency could not be assessed in this run — the check did not complete, so it is not scored. This is a gap in the analyzer, not a finding about this repository. Engine failure: ArgumentException: Syntax node is not within syntax tree.
  • IC1 Incompleteness & stubs — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 80 further occurrence(s) are not listed individually; the score already reflects all 120.
  • M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
  • X5 Nullable reference types — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 20 further occurrence(s) are not listed individually; the score already reflects all 60.

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

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • 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 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D18 Solution Shape: Build integrity reflects whether the solution compiled in this environment — a build that needs a private feed, a specific SDK, or a generated file absent from the repo can read as broken when it is merely unreproducible here.
  • D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
  • D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
  • D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • 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.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • C4 Data Retention: This control is scored from in-repo evidence only — its real-world effectiveness, exercised only at runtime, is outside a static scan.
  • M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

Dimensions

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

167 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was Exchanges.GetPrimaryExchange at 106. A further 10 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 40 — they are counted neither in the figure above nor in this dimension's score. 9 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: Common/Brokerages/IBrokerageModel.cs (BrokerageModel.Create at 40), Common/Brokerages/FxcmBrokerageModel.cs (FxcmBrokerageModel.IsValidOrderPrices at 26), Common/StringExtensions.cs (StringExtensions.ConvertInvariant at 20), Indicators/CandlestickPatterns/TasukiGap.cs (TasukiGap.ComputeNextValue at 19), Common/Algorithm/Framework/Portfolio/SignalExports/Collective2SignalExport.cs (Collective2SignalExport.GetMICExchangeCode at 18), and 4 more not listed here. They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.

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

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

What to do

  1. Bring the 4 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with Exchanges.GetPrimaryExchange (cyclomatic 106), LeanData.GenerateLine (cyclomatic 100), AlgorithmManager.Run (cyclomatic 72). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 4 together lifts Cyclomatic Complexity from 6.0 to about 6.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.

Detailed fixes: 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: Documented → Verified → Prevented · effective 5.3 / 10 · rule-coverage 100% · ceiling Prevented

325 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 175)Engine/AlgorithmManager.cs:121
SubscriptionSynchronizer.Sync (cognitive 106)Engine/DataFeeds/SubscriptionSynchronizer.cs:88
RandomDataGenerator.Run (cognitive 97)ToolBox/RandomDataGenerator/RandomDataGenerator.cs:53

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

What to do

  1. Bring the 3 bodies over 120 down to 120 or less in Cognitive Complexity — start with LeanData.GenerateLine (cognitive 187), TimeSliceFactory.Create (cognitive 182), AlgorithmManager.Run (cognitive 175). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 3 together lifts Cognitive Complexity from 5.4 to about 5.8/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.

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

D3 · God Classes9.6 / 10Stronggated by 55 serious findings✓ Tool-verified

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

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

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

55 god class(es) detected.

TooManyMethods: QCAlgorithm · ×26Algorithm/QCAlgorithm.Indicators.cs
MethodTooLong: LeanData.GenerateLine · ×14Common/Util/LeanData.cs:90
FileTooLong: Algorithm/QCAlgorithm.Indicators.cs · ×12Algorithm/QCAlgorithm.Indicators.cs
ClassTooLong: FillModel · ×3Common/Orders/Fills/FillModel.cs

What to do

  1. Resolve the 26 TooManyMethods finding(s) in God Classes — start with QCAlgorithm.Indicators.cs, AlgorithmPythonWrapper.cs, Api.cs. — One of this dimension's main actionable groups (26 warning-level).
  2. Resolve the 14 MethodTooLong finding(s) in God Classes — start with LeanData.cs, AlgorithmManager.cs, Engine.cs. — One of this dimension's main actionable groups (14 warning-level).
  3. Resolve the 12 FileTooLong finding(s) in God Classes — start with QCAlgorithm.Indicators.cs, QCAlgorithm.cs, BrokerageTransactionHandler.cs. — One of this dimension's main actionable groups (12 warning-level).

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

D4 · Code Duplication9.5 / 10Stronggated by 1004 serious findings✓ Tool-verified

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

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

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

519 duplicated block group(s) detected. A further 485 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 11 of the 1004 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.

Duplicated block (6 lines × 2) · ×31Algorithm.CSharp/OptionEquityBearCallLadderRegressionAlgorithm.cs:56
Duplicated block (7 lines × 2) · ×29Common/Data/Auxiliary/CorporateFactorProvider.cs:113
Duplicated block (11 lines × 2) · ×27Algorithm.CSharp/BaseFrameworkRegressionAlgorithm.cs:42
Duplicated block (5 lines × 2) · ×26Algorithm.CSharp/IndexOptionCallCalendarSpreadAlgorithm.cs:61
Edited copy of a member (9 corresponding lines) · ×25Common/Securities/ContractSecurityFilterUniverse.cs:271

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

What to do

  1. Resolve the 31 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with IndexOptionCallITMExpiryRegressionAlgorithm.cs (2), OptionStrategyPositionGroupBuyingPowerModel.cs (2), OptionEquityBearCallLadderRegressionAlgorithm.cs. — One of this dimension's main actionable groups (31 warning-level).
  2. Resolve the 29 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with CustomDataLinkedIconicTypeAddDataCoarseSelectionRegressionAlgorithm.py (2), FutureOptionCallITMExpiryRegressionAlgorithm.py (2), ReportCharts.py (2). — One of this dimension's main actionable groups (29 warning-level).
  3. Resolve the 27 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with CoarseFineFundamentalComboAlgorithm.cs (2), BaseFrameworkRegressionAlgorithm.cs, UniverseExtensions.cs. — One of this dimension's main actionable groups (27 warning-level).

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

D5 · Coupling8.3 / 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: Documented → Verified → Prevented · effective 8.3 / 10 · rule-coverage 100% · ceiling Prevented

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

Off the main sequence: QuantConnect.Configuration · ×5Configuration/QuantConnect.Configuration.csproj:1

What to do

  1. Resolve the 5 Off the main sequence finding(s) in Coupling — start with QuantConnect.Configuration.csproj, QuantConnect.Logging.csproj, REDACTED. — One of this dimension's main actionable groups (5 warning-level).

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

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

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

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

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

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

8 of 1086 classes have LCOM4 above 3.

Low cohesion: Security (LCOM4 9) · ×8Common/Securities/Security.cs:47

What to do

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

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

D10 · Test Quality9.9 / 10Adequategated by 5 critical findings✓ Tool-verified

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

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

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

48 skipped (32 with a documented reason), 10 zero-assertion, 1 synchronised by a fixed sleep, 1 whose failure is swallowed by a catch-all, 1 mock references across 5641 tests. Measured on the C# suite only — at least 14 test source file(s) (.py) went unread, so its test quality is unmeasured and is not in these counts.

No assertions (empty test): PriceGapBehaviorIsTheExpectedOne · ×5Tests/Common/Data/ClassicRangeConsolidatorTests.cs:35
Skipped test: BuyingPowerForStrategyStartingFromOptionPositionInOppositeDirectionAndLiquidating · ×16Tests/Common/Securities/OptionStrategyPositionGroupBuyingPowerModelTests.cs:2510
No assertions: TestGetChartUpdatesWhileAdding · ×5Tests/Algorithm/AlgorithmPlottingTests.cs:92
Test cannot fail: DoesNotParseCSVTests/Common/Securities/SecurityDefinitionTests.cs:43
Fixed-sleep synchronisation: DoesNotSetRunTimeErrorWhenReconnectMessageComesThroughTests/Engine/DefaultBrokerageMessageHandlerTests.cs:54

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

What to do

  1. Resolve the 5 No assertions (empty test) finding(s) in Test Quality — start with OptionBaseIndicatorTests.cs (2), PythonIndicatorTests.cs (2), ClassicRangeConsolidatorTests.cs. — One of this dimension's main actionable groups (5 issue-level).
  2. Resolve the 16 Skipped test finding(s) in Test Quality — start with PythonPackagesTests.cs (10), OptionStrategyPositionGroupBuyingPowerModelTests.cs (3), SymbolPropertiesDatabaseTests.cs (2). — One of this dimension's main actionable groups (16 warning-level).
  3. Resolve the 5 No assertions finding(s) in Test Quality — start with AlgorithmPlottingTests.cs, SecurityExchangeHoursTests.cs, ConcurrentSetTests.cs. — One of this dimension's main actionable groups (5 warning-level).

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

D12 · Dependency Hygiene8.3 / 10Strong✓ Tool-verified

What it measures: Whether dependencies are current, not deprecated, and not bloated. Known vulnerabilities are D30's.

Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (capped-linear for deprecation, prerelease and outdated) per KLoC. Known-vulnerable packages are D30's and are not charged here (rubric-2026.11.2). Exhaustive.

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

23 outdated, 1 vulnerable, 1 deprecated packages.

Deprecated: DotNetZipREDACTED:32
Outdated: System.ComponentModel.Composition · ×5Logging/QuantConnect.Logging.csproj:37
Outdated: Newtonsoft.Json · ×18

What to do

  1. Resolve the 5 Outdated finding(s) in Dependency Hygiene — start with QuantConnect.Logging.csproj, QuantConnect.Report.csproj, QuantConnect.Brokerages.csproj. — One of this dimension's main actionable groups (5 recommendation-level).
  2. Resolve the 1 Deprecated finding(s) in Dependency Hygiene — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).

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

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

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

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

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

REDACTED scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

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

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

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

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

0 of 268 packages use a banned license. ★ DEPTH: this repository's MSBuild projects declare 33 direct `PackageReference`(s), and 187 further package(s) were reached beyond them by closing the graph over nuget.org's own nuspec dependency graph — so a banned licence pulled in only by a dependency's OWN dependencies is inside this verdict. A package whose licence nuget.org could not be asked for is not graded, and version ranges are taken at their lower bound, so this is the closure as that graph states it rather than a restored consumer's exact resolution.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

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

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

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

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

Top hotspots: Engine/TransactionHandlers/BrokerageTransactionHandler.cs (7×42=294); Engine/Results/BacktestingResultHandler.cs (9×17=153); Engine/DataFeeds/UniverseSelection.cs (4×38=152)

Hotspot: Engine/TransactionHandlers/BrokerageTransactionHandler.cs · ×7Engine/TransactionHandlers/BrokerageTransactionHandler.cs:1267

What to do

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

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

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

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

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

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

135 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is Common/Securities/Option/OptionFilterUniverse.cs. Counted over 1880 of the 2749 production source files in this repository: 628 are under the ~2,400-byte size floor this dimension measures over, and the remaining 241 have no attributable history left to measure.

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.3 / 10Adequategated by 80 critical findings✓ Tool-verified

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

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

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

301 deducted debt markers + 50 dead symbols across 511145 LoC in the .NET projects (0.3/KLoC) → score 9.3.

WriteOnlyPrivateField · ×35Algorithm.CSharp/BasicTemplateMultiAssetAlgorithm.cs:41
EmptyCatchBlock · ×33Algorithm.CSharp/BracketOrderLimitEntryRegressionAlgorithm.cs:87
NoWarnInCsproj · ×4Algorithm.CSharp/QuantConnect.Algorithm.CSharp.csproj:13
InvertedNullGuard · ×3Algorithm.CSharp/BasicTemplateFuturesAlgorithm.cs:114
FileScopedPragmaDisable · ×2Tests/Common/Util/DisposableExtensionsTests.cs:25

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

What to do

  1. Resolve the 35 WriteOnlyPrivateField finding(s) in Explicit Debt — start with IndicatorSuiteAlgorithm.cs (3), HistoryWithCustomDataSourceRegressionAlgorithm.cs (2), AssetAllocationReportElement.cs (2). — One of this dimension's main actionable groups (35 issue-level).
  2. Resolve the 33 EmptyCatchBlock finding(s) in Explicit Debt — start with REDACTED (2), CustomDataBitcoinAlgorithm.cs (2), CustomDataNIFTYAlgorithm.cs (2). — One of this dimension's main actionable groups (33 issue-level).
  3. Resolve the 4 NoWarnInCsproj finding(s) in Explicit Debt — start with QuantConnect.Algorithm.CSharp.csproj (2), QuantConnect.Tests.csproj (2). — One of this dimension's main actionable groups (4 issue-level).

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

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

23 projects, 3620 source files, 699974 hand-written lines of code (511145 production / 188829 test — the split is derived per file: test is what its project, its own path, or a compile-guarded region marks as test, and a file carrying no test signal counts as production), 118 inter-project edges.

✓ On the Gold path — maintain.

Detailed fixes: d18_recommendation.md.

D19 · Documentation Quality7.5 / 10Strong✓ Tool-verified

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

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

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

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

Documentation: no build, run or usage exampleToolBox/README.md:1

What to do

  1. Resolve the 1 Documentation finding(s) in Documentation Quality — start with README.md. — One of this dimension's main actionable groups (1 recommendation-level).

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

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

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

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

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

No architecture decision records were found.

No ADRs 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 Consistency7.9 / 10Strong✓ Tool-verified

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

Method: Seven vocabulary-free rules (N1-N7) mine each naming convention from the repository and flag a name that breaks a convention its structural peers in the same unit follow; production C# and TypeScript, each its own population. Deterministic, no model, no sample. Advisory.

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

5 naming inconsistencies among 237 declarations measured against a convention their peers follow.

`ConvertToCSVFormat` spells `CSV` where 22 names in the project spell it `Csv`Common/Algorithm/Framework/Portfolio/SignalExports/CrunchDAOSignalExport.cs:141
`GetCurrentRoundID` spells `ID` where 256 names in the project spell it `Id`Common/Algorithm/Framework/Portfolio/SignalExports/CrunchDAOSignalExport.cs:216
`GetFxcmIDFromSymbol` spells `ID` where 256 names in the project spell it `Id`Common/Data/Custom/FxcmVolume.cs:198
`OrganizationID` spells `ID` where 256 names in the project spell it `Id`Common/Globals.cs:56
`TypesCSV` spells `CSV` where 22 names in the project spell it `Csv`Common/Packets/SecurityTypesPacket.cs:35

What to do

  1. Resolve the 1 `ConvertToCSVFormat` spells `CSV` where 22 names in the project spell it… finding(s) in Naming Consistency — start with CrunchDAOSignalExport.cs. — One of this dimension's main actionable groups (1 recommendation-level).
  2. Resolve the 1 `GetCurrentRoundID` spells `ID` where 256 names in the project spell it… finding(s) in Naming Consistency — start with CrunchDAOSignalExport.cs. — One of this dimension's main actionable groups (1 recommendation-level).
  3. Resolve the 1 `GetFxcmIDFromSymbol` spells `ID` where 256 names in the project spell… finding(s) in Naming Consistency — start with FxcmVolume.cs. — One of this dimension's main actionable groups (1 recommendation-level).

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

D24 · Comment Value5.0 4.7 / 10Weak✓ Tool-verified

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

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

Maturity: Documented → Verified → Prevented · effective 4.7 / 10 · rule-coverage 94% · ceiling Documented

564 of 11192 judged comments only repeat the code they sit on (5.0 %). 938 comment(s) in another language or script were not judged.

redundant comment · ×446Algorithm.CSharp/AccumulativeInsightPortfolioRegressionAlgorithm.cs:40
doc comments repeat the names · ×21Common/Algorithm/Framework/Alphas/InsightScore.cs:108

What to do

  1. Resolve the 446 redundant comment finding(s) in Comment Value — start with AssemblyInfo.cs (66), Engine.cs (4), BacktestingSetupHandler.cs (4). — One of this dimension's main actionable groups (446 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.

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

4 of 23 projects flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion · ×4Common/QuantConnect.csproj:1

What to do

  1. Resolve the 4 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with QuantConnect.csproj, QuantConnect.Algorithm.CSharp.csproj, QuantConnect.Lean.Engine.csproj. — One of this dimension's main actionable groups (4 recommendation-level).

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

D27 · Navigability5.5 / 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. C# also names each pass-through layer (a class whose every public method only forwards its own parameters to one collaborator) as a located finding; the score is not affected.

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

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

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

Pass-through layerCompression/ZipStreamWriter.cs:25

What to do

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

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

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

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

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

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

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

REDACTED
REDACTED
REDACTED

What to do

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

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

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

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

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

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

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

47 finding(s): 0 critical, 30 high, 16 medium, 1 low. 12 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 58 file(s) — `Algorithm.CSharp/StressSymbols.cs`, `Common/Analysis.cs` (line 26, line 31, line 57), `Common/Data/UniverseSelection/BackupUniverseFileDataProvider.cs` (line 44, line 45), `Data/alternative/alphastreams/portfoliostate/623b06b231eb1cc1aa3643a46/20180404.json`, `Data/alternative/alphastreams/portfoliostate/9fc8ef73792331b11dbd5429a/20180404.json`, … (+53 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. In 1 of those file(s) — `Common/Analysis.cs` — the break is a C# primary constructor, which semgrep's grammar cannot parse and which hides the type from every rule scoped to it; those files were re-scanned from a shadow copy with the constructor's parameter list blanked (line and column preserving), which restores the type to the rules, and 0 additional row(s) came from that pass. Only the header's own parameter list is unread in them. Separately, one or more rules could not re-parse an embedded snippet in 2 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

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

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

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

What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.

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

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

5 finding(s): 1 critical, 4 high, 0 medium, 0 low.

REDACTED
REDACTED

What to do

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

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

D31 · IaC & Container Security8.7 / 10Adequategated by 3 critical findings✓ Tool-verified

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

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

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

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

REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 3 High IaC finding(s) in IaC & Container Security — start with REDACTED (3). — One of this dimension's main actionable groups (3 issue-level).
  2. Resolve the 4 Low IaC finding(s) in IaC & Container Security — start with REDACTED (4). — One of this dimension's main actionable groups (4 recommendation-level).
  3. Resolve the 2 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (2). — One of this dimension's main actionable groups (2 warning-level).

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

D34 · Knowledge Freshness6.5 / 10Adequate✓ Tool-verified

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

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

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

752 of 2121 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. Counted over 2121 of the 2749 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned knowledge · ×11Algorithm.CSharp/StressSymbols.cs:1
Orphaned file · ×741Common/Util/LinqExtensions.cs:1
Further orphaned files (smaller)

What to do

  1. Resolve the 741 Orphaned file finding(s) in Knowledge Freshness — start with LinqExtensions.cs, HistoryAlgorithm.cs, IndicatorBase.Operators.cs. — One of this dimension's main actionable groups (741 recommendation-level).
  2. Resolve the 11 Orphaned knowledge finding(s) in Knowledge Freshness — start with StressSymbols.cs, CandlestickPatterns.cs, AssetClassificationHelper.cs. — One of this dimension's main actionable groups (11 issue-level).
  3. 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 / 10Stronggated by 2 serious findings✓ Tool-verified

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

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

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

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

Strongest change-coupling: BlackLittermanOptimizationPortfolioConstructionModel.py↔MeanVarianceOptimizationPortfolioConstructionModel.py 58%; DefaultBrokerageModel.cs↔BrokerageModelPythonWrapper.cs 50%

Change coupling: BlackLittermanOptimizationPortfolioConstructionModel.py ↔ MeanVarianceOptimizationPortfolioConstructionModel.py · ×2Algorithm.Framework/Portfolio/BlackLittermanOptimizationPortfolioConstructionModel.py:1

What to do

  1. Resolve the 2 Change coupling finding(s) in Change Coupling — start with BlackLittermanOptimizationPortfolioConstructionModel.py, DefaultBrokerageModel.cs. — One of this dimension's main actionable groups (2 warning-level).

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

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

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

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

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

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

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

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

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

D44 · Platform End-of-Life10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

Frontend & cross-cutting dimensions

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

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. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does.

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

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

What to do

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

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

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

  • `AlgorithmManager` is not registered, but `Program` creates it and keeps it in the static `algorithmManager`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_algorithm, _performanceTrackingTool, _cancellationTokenSource, AlgorithmId; e.g. `_algorithm` at line 125). — Engine/AlgorithmManager.cs:47
  • `CpuPerformance` is not registered, but `OS` creates it and keeps it in the static `CpuPerformanceCounter`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (CpuPercentage; e.g. `CpuPercentage` at line 217). — Common/OS.cs:173
  • `SecurityIdentifier` keeps one instance of itself in the static `Empty`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_date, _market, _strikePrice, _optionRight, _optionStyle, _hashCode; e.g. `_date` at line 179). — Common/SecurityIdentifier.cs:39
  • `Symbol` keeps one instance of itself in the static `Empty`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_canonical, _isEmpty; e.g. `_canonical` at line 343). — Common/Symbol.cs:31
  • `OptionPriceModelResultData` keeps one instance of itself in the static `Null`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_tradeBar, _quoteBar, _openInterest, _underlying; e.g. `_tradeBar` at line 309). — Common/Data/Market/OptionContract.cs:260
  • `OptionPositionCollection` keeps one instance of itself in the static `Empty`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_orderedPositions; e.g. `_orderedPositions` at line 578). — Common/Securities/Option/StrategyMatcher/OptionPositionCollection.cs:29
  • `WeightedWorkQueue` is not registered, but the singleton `WeightedWorkScheduler` creates it and keeps it in `_workerQueues`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (_singleCallWork, _workQueue, _removed, _pointer; e.g. `_singleCallWork` at line 79). — Engine/DataFeeds/WorkScheduling/WeightedWorkQueue.cs:25
  • `WorkItem` is not registered, but the singleton `WeightedWorkScheduler` creates it and keeps it in `_newWork`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (Weight; e.g. `Weight` at line 60). — Engine/DataFeeds/WorkScheduling/WorkItem.cs:25
  • `PerformanceTrackingTool` is not registered, but `Engine` creates it and hands it to the singleton `AlgorithmManager`, which keeps it in `_performanceTrackingTool`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (_algorithm, _sampleEnabled, _onData, _dataSubscription, _schedule, _selection; e.g. `_algorithm` at line 79). — Common/Util/PerformanceTrackingTool.cs:26
  • `PerformanceTimer` is not registered, but the singleton `PerformanceTrackingTool` creates it and keeps it in `_onData`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (_start, _currentTicks, _totalSeconds; e.g. `_start` at line 36). — Common/Util/PerformanceTimer.cs:26
  • `LeanEngineAlgorithmHandlers` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_mapfileProvider, _factorFileProvider, _dataProvider; e.g. `_mapfileProvider` at line 221). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — Engine/LeanEngineAlgorithmHandlers.cs:37
  • `LiveOptionChainProvider` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_cmeRateGate; e.g. `_cmeRateGate` at line 144). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — Engine/DataFeeds/LiveOptionChainProvider.cs:38
  • `LiveTradingDataFeed` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_lastUtcDateShiftUpdate, _scheduledUniverseUtcTimeShift; e.g. `_lastUtcDateShiftUpdate` at line 412). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — Engine/DataFeeds/LiveTradingDataFeed.cs:41
  • `TextSubscriptionDataSourceReader` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (CacheSize; e.g. `CacheSize` at line 219). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — Engine/DataFeeds/TextSubscriptionDataSourceReader.cs:32
  • `RemoteFileSubscriptionStreamReader` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_downloader; e.g. `_downloader` at line 170). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — Engine/DataFeeds/Transport/RemoteFileSubscriptionStreamReader.cs:31
  • `Extensions` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (InvalidSecurityTypes, PythonActivators, _notifiedUniverseSettingsUsed; e.g. `InvalidSecurityTypes` at line 2323). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — Common/Extensions.cs:72
  • `Globals` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (CacheDataFolder, DataFolder, Version, LiveMode, UserId, ProjectId; e.g. `CacheDataFolder` at line 78). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — Common/Globals.cs:26
  • `Market` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (Markets, ReverseMarkets; e.g. `Markets` at line 312). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — Common/Market.cs:25
  • `Messages` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_algorithmLanguage; e.g. `_algorithmLanguage` at line 40). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — Common/Messages/Messages.Algorithm.cs:23
  • `OS` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (CpuPerformanceCounter; e.g. `CpuPerformanceCounter` at line 159). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — Common/OS.cs:31
  • `PortfolioTarget` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (MinimumOrderMarginPercentageWarningSent; e.g. `MinimumOrderMarginPercentageWarningSent` at line 183). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — Common/Algorithm/Framework/Portfolio/PortfolioTarget.cs:29
  • `DividendYieldProvider` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_cacheClearTask; e.g. `_cacheClearTask` at line 141). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — Common/Data/DividendYieldProvider.cs:31
  • `InterestRateProvider` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_lastInterestRateDate; e.g. `_lastInterestRateDate` at line 89). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — Common/Data/InterestRateProvider.cs:30
  • `GenericDataDictionary` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_genericCache; e.g. `_genericCache` at line 857). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — Common/Data/Slice.cs:815
  • `IntrinioConfig` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (RateGate, User, Password; e.g. `RateGate` at line 57). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — Common/Data/Custom/Intrinio/IntrinioConfig.cs:24
  • `Tiingo` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (AuthCode, IsAuthCodeSet; e.g. `AuthCode` at line 41). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — Common/Data/Custom/Tiingo/Tiingo.cs:21
  • `FundamentalService` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_fundamentalDataProvider; e.g. `_fundamentalDataProvider` at line 60). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — Common/Data/UniverseSelection/FundamentalService.cs:27
  • `CommandPythonWrapper` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_linkSerializationMethod; e.g. `_linkSerializationMethod` at line 115). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — Common/Python/CommandPythonWrapper.cs:28
  • `PythonInitializer` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_isInitialized, _pendingPathAdditions, _algorithmLocation, PathToVirtualEnv, IncludeSystemPackages; e.g. `_isInitialized` at line 64). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — Common/Python/PythonInitializer.cs:31
  • `MarketHoursDatabase` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_alwaysOpenMarketHoursDatabase; e.g. `_alwaysOpenMarketHoursDatabase` at line 54). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — Common/Securities/MarketHoursDatabase.cs:33
  • `OptionFilterUniverse` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_defaultAtTheMoneyStrikeDistance; e.g. `_defaultAtTheMoneyStrikeDistance` at line 1347). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — Common/Securities/Option/OptionFilterUniverse.cs:1328
  • `PythonObjectStore` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_jsonDeserializeMethod, _dataFrameSerializeMethod, _dataFrameDeserializeMethod, _jsonSerializeMethod; e.g. `_jsonDeserializeMethod` at line 214). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — Common/Storage/PythonObjectStore.cs:26
  • `Composer` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (PluginDirectory; e.g. `PluginDirectory` at line 44). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — Common/Util/Composer.cs:38
  • `ObjectActivator` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_cloneMethodsByType, _activatorsByType; e.g. `_cloneMethodsByType` at line 109). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — Common/Util/ObjectActivator.cs:29
  • `Log` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_logHandler, _debuggingEnabled, _level, UserId, ProjectId, JobId; e.g. `_logHandler` at line 61). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — Logging/Log.cs:30
  • `CandleSettings` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (DefaultSettings; e.g. `DefaultSettings` at line 61). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — Indicators/CandlestickPatterns/CandleSettings.cs:23
  • `Config` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (ConfigurationFileName; e.g. `ConfigurationFileName` at line 45). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — REDACTED:31
  • `AllShortableSymbolsCoarseSelectionRegressionAlgorithm` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_coarseSelected; e.g. `_coarseSelected` at line 156). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — Algorithm.CSharp/AllShortableSymbolsCoarseSelectionRegressionAlgorithm.cs:32
  • `CoarseNoLookAheadBiasAlgorithm` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_coarsePrices; e.g. `_coarsePrices` at line 77). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — Algorithm.CSharp/CoarseNoLookAheadBiasAlgorithm.cs:26
  • `IncrementallyGeneratedCustomData` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_step; e.g. `_step` at line 98). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt. — Algorithm.CSharp/RegressionTests/CustomData/CustomDataUnlinkedTradeBarIconicTypeConsolidationRegressionAlgorithm.cs:69

What to do

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

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

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

  • The namespaces QuantConnect ↔ QuantConnect.Algorithm ↔ QuantConnect.Algorithm.Framework ↔ QuantConnect.Algorithm.Framework.Alphas ↔ QuantConnect.Algorithm.Framework.Alphas.Analysis ↔ QuantConnect.Algorithm.Framework.Alphas.Serialization ↔ QuantConnect.Algorithm.Framework.Execution ↔ QuantConnect.Algorithm.Framework.Portfolio ↔ QuantConnect.Algorithm.Framework.Portfolio.SignalExports ↔ QuantConnect.Algorithm.Framework.Risk ↔ QuantConnect.Algorithm.Framework.Selection ↔ QuantConnect.Api ↔ QuantConnect.Brokerages ↔ QuantConnect.Brokerages.Authentication ↔ QuantConnect.Brokerages.CrossZero ↔ QuantConnect.Commands ↔ QuantConnect.Data ↔ QuantConnect.Data.Auxiliary ↔ QuantConnect.Data.Consolidators ↔ QuantConnect.Data.Fundamental ↔ QuantConnect.Data.Market ↔ QuantConnect.Data.UniverseSelection ↔ QuantConnect.Indicators ↔ QuantConnect.Indicators.CandlestickPatterns ↔ QuantConnect.Interfaces ↔ QuantConnect.Optimizer ↔ QuantConnect.Optimizer.Objectives ↔ QuantConnect.Optimizer.Strategies ↔ QuantConnect.Orders ↔ QuantConnect.Orders.Fees ↔ QuantConnect.Orders.Fills ↔ QuantConnect.Orders.OptionExercise ↔ QuantConnect.Orders.Serialization ↔ QuantConnect.Orders.Slippage ↔ QuantConnect.Packets ↔ QuantConnect.Python ↔ QuantConnect.Scheduling ↔ QuantConnect.Securities ↔ QuantConnect.Securities.Cfd ↔ QuantConnect.Securities.Crypto ↔ QuantConnect.Securities.CryptoFuture ↔ QuantConnect.Securities.CurrencyConversion ↔ QuantConnect.Securities.Equity ↔ QuantConnect.Securities.Forex ↔ QuantConnect.Securities.Future ↔ QuantConnect.Securities.Index ↔ QuantConnect.Securities.IndexOption ↔ QuantConnect.Securities.Interfaces ↔ QuantConnect.Securities.Option ↔ QuantConnect.Securities.Option.StrategyMatcher ↔ QuantConnect.Securities.Positions ↔ QuantConnect.Securities.Volatility ↔ QuantConnect.Statistics ↔ QuantConnect.Storage ↔ QuantConnect.Util depend on each other. The lightest dependency in the cycle is QuantConnect → QuantConnect.Commands (QuantConnect.BaseCommandHandler → QuantConnect.Commands.ICommand, 1 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface. — Common/Messages/Messages.Commands.cs:17
  • The namespaces QuantConnect.Lean.Engine.Results ↔ QuantConnect.Lean.Engine.Results.Analysis ↔ QuantConnect.Lean.Engine.Results.Analysis.Analyses ↔ QuantConnect.Lean.Engine.Results.Analysis.Analyses.Messages ↔ QuantConnect.Lean.Engine.TransactionHandlers depend on each other. The lightest dependency in the cycle is QuantConnect.Lean.Engine.Results → QuantConnect.Lean.Engine.Results.Analysis (QuantConnect.Lean.Engine.Results.BacktestingResultHandler → QuantConnect.Lean.Engine.Results.Analysis.ResultsAnalyzer, 1 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface. — Engine/Results/BacktestingResultHandler.cs:23
  • The namespaces QuantConnect.Lean.Engine.DataFeeds ↔ QuantConnect.Lean.Engine.DataFeeds.Enumerators ↔ QuantConnect.Lean.Engine.DataFeeds.Enumerators.Factories depend on each other. The lightest dependency in the cycle is QuantConnect.Lean.Engine.DataFeeds → QuantConnect.Lean.Engine.DataFeeds.Enumerators.Factories (QuantConnect.Lean.Engine.DataFeeds.FileSystemDataFeed → QuantConnect.Lean.Engine.DataFeeds.Enumerators.Factories.SubscriptionDataReaderSubscriptionEnumeratorFactory, 1 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface. — Engine/DataFeeds/FileSystemDataFeed.cs:27
  • The namespaces QuantConnect.Lean.Engine ↔ QuantConnect.Lean.Engine.Server depend on each other. The lightest dependency in the cycle is QuantConnect.Lean.Engine → QuantConnect.Lean.Engine.Server (QuantConnect.Lean.Engine.AlgorithmManager → QuantConnect.Lean.Engine.Server.ILeanManager, 2 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface. — Engine/AlgorithmManager.cs:32
  • The namespaces QuantConnect.Report ↔ QuantConnect.Report.ReportElements depend on each other. The lightest dependency in the cycle is QuantConnect.Report → QuantConnect.Report.ReportElements (QuantConnect.Report.Report → QuantConnect.Report.ReportElements.IReportElement, 1 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface. — REDACTED:25

What to do

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

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

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

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

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

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

  • `IResultHandler` declares 24 members: `Messages`, `IsActive`, `OnSecuritiesChanged`, `OnWarmupFinished`, `Initialize`, `DebugMessage`, `SystemDebugMessage`, `SecurityType`, `LogMessage`, `ErrorMessage`, `RuntimeError`, `BrokerageMessage`, `Sample`, `SetAlgorithm`, `SendStatusUpdate`, `RuntimeStatistic`, `AddDeploymentDetail`, `DeploymentDetails`, `OrderEvent`, `Exit`, `ProcessSynchronousEvents`, `SaveResults`, `AlgorithmNameUpdated`, `AlgorithmTagsUpdated`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — Engine/Results/IResultHandler.cs:35
  • `IBrokerageModel` declares 18 members: `AccountType`, `RequiredFreeBuyingPowerPercent`, `DefaultMarkets`, `CanSubmitOrder`, `CanUpdateOrder`, `CanExecuteOrder`, `ApplySplit`, `GetLeverage`, `GetBenchmark`, `GetFillModel`, `GetFeeModel`, `GetSlippageModel`, `GetSettlementModel`, `GetMarginInterestRateModel`, `GetSettlementModel`, `GetBuyingPowerModel`, `GetBuyingPowerModel`, `GetShortableProvider`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. Those 18 declarations carry 16 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 16 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — Common/Brokerages/IBrokerageModel.cs:34
  • `IAlgorithm` declares 126 members: `InsightsGenerated`, `TimeKeeper`, `SubscriptionManager`, `ProjectId`, `Securities`, `UniverseManager`, `Portfolio`, `Transactions`, `BrokerageModel`, `BrokerageName`, `RiskFreeInterestRateModel`, `BrokerageMessageHandler`, `Notify`, `Schedule`, `HistoryProvider`, `Status`, `IsWarmingUp`, `Name`, `Tags`, `NameUpdated`, `TagsUpdated`, `Time`, `TimeZone`, `UtcTime`, `StartDate`, `EndDate`, `AlgorithmId`, `LiveMode`, `AlgorithmMode`, `DeploymentTarget`, `UniverseSettings`, `DebugMessages`, `ErrorMessages`, `LogMessages`, `RunTimeError`, `RuntimeStatistics`, `Statistics`, `Benchmark`, `TradeBuilder`, `Settings`, and 86 more. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. Those 126 declarations carry 119 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 119 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — Common/Interfaces/IAlgorithm.cs:52
  • `IAlgorithmSettings` declares 19 members: `AutomaticIndicatorWarmUp`, `RebalancePortfolioOnSecurityChanges`, `RebalancePortfolioOnInsightChanges`, `MaxAbsolutePortfolioTargetPercentage`, `MinAbsolutePortfolioTargetPercentage`, `MinimumOrderMarginPortfolioPercentage`, `FreePortfolioValue`, `FreePortfolioValuePercentage`, `LiquidateEnabled`, `DailyPreciseEndTime`, `DailyConsolidationUseExtendedMarketHours`, `DataSubscriptionLimit`, `StalePriceTimeSpan`, `WarmupResolution`, `TradingDaysPerYear`, `DatabasesRefreshPeriod`, `IgnoreUnknownAssetHoldings`, `PerformanceSamplePeriod`, `SeedInitialPrices`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — Common/Interfaces/IAlgorithmSettings.cs:24
  • `IApi` declares 65 members: `Initialize`, `CreateProject`, `ReadProject`, `UpdateProject`, `AddProjectFile`, `UpdateProjectFileName`, `UpdateProjectFileContent`, `ReadProjectFile`, `ReadProjectFiles`, `ReadProjectNodes`, `UpdateProjectNodes`, `DeleteProjectFile`, `DeleteProject`, `ListProjects`, `CreateCompile`, `ReadCompile`, `CreateBacktest`, `ReadBacktest`, `UpdateBacktest`, `UpdateBacktestTags`, `DeleteBacktest`, `ListBacktests`, `ReadBacktestInsights`, `ReadBacktestOrders`, `ReadBacktestLog`, `EstimateOptimization`, `CreateOptimization`, `ListOptimizations`, `ReadOptimization`, `AbortOptimization`, `UpdateOptimization`, `DeleteOptimization`, `ReadLiveLogs`, `ReadLiveChart`, `ReadLivePortfolio`, `ReadLiveInsights`, `ReadLiveInsights`, `ReadLiveOrders`, `ReadDataLink`, `ReadDataDirectory`, and 25 more. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. Those 65 declarations carry 64 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 64 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — Common/Interfaces/IApi.cs:32
  • `IBrokerage` declares 23 members: `OrderIdChanged`, `OrdersStatusChanged`, `OrderUpdated`, `OptionPositionAssigned`, `OptionNotification`, `NewBrokerageOrderNotification`, `DelistingNotification`, `AccountChanged`, `Message`, `Name`, `IsConnected`, `GetOpenOrders`, `GetAccountHoldings`, `GetCashBalance`, `PlaceOrder`, `UpdateOrder`, `CancelOrder`, `Connect`, `Disconnect`, `AccountInstantlyUpdated`, `AccountBaseCurrency`, `GetHistory`, `ConcurrencyEnabled`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — Common/Interfaces/IBrokerage.cs:29
  • `IOptionContractFilters<TSelf>` declares 42 members: `Strikes`, `Strikes`, `StrikesAbove`, `StrikesBelow`, `OutOfTheMoney`, `OTM`, `InTheMoney`, `ITM`, `AtTheMoney`, `ATM`, `CallsOnly`, `PutsOnly`, `Delta`, `D`, `Gamma`, `G`, `Theta`, `T`, `Vega`, `V`, `Rho`, `R`, `ImpliedVolatility`, `IV`, `NakedCall`, `NakedPut`, `CallSpread`, `PutSpread`, `CallCalendarSpread`, `PutCalendarSpread`, `Strangle`, `Straddle`, `ProtectiveCollar`, `Conversion`, `CallButterfly`, `PutButterfly`, `IronButterfly`, `IronCondor`, `BoxSpread`, `JellyRoll`, and 2 more. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. Those 42 declarations carry 41 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 41 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — Common/Securities/Option/IOptionContractFilters.cs:27

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

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

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

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

  • A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface. (×9) — Common/Data/UniverseSelection/BaseFundamentalDataProvider.cs:58, Common/DefaultConverter.cs:55, Common/Util/NullStringValueConverter.cs:35, …

What to do

  • Finish or delete NotImplementedException stubs and replace placeholder literals before shipping.
IC1 · Incompleteness & stubs7.1 / 10Strong✓ Tool-verified

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

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

  • Control only reaches here when `marginRemaining > 0` is false, because the guard on line 62 exits otherwise. This test is therefore always false and everything it guards is unreachable. Implement the distinction that was intended, or delete the test. — Algorithm.CSharp/CryptoFutureLeverageBasedMarginRegressionAlgorithm.cs:99
  • Control only reaches here when `bollingerBands.Window.IsReady` is false, because the guard on line 46 exits otherwise. This test is therefore always true and its `else`, and any code it is meant to skip, is unreachable. Implement the distinction that was intended, or delete the test. — Algorithm.CSharp/IndicatorHistoryRegressionAlgorithm.cs:53
  • The `if` and its `else` contain the same 1 statement, so no input can make the condition matter. Implement the distinction that was intended, or drop the branch and keep the body. (×2) — Algorithm.CSharp/ScheduledUniverseSelectionModelRegressionAlgorithm.cs:109, Common/Securities/Future/FuturesExpiryFunctions.cs:2299
  • `GetAlphaWeight` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — Algorithm.Framework/Portfolio/AlphaStreamsPortfolioConstructionModel.cs:32
  • Control only reaches here when `resolution != null` is false, because the guard on line 1428 exits otherwise. This test is therefore always false and everything it guards is unreachable. Implement the distinction that was intended, or delete the test. — Algorithm/QCAlgorithm.History.cs:1458
  • `CanConvert` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. (×3) — Common/DefaultConverter.cs:55, Common/SymbolValueJsonConverter.cs:65, Common/Util/NullStringValueConverter.cs:66
  • The first 2 statements of the `if` and of the `else` are identical, so they run on both paths regardless of the condition. Lift them above the `if` — leaving them duplicated inside makes the branches read as though they handled this differently. — Common/Statistics/TradeBuilder.cs:424
  • `ReadJson` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — Common/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) — Common/Util/NullStringValueConverter.cs:35, Report/NullResultValueTypeJsonConverter.cs:114, Report/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). (×25) — Algorithm.CSharp/AddUniverseSelectionModelCoarseAlgorithm.cs:42, Algorithm.CSharp/AlgorithmModeAndDeploymentTargetAlgorithm.cs:51, Algorithm.CSharp/AlgorithmModeAndDeploymentTargetAlgorithm.cs:52, …
  • `Rebalance` has an empty body — confirm it's an intentional no-op and not an unfinished method. — Algorithm.CSharp/Benchmarks/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)6.9 / 10Adequate✓ Tool-verified

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

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

What to do

  • Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
  • Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
  • Describe the projects a newcomer cannot place from the root README: 19 of 22 have no README of their own, in their folder or in their family's project (`Launcher`, `Engine`, `Algorithm`, `Common`, `Logging` and 14 more).
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 numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.

What to do

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

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

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

  • Most of the production code is in directories of its own, but 4 application file(s) sit at the repository root beside the build and tooling files (`compare_benchmarks.py`, `REDACTED`, `run_benchmarks.py`, `run_syntax_check.py`).

What to do

  • Move the application code at the repository root (`compare_benchmarks.py`, `REDACTED`, `run_benchmarks.py`, `run_syntax_check.py`) in with the rest of the product's code, so the root holds only build and tooling files.
M4 · Documentation accuracy10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged

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

Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language's code model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.

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.

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

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.
P6 · Release Hygiene5.0 / 10Adequate✓ Tool-verified

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

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

  • No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)

What to do

  • Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
P7 · Outbound HTTP resilience3.0 / 10Weak✓ Tool-verified

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

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

  • `new()` builds an outbound HTTP client and nothing bounds it: no timeout is set on it and no retry or resilience policy wraps its calls in the type that owns it. This codebase ships libraries/tools rather than a service it operates, so the failure lands as a hung caller — a build step, a CLI run, a UI thread — with no way out. — Algorithm.CSharp/CustomSignalExportDemonstrationAlgorithm.cs:76
  • `new HttpClient()` builds an outbound HTTP client and nothing bounds it: no timeout is set on it and no retry or resilience policy wraps its calls in the type that owns it. This codebase ships libraries/tools rather than a service it operates, so the failure lands as a hung caller — a build step, a CLI run, a UI thread — with no way out. (×3) — Common/Extensions.cs:350, Common/Extensions.cs:418, Engine/DataFeeds/Transport/RestSubscriptionStreamReader.cs:31

What to do

  • Give every outbound call a bound the caller can rely on: set an explicit `HttpClient.Timeout` (or pass a `CancellationToken` from a `CancellationTokenSource` with a deadline) and flow the caller's own `CancellationToken` through, so a slow endpoint fails fast instead of hanging.
PF1 · Benchmark discipline8.0 / 10Strong✓ Tool-verified

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

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

PF3 · Async & latency hygiene6.0 / 10Adequate✓ Tool-verified

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

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

  • 10 blocking call(s) on async work (.Wait()/.GetAwaiter().GetResult()) — these waste a thread and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
  • `manualEvent.Wait()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one). — Engine/DataFeeds/BaseDataExchange.cs:155
  • `_newLiveDataEmitted.Wait()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one). — Engine/DataFeeds/LiveSynchronizer.cs:112
  • `task.Wait()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one). — Common/Data/LeanDataWriter.cs:184
  • `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one). (×6) — Common/Extensions.cs:3464, Common/Extensions.cs:3474, Common/Extensions.cs:3498, …
  • `_messagesProcessedEvent.Wait()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one). — Brokerages/BrokerageConcurrentMessageHandler.cs:110

What to do

  • Make the call chain async end-to-end and await it — never block on a Task with .Wait()/.GetAwaiter().GetResult().
S1 · Cryptographic Hygiene6.0 / 10Adequate✓ 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. Outbound TLS (certificate validation, protocol version) is scored wherever it appears — a client verifies its peer whether or not it serves anything itself.

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

  • `SecurityProtocol` explicitly selects `SecurityProtocolType.Tls11`, a protocol version that is broken (SSL 2.0/3.0) or withdrawn (TLS 1.0/1.1, RFC 8996). Offering an obsolete version does not merely permit it — it is what a downgrade attack negotiates, so the weakest version on the list is the one that decides the connection's strength. Stop pinning versions here: leave the protocol unset (`SecurityProtocolType.SystemDefault`, or simply do not assign it) so the connection uses the OS policy and picks up TLS 1.3 and future versions without a code change. Where a version must be named explicitly, name `Tls12` and `Tls13` only. — Engine/DataFeeds/LiveOptionChainProvider.cs:62
  • 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. — Common/Extensions.cs:2429

What to do

  • Drop SSL 2.0/3.0 and TLS 1.0/1.1 from the enabled protocol list — prefer leaving it to the OS default (`SystemDefault`) so new versions are picked up automatically, or name `Tls12`/`Tls13` explicitly if it must be pinned.
  • Review each MD5/SHA1 use by what it protects: replace it with SHA-256+ (or a KDF for passwords) where the digest is security-relevant, and switch it to a non-cryptographic hash (`System.IO.Hashing.XxHash64`/`Crc32`) where it only derives an identifier such as a cache key or a mutex name.
X1 · Async correctness1.1 / 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.

  • Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout. (×27) — Engine/DataFeeds/LiveOptionChainProvider.cs:216, Engine/DataFeeds/LiveOptionChainProvider.cs:218, Engine/Engine.cs:121, …
  • `.Wait(…)` blocks this thread until the task completes or the bound expires — sync-over-async: it can deadlock under a synchronization context and it parks a thread while it waits. `await` the task (with `.WaitAsync(timeout, token)` where the bound matters). (×2) — Engine/DataFeeds/WorkScheduling/WeightedWorkScheduler.cs:104, Common/Isolator.cs:150
  • 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) — Common/Data/LeanDataWriter.cs:184, Common/Extensions.cs:3464, Common/Extensions.cs:3474, …

What to do

  • Sync-over-async (deadlock risk) through `.Result`
X12 · Unreachable branch8.0 / 10Strong✓ Tool-verified

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

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

  • `resolution != null` can never be true where it stands: the guard on line 1428 (`resolution != null`) left this block when it was true. No value of `resolution` satisfies all of that, so this arm never runs. Reorder the tests, drop the dead branch, or fix the bound that was meant. — Algorithm/QCAlgorithm.History.cs:1458
  • `marginRemaining > 0` can never be true where it stands: the guard on line 62 (`marginRemaining > 0`) left this block when it was true. No value of `marginRemaining` satisfies all of that, so this arm never runs. Reorder the tests, drop the dead branch, or fix the bound that was meant. — Algorithm.CSharp/CryptoFutureLeverageBasedMarginRegressionAlgorithm.cs:99

What to do

  • Each finding names the span that makes the branch dead and the span it is dead because of. Confirm from the two, then delete the dead arm or fix the predicate that was meant to be reachable.
X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged

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

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

X16 · Unfloored truncation loop10.0 / 10Exemplary○ Nothing flagged

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

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

X18 · Disposal-pattern correctness7.3 / 10Strong✓ Tool-verified

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

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

  • `manualEvent` is a `ManualResetEventSlim`, which implements `IDisposable`, and it is created here (line 146). Every use of it in `Start` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var manualEvent = …;`), which releases it at the end of the scope on every path including a throw. — Engine/DataFeeds/BaseDataExchange.cs:146
  • `blockingCollection` is a `BlockingCollection`, which implements `IDisposable`, and it is created here (line 197). Every use of it in `GetContractsData` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var blockingCollection = …;`), which releases it at the end of the scope on every path including a throw. — Engine/DataFeeds/DataDownloader/CanonicalDataDownloaderDecorator.cs:197
  • `_enumerator` is never created by `BaseDataCollectionAggregatorEnumerator` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 160). Its declared type `IEnumerator` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed. — Engine/DataFeeds/Enumerators/BaseDataCollectionAggregatorEnumerator.cs:160
  • `_enumerator` is never created by `FastForwardEnumerator` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 128). Its declared type `IEnumerator` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed. — Engine/DataFeeds/Enumerators/FastForwardEnumerator.cs:128
  • `_enumerator` is never created by `FillForwardEnumerator` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 303). Its declared type `IEnumerator` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed. — Engine/DataFeeds/Enumerators/FillForwardEnumerator.cs:303
  • `_enumerator` is never created by `FilterEnumerator` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 50). Its declared type `IEnumerator` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed. — Engine/DataFeeds/Enumerators/FilterEnumerator.cs:50
  • `_enumerator` is never created by `FrontierAwareEnumerator` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 146). Its declared type `IEnumerator` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed. — Engine/DataFeeds/Enumerators/FrontierAwareEnumerator.cs:146
  • `_rawDataEnumerator` is never created by `PriceScaleFactorEnumerator` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 88). Its declared type `IEnumerator` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed. — Engine/DataFeeds/Enumerators/PriceScaleFactorEnumerator.cs:88
  • `_enumerator` is never created by `QuoteBarFillForwardEnumerator` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 101). Its declared type `IEnumerator` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed. — Engine/DataFeeds/Enumerators/QuoteBarFillForwardEnumerator.cs:101
  • `_enumerator` is never created by `RateLimitEnumerator` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 125). Its declared type `IEnumerator` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed. — Engine/DataFeeds/Enumerators/RateLimitEnumerator.cs:125
  • `_underlyingEnumerator` is never created by `ScheduledEnumerator` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 172). Its declared type `IEnumerator` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed. — Engine/DataFeeds/Enumerators/ScheduledEnumerator.cs:172
  • `_underlying` is never created by `StrictDailyEndTimesEnumerator` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 92). Its declared type `IEnumerator` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed. — Engine/DataFeeds/Enumerators/StrictDailyEndTimesEnumerator.cs:92
  • `_enumerator` is never created by `SubscriptionDataEnumerator` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 95). Its declared type `IEnumerator` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed. — Engine/DataFeeds/Enumerators/SubscriptionDataEnumerator.cs:95
  • `_enumerator` is never created by `SubscriptionFilterEnumerator` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 173). Its declared type `IEnumerator` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed. — Engine/DataFeeds/Enumerators/SubscriptionFilterEnumerator.cs:173
  • `FakeDataQueue` implements `IDisposable` — so it has told every caller it holds something worth releasing — and it constructs `_subscriptionManager` itself (line 42), which makes that instance its own. But `_subscriptionManager` is named in none of the methods the disposal search covered: `Dispose` (line 155) — that is `Dispose` plus every method `Dispose` calls BY NAME, so a release reached through an interface, a delegate or a base class is not followed and is worth checking before acting. On what was read, the type's disposal releases everything except the one thing it owns. A disposable the owner never disposes is held until finalization if its type has a finalizer, and forever if it does not — which for a synchronisation primitive, a timer, a stream or a handle means the resource accumulates once per instance for the life of the process. Release it in `Dispose` (`_subscriptionManager?.Dispose();`), or, if it truly does not need releasing, drop `IDisposable` from the type so the claim and the behaviour agree. — Engine/DataFeeds/Queues/FakeDataQueue.cs:42
  • `testInstance` is a `CommandPythonWrapper`, which implements `IDisposable`, and it is created here (line 1920). Every use of it in `AddCommand` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var testInstance = …;`), which releases it at the end of the scope on every path including a throw. — Algorithm/QCAlgorithm.Python.cs:1920
  • `_cancellationTokenSource` is a `CancellationTokenSource` this type creates itself, and here (line 193) a new instance is written over it — but `StartCheckReconnected` itself reads through `_cancellationTokenSource` before replacing it, so it expects an instance to be there, and nothing earlier in `StartCheckReconnected` disposes, closes, saves or hands on the instance being replaced. The assignment makes it unreachable while it still holds what it holds (a timer that keeps firing, a callback registered on a longer-lived token, a socket, a handle), and no later `Dispose` can reach it: the type's own disposal releases only the CURRENT instance. The cost accumulates once per overwrite. Release the previous instance first (`_cancellationTokenSource?.Dispose();` before the assignment), or swap it out with `Interlocked.Exchange` and dispose what comes back. — Common/Brokerages/DefaultBrokerageMessageHandler.cs:193
  • `First` is never created by `SequentialConsolidator` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 113). Its declared type `IDataConsolidator` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed. — Common/Data/Consolidators/SequentialConsolidator.cs:113
  • `Second` is never created by `SequentialConsolidator` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 114). Its declared type `IDataConsolidator` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed. — Common/Data/Consolidators/SequentialConsolidator.cs:114
  • `writer` is a `StreamWriter`, which implements `IDisposable`, and it is created here (line 1898). Every use of it in `ToStream` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var writer = …;`), which releases it at the end of the scope on every path including a throw. — Common/Extensions.cs:1898
  • `_orderedEventUtcTimes` is never created by `ScheduledEvent` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 247). Its declared type `IEnumerator` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed. — Common/Scheduling/ScheduledEvent.cs:247
  • `_store` is never created by `ObjectStore` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 345). Its declared type `IObjectStore` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed. — Common/Storage/ObjectStore.cs:345
  • `StreamReaderEnumerable` declares a finalizer (line 102), but nothing in the type is unmanaged: no `IntPtr`/`UIntPtr` or pointer field, no `SafeHandle`, no `HandleRef`, no `extern`/`DllImport` member and no `Marshal`/`GCHandle`/`NativeMemory` use. A finalizer can only release what the garbage collector cannot, so on a purely-managed type it releases nothing and costs something: every instance is put on the finalizer queue, survives at least one extra collection, and is then finalized on a thread that is NOT the disposing one — where the managed objects it touches may already have been finalized themselves. Delete the finalizer (and the `GC.SuppressFinalize` that exists to defuse it); if a handle is added later, wrap it in a `SafeHandle`, which brings its own correct finalization. — Common/Util/StreamReaderEnumerable.cs:102
  • `tcpListener` is a `TcpListener`, which implements `IDisposable`, and it is created here (line 117). Every use of it in `CheckPort` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var tcpListener = …;`), which releases it at the end of the scope on every path including a throw. — Messaging/StreamingMessageHandler.cs:117
  • `resetEvent` is a `ManualResetEvent`, which implements `IDisposable`, and it is created here (line 221). Every use of it in `ConnectSync` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var resetEvent = …;`), which releases it at the end of the scope on every path including a throw. — Brokerages/BaseWebsocketsBrokerage.cs:221
  • `connectedEvent` is a `ManualResetEvent`, which implements `IDisposable`, and it is created here (line 284). Every use of it in `Connect` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var connectedEvent = …;`), which releases it at the end of the scope on every path including a throw. — Brokerages/BrokerageMultiWebSocketSubscriptionManager.cs:284
  • `application` is a `CommandLineApplication`, which implements `IDisposable`, and it is created here (line 27). Every use of it in `Parse` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var application = …;`), which releases it at the end of the scope on every path including a throw. — Configuration/ApplicationParser.cs:27
  • `tarArchive` is a `TarArchive`, which implements `IDisposable`, and it is created here (line 925). Every use of it in `UnTarFiles` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var tarArchive = …;`), which releases it at the end of the scope on every path including a throw. — REDACTED:925
  • `tarArchive` is a `TarArchive`, which implements `IDisposable`, and it is created here (line 940). Every use of it in `UnTarGzFiles` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var tarArchive = …;`), which releases it at the end of the scope on every path including a throw. — REDACTED:940
  • `process` is a `Process`, which implements `IDisposable`, and it is created here (line 1063). Every use of it in `Extract7ZipArchive` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var process = …;`), which releases it at the end of the scope on every path including a throw. — REDACTED:1063
  • `_httpClient` is a `HttpClient` this type creates itself, and here (line 114) a new instance is written over it — but `SetClient` itself reads through `_httpClient` before replacing it, so it expects an instance to be there, and nothing earlier in `SetClient` disposes, closes, saves or hands on the instance being replaced. The assignment makes it unreachable while it still holds what it holds (a timer that keeps firing, a callback registered on a longer-lived token, a socket, a handle), and no later `Dispose` can reach it: the type's own disposal releases only the CURRENT instance. The cost accumulates once per overwrite. Release the previous instance first (`_httpClient?.Dispose();` before the assignment), or swap it out with `Interlocked.Exchange` and dispose what comes back. — Api/ApiConnection.cs:114
  • `_destination` is never created by `ConsolidatorDataProcessor` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 77). Its declared type `IDataProcessor` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed. — ToolBox/ConsolidatorDataProcessor.cs:77
  • `_processor` is never created by `FilteredDataProcessor` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 58). Its declared type `IDataProcessor` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed. — ToolBox/FilteredDataProcessor.cs:58
  • `_streamProvider` is never created by `RawFileProcessor` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 110). Its declared type `IStreamProvider` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed. — ToolBox/RawFileProcessor.cs:110
  • `_parser` is never created by `RawFileProcessor` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 111). Its declared type `IStreamParser` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed. — ToolBox/RawFileProcessor.cs:111
  • `pyDict` is a `PyDict`, which implements `IDisposable`, and it is created here (line 990). Every use of it in `GetDictionaryFromSeries` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var pyDict = …;`), which releases it at the end of the scope on every path including a throw. — Research/QuantBook.cs:990
  • `looper` is a `PortfolioLooper`, which implements `IDisposable`, and it is created here (line 221). Every use of it in `GetHistory` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var looper = …;`), which releases it at the end of the scope on every path including a throw. — Report/PortfolioLooper/PortfolioLooper.cs:221
  • `looper` is a `PortfolioLooper`, which implements `IDisposable`, and it is created here (line 310). Every use of it in `FromOrders` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var looper = …;`), which releases it at the end of the scope on every path including a throw. — Report/PortfolioLooper/PortfolioLooper.cs:310
  • `process` is a `Process`, which implements `IDisposable`, and it is created here (line 140). Every use of it in `Main` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var process = …;`), which releases it at the end of the scope on every path including a throw. — Report/Program.cs:140

What to do

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

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

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

X2 · Cancellation propagation4.0 / 10Weak✓ Tool-verified

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

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

  • Only 0/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) — REDACTED:254, REDACTED:316, REDACTED:330, …
  • 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. — Api/ApiConnection.cs:234

What to do

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

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

Method: Roslyn syntax: `throw new ArgumentNullException(nameof(p))` statements controlled by an `if`, whose condition is read for a test that is true of a NON-null `p` — an emptiness test that dereferences it (`p.Count == 0`, `!p.Any()`) or a BCL predicate documented true of the empty value (`string.IsNullOrEmpty(p)`). Deterministic, provable per finding. Advisory.

  • The guard on line 630 rejects `dataTypes` and line 632 reports that rejection as `ArgumentNullException` — but the condition's own test `!dataTypes.Any()` is true of a value that is NOT null: it is satisfied by an EMPTY `dataTypes`, and on that path `dataTypes` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — Engine/DataFeeds/DataManager.cs:632
  • The guard on line 61 rejects `permtick` and line 63 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrEmpty(permtick)` is true of a value that is NOT null: it is satisfied by an EMPTY `permtick`, and on that path `permtick` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — Common/Data/Auxiliary/MapFile.cs:63
  • The guard on line 49 rejects `channelName` and line 51 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrEmpty(channelName)` is true of a value that is NOT null: it is satisfied by an EMPTY `channelName`, and on that path `channelName` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — Common/Data/Channel.cs:51
  • The guard on line 63 rejects `jsonBacktestResult` and line 65 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrEmpty(jsonBacktestResult)` is true of a value that is NOT null: it is satisfied by an EMPTY `jsonBacktestResult`, and on that path `jsonBacktestResult` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — Common/Optimizer/Objectives/Constraint.cs:65
  • The guard on line 63 rejects `target` and line 65 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrEmpty(target)` is true of a value that is NOT null: it is satisfied by an EMPTY `target`, and on that path `target` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — Common/Optimizer/Objectives/Objective.cs:65
  • The guard on line 74 rejects `jsonBacktestResult` and line 76 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrEmpty(jsonBacktestResult)` is true of a value that is NOT null: it is satisfied by an EMPTY `jsonBacktestResult`, and on that path `jsonBacktestResult` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — Common/Optimizer/Objectives/Target.cs:76
  • The guard on line 41 rejects `handlers` and line 43 reports that rejection as `ArgumentNullException` — but the condition's own test `handlers.Length == 0` is true of a value that is NOT null: it is satisfied by an EMPTY `handlers`, and on that path `handlers` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition. — Logging/CompositeLogHandler.cs:43

What to do

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

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

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

X22 · Contradicted release guard10.0 / 10Exemplary○ Nothing flagged

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

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

X23 · Unguarded diagnostic materialisation7.3 / 10Strong✓ Tool-verified

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

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

  • `Trace` at line 253 is called with an argument built by `string.Join(",", timeProviders.Select(x => x.GetType()))` (line 253), whose cost grows with the collection it walks. C# evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because Trace is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `IsEnabled` test, no debug flag, no conditional-compilation region. — Engine/DataFeeds/DataQueueHandlerManager.cs:253
  • `Trace` at line 126 is called with an argument built by `string.Join(",", _historyProviders.Select(x => x.GetType().Name))` (line 126), whose cost grows with the collection it walks. C# evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because Trace is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `IsEnabled` test, no debug flag, no conditional-compilation region. — Engine/HistoricalData/HistoryProviderManager.cs:126
  • `Trace` at line 165 is called with an argument built by `string.Join(",", _historyProviders.Skip(1).Select(x => x.GetType().Name))` (line 166), whose cost grows with the collection it walks. C# evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because Trace is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `IsEnabled` test, no debug flag, no conditional-compilation region. — Engine/HistoricalData/HistoryProviderManager.cs:165
  • `Trace` at line 400 is called with an argument built by `string.Join(Environment.NewLine, holdings)` (line 400), whose cost grows with the collection it walks. C# evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because Trace is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `IsEnabled` test, no debug flag, no conditional-compilation region. — Engine/Results/RegressionResultHandler.cs:400
  • `Trace` at line 66 is called with an argument built by `string.Join(",", symbols.Select(x => x.Value))` (line 66), whose cost grows with the collection it walks. C# evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because Trace is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `IsEnabled` test, no debug flag, no conditional-compilation region. — Common/Data/EventBasedDataQueueHandlerSubscriptionManager.cs:66
  • `Trace` at line 78 is called with an argument built by `string.Join(",", symbols.Select(x => x.Value))` (line 78), whose cost grows with the collection it walks. C# evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because Trace is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `IsEnabled` test, no debug flag, no conditional-compilation region. — Common/Data/EventBasedDataQueueHandlerSubscriptionManager.cs:78
  • `Debug` at line 251 is called with an argument built by `string.Join(",", types)` (line 251), whose cost grows with the collection it walks. C# evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because Debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `IsEnabled` test, no debug flag, no conditional-compilation region. — AlgorithmFactory/Loader.cs:251
  • `Trace` at line 138 is called with an argument built by `string.Join(",", symbols.Select(x => x.Value))` (line 138), whose cost grows with the collection it walks. C# evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because Trace is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `IsEnabled` test, no debug flag, no conditional-compilation region. — Brokerages/BrokerageMultiWebSocketSubscriptionManager.cs:138
  • `Trace` at line 159 is called with an argument built by `string.Join(",", symbols.Select(x => x.Value))` (line 159), whose cost grows with the collection it walks. C# evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because Trace is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `IsEnabled` test, no debug flag, no conditional-compilation region. — Brokerages/BrokerageMultiWebSocketSubscriptionManager.cs:159
  • `Trace` at line 1008 is called with an argument built by `string.Join(',', dataLink.Errors)` (line 1009), whose cost grows with the collection it walks. C# evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because Trace is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `IsEnabled` test, no debug flag, no conditional-compilation region. — Api/Api.cs:1008
  • `Trace` at line 75 is called with an argument built by `string.Join(";", resolutionList.Select(x => x.ToString()).ToArray())` (line 75), whose cost grows with the collection it walks. C# evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because Trace is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `IsEnabled` test, no debug flag, no conditional-compilation region. — ToolBox/AlgoSeekFuturesConverter/AlgoSeekFuturesProgram.cs:75
  • `Debug` at line 144 is called with an argument built by `string.Join(",", sidContext.Tickers)` (line 144), whose cost grows with the collection it walks. C# evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because Debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `IsEnabled` test, no debug flag, no conditional-compilation region. — ToolBox/CoarseUniverseGenerator/CoarseUniverseGeneratorProgram.cs:144

What to do

  • Each finding names the diagnostic call and the expression inside its argument whose cost scales with a collection. Confirm from the two that the argument is built before the call — that is C#'s evaluation order, not a guess — then put the construction behind the same level check the sink applies: `if (logger.IsEnabled(LogLevel.Trace))` for Microsoft.Extensions.Logging, the repository's own debug flag where it has one, or a message template whose ARGUMENTS the logging framework only formats when the level is on. Moving the call is not the fix: it is the join/projection in the argument that is paid, wherever the call sits.
X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged

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

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

X25 · Inert configuration knob10.0 / 10Exemplary○ Nothing flagged

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

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

X26 · Unsynchronised callback handoff10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.

Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.

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

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

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

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

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

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

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

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

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

X3 · Exception handling5.7 / 10Adequate✓ Tool-verified

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

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

  • `catch (InvalidOperationException)` does nothing with the exception it caught — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch. Log it through whatever this codebase already uses to report problems, or let it propagate; if one specific failure genuinely cannot matter, catch exactly that exception type and say why in a comment on the catch. — Engine/DataFeeds/DownloaderDataProvider.cs:155
  • `productResults` is used without ever being checked for null, but `JsonConvert` returns null for the document `null` — and no catch clause around it catches NullReferenceException, so that one input throws past every handler here and out of the method. The try already answers unreadable files and malformed JSON; answer the empty document too, by testing the result before using it (or by rejecting null where the value is produced) rather than by widening the catch to swallow the deref. — Engine/DataFeeds/LiveOptionChainProvider.cs:157
  • `tradesAndExpiriesResponse` is used without ever being checked for null, but `JsonConvert` returns null for the document `null` — and no catch clause around it catches NullReferenceException, so that one input throws past every handler here and out of the method. The try already answers unreadable files and malformed JSON; answer the empty document too, by testing the result before using it (or by rejecting null where the value is produced) rather than by widening the catch to swallow the deref. — Engine/DataFeeds/LiveOptionChainProvider.cs:176
  • 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. (×32) — Engine/DataFeeds/LiveTradingDataFeed.cs:550, Engine/HistoricalData/HistoryProviderManager.cs:171, Engine/Results/BacktestProgressMonitor.cs:56, …
  • `catch` does nothing with the exception it caught — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch. Log it through whatever this codebase already uses to report problems, or let it propagate; if one specific failure genuinely cannot matter, catch exactly that exception type and say why in a comment on the catch. — Algorithm/Portfolio/PortfolioConstructionModel.cs:233
  • `catch (PythonException)` does nothing with the exception it caught — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch. Log it through whatever this codebase already uses to report problems, or let it propagate; if one specific failure genuinely cannot matter, catch exactly that exception type and say why in a comment on the catch. — Common/Python/FeeModelPythonWrapper.cs:55
  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. On a teardown path letting it propagate is not an option (throwing out of `Dispose()` masks the failure already in flight and abandons the rest of the cleanup), so make the swallow deliberate instead: record it through whatever this codebase already uses to report problems — or, if one specific failure truly cannot matter, catch exactly that exception type and say why in a comment on the catch (a comment on a catch-all still swallows everything else). — Brokerages/WebSocketClientWrapper.cs:135

What to do

  • Swallowed exception (caught, then discarded)
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged

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

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

X32 · Type resolved by simple name across every loaded assembly10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a plugin lookup names the type it means — searching every assembly loaded into the process for a candidate whose SIMPLE name equals a string supplied at runtime, and taking the first one found, is decided by assembly LOAD ORDER rather than by this source, so the same name can resolve to a different type on the next run.

Method: Roslyn syntax only, no semantic model: every invocation of `First`/`FirstOrDefault`/`Single`/`SingleOrDefault` whose OWN expression subtree contains both a `GetAssemblies()` call and a `GetTypes()`/`GetExportedTypes()` call — a single-element pick out of every type loaded into the process. A nested selector in the same chain sees no `GetAssemblies()` in its own subtree and is outside the population, so one lookup counts once however many links its chain has. A finding additionally needs both remaining halves: the selector must be `First`/`FirstOrDefault` (`Single`/`SingleOrDefault` reports the ambiguity rather than resolving it, and is counted and never reported), and the chain must carry an `==` comparison of `<lambda parameter>.Name` against something that is not a literal. The receiver must be a plain identifier bound by one of the chain’s own lambdas, which places `assembly.GetName().Name == "X"` outside the rule by construction. One exemption: a `.Name` test joined by `&&` to a `FullName`/`AssemblyQualifiedName` test on the same identifier is spared; joined by `||` it is not. Deterministic, provable per finding. Advisory.

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.

  • This method contradicts itself about `security`: line 1027 writes `security?.`, which says `security` can be null, but line 1025 then dereferences it directly as `security.Type` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `security` truly cannot be null here, the `?.` is misleading. Settle it one way — test `security` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side. — Engine/AlgorithmManager.cs:1025
  • This method contradicts itself about `logs`: line 240 writes `logs?.Count`, which says `logs` can be null, but line 242 then dereferences it directly with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `logs` truly cannot be null here, the `?.` is misleading. Settle it one way — test `logs` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side. — Engine/Results/Analysis/Analyses/AlgorithmSpeedAnalysis.cs:242
  • This method contradicts itself about `limit`: line 1361 assigns it with `as LimitOrder`, which hands back null rather than throwing when the value is not a `LimitOrder`, but line 1362 then dereferences it directly as `limit.LimitPrice` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `limit` once before the first use and handle the null case, or cast with `(LimitOrder)` so the failure is reported where it happens — rather than leaving the two readings side by side. — Engine/TransactionHandlers/BrokerageTransactionHandler.cs:1362
  • This method contradicts itself about `legLimitOrder`: line 1365 assigns it with `as ComboLegLimitOrder`, which hands back null rather than throwing when the value is not a `ComboLegLimitOrder`, but line 1366 then dereferences it directly as `legLimitOrder.LimitPrice` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `legLimitOrder` once before the first use and handle the null case, or cast with `(ComboLegLimitOrder)` so the failure is reported where it happens — rather than leaving the two readings side by side. — Engine/TransactionHandlers/BrokerageTransactionHandler.cs:1366
  • This method contradicts itself about `marketOrder`: line 1369 assigns it with `as StopMarketOrder`, which hands back null rather than throwing when the value is not a `StopMarketOrder`, but line 1370 then dereferences it directly as `marketOrder.StopPrice` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `marketOrder` once before the first use and handle the null case, or cast with `(StopMarketOrder)` so the failure is reported where it happens — rather than leaving the two readings side by side. — Engine/TransactionHandlers/BrokerageTransactionHandler.cs:1370
  • This method contradicts itself about `stopLimitOrder`: line 1373 assigns it with `as StopLimitOrder`, which hands back null rather than throwing when the value is not a `StopLimitOrder`, but line 1374 then dereferences it directly as `stopLimitOrder.LimitPrice` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `stopLimitOrder` once before the first use and handle the null case, or cast with `(StopLimitOrder)` so the failure is reported where it happens — rather than leaving the two readings side by side. — Engine/TransactionHandlers/BrokerageTransactionHandler.cs:1374
  • This method contradicts itself about `trailingStopOrder`: line 1378 assigns it with `as TrailingStopOrder`, which hands back null rather than throwing when the value is not a `TrailingStopOrder`, but line 1379 then dereferences it directly as `trailingStopOrder.StopPrice` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `trailingStopOrder` once before the first use and handle the null case, or cast with `(TrailingStopOrder)` so the failure is reported where it happens — rather than leaving the two readings side by side. — Engine/TransactionHandlers/BrokerageTransactionHandler.cs:1379
  • This method contradicts itself about `limitIfTouchedOrder`: line 1383 assigns it with `as LimitIfTouchedOrder`, which hands back null rather than throwing when the value is not a `LimitIfTouchedOrder`, but line 1384 then dereferences it directly as `limitIfTouchedOrder.LimitPrice` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `limitIfTouchedOrder` once before the first use and handle the null case, or cast with `(LimitIfTouchedOrder)` so the failure is reported where it happens — rather than leaving the two readings side by side. — Engine/TransactionHandlers/BrokerageTransactionHandler.cs:1384
  • This method contradicts itself about `contingency`: line 2210 writes `contingency?.GetLink`, which says `contingency` can be null, but line 2224 then dereferences it directly as `contingency.Id` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `contingency` truly cannot be null here, the `?.` is misleading. Settle it one way — test `contingency` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side. — Engine/TransactionHandlers/BrokerageTransactionHandler.cs:2224
  • This method contradicts itself about `instance`: line 707 assigns it with `as BaseDataCollection`, which hands back null rather than throwing when the value is not a `BaseDataCollection`, but line 708 then dereferences it directly as `instance.UniverseSymbol` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `instance` once before the first use and handle the null case, or cast with `(BaseDataCollection)` so the failure is reported where it happens — rather than leaving the two readings side by side. — Algorithm/QCAlgorithm.Universe.cs:708
  • This method contradicts itself about `algorithm`: line 150 writes `algorithm?.Settings`, which says `algorithm` can be null, but line 139 then dereferences it directly as `algorithm.Name` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `algorithm` truly cannot be null here, the `?.` is misleading. Settle it one way — test `algorithm` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side. — Common/AlgorithmConfiguration.cs:139
  • This method contradicts itself about `optimizationBacktest`: line 90 assigns it with `as OptimizationBacktest`, which hands back null rather than throwing when the value is not a `OptimizationBacktest`, but line 95 then dereferences it directly as `optimizationBacktest.Name` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `optimizationBacktest` once before the first use and handle the null case, or cast with `(OptimizationBacktest)` so the failure is reported where it happens — rather than leaving the two readings side by side. — Common/Api/OptimizationBacktestJsonConverter.cs:95
  • This method contradicts itself about `parameterSet`: line 46 assigns it with `as ParameterSet`, which hands back null rather than throwing when the value is not a `ParameterSet`, but line 51 then dereferences it directly as `parameterSet.Value` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `parameterSet` once before the first use and handle the null case, or cast with `(ParameterSet)` so the failure is reported where it happens — rather than leaving the two readings side by side. — Common/Api/ParameterSetJsonConverter.cs:51
  • This method contradicts itself about `typeData`: line 211 assigns it with `as DataDictionary<T>`, which hands back null rather than throwing when the value is not a `DataDictionary<T>`, but line 212 then dereferences it directly as `typeData.ContainsKey` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `typeData` once before the first use and handle the null case, or cast with `(DataDictionary<T>)` so the failure is reported where it happens — rather than leaving the two readings side by side. — Common/Data/SliceExtensions.cs:212
  • This method contradicts itself about `exchange`: line 399 assigns it with `as Exchange`, which hands back null rather than throwing when the value is not a `Exchange`, but line 407 then dereferences it directly as `exchange.Code` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `exchange` once before the first use and handle the null case, or cast with `(Exchange)` so the failure is reported where it happens — rather than leaving the two readings side by side. — Common/Exchange.cs:407
  • This method contradicts itself about `limitOrder`: line 2827 assigns it with `as LimitOrder`, which hands back null rather than throwing when the value is not a `LimitOrder`, but line 2828 then dereferences it directly as `limitOrder.LimitPrice` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `limitOrder` once before the first use and handle the null case, or cast with `(LimitOrder)` so the failure is reported where it happens — rather than leaving the two readings side by side. — Common/Extensions.cs:2828
  • This method contradicts itself about `stopMarketOrder`: line 2831 assigns it with `as StopMarketOrder`, which hands back null rather than throwing when the value is not a `StopMarketOrder`, but line 2832 then dereferences it directly as `stopMarketOrder.StopPrice` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `stopMarketOrder` once before the first use and handle the null case, or cast with `(StopMarketOrder)` so the failure is reported where it happens — rather than leaving the two readings side by side. — Common/Extensions.cs:2832
  • This method contradicts itself about `stopLimitOrder`: line 2835 assigns it with `as StopLimitOrder`, which hands back null rather than throwing when the value is not a `StopLimitOrder`, but line 2836 then dereferences it directly as `stopLimitOrder.StopPrice` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `stopLimitOrder` once before the first use and handle the null case, or cast with `(StopLimitOrder)` so the failure is reported where it happens — rather than leaving the two readings side by side. — Common/Extensions.cs:2836
  • This method contradicts itself about `trailingStopOrder`: line 2840 assigns it with `as TrailingStopOrder`, which hands back null rather than throwing when the value is not a `TrailingStopOrder`, but line 2841 then dereferences it directly as `trailingStopOrder.StopPrice` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `trailingStopOrder` once before the first use and handle the null case, or cast with `(TrailingStopOrder)` so the failure is reported where it happens — rather than leaving the two readings side by side. — Common/Extensions.cs:2841
  • This method contradicts itself about `limitIfTouched`: line 2846 assigns it with `as LimitIfTouchedOrder`, which hands back null rather than throwing when the value is not a `LimitIfTouchedOrder`, but line 2847 then dereferences it directly as `limitIfTouched.TriggerPrice` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `limitIfTouched` once before the first use and handle the null case, or cast with `(LimitIfTouchedOrder)` so the failure is reported where it happens — rather than leaving the two readings side by side. — Common/Extensions.cs:2847
  • This method contradicts itself about `legLimitOrder`: line 2862 assigns it with `as ComboLegLimitOrder`, which hands back null rather than throwing when the value is not a `ComboLegLimitOrder`, but line 2863 then dereferences it directly as `legLimitOrder.LimitPrice` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `legLimitOrder` once before the first use and handle the null case, or cast with `(ComboLegLimitOrder)` so the failure is reported where it happens — rather than leaving the two readings side by side. — Common/Extensions.cs:2863
  • This method contradicts itself about `data`: line 3855 writes `data?.Scale`, which says `data` can be null, but line 3857 then dereferences it directly as `data.Scale` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `data` truly cannot be null here, the `?.` is misleading. Settle it one way — test `data` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side. — Common/Extensions.cs:3857
  • This method contradicts itself about `point`: line 175 assigns it with `as IndicatorDataPoint`, which hands back null rather than throwing when the value is not a `IndicatorDataPoint`, but line 177 then dereferences it directly as `point.EndTime` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `point` once before the first use and handle the null case, or cast with `(IndicatorDataPoint)` so the failure is reported where it happens — rather than leaving the two readings side by side. — Common/Indicators/InternalIndicatorValues.cs:177
  • This method contradicts itself about `markets`: line 78 assigns it with `as dynamic`, which hands back null rather than throwing when the value is not a `dynamic`, but line 89 then dereferences it directly with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `markets` once before the first use and handle the null case, or cast with `(dynamic)` so the failure is reported where it happens — rather than leaving the two readings side by side. — Common/Python/BrokerageModelPythonWrapper.cs:89
  • This method contradicts itself about `pyItem`: line 87 assigns it with `as PyObject`, which hands back null rather than throwing when the value is not a `PyObject`, but line 88 then dereferences it directly as `pyItem.As` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `pyItem` once before the first use and handle the null case, or cast with `(PyObject)` so the failure is reported where it happens — rather than leaving the two readings side by side. — Common/Python/BrokerageModelPythonWrapper.cs:88
  • This method contradicts itself about `baseData`: line 153 assigns it with `as BaseData`, which hands back null rather than throwing when the value is not a `BaseData`, but line 155 then dereferences it directly as `baseData.Symbol` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `baseData` once before the first use and handle the null case, or cast with `(BaseData)` so the failure is reported where it happens — rather than leaving the two readings side by side. — Common/Python/PandasConverter.DataFrameGenerator.cs:155
  • This method contradicts itself about `collectionData`: line 154 assigns it with `as IEnumerable`, which hands back null rather than throwing when the value is not a `IEnumerable`, but line 155 then dereferences it directly as `collectionData.Cast` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `collectionData` once before the first use and handle the null case, or cast with `(IEnumerable)` so the failure is reported where it happens — rather than leaving the two readings side by side. — Common/Python/PandasConverter.DataFrameGenerator.cs:155
  • This method contradicts itself about `security`: line 207 writes `security?.GetLastData`, which says `security` can be null, but line 213 then dereferences it directly as `security.Symbol` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `security` truly cannot be null here, the `?.` is misleading. Settle it one way — test `security` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side. — Common/Securities/Future/FutureMarginModel.cs:213
  • This method contradicts itself about `symbol`: line 35 assigns it with `as Symbol`, which hands back null rather than throwing when the value is not a `Symbol`, but line 40 then dereferences it directly as `symbol.Value` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `symbol` once before the first use and handle the null case, or cast with `(Symbol)` so the failure is reported where it happens — rather than leaving the two readings side by side. — Common/SymbolJsonConverter.cs:40
  • This method contradicts itself about `currencyPair`: line 73 writes `currencyPair?.SecurityType`, which says `currencyPair` can be null, but line 74 then dereferences it directly as `currencyPair.SecurityType` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `currencyPair` truly cannot be null here, the `?.` is misleading. Settle it one way — test `currencyPair` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side. — Common/Util/CurrencyPairUtil.cs:74
  • This method contradicts itself about `bigTradeBar`: line 254 assigns it with `as TradeBar`, which hands back null rather than throwing when the value is not a `TradeBar`, but line 255 then dereferences it directly as `bigTradeBar.Open` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `bigTradeBar` once before the first use and handle the null case, or cast with `(TradeBar)` so the failure is reported where it happens — rather than leaving the two readings side by side. — Common/Util/LeanData.cs:255
  • This method contradicts itself about `capture`: line 229 assigns it with `as Match`, which hands back null rather than throwing when the value is not a `Match`, but line 231 then dereferences it directly as `capture.Groups` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `capture` once before the first use and handle the null case, or cast with `(Match)` so the failure is reported where it happens — rather than leaving the two readings side by side. — REDACTED:231
  • This method contradicts itself about `args`: line 267 assigns it with `as PyObject`, which hands back null rather than throwing when the value is not a `PyObject`, but line 271 then dereferences it directly as `args.Dispose` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `args` once before the first use and handle the null case, or cast with `(PyObject)` so the failure is reported where it happens — rather than leaving the two readings side by side. — REDACTED:271
  • This method contradicts itself about `args`: line 277 assigns it with `as PyObject`, which hands back null rather than throwing when the value is not a `PyObject`, but line 281 then dereferences it directly as `args.Dispose` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `args` once before the first use and handle the null case, or cast with `(PyObject)` so the failure is reported where it happens — rather than leaving the two readings side by side. — REDACTED:281
  • This method contradicts itself about `option`: line 82 assigns it with `as Option`, which hands back null rather than throwing when the value is not a `Option`, but line 83 then dereferences it directly as `option.Underlying` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `option` once before the first use and handle the null case, or cast with `(Option)` so the failure is reported where it happens — rather than leaving the two readings side by side. — Indicators/IndicatorBasedOptionPriceModel.cs:83
  • This method contradicts itself about `exerciseValues`: line 129 writes `exerciseValues?.Length`, which says `exerciseValues` can be null, but line 159 then dereferences it directly with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `exerciseValues` truly cannot be null here, the `?.` is misleading. Settle it one way — test `exerciseValues` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side. — Indicators/OptionGreekIndicatorsHelper.cs:159
  • This method contradicts itself about `dynAlgorithm`: line 120 assigns it with `as dynamic`, which hands back null rather than throwing when the value is not a `dynamic`, but line 123 then dereferences it directly as `dynAlgorithm.SetPandasConverter` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `dynAlgorithm` once before the first use and handle the null case, or cast with `(dynamic)` so the failure is reported where it happens — rather than leaving the two readings side by side. — AlgorithmFactory/Python/Wrappers/AlgorithmPythonWrapper.cs:123
  • This method contradicts itself about `security`: line 567 writes `security?.GetLastData`, which says `security` can be null, but line 568 then dereferences it directly as `security.Exchange` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `security` truly cannot be null here, the `?.` is misleading. Settle it one way — test `security` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side. — Brokerages/Backtesting/BacktestingBrokerage.cs:568
  • This method contradicts itself about `marginModel`: line 128 assigns it with `as FuturesOptionsMarginModel`, which hands back null rather than throwing when the value is not a `FuturesOptionsMarginModel`, but line 129 then dereferences it directly as `marginModel.InitialIntradayMarginRequirement` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `marginModel` once before the first use and handle the null case, or cast with `(FuturesOptionsMarginModel)` so the failure is reported where it happens — rather than leaving the two readings side by side. — Algorithm.CSharp/AddFutureOptionSingleOptionChainSelectedInUniverseFilterRegressionAlgorithm.cs:129
  • This method contradicts itself about `futureMarginModel`: line 111 assigns it with `as FutureMarginModel`, which hands back null rather than throwing when the value is not a `FutureMarginModel`, but line 116 then dereferences it directly as `futureMarginModel.InitialOvernightMarginRequirement` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `futureMarginModel` once before the first use and handle the null case, or cast with `(FutureMarginModel)` so the failure is reported where it happens — rather than leaving the two readings side by side. — Algorithm.CSharp/BasicTemplateFuturesAlgorithm.cs:116

What to do

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

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 Health39%Weak — gated by X1, X5Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture66%Adequate — gated by AX2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity60%Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness54%Adequate — gated by P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security39%Weak — gated by D28, D29, D36, C1Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance69%AdequateStrongest area.
Unscored — 4 check(s) recorded observations but carry no score

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

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

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

  • C3 Audit Trail — Repo shows no audit-logging mechanism (IAuditable, an immutable audit log, an EF SaveChanges interceptor) for sensitive changes — absence of evidence is not evidence of a working control. Record an audit trail in code (or document where it lives) so this dimension can be scored.
  • C5 Data-Subject Rights — Repo shows no corroborated data-subject-rights mechanism (erasure / export-portability / consent) tied to a subject id or GDPR vocabulary — absence of evidence is not evidence of a working control. Implement erasure, data export/portability and consent tracking over the subject's records.
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 38 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.
  • AX1 Captive dependencies — no DI registrations 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.
  • AXR1 Runtime accessibility — the service exited before it opened a port — `/tmp/wd-venv/bin/python -m flask --app 'Algorithm.Python.CustomSignalExportDemonstrationAlgorithm:app' run --host 127.0.0.1 --port 5000`: Usage: python -m flask run [OPTIONS] Try 'python -m flask run --help' for help. Error: Could not import 'Algorithm.Python.CustomSignalExportDemonstrationAlgorithm'.; runtime evidence skipped (launch chosen because Algorithm.Python/CustomSignalExportDemonstrationAlgorithm.py defines the Flask application 'app' at module level) This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
  • 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.
  • D11 Test Reliability — Test runner surfaced no tests
  • D22 Internal API Consistency — No intentionally-exposed public API to evaluate for consistency.
  • D23 Boundary Type-Coupling — Cross-context type coupling could not be assessed — this codebase's bounded contexts are neither declared nor inferable.
  • D25 ADR Conformance — no ADRs to check
  • D32 Data Compliance (PII/GDPR) — 53 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D7 Architectural Integrity — no checkable ADRs and no dependency cycles — architectural integrity not assessed
  • D8 Code Coverage — Coverage not measured — no coverage collector is wired up
  • DM1 Domain Modelling — not scored — this repository shows none of the 3 signals this lens 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 — Idempotency could not be assessed in this run — the check did not complete, so it is not scored. This is a gap in the analyzer, not a finding about this repository.
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • P2 Observability — This repo is a library, not a deployed service — it has no process to operate, so production observability (structured logging, tracing/metrics, health checks) is N/A. A library may log via an injected ILogger, but the absence of operational telemetry is not a defect here. If it grows a host (web API, worker), the dimension reactivates.
  • 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) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
  • PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X4 Structured logging — This check asks whether log calls keep a message's values apart from its text, which needs a logger that can carry them as fields. This repository's C# was read, and every log call in it goes through a logger that takes one finished message — its own wrapper, log4net, Console or Debug — so an interpolated message there loses nothing the API could have kept. Calls through Microsoft.Extensions.Logging, Serilog, NLog or ZLogger, or any logger with a message-template overload, would be judged.
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

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

Critical — 148 finding(s)
D17 · Explicit Debt · WriteOnlyPrivateField · ×35
  • WriteOnlyPrivateField Algorithm.CSharp/BasicTemplateMultiAssetAlgorithm.cs:41 — private Symbol _futureSymbol — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField Algorithm.CSharp/Benchmarks/HistoryRequestBenchmark.cs:22 — private Symbol _symbol — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField REDACTED:35 — private SecurityChanges _changes — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField Algorithm.CSharp/CustomPartialFillModelAlgorithm.cs:69 — private QCAlgorithm _algorithm — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField Algorithm.CSharp/FuzzyInferenceAlgorithm.cs:45 — private Accord.Math.Matrix3x3 _matrix — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField Algorithm.CSharp/HistoryWithCustomDataSourceRegressionAlgorithm.cs:31 — private Symbol _aapl — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField Algorithm.CSharp/HistoryWithCustomDataSourceRegressionAlgorithm.cs:32 — private Symbol _spy — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField Tests/Algorithm/AlgorithmPlottingTests.cs:35 — private Symbol _spy — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField Algorithm.CSharp/IndicatorSuiteAlgorithm.cs:44 — private Indicators _selectorIndicators — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField Algorithm.CSharp/IndicatorSuiteAlgorithm.cs:49 — private Minimum _minCustom — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField Algorithm.CSharp/IndicatorSuiteAlgorithm.cs:50 — private Maximum _maxCustom — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField REDACTED:35 — private bool _isConnected — assigned 3 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField Algorithm.CSharp/TickDataFilteringAlgorithm.cs:144 — private IAlgorithm _algo — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField Api/Api.cs:51 — private string _dataFolder — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField Common/Python/PythonData.cs:32 — private dynamic _pythonData — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField Engine/DataFeeds/FileSystemDataFeed.cs:43 — private ITimeProvider _timeProvider — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField Engine/HistoricalData/BrokerageHistoryProvider.cs:32 — private IDataPermissionManager _dataPermissionManager — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField Engine/Results/RegressionResultHandler.cs:50 — private Dictionary<string, string> _currentAlphaRuntimeStatistics — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField Messaging/EventMessagingHandler.cs:29 — private AlgorithmNodePacket _job — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField Report/ReportElements/AssetAllocationReportElement.cs:28 — private BacktestResult _backtest — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField Report/ReportElements/ExposureReportElement.cs:29 — private BacktestResult _backtest — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField Report/ReportElements/LeverageUtilizationReportElement.cs:29 — private BacktestResult _backtest — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField Report/ReportElements/AssetAllocationReportElement.cs:30 — private LiveResult _live — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField Report/ReportElements/CrisisReportElement.cs:28 — private LiveResult _live — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • WriteOnlyPrivateField Report/ReportElements/EstimatedCapacityReportElement.cs:28 — private LiveResult _live — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
  • + 10 more in this group — see findings.md.
D17 · Explicit Debt · EmptyCatchBlock · ×33
  • EmptyCatchBlock Algorithm.CSharp/BracketOrderLimitEntryRegressionAlgorithm.cs:87 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock Algorithm.CSharp/BubbleAlgorithm.cs:276 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock REDACTED:205 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock REDACTED:226 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock Algorithm.CSharp/CustomDataBitcoinAlgorithm.cs:158 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock Algorithm.CSharp/CustomDataBitcoinAlgorithm.cs:179 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock Algorithm.CSharp/CustomDataNIFTYAlgorithm.cs:192 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock Algorithm.CSharp/CustomDataNIFTYAlgorithm.cs:256 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock Algorithm.CSharp/CustomDataPropertiesRegressionAlgorithm.cs:248 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock Algorithm.CSharp/CustomDataPropertiesRegressionAlgorithm.cs:267 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock REDACTED:252 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock REDACTED:273 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock REDACTED:214 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock REDACTED:234 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock Algorithm.CSharp/OptionChainStrategyFiltersRegressionAlgorithm.cs:84 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock Brokerages/WebSocketClientWrapper.cs:135 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock Brokerages/WebSocketClientWrapper.cs:265 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock Common/Data/Fundamental/Fundamental.cs:116 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock Common/Extensions.cs:3036 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock Common/Scheduling/TimeMonitor.cs:113 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock Common/Util/CurrencyPairUtil.cs:56 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock Common/Util/DateTimeJsonConverter.cs:91 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock Common/Util/RateGate.cs:149 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock Engine/DataFeeds/LiveTradingDataFeed.cs:550 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • EmptyCatchBlock Engine/HistoricalData/HistoryProviderManager.cs:171 — empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
  • + 8 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D34 · Knowledge Freshness · Orphaned knowledge · ×11
  • Orphaned knowledge Algorithm.CSharp/StressSymbols.cs:1 — 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/CandlestickPatterns.cs:1 — 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:1 — 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:1 — 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:1 — 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:1 — 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:1 — 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:1 — 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 Indicators/ImpliedVolatility.cs:1 — 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:1 — 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 Optimizer/LeanOptimizer.cs:1 — 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.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D28 · Secrets (history) · REDACTED · ×8
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AX3 · Project dependency cycles · Namespace dependency cycle · ×5
  • Namespace dependency cycle Common/Messages/Messages.Commands.cs:17 — The namespaces QuantConnect ↔ QuantConnect.Algorithm ↔ QuantConnect.Algorithm.Framework ↔ QuantConnect.Algorithm.Framework.Alphas ↔ QuantConnect.Algorithm.Framework.Alphas.Analysis ↔ QuantConnect.Algorithm.Framework.Alphas.Serialization ↔ QuantConnect.Algorithm.Framework.Execution ↔ QuantConnect.Algorithm.Framework.Portfolio ↔ QuantConnect.Algorithm.Framework.Portfolio.SignalExports ↔ QuantConnect.Algorithm.Framework.Risk ↔ QuantConnect.Algorithm.Framework.Selection ↔ QuantConnect.Api ↔ QuantConnect.Brokerages ↔ QuantConnect.Brokerages.Authentication ↔ QuantConnect.Brokerages.CrossZero ↔ QuantConnect.Commands ↔ QuantConnect.Data ↔ QuantConnect.Data.Auxiliary ↔ QuantConnect.Data.Consolidators ↔ QuantConnect.Data.Fundamental ↔ QuantConnect.Data.Market ↔ QuantConnect.Data.UniverseSelection ↔ QuantConnect.Indicators ↔ QuantConnect.Indicators.CandlestickPatterns ↔ QuantConnect.Interfaces ↔ QuantConnect.Optimizer ↔ QuantConnect.Optimizer.Objectives ↔ QuantConnect.Optimizer.Strategies ↔ QuantConnect.Orders ↔ QuantConnect.Orders.Fees ↔ QuantConnect.Orders.Fills ↔ QuantConnect.Orders.OptionExercise ↔ QuantConnect.Orders.Serialization ↔ QuantConnect.Orders.Slippage ↔ QuantConnect.Packets ↔ QuantConnect.Python ↔ QuantConnect.Scheduling ↔ QuantConnect.Securities ↔ QuantConnect.Securities.Cfd ↔ QuantConnect.Securities.Crypto ↔ QuantConnect.Securities.CryptoFuture ↔ QuantConnect.Securities.CurrencyConversion ↔ QuantConnect.Securities.Equity ↔ QuantConnect.Securities.Forex ↔ QuantConnect.Securities.Future ↔ QuantConnect.Securities.Index ↔ QuantConnect.Securities.IndexOption ↔ QuantConnect.Securities.Interfaces ↔ QuantConnect.Securities.Option ↔ QuantConnect.Securities.Option.StrategyMatcher ↔ QuantConnect.Securities.Positions ↔ QuantConnect.Securities.Volatility ↔ QuantConnect.Statistics ↔ QuantConnect.Storage ↔ QuantConnect.Util depend on each other. The lightest dependency in the cycle is QuantConnect → QuantConnect.Commands (QuantConnect.BaseCommandHandler → QuantConnect.Commands.ICommand, 1 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface.
  • Namespace dependency cycle Engine/Results/BacktestingResultHandler.cs:23 — The namespaces QuantConnect.Lean.Engine.Results ↔ QuantConnect.Lean.Engine.Results.Analysis ↔ QuantConnect.Lean.Engine.Results.Analysis.Analyses ↔ QuantConnect.Lean.Engine.Results.Analysis.Analyses.Messages ↔ QuantConnect.Lean.Engine.TransactionHandlers depend on each other. The lightest dependency in the cycle is QuantConnect.Lean.Engine.Results → QuantConnect.Lean.Engine.Results.Analysis (QuantConnect.Lean.Engine.Results.BacktestingResultHandler → QuantConnect.Lean.Engine.Results.Analysis.ResultsAnalyzer, 1 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface.
  • Namespace dependency cycle Engine/DataFeeds/FileSystemDataFeed.cs:27 — The namespaces QuantConnect.Lean.Engine.DataFeeds ↔ QuantConnect.Lean.Engine.DataFeeds.Enumerators ↔ QuantConnect.Lean.Engine.DataFeeds.Enumerators.Factories depend on each other. The lightest dependency in the cycle is QuantConnect.Lean.Engine.DataFeeds → QuantConnect.Lean.Engine.DataFeeds.Enumerators.Factories (QuantConnect.Lean.Engine.DataFeeds.FileSystemDataFeed → QuantConnect.Lean.Engine.DataFeeds.Enumerators.Factories.SubscriptionDataReaderSubscriptionEnumeratorFactory, 1 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface.
  • Namespace dependency cycle Engine/AlgorithmManager.cs:32 — The namespaces QuantConnect.Lean.Engine ↔ QuantConnect.Lean.Engine.Server depend on each other. The lightest dependency in the cycle is QuantConnect.Lean.Engine → QuantConnect.Lean.Engine.Server (QuantConnect.Lean.Engine.AlgorithmManager → QuantConnect.Lean.Engine.Server.ILeanManager, 2 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface.
  • Namespace dependency cycle REDACTED:25 — The namespaces QuantConnect.Report ↔ QuantConnect.Report.ReportElements depend on each other. The lightest dependency in the cycle is QuantConnect.Report → QuantConnect.Report.ReportElements (QuantConnect.Report.Report → QuantConnect.Report.ReportElements.IReportElement, 1 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface.
D10 · Test Quality · No assertions (empty test) · ×5
  • No assertions (empty test): PriceGapBehaviorIsTheExpectedOne Tests/Common/Data/ClassicRangeConsolidatorTests.cs:35 — Test method has an empty body — it asserts nothing and exercises no code.
  • 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:531 — Test method has an empty body — it asserts nothing and exercises no code.
  • No assertions (empty test): AcceptsVolumeRenkoBarsAsInput Tests/Indicators/PythonIndicatorTests.cs:540 — Test method has an empty body — it asserts nothing and exercises no code.
D17 · Explicit Debt · NoWarnInCsproj · ×4
  • 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.
  • 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.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · High CVE · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D17 · Explicit Debt · InvertedNullGuard · ×3
  • InvertedNullGuard Algorithm.CSharp/BasicTemplateFuturesAlgorithm.cs:114 — if (buyingPowerModel == null) … buyingPowerModel.GetType — the guard has already decided this variable is null on the way into this branch, and nothing here gives it another value, so this dereference cannot run without throwing a NullReferenceException. It survives because the branch is the uncommon one: the code is correct on every input where the variable is set, and crashes on exactly the case the branch was written to handle. Decide which the line meant — if it is reporting the absence, it must not read through the missing value (use the other variable that identifies it, or a literal); if it is meant to work on a value, it belongs in the other branch.
  • InvertedNullGuard Algorithm.CSharp/BasicTemplateFuturesWithExtendedMarketAlgorithm.cs:118 — if (buyingPowerModel == null) … buyingPowerModel.GetType — the guard has already decided this variable is null on the way into this branch, and nothing here gives it another value, so this dereference cannot run without throwing a NullReferenceException. It survives because the branch is the uncommon one: the code is correct on every input where the variable is set, and crashes on exactly the case the branch was written to handle. Decide which the line meant — if it is reporting the absence, it must not read through the missing value (use the other variable that identifies it, or a literal); if it is meant to work on a value, it belongs in the other branch.
  • InvertedNullGuard Algorithm.CSharp/HSIFutureHourRegressionAlgorithm.cs:116 — if (buyingPowerModel == null) … buyingPowerModel.GetType — the guard has already decided this variable is null on the way into this branch, and nothing here gives it another value, so this dereference cannot run without throwing a NullReferenceException. It survives because the branch is the uncommon one: the code is correct on every input where the variable is set, and crashes on exactly the case the branch was written to handle. Decide which the line meant — if it is reporting the absence, it must not read through the missing value (use the other variable that identifies it, or a literal); if it is meant to work on a value, it belongs in the other branch.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D31 · IaC & Container Security · High IaC · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D17 · Explicit Debt · FileScopedPragmaDisable · ×2
  • FileScopedPragmaDisable Tests/Common/Util/DisposableExtensionsTests.cs:25 — #pragma warning disable CA2000 — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
  • FileScopedPragmaDisable Tests/Compression/ZipStreamWriterTests.cs:27 — #pragma warning disable CA2000 — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D17 · Explicit Debt · DeadLoopAccumulator · ×1
  • DeadLoopAccumulator Algorithm.CSharp/FillForwardUntilExpiryRegressionAlgorithm.cs:65 — BaseData bar = null; … if (bar == null && value.QuoteBars.TryGetValue(contact.Key, out quoteBar)) — this reset runs at the top of every pass, so the value is back to its starting constant before the test below it is reached: the test is decided the same way on every iteration, and whatever the loop adds to this variable further down is wiped out before anything can read it. The threshold it is guarding can therefore never be crossed, however many times the loop goes round, which is why nothing has ever been seen to trip. Move the reset ABOVE the loop, so the count accumulates across iterations the way the test below assumes; if it really is meant to be per-iteration state, then the test belongs with it and the accumulation does not.
D17 · Explicit Debt · DiscardedPureResult · ×1
  • DiscardedPureResult Tests/Common/StringExtensionsTests.cs:225 — sourceString.Substring(startIndex, length); — strings are immutable, so this call cannot change the text it was called on: it computes a new string and the statement throws it away, leaving the original exactly as it was. The line reads as the transformation it names, and the value that comes out of this method later is the untransformed one. Assign the result — to the same variable, or to the field or property the transformed text was meant to reach — or, if the call really was pointless, delete the line rather than leaving something that looks like it works.
D17 · Explicit Debt · NoWarnInCsproj repeated across 20 files · ×1
  • NoWarnInCsproj repeated across 20 files Algorithm/QuantConnect.Algorithm.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.)
D28 · Secrets (history) · High secret · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Critical CVE · ×1
  • REDACTED
Serious — 2098 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:965 — // 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:850 — // 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:373 — // 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:335 — // 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:107 — // 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:3905 — // 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:437 — // 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:456 — // 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:59 — // 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:230 — // 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:1759 — // 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 · ×56
  • 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:785 — [Obsolete] GetLastKnownPrice
  • ObsoleteWithCallers Algorithm/QCAlgorithm.History.cs:800 — [Obsolete] GetLastKnownPrice
  • ObsoleteWithCallers Algorithm/QCAlgorithm.Universe.cs:460 — [Obsolete] AddUniverse
  • ObsoleteWithCallers Algorithm/QCAlgorithm.cs:507 — [Obsolete] OptionChainProvider
  • ObsoleteWithCallers Algorithm/QCAlgorithm.cs:516 — [Obsolete] FutureChainProvider
  • ObsoleteWithCallers Algorithm/QCAlgorithm.cs:1225 — [Obsolete] OnEndOfDay
  • ObsoleteWithCallers AlgorithmFactory/Python/Wrappers/AlgorithmPythonWrapper.cs:850 — [Obsolete] OnEndOfDay
  • ObsoleteWithCallers Common/Interfaces/IAlgorithm.cs:605 — [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:75 — [Obsolete] GDAX
  • ObsoleteWithCallers Common/Brokerages/BrokerageName.cs:186 — [Obsolete] TerminalLink
  • ObsoleteWithCallers Common/Brokerages/GDAXBrokerageModel.cs:23 — [Obsolete] GDAXBrokerageModel
  • ObsoleteWithCallers Common/Brokerages/TerminalLinkBrokerageModel.cs:23 — [Obsolete] TerminalLinkBrokerageModel
  • 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
  • + 31 more in this group — see findings.md.
D17 · Explicit Debt · Dead code · ×50
  • Dead code: GetUniverseProvider Engine/DataFeeds/LiveTradingDataFeed.cs:581 — Method GetUniverseProvider — Roslyn's SymbolFinder walked every project the solution loads, including QuantConnect.Lean.Engine, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
  • Dead code: PeriodAsByte Common/Data/Fundamental/Period.cs:87 — NamedType PeriodAsByte — Roslyn's SymbolFinder walked every project the solution loads, including QuantConnect, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
  • Dead code: UpdateSymbolProperties Common/Securities/Security.cs:1211 — Method UpdateSymbolProperties — Roslyn's SymbolFinder walked every project the solution loads, including QuantConnect, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
  • Dead code: GetAllDataNormalizationModes Tests/Algorithm/AlgorithmHistoryTests.cs:4770 — Method GetAllDataNormalizationModes — Roslyn's SymbolFinder walked every project the solution loads, including QuantConnect.Tests, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
  • Dead code: CancelComboOrders Tests/Brokerages/BrokerageTests.cs:372 — Method CancelComboOrders — Roslyn's SymbolFinder walked every project the solution loads, including QuantConnect.Tests, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
  • Dead code: LongFromZero Tests/Brokerages/BrokerageTests.cs:390 — Method LongFromZero — Roslyn's SymbolFinder walked every project the solution loads, including QuantConnect.Tests, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
  • Dead code: CloseFromLong Tests/Brokerages/BrokerageTests.cs:398 — Method CloseFromLong — Roslyn's SymbolFinder walked every project the solution loads, including QuantConnect.Tests, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
  • Dead code: ShortFromZero Tests/Brokerages/BrokerageTests.cs:410 — Method ShortFromZero — Roslyn's SymbolFinder walked every project the solution loads, including QuantConnect.Tests, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
  • Dead code: CloseFromShort Tests/Brokerages/BrokerageTests.cs:418 — Method CloseFromShort — Roslyn's SymbolFinder walked every project the solution loads, including QuantConnect.Tests, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
  • Dead code: ShortFromLong Tests/Brokerages/BrokerageTests.cs:430 — Method ShortFromLong — Roslyn's SymbolFinder walked every project the solution loads, including QuantConnect.Tests, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
  • Dead code: LongFromShort Tests/Brokerages/BrokerageTests.cs:447 — Method LongFromShort — Roslyn's SymbolFinder walked every project the solution loads, including QuantConnect.Tests, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
  • Dead code: LongCombo Tests/Brokerages/BrokerageTests.cs:464 — Method LongCombo — Roslyn's SymbolFinder walked every project the solution loads, including QuantConnect.Tests, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
  • Dead code: ShortCombo Tests/Brokerages/BrokerageTests.cs:478 — Method ShortCombo — Roslyn's SymbolFinder walked every project the solution loads, including QuantConnect.Tests, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
  • Dead code: LongFromZeroUpdateAndCancel Tests/Brokerages/BrokerageTests.cs:500 — Method LongFromZeroUpdateAndCancel — Roslyn's SymbolFinder walked every project the solution loads, including QuantConnect.Tests, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
  • Dead code: ContingentOrdersCancel Tests/Brokerages/BrokerageTests.cs:583 — Method ContingentOrdersCancel — Roslyn's SymbolFinder walked every project the solution loads, including QuantConnect.Tests, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
  • Dead code: ContingentOrdersUpdate Tests/Brokerages/BrokerageTests.cs:597 — Method ContingentOrdersUpdate — Roslyn's SymbolFinder walked every project the solution loads, including QuantConnect.Tests, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
  • Dead code: ContingentOrdersGetOpenOrders Tests/Brokerages/BrokerageTests.cs:635 — Method ContingentOrdersGetOpenOrders — Roslyn's SymbolFinder walked every project the solution loads, including QuantConnect.Tests, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
  • Dead code: ContingentOrdersTrigger Tests/Brokerages/BrokerageTests.cs:659 — Method ContingentOrdersTrigger — Roslyn's SymbolFinder walked every project the solution loads, including QuantConnect.Tests, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
  • Dead code: OneTriggersOther Tests/Brokerages/ContingentOrderTestParameters.cs:70 — Method OneTriggersOther — Roslyn's SymbolFinder walked every project the solution loads, including QuantConnect.Tests, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
  • Dead code: NonUpdateableLimitIfTouchedOrderTestParameters Tests/Brokerages/LimitIfTouchedOrderTestParameters.cs:96 — NamedType NonUpdateableLimitIfTouchedOrderTestParameters — Roslyn's SymbolFinder walked every project the solution loads, including QuantConnect.Tests, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
  • Dead code: NonUpdateableLimitOrderTestParameters Tests/Brokerages/LimitOrderTestParameters.cs:81 — NamedType NonUpdateableLimitOrderTestParameters — Roslyn's SymbolFinder walked every project the solution loads, including QuantConnect.Tests, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
  • Dead code: NonUpdateableStopLimitOrderTestParameters Tests/Brokerages/StopLimitOrderTestParameters.cs:85 — NamedType NonUpdateableStopLimitOrderTestParameters — Roslyn's SymbolFinder walked every project the solution loads, including QuantConnect.Tests, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
  • Dead code: NonUpdateableStopMarketOrderTestParameters Tests/Brokerages/StopMarketOrderTestParameters.cs:83 — NamedType NonUpdateableStopMarketOrderTestParameters — Roslyn's SymbolFinder walked every project the solution loads, including QuantConnect.Tests, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
  • Dead code: AssertDailyTradeBar Tests/Common/Data/CalendarConsolidatorsTests.cs:419 — Method AssertDailyTradeBar — Roslyn's SymbolFinder walked every project the solution loads, including QuantConnect.Tests, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
  • Dead code: PublicArrayTest Tests/Common/Data/SliceTests.cs:1496 — NamedType PublicArrayTest — Roslyn's SymbolFinder walked every project the solution loads, including QuantConnect.Tests, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
  • + 25 more in this group — see findings.md.
X5 · Nullable reference types · Symbol treated as nullable, then dereferenced unguarded · ×40
  • Symbol treated as nullable, then dereferenced unguarded Engine/AlgorithmManager.cs:1025 — This method contradicts itself about `security`: line 1027 writes `security?.`, which says `security` can be null, but line 1025 then dereferences it directly as `security.Type` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `security` truly cannot be null here, the `?.` is misleading. Settle it one way — test `security` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side.
  • Symbol treated as nullable, then dereferenced unguarded Engine/Results/Analysis/Analyses/AlgorithmSpeedAnalysis.cs:242 — This method contradicts itself about `logs`: line 240 writes `logs?.Count`, which says `logs` can be null, but line 242 then dereferences it directly with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `logs` truly cannot be null here, the `?.` is misleading. Settle it one way — test `logs` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side.
  • Symbol treated as nullable, then dereferenced unguarded Engine/TransactionHandlers/BrokerageTransactionHandler.cs:1362 — This method contradicts itself about `limit`: line 1361 assigns it with `as LimitOrder`, which hands back null rather than throwing when the value is not a `LimitOrder`, but line 1362 then dereferences it directly as `limit.LimitPrice` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `limit` once before the first use and handle the null case, or cast with `(LimitOrder)` so the failure is reported where it happens — rather than leaving the two readings side by side.
  • Symbol treated as nullable, then dereferenced unguarded Engine/TransactionHandlers/BrokerageTransactionHandler.cs:1366 — This method contradicts itself about `legLimitOrder`: line 1365 assigns it with `as ComboLegLimitOrder`, which hands back null rather than throwing when the value is not a `ComboLegLimitOrder`, but line 1366 then dereferences it directly as `legLimitOrder.LimitPrice` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `legLimitOrder` once before the first use and handle the null case, or cast with `(ComboLegLimitOrder)` so the failure is reported where it happens — rather than leaving the two readings side by side.
  • Symbol treated as nullable, then dereferenced unguarded Engine/TransactionHandlers/BrokerageTransactionHandler.cs:1370 — This method contradicts itself about `marketOrder`: line 1369 assigns it with `as StopMarketOrder`, which hands back null rather than throwing when the value is not a `StopMarketOrder`, but line 1370 then dereferences it directly as `marketOrder.StopPrice` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `marketOrder` once before the first use and handle the null case, or cast with `(StopMarketOrder)` so the failure is reported where it happens — rather than leaving the two readings side by side.
  • Symbol treated as nullable, then dereferenced unguarded Engine/TransactionHandlers/BrokerageTransactionHandler.cs:1374 — This method contradicts itself about `stopLimitOrder`: line 1373 assigns it with `as StopLimitOrder`, which hands back null rather than throwing when the value is not a `StopLimitOrder`, but line 1374 then dereferences it directly as `stopLimitOrder.LimitPrice` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `stopLimitOrder` once before the first use and handle the null case, or cast with `(StopLimitOrder)` so the failure is reported where it happens — rather than leaving the two readings side by side.
  • Symbol treated as nullable, then dereferenced unguarded Engine/TransactionHandlers/BrokerageTransactionHandler.cs:1379 — This method contradicts itself about `trailingStopOrder`: line 1378 assigns it with `as TrailingStopOrder`, which hands back null rather than throwing when the value is not a `TrailingStopOrder`, but line 1379 then dereferences it directly as `trailingStopOrder.StopPrice` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `trailingStopOrder` once before the first use and handle the null case, or cast with `(TrailingStopOrder)` so the failure is reported where it happens — rather than leaving the two readings side by side.
  • Symbol treated as nullable, then dereferenced unguarded Engine/TransactionHandlers/BrokerageTransactionHandler.cs:1384 — This method contradicts itself about `limitIfTouchedOrder`: line 1383 assigns it with `as LimitIfTouchedOrder`, which hands back null rather than throwing when the value is not a `LimitIfTouchedOrder`, but line 1384 then dereferences it directly as `limitIfTouchedOrder.LimitPrice` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `limitIfTouchedOrder` once before the first use and handle the null case, or cast with `(LimitIfTouchedOrder)` so the failure is reported where it happens — rather than leaving the two readings side by side.
  • Symbol treated as nullable, then dereferenced unguarded Engine/TransactionHandlers/BrokerageTransactionHandler.cs:2224 — This method contradicts itself about `contingency`: line 2210 writes `contingency?.GetLink`, which says `contingency` can be null, but line 2224 then dereferences it directly as `contingency.Id` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `contingency` truly cannot be null here, the `?.` is misleading. Settle it one way — test `contingency` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side.
  • Symbol treated as nullable, then dereferenced unguarded Algorithm/QCAlgorithm.Universe.cs:708 — This method contradicts itself about `instance`: line 707 assigns it with `as BaseDataCollection`, which hands back null rather than throwing when the value is not a `BaseDataCollection`, but line 708 then dereferences it directly as `instance.UniverseSymbol` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `instance` once before the first use and handle the null case, or cast with `(BaseDataCollection)` so the failure is reported where it happens — rather than leaving the two readings side by side.
  • Symbol treated as nullable, then dereferenced unguarded Common/AlgorithmConfiguration.cs:139 — This method contradicts itself about `algorithm`: line 150 writes `algorithm?.Settings`, which says `algorithm` can be null, but line 139 then dereferences it directly as `algorithm.Name` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `algorithm` truly cannot be null here, the `?.` is misleading. Settle it one way — test `algorithm` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side.
  • Symbol treated as nullable, then dereferenced unguarded Common/Api/OptimizationBacktestJsonConverter.cs:95 — This method contradicts itself about `optimizationBacktest`: line 90 assigns it with `as OptimizationBacktest`, which hands back null rather than throwing when the value is not a `OptimizationBacktest`, but line 95 then dereferences it directly as `optimizationBacktest.Name` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `optimizationBacktest` once before the first use and handle the null case, or cast with `(OptimizationBacktest)` so the failure is reported where it happens — rather than leaving the two readings side by side.
  • Symbol treated as nullable, then dereferenced unguarded Common/Api/ParameterSetJsonConverter.cs:51 — This method contradicts itself about `parameterSet`: line 46 assigns it with `as ParameterSet`, which hands back null rather than throwing when the value is not a `ParameterSet`, but line 51 then dereferences it directly as `parameterSet.Value` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `parameterSet` once before the first use and handle the null case, or cast with `(ParameterSet)` so the failure is reported where it happens — rather than leaving the two readings side by side.
  • Symbol treated as nullable, then dereferenced unguarded Common/Data/SliceExtensions.cs:212 — This method contradicts itself about `typeData`: line 211 assigns it with `as DataDictionary<T>`, which hands back null rather than throwing when the value is not a `DataDictionary<T>`, but line 212 then dereferences it directly as `typeData.ContainsKey` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `typeData` once before the first use and handle the null case, or cast with `(DataDictionary<T>)` so the failure is reported where it happens — rather than leaving the two readings side by side.
  • Symbol treated as nullable, then dereferenced unguarded Common/Exchange.cs:407 — This method contradicts itself about `exchange`: line 399 assigns it with `as Exchange`, which hands back null rather than throwing when the value is not a `Exchange`, but line 407 then dereferences it directly as `exchange.Code` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `exchange` once before the first use and handle the null case, or cast with `(Exchange)` so the failure is reported where it happens — rather than leaving the two readings side by side.
  • Symbol treated as nullable, then dereferenced unguarded Common/Extensions.cs:2828 — This method contradicts itself about `limitOrder`: line 2827 assigns it with `as LimitOrder`, which hands back null rather than throwing when the value is not a `LimitOrder`, but line 2828 then dereferences it directly as `limitOrder.LimitPrice` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `limitOrder` once before the first use and handle the null case, or cast with `(LimitOrder)` so the failure is reported where it happens — rather than leaving the two readings side by side.
  • Symbol treated as nullable, then dereferenced unguarded Common/Extensions.cs:2832 — This method contradicts itself about `stopMarketOrder`: line 2831 assigns it with `as StopMarketOrder`, which hands back null rather than throwing when the value is not a `StopMarketOrder`, but line 2832 then dereferences it directly as `stopMarketOrder.StopPrice` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `stopMarketOrder` once before the first use and handle the null case, or cast with `(StopMarketOrder)` so the failure is reported where it happens — rather than leaving the two readings side by side.
  • Symbol treated as nullable, then dereferenced unguarded Common/Extensions.cs:2836 — This method contradicts itself about `stopLimitOrder`: line 2835 assigns it with `as StopLimitOrder`, which hands back null rather than throwing when the value is not a `StopLimitOrder`, but line 2836 then dereferences it directly as `stopLimitOrder.StopPrice` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `stopLimitOrder` once before the first use and handle the null case, or cast with `(StopLimitOrder)` so the failure is reported where it happens — rather than leaving the two readings side by side.
  • Symbol treated as nullable, then dereferenced unguarded Common/Extensions.cs:2841 — This method contradicts itself about `trailingStopOrder`: line 2840 assigns it with `as TrailingStopOrder`, which hands back null rather than throwing when the value is not a `TrailingStopOrder`, but line 2841 then dereferences it directly as `trailingStopOrder.StopPrice` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `trailingStopOrder` once before the first use and handle the null case, or cast with `(TrailingStopOrder)` so the failure is reported where it happens — rather than leaving the two readings side by side.
  • Symbol treated as nullable, then dereferenced unguarded Common/Extensions.cs:2847 — This method contradicts itself about `limitIfTouched`: line 2846 assigns it with `as LimitIfTouchedOrder`, which hands back null rather than throwing when the value is not a `LimitIfTouchedOrder`, but line 2847 then dereferences it directly as `limitIfTouched.TriggerPrice` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `limitIfTouched` once before the first use and handle the null case, or cast with `(LimitIfTouchedOrder)` so the failure is reported where it happens — rather than leaving the two readings side by side.
  • Symbol treated as nullable, then dereferenced unguarded Common/Extensions.cs:2863 — This method contradicts itself about `legLimitOrder`: line 2862 assigns it with `as ComboLegLimitOrder`, which hands back null rather than throwing when the value is not a `ComboLegLimitOrder`, but line 2863 then dereferences it directly as `legLimitOrder.LimitPrice` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `legLimitOrder` once before the first use and handle the null case, or cast with `(ComboLegLimitOrder)` so the failure is reported where it happens — rather than leaving the two readings side by side.
  • Symbol treated as nullable, then dereferenced unguarded Common/Extensions.cs:3857 — This method contradicts itself about `data`: line 3855 writes `data?.Scale`, which says `data` can be null, but line 3857 then dereferences it directly as `data.Scale` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `data` truly cannot be null here, the `?.` is misleading. Settle it one way — test `data` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side.
  • Symbol treated as nullable, then dereferenced unguarded Common/Indicators/InternalIndicatorValues.cs:177 — This method contradicts itself about `point`: line 175 assigns it with `as IndicatorDataPoint`, which hands back null rather than throwing when the value is not a `IndicatorDataPoint`, but line 177 then dereferences it directly as `point.EndTime` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `point` once before the first use and handle the null case, or cast with `(IndicatorDataPoint)` so the failure is reported where it happens — rather than leaving the two readings side by side.
  • Symbol treated as nullable, then dereferenced unguarded Common/Python/BrokerageModelPythonWrapper.cs:89 — This method contradicts itself about `markets`: line 78 assigns it with `as dynamic`, which hands back null rather than throwing when the value is not a `dynamic`, but line 89 then dereferences it directly with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `markets` once before the first use and handle the null case, or cast with `(dynamic)` so the failure is reported where it happens — rather than leaving the two readings side by side.
  • Symbol treated as nullable, then dereferenced unguarded Common/Python/BrokerageModelPythonWrapper.cs:88 — This method contradicts itself about `pyItem`: line 87 assigns it with `as PyObject`, which hands back null rather than throwing when the value is not a `PyObject`, but line 88 then dereferences it directly as `pyItem.As` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `pyItem` once before the first use and handle the null case, or cast with `(PyObject)` so the failure is reported where it happens — rather than leaving the two readings side by side.
  • + 15 more in this group — see findings.md.
X3 · Exception handling · Swallowed exception (empty catch) · ×33
  • Swallowed exception (empty catch) Engine/DataFeeds/LiveTradingDataFeed.cs:550 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) Engine/HistoricalData/HistoryProviderManager.cs:171 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) Engine/Results/BacktestProgressMonitor.cs:56 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) Engine/Storage/LocalObjectStore.cs:465 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) Engine/Storage/LocalObjectStore.cs:627 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) Common/Data/Fundamental/Fundamental.cs:116 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) Common/Extensions.cs:3036 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) Common/Scheduling/TimeMonitor.cs:113 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) Common/Util/CurrencyPairUtil.cs:56 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) Common/Util/DateTimeJsonConverter.cs:91 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) Common/Util/RateGate.cs:149 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) Logging/Log.cs:294 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) Logging/Log.cs:302 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) Indicators/OptionGreekIndicatorBase.cs:163 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) Brokerages/WebSocketClientWrapper.cs:135 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. On a teardown path letting it propagate is not an option (throwing out of `Dispose()` masks the failure already in flight and abandons the rest of the cleanup), so make the swallow deliberate instead: record it through whatever this codebase already uses to report problems — or, if one specific failure truly cannot matter, catch exactly that exception type and say why in a comment on the catch (a comment on a catch-all still swallows everything else).
  • Swallowed exception (empty catch) Brokerages/WebSocketClientWrapper.cs:265 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) Algorithm.CSharp/BracketOrderLimitEntryRegressionAlgorithm.cs:87 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) Algorithm.CSharp/BubbleAlgorithm.cs:276 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) REDACTED:205 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) REDACTED:226 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) Algorithm.CSharp/CustomDataBitcoinAlgorithm.cs:158 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) Algorithm.CSharp/CustomDataBitcoinAlgorithm.cs:179 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) Algorithm.CSharp/CustomDataNIFTYAlgorithm.cs:192 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) Algorithm.CSharp/CustomDataNIFTYAlgorithm.cs:256 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) Algorithm.CSharp/CustomDataPropertiesRegressionAlgorithm.cs:248 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • + 8 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×31
  • Duplicated block (6 lines × 2) Algorithm.CSharp/OptionEquityBearCallLadderRegressionAlgorithm.cs:56 — Algorithm.CSharp/OptionEquityBearCallLadderRegressionAlgorithm.cs:56-61 | Algorithm.CSharp/OptionEquityBullPutLadderRegressionAlgorithm.cs:56-61 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) Algorithm.CSharp/OptionEquityBearPutLadderRegressionAlgorithm.cs:57 — Algorithm.CSharp/OptionEquityBearPutLadderRegressionAlgorithm.cs:57-62 | Algorithm.CSharp/OptionEquityBullCallLadderRegressionAlgorithm.cs:57-62 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) Algorithm.CSharp/FutureOptionCallITMExpiryRegressionAlgorithm.cs:119 — Algorithm.CSharp/FutureOptionCallITMExpiryRegressionAlgorithm.cs:119-124 | Algorithm.CSharp/FutureOptionPutITMExpiryRegressionAlgorithm.cs:120-125 — before extracting anything, compare `Algorithm.CSharp/FutureOptionCallITMExpiryRegressionAlgorithm.cs` and `Algorithm.CSharp/FutureOptionPutITMExpiryRegressionAlgorithm.cs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 77 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/FutureOptionCallITMExpiryRegressionAlgorithm.cs:119` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) Algorithm.CSharp/IndexOptionCallITMExpiryRegressionAlgorithm.cs:117 — Algorithm.CSharp/IndexOptionCallITMExpiryRegressionAlgorithm.cs:117-122 | Algorithm.CSharp/IndexOptionPutITMExpiryRegressionAlgorithm.cs:114-119 — before extracting anything, compare `Algorithm.CSharp/IndexOptionCallITMExpiryRegressionAlgorithm.cs` and `Algorithm.CSharp/IndexOptionPutITMExpiryRegressionAlgorithm.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/IndexOptionCallITMExpiryRegressionAlgorithm.cs:117` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) Indicators/CandlestickPatterns/IdenticalThreeCrows.cs:81 — Indicators/CandlestickPatterns/IdenticalThreeCrows.cs:81-86 | Indicators/CandlestickPatterns/ThreeWhiteSoldiers.cs:90-95 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs:119 — Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs:119-124 | Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs:627-632 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) Algorithm.CSharp/BasicTemplateFuturesHistoryAlgorithm.cs:95 — Algorithm.CSharp/BasicTemplateFuturesHistoryAlgorithm.cs:95-100 | Algorithm.CSharp/BasicTemplateOptionsHistoryAlgorithm.cs:69-74 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/BasicTemplateFuturesHistoryAlgorithm.cs:95` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) Algorithm.CSharp/PortfolioRebalanceOnInsightChangesRegressionAlgorithm.cs:53 — Algorithm.CSharp/PortfolioRebalanceOnInsightChangesRegressionAlgorithm.cs:53-58 | Algorithm.CSharp/PortfolioRebalanceOnSecurityChangesRegressionAlgorithm.cs:60-65 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) Common/Securities/Option/OptionFilterUniverse.cs:1204 — Common/Securities/Option/OptionFilterUniverse.cs:1204-1209 | Common/Securities/Option/OptionFilterUniverse.cs:1210-1215 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Common/Securities/Option/OptionFilterUniverse.cs:1200` calls `GetContractsForExpiry`, `Where`, `ToList` and `Common/Securities/Option/OptionFilterUniverse.cs:1209` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 2) Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs:652 — Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs:652-657 | Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs:675-680 — both copies are in the same file, so extract the 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/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs:652` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) Algorithm.CSharp/FutureOptionCallITMGreeksExpiryRegressionAlgorithm.cs:130 — Algorithm.CSharp/FutureOptionCallITMGreeksExpiryRegressionAlgorithm.cs:130-137 | Algorithm.CSharp/IndexOptionCallITMGreeksExpiryRegressionAlgorithm.cs:118-123 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/FutureOptionCallITMGreeksExpiryRegressionAlgorithm.cs:130` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) Algorithm.CSharp/IndexOptionBullCallSpreadAlgorithm.cs:35 — Algorithm.CSharp/IndexOptionBullCallSpreadAlgorithm.cs:35-40 | Algorithm.CSharp/IndexOptionIronCondorAlgorithm.cs:33-38 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) Algorithm.CSharp/IndexOptionCallITMExpiryRegressionAlgorithm.cs:51 — Algorithm.CSharp/IndexOptionCallITMExpiryRegressionAlgorithm.cs:51-56 | Algorithm.CSharp/IndexOptionCallITMGreeksExpiryRegressionAlgorithm.cs:45-50 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/IndexOptionCallITMExpiryRegressionAlgorithm.cs:51` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) Algorithm.CSharp/IndexOptionCallOTMExpiryRegressionAlgorithm.cs:56 — Algorithm.CSharp/IndexOptionCallOTMExpiryRegressionAlgorithm.cs:56-61 | Algorithm.CSharp/IndexOptionShortCallOTMExpiryRegressionAlgorithm.cs:50-55 — before extracting anything, compare `Algorithm.CSharp/IndexOptionCallOTMExpiryRegressionAlgorithm.cs` and `Algorithm.CSharp/IndexOptionShortCallOTMExpiryRegressionAlgorithm.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 66 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/IndexOptionCallOTMExpiryRegressionAlgorithm.cs:56` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) Algorithm.CSharp/BacktestingAsynchronousOrdersRegressionAlgorithm.cs:32 — Algorithm.CSharp/BacktestingAsynchronousOrdersRegressionAlgorithm.cs:32-37 | Algorithm.CSharp/TrailingStopOrderRegressionAlgorithm.cs:44-49 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (6 lines × 2) Algorithm.CSharp/BitfinexCashAccountFeeRegressionAlgorithm.cs:33 — Algorithm.CSharp/BitfinexCashAccountFeeRegressionAlgorithm.cs:33-38 | Algorithm.CSharp/BitfinexMarginAccountFeeRegressionAlgorithm.cs:33-38 — before extracting anything, compare `Algorithm.CSharp/BitfinexCashAccountFeeRegressionAlgorithm.cs` and `Algorithm.CSharp/BitfinexMarginAccountFeeRegressionAlgorithm.cs` as WHOLE FILES: 93% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (6 lines × 2) Algorithm.CSharp/TickQuoteBarConsolidatorWithTickTypeRegressionAlgorithm.cs:39 — Algorithm.CSharp/TickQuoteBarConsolidatorWithTickTypeRegressionAlgorithm.cs:39-44 | Algorithm.CSharp/TickTradeBarConsolidatorWithDefaultTickTypeRegressionAlgorithm.cs:39-44 — before extracting anything, compare `Algorithm.CSharp/TickQuoteBarConsolidatorWithTickTypeRegressionAlgorithm.cs` and `Algorithm.CSharp/TickTradeBarConsolidatorWithDefaultTickTypeRegressionAlgorithm.cs` as WHOLE FILES: 83% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (6 lines × 2) Algorithm.Framework/Alphas/HistoricalReturnsAlphaModel.cs:136 — Algorithm.Framework/Alphas/HistoricalReturnsAlphaModel.cs:136-141 | Algorithm.Framework/Alphas/MacdAlphaModel.cs:155-160 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (6 lines × 2) Algorithm.Python/BasicTemplateCryptoFutureAlgorithm.py:131 — Algorithm.Python/BasicTemplateCryptoFutureAlgorithm.py:131-136 | Algorithm.Python/BybitCryptoFuturesRegressionAlgorithm.py:123-128 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) Algorithm.Python/ComboOrderTicketDemoAlgorithm.py:178 — Algorithm.Python/ComboOrderTicketDemoAlgorithm.py:178-183 | Algorithm.Python/ComboOrderTicketDemoAlgorithm.py:185-190 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (6 lines × 2) Algorithm.Python/FutureOptionChainFullDataRegressionAlgorithm.py:23 — Algorithm.Python/FutureOptionChainFullDataRegressionAlgorithm.py:23-28 | Algorithm.Python/FutureOptionChainsMultipleFullDataRegressionAlgorithm.py:23-28 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) Algorithm.Python/IronCondorStrategyAlgorithm.py:68 — Algorithm.Python/IronCondorStrategyAlgorithm.py:68-73 | Algorithm.Python/IronCondorStrategyAlgorithm.py:75-80 — both copies are in the same file, so extract the 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 `Algorithm.Python/IronCondorStrategyAlgorithm.py:68` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) Algorithm.Python/LongAndShortButterflyCallStrategiesAlgorithm.py:56 — Algorithm.Python/LongAndShortButterflyCallStrategiesAlgorithm.py:56-61 | Algorithm.Python/LongAndShortButterflyCallStrategiesAlgorithm.py:64-69 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) Algorithm.Python/LongAndShortButterflyPutStrategiesAlgorithm.py:56 — Algorithm.Python/LongAndShortButterflyPutStrategiesAlgorithm.py:56-61 | Algorithm.Python/LongAndShortButterflyPutStrategiesAlgorithm.py:64-69 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) Algorithm.Python/MarketOnCloseOrderBufferExtendedMarketHoursRegressionAlgorithm.py:43 — Algorithm.Python/MarketOnCloseOrderBufferExtendedMarketHoursRegressionAlgorithm.py:43-48 | Algorithm.Python/MarketOnCloseOrderBufferRegressionAlgorithm.py:40-45 — before extracting anything, compare `Algorithm.Python/MarketOnCloseOrderBufferExtendedMarketHoursRegressionAlgorithm.py` and `Algorithm.Python/MarketOnCloseOrderBufferRegressionAlgorithm.py` as WHOLE FILES: 84% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Algorithm.Python/MarketOnCloseOrderBufferExtendedMarketHoursRegressionAlgorithm.py:52` calls `market_on_close_order` and `Algorithm.Python/MarketOnCloseOrderBufferRegressionAlgorithm.py:47` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • + 6 more in this group — see findings.md.
AX2 · Stateful singletons · Process-global static state · ×30
  • Process-global static state: LeanEngineAlgorithmHandlers Engine/LeanEngineAlgorithmHandlers.cs:37 — `LeanEngineAlgorithmHandlers` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_mapfileProvider, _factorFileProvider, _dataProvider; e.g. `_mapfileProvider` at line 221). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
  • Process-global static state: LiveOptionChainProvider Engine/DataFeeds/LiveOptionChainProvider.cs:38 — `LiveOptionChainProvider` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_cmeRateGate; e.g. `_cmeRateGate` at line 144). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
  • Process-global static state: LiveTradingDataFeed Engine/DataFeeds/LiveTradingDataFeed.cs:41 — `LiveTradingDataFeed` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_lastUtcDateShiftUpdate, _scheduledUniverseUtcTimeShift; e.g. `_lastUtcDateShiftUpdate` at line 412). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
  • Process-global static state: TextSubscriptionDataSourceReader Engine/DataFeeds/TextSubscriptionDataSourceReader.cs:32 — `TextSubscriptionDataSourceReader` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (CacheSize; e.g. `CacheSize` at line 219). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
  • Process-global static state: RemoteFileSubscriptionStreamReader Engine/DataFeeds/Transport/RemoteFileSubscriptionStreamReader.cs:31 — `RemoteFileSubscriptionStreamReader` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_downloader; e.g. `_downloader` at line 170). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
  • Process-global static state: Extensions Common/Extensions.cs:72 — `Extensions` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (InvalidSecurityTypes, PythonActivators, _notifiedUniverseSettingsUsed; e.g. `InvalidSecurityTypes` at line 2323). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
  • Process-global static state: Globals Common/Globals.cs:26 — `Globals` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (CacheDataFolder, DataFolder, Version, LiveMode, UserId, ProjectId; e.g. `CacheDataFolder` at line 78). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
  • Process-global static state: Market Common/Market.cs:25 — `Market` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (Markets, ReverseMarkets; e.g. `Markets` at line 312). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
  • Process-global static state: Messages Common/Messages/Messages.Algorithm.cs:23 — `Messages` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_algorithmLanguage; e.g. `_algorithmLanguage` at line 40). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
  • Process-global static state: OS Common/OS.cs:31 — `OS` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (CpuPerformanceCounter; e.g. `CpuPerformanceCounter` at line 159). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
  • Process-global static state: PortfolioTarget Common/Algorithm/Framework/Portfolio/PortfolioTarget.cs:29 — `PortfolioTarget` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (MinimumOrderMarginPercentageWarningSent; e.g. `MinimumOrderMarginPercentageWarningSent` at line 183). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
  • Process-global static state: DividendYieldProvider Common/Data/DividendYieldProvider.cs:31 — `DividendYieldProvider` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_cacheClearTask; e.g. `_cacheClearTask` at line 141). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
  • Process-global static state: InterestRateProvider Common/Data/InterestRateProvider.cs:30 — `InterestRateProvider` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_lastInterestRateDate; e.g. `_lastInterestRateDate` at line 89). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
  • Process-global static state: GenericDataDictionary Common/Data/Slice.cs:815 — `GenericDataDictionary` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_genericCache; e.g. `_genericCache` at line 857). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
  • Process-global static state: IntrinioConfig Common/Data/Custom/Intrinio/IntrinioConfig.cs:24 — `IntrinioConfig` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (RateGate, User, Password; e.g. `RateGate` at line 57). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
  • Process-global static state: Tiingo Common/Data/Custom/Tiingo/Tiingo.cs:21 — `Tiingo` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (AuthCode, IsAuthCodeSet; e.g. `AuthCode` at line 41). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
  • Process-global static state: FundamentalService Common/Data/UniverseSelection/FundamentalService.cs:27 — `FundamentalService` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_fundamentalDataProvider; e.g. `_fundamentalDataProvider` at line 60). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
  • Process-global static state: CommandPythonWrapper Common/Python/CommandPythonWrapper.cs:28 — `CommandPythonWrapper` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_linkSerializationMethod; e.g. `_linkSerializationMethod` at line 115). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
  • Process-global static state: PythonInitializer Common/Python/PythonInitializer.cs:31 — `PythonInitializer` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_isInitialized, _pendingPathAdditions, _algorithmLocation, PathToVirtualEnv, IncludeSystemPackages; e.g. `_isInitialized` at line 64). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
  • Process-global static state: MarketHoursDatabase Common/Securities/MarketHoursDatabase.cs:33 — `MarketHoursDatabase` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_alwaysOpenMarketHoursDatabase; e.g. `_alwaysOpenMarketHoursDatabase` at line 54). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
  • Process-global static state: OptionFilterUniverse Common/Securities/Option/OptionFilterUniverse.cs:1328 — `OptionFilterUniverse` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_defaultAtTheMoneyStrikeDistance; e.g. `_defaultAtTheMoneyStrikeDistance` at line 1347). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
  • Process-global static state: PythonObjectStore Common/Storage/PythonObjectStore.cs:26 — `PythonObjectStore` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_jsonDeserializeMethod, _dataFrameSerializeMethod, _dataFrameDeserializeMethod, _jsonSerializeMethod; e.g. `_jsonDeserializeMethod` at line 214). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
  • Process-global static state: Composer Common/Util/Composer.cs:38 — `Composer` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (PluginDirectory; e.g. `PluginDirectory` at line 44). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
  • Process-global static state: ObjectActivator Common/Util/ObjectActivator.cs:29 — `ObjectActivator` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_cloneMethodsByType, _activatorsByType; e.g. `_cloneMethodsByType` at line 109). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
  • Process-global static state: Log Logging/Log.cs:30 — `Log` keeps mutable `static` state — one slot for the whole process, shared by every thread that reaches the type however its instances are created — and mutates it outside any lock (_logHandler, _debuggingEnabled, _level, UserId, ProjectId, JobId; e.g. `_logHandler` at line 61). Concurrent callers lose updates, and a collection that is not built for concurrent writers can corrupt.
  • + 5 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×29
  • Duplicated block (7 lines × 2) Common/Data/Auxiliary/CorporateFactorProvider.cs:113 — Common/Data/Auxiliary/CorporateFactorProvider.cs:113-119 | Common/Data/Auxiliary/CorporateFactorProvider.cs:150-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 `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 (7 lines × 2) Algorithm.CSharp/IndexOptionBearCallSpreadAlgorithm.cs:56 — Algorithm.CSharp/IndexOptionBearCallSpreadAlgorithm.cs:56-62 | Algorithm.CSharp/IndexOptionBullCallSpreadAlgorithm.cs:56-62 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) Common/Securities/Option/OptionFilterUniverse.cs:833 — Common/Securities/Option/OptionFilterUniverse.cs:833-839 | Common/Securities/Option/OptionFilterUniverse.cs:896-902 — both copies are in the same file, so extract the 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/Securities/Option/OptionFilterUniverse.cs:833` 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 (7 lines × 2) Algorithm.CSharp/MarketOnCloseOrderFillsOnCloseTradeWithTickResolutionAlgorithm.cs:34 — Algorithm.CSharp/MarketOnCloseOrderFillsOnCloseTradeWithTickResolutionAlgorithm.cs:34-40 | Algorithm.CSharp/MarketOnOpenOrderFillsOnOpenTradeWithTickResolutionAlgorithm.cs:34-40 — before extracting anything, compare `Algorithm.CSharp/MarketOnCloseOrderFillsOnCloseTradeWithTickResolutionAlgorithm.cs` and `Algorithm.CSharp/MarketOnOpenOrderFillsOnOpenTradeWithTickResolutionAlgorithm.cs` as WHOLE FILES: 88% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/MarketOnCloseOrderFillsOnCloseTradeWithTickResolutionAlgorithm.cs:34` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) Engine/HistoricalData/SubscriptionDataReaderHistoryProvider.cs:161 — Engine/HistoricalData/SubscriptionDataReaderHistoryProvider.cs:161-167 | Engine/HistoricalData/SynchronizingHistoryProvider.cs:174-180 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Engine/HistoricalData/SynchronizingHistoryProvider.cs:170` calls `ConvertFromUtc` and `Engine/HistoricalData/SubscriptionDataReaderHistoryProvider.cs:159` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) Algorithm/QCAlgorithm.Indicators.cs:3992 — Algorithm/QCAlgorithm.Indicators.cs:3992-3998 | Algorithm/QCAlgorithm.Indicators.cs:4030-4036 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (7 lines × 2) Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs:178 — Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs:178-184 | Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs:369-375 — both copies are in the same file, so extract the 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/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs:178` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (7 lines × 2) Common/Util/LeanData.cs:821 — Common/Util/LeanData.cs:821-827 | Common/Util/LeanData.cs:832-838 — both copies are in the same file, so extract the 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:821` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) Algorithm.CSharp/CustomDataUsingMapFileRegressionAlgorithm.cs:68 — Algorithm.CSharp/CustomDataUsingMapFileRegressionAlgorithm.cs:68-80 | Algorithm.CSharp/IndiaDataRegressionAlgorithm.cs:103-109 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) Algorithm.CSharp/IndicatorBasedOptionPricingModelRegressionAlgorithm.cs:74 — Algorithm.CSharp/IndicatorBasedOptionPricingModelRegressionAlgorithm.cs:74-80 | Algorithm.CSharp/QLOptionPricingModelRegressionAlgorithm.cs:64-70 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Algorithm.CSharp/QLOptionPricingModelRegressionAlgorithm.cs:62` calls `foreach` and `Algorithm.CSharp/IndicatorBasedOptionPricingModelRegressionAlgorithm.cs:72` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) Report/ReportElements/RollingPortfolioBetaReportElement.cs:66 — Report/ReportElements/RollingPortfolioBetaReportElement.cs:66-72 | Report/ReportElements/RollingPortfolioBetaReportElement.cs:74-80 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) Algorithm.CSharp/BinanceCashAccountFeeRegressionAlgorithm.cs:33 — Algorithm.CSharp/BinanceCashAccountFeeRegressionAlgorithm.cs:33-39 | Algorithm.CSharp/BinanceMarginAccountFeeRegressionAlgorithm.cs:33-39 — before extracting anything, compare `Algorithm.CSharp/BinanceCashAccountFeeRegressionAlgorithm.cs` and `Algorithm.CSharp/BinanceMarginAccountFeeRegressionAlgorithm.cs` as WHOLE FILES: 93% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (7 lines × 2) Algorithm.CSharp/ObjectStoreHelpersRegressionAlgorithm.cs:35 — Algorithm.CSharp/ObjectStoreHelpersRegressionAlgorithm.cs:35-41 | Algorithm.CSharp/ObjectStoreKeySanitizationRegressionAlgorithm.cs:33-39 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (7 lines × 2) Algorithm.Python/AddOptionContractExpiresRegressionAlgorithm.py:47 — Algorithm.Python/AddOptionContractExpiresRegressionAlgorithm.py:47-53 | Algorithm.Python/AddOptionContractFromUniverseRegressionAlgorithm.py:71-77 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) Algorithm.Python/ComboOrderTicketDemoAlgorithm.py:23 — Algorithm.Python/ComboOrderTicketDemoAlgorithm.py:23-29 | Algorithm.Python/ContingentComboOrderRegressionAlgorithm.py:24-30 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) Algorithm.Python/CustomDataLinkedIconicTypeAddDataCoarseSelectionRegressionAlgorithm.py:46 — Algorithm.Python/CustomDataLinkedIconicTypeAddDataCoarseSelectionRegressionAlgorithm.py:46-52 | Algorithm.Python/CustomDataLinkedIconicTypeAddDataOnSecuritiesChangedRegressionAlgorithm.py:39-45 — before extracting anything, compare `Algorithm.Python/CustomDataLinkedIconicTypeAddDataCoarseSelectionRegressionAlgorithm.py` and `Algorithm.Python/CustomDataLinkedIconicTypeAddDataOnSecuritiesChangedRegressionAlgorithm.py` as WHOLE FILES: 85% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) Algorithm.Python/CustomDataMultiFileObjectStoreRegressionAlgorithm.py:93 — Algorithm.Python/CustomDataMultiFileObjectStoreRegressionAlgorithm.py:93-99 | Algorithm.Python/CustomDataObjectStoreRegressionAlgorithm.py:84-90 — before extracting anything, compare `Algorithm.Python/CustomDataMultiFileObjectStoreRegressionAlgorithm.py` and `Algorithm.Python/CustomDataObjectStoreRegressionAlgorithm.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) Algorithm.Python/FundamentalRegressionAlgorithm.py:107 — Algorithm.Python/FundamentalRegressionAlgorithm.py:107-113 | Algorithm.Python/FundamentalUniverseSelectionAlgorithm.py:43-49 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.Python/FundamentalRegressionAlgorithm.py: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 (7 lines × 2) Algorithm.Python/FutureOptionCallITMExpiryRegressionAlgorithm.py:94 — Algorithm.Python/FutureOptionCallITMExpiryRegressionAlgorithm.py:94-100 | Algorithm.Python/FutureOptionPutITMExpiryRegressionAlgorithm.py:93-99 — before extracting anything, compare `Algorithm.Python/FutureOptionCallITMExpiryRegressionAlgorithm.py` and `Algorithm.Python/FutureOptionPutITMExpiryRegressionAlgorithm.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Algorithm.Python/FutureOptionPutITMExpiryRegressionAlgorithm.py:103` calls `AssertionError` and `Algorithm.Python/FutureOptionCallITMExpiryRegressionAlgorithm.py:102` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) Algorithm.Python/IndexOptionCallOTMExpiryRegressionAlgorithm.py:95 — Algorithm.Python/IndexOptionCallOTMExpiryRegressionAlgorithm.py:95-101 | Algorithm.Python/IndexOptionPutOTMExpiryRegressionAlgorithm.py:95-101 — before extracting anything, compare `Algorithm.Python/IndexOptionCallOTMExpiryRegressionAlgorithm.py` and `Algorithm.Python/IndexOptionPutOTMExpiryRegressionAlgorithm.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) Algorithm.Python/OrderTicketDemoAlgorithm.py:438 — Algorithm.Python/OrderTicketDemoAlgorithm.py:438-444 | Algorithm.Python/OrderTicketDemoAlgorithm.py:460-466 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) Algorithm.Python/SecuritySessionRegressionAlgorithm.py:115 — Algorithm.Python/SecuritySessionRegressionAlgorithm.py:115-122 | Algorithm.Python/SecuritySessionWithFuturesRegressionAlgorithm.py:69-75 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.Python/SecuritySessionRegressionAlgorithm.py: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 (7 lines × 2) Report/ReportCharts.py:823 — Report/ReportCharts.py:823-829 | Report/ReportCharts.py:959-965 — both copies are in the same file, so extract the 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 `Report/ReportCharts.py:823` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) Algorithm.Python/FutureOptionCallITMExpiryRegressionAlgorithm.py:60 — Algorithm.Python/FutureOptionCallITMExpiryRegressionAlgorithm.py:60-66 | Algorithm.Python/FutureOptionPutITMExpiryRegressionAlgorithm.py:59-65 — before extracting anything, compare `Algorithm.Python/FutureOptionCallITMExpiryRegressionAlgorithm.py` and `Algorithm.Python/FutureOptionPutITMExpiryRegressionAlgorithm.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) Algorithm.Python/ClassicRangeConsolidatorAlgorithm.py:23 — Algorithm.Python/ClassicRangeConsolidatorAlgorithm.py:23-29 | Algorithm.Python/ClassicRangeConsolidatorWithTickAlgorithm.py:22-28 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • + 4 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×27
  • Duplicated block (11 lines × 2) Algorithm.CSharp/BaseFrameworkRegressionAlgorithm.cs:42 — Algorithm.CSharp/BaseFrameworkRegressionAlgorithm.cs:42-52 | Algorithm.CSharp/PearsonCorrelationPairsTradingAlphaModelFrameworkAlgorithm.cs:41-51 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/BaseFrameworkRegressionAlgorithm.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 (11 lines × 2) Common/Data/UniverseSelection/UniverseExtensions.cs:147 — Common/Data/UniverseSelection/UniverseExtensions.cs:147-157 | Common/Symbol.cs:93-103 — 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/Data/UniverseSelection/UniverseExtensions.cs:147` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Common/Symbol.cs:91` calls `CreateOption` and `Common/Data/UniverseSelection/UniverseExtensions.cs:145` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) Algorithm.CSharp/BasicTemplateFuturesWithExtendedMarketAlgorithm.cs:90 — Algorithm.CSharp/BasicTemplateFuturesWithExtendedMarketAlgorithm.cs:90-100 | Algorithm.CSharp/SetHoldingsFutureRegressionAlgorithm.cs:61-71 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/BasicTemplateFuturesWithExtendedMarketAlgorithm.cs:90` 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.Framework/Portfolio/MeanVarianceOptimizationPortfolioConstructionModel.cs:321 — Algorithm.Framework/Portfolio/MeanVarianceOptimizationPortfolioConstructionModel.cs:321-331 | Algorithm.Framework/Portfolio/RiskParityPortfolioConstructionModel.cs:253-263 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.Framework/Portfolio/MeanVarianceOptimizationPortfolioConstructionModel.cs:321` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Algorithm.Framework/Portfolio/RiskParityPortfolioConstructionModel.cs:249` calls `RegisterIndicator` and `Algorithm.Framework/Portfolio/MeanVarianceOptimizationPortfolioConstructionModel.cs:317` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) Indicators/CandlestickPatterns/AdvanceBlock.cs:111 — Indicators/CandlestickPatterns/AdvanceBlock.cs:111-121 | Indicators/CandlestickPatterns/ThreeWhiteSoldiers.cs:97-107 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (11 lines × 2) Algorithm.CSharp/IndexOptionPutITMExpiryRegressionAlgorithm.cs:45 — Algorithm.CSharp/IndexOptionPutITMExpiryRegressionAlgorithm.cs:45-55 | Algorithm.CSharp/IndexOptionShortCallOTMExpiryRegressionAlgorithm.cs:47-57 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (11 lines × 2) Common/Orders/Fills/EquityFillModel.cs:805 — Common/Orders/Fills/EquityFillModel.cs:805-815 | Common/Orders/Fills/EquityFillModel.cs:914-924 — both copies are in the same file, so extract the 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:805` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 2) Common/Util/LeanData.cs:283 — Common/Util/LeanData.cs:283-293 | Common/Util/LeanData.cs:306-316 — both copies are in the same file, so extract the 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:283` 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/IdenticalThreeCrows.cs:100 — Indicators/CandlestickPatterns/IdenticalThreeCrows.cs:100-110 | Indicators/CandlestickPatterns/ThreeBlackCrows.cs:91-101 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Indicators/CandlestickPatterns/ThreeBlackCrows.cs:89` calls `GetCandleColor` and `Indicators/CandlestickPatterns/IdenticalThreeCrows.cs:98` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) Indicators/CandlestickPatterns/StalledPattern.cs:106 — Indicators/CandlestickPatterns/StalledPattern.cs:106-116 | Indicators/CandlestickPatterns/ThreeLineStrike.cs:77-87 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/StalledPattern.cs:106` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 2) Algorithm.CSharp/ForexInternalFeedOnDataHigherResolutionRegressionAlgorithm.cs:84 — Algorithm.CSharp/ForexInternalFeedOnDataHigherResolutionRegressionAlgorithm.cs:84-94 | Algorithm.CSharp/ForexInternalFeedOnDataSameResolutionRegressionAlgorithm.cs:84-94 — before extracting anything, compare `Algorithm.CSharp/ForexInternalFeedOnDataHigherResolutionRegressionAlgorithm.cs` and `Algorithm.CSharp/ForexInternalFeedOnDataSameResolutionRegressionAlgorithm.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/ForexInternalFeedOnDataHigherResolutionRegressionAlgorithm.cs:84` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) Algorithm.CSharp/BasicTemplateOptionsFrameworkAlgorithm.cs:53 — Algorithm.CSharp/BasicTemplateOptionsFrameworkAlgorithm.cs:53-63 | Algorithm.CSharp/OptionChainSubscriptionRemovalRegressionAlgorithm.cs:61-71 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 2) Algorithm.CSharp/BasicTemplateSPXWeeklyIndexOptionsAlgorithm.cs:76 — Algorithm.CSharp/BasicTemplateSPXWeeklyIndexOptionsAlgorithm.cs:76-86 | Algorithm.CSharp/OptionResolutionRegressionAlgorithm.cs:65-75 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/BasicTemplateSPXWeeklyIndexOptionsAlgorithm.cs:76` 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/CoarseFineFundamentalComboAlgorithm.cs:113 — Algorithm.CSharp/CoarseFineFundamentalComboAlgorithm.cs:113-123 | Algorithm.CSharp/CoarseFineFundamentalRegressionAlgorithm.cs:137-147 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 2) Algorithm.CSharp/HourMarketOrderFillsAtBarCloseRegressionAlgorithm.cs:54 — Algorithm.CSharp/HourMarketOrderFillsAtBarCloseRegressionAlgorithm.cs:54-64 | Algorithm.CSharp/RestingMarketOrderFillsAtBarOpenRegressionAlgorithm.cs:61-71 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (11 lines × 2) Common/Securities/Option/OptionFilterUniverse.cs:473 — Common/Securities/Option/OptionFilterUniverse.cs:473-484 | Common/Securities/Option/OptionFilterUniverse.cs:541-551 — both copies are in the same file, so extract the 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/Securities/Option/OptionFilterUniverse.cs:473` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) REDACTED:957 — REDACTED:957-967 | REDACTED:991-1001 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:1002` calls `Close` and `REDACTED:968` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) Algorithm.CSharp/FutureOptionCallITMExpiryRegressionAlgorithm.cs:62 — Algorithm.CSharp/FutureOptionCallITMExpiryRegressionAlgorithm.cs:62-72 | Algorithm.CSharp/FutureOptionCallOTMExpiryRegressionAlgorithm.cs:68-79 — before extracting anything, compare `Algorithm.CSharp/FutureOptionCallITMExpiryRegressionAlgorithm.cs` and `Algorithm.CSharp/FutureOptionCallOTMExpiryRegressionAlgorithm.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/FutureOptionCallITMExpiryRegressionAlgorithm.cs:62` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) Algorithm.CSharp/NakedShortOptionStrategyOverMarginAlgorithm.cs:45 — Algorithm.CSharp/NakedShortOptionStrategyOverMarginAlgorithm.cs:45-55 | Algorithm.CSharp/OptionStrategyFactoryMethodsBaseAlgorithm.cs:41-51 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 2) Algorithm.CSharp/CoarseFineFundamentalComboAlgorithm.cs:44 — Algorithm.CSharp/CoarseFineFundamentalComboAlgorithm.cs:44-54 | Algorithm.CSharp/CoarseFineFundamentalRegressionAlgorithm.cs:44-54 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 2) Algorithm.CSharp/FeeModelNotUsingAccountCurrency.cs:71 — Algorithm.CSharp/FeeModelNotUsingAccountCurrency.cs:71-81 | Algorithm.CSharp/ZeroFeeRegressionAlgorithm.cs:53-63 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 2) Algorithm.Python/AddFutureOptionContractDataStreamingRegressionAlgorithm.py:84 — Algorithm.Python/AddFutureOptionContractDataStreamingRegressionAlgorithm.py:84-94 | Algorithm.Python/AddFutureOptionSingleOptionChainSelectedInUniverseFilterRegressionAlgorithm.py:108-118 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (11 lines × 2) Algorithm.Python/FutureContractsExtendedMarketHoursRegressionAlgorithm.py:55 — Algorithm.Python/FutureContractsExtendedMarketHoursRegressionAlgorithm.py:55-65 | Algorithm.Python/FuturesExtendedMarketHoursRegressionAlgorithm.py:62-72 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (11 lines × 2) Algorithm.Python/IndexOptionCallButterflyAlgorithm.py:23 — Algorithm.Python/IndexOptionCallButterflyAlgorithm.py:23-33 | Algorithm.Python/IndexOptionPutButterflyAlgorithm.py:23-33 — before extracting anything, compare `Algorithm.Python/IndexOptionCallButterflyAlgorithm.py` and `Algorithm.Python/IndexOptionPutButterflyAlgorithm.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 2) Algorithm.Python/OptionChainConsistencyRegressionAlgorithm.py:29 — Algorithm.Python/OptionChainConsistencyRegressionAlgorithm.py:29-39 | Algorithm.Python/OptionExerciseAssignRegressionAlgorithm.py:27-37 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • + 2 more in this group — see findings.md.
X1 · Async correctness · Sync-over-async (deadlock risk) through `.Result` · ×27
  • Sync-over-async (deadlock risk) through `.Result` Engine/DataFeeds/LiveOptionChainProvider.cs:216 — Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout.
  • Sync-over-async (deadlock risk) through `.Result` Engine/DataFeeds/LiveOptionChainProvider.cs:218 — Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout.
  • Sync-over-async (deadlock risk) through `.Result` Engine/Engine.cs:121 — Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout.
  • Sync-over-async (deadlock risk) through `.Result` Common/Algorithm/Framework/Portfolio/SignalExports/Collective2SignalExport.cs:290 — Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout.
  • Sync-over-async (deadlock risk) through `.Result` Common/Algorithm/Framework/Portfolio/SignalExports/Collective2SignalExport.cs:293 — Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout.
  • Sync-over-async (deadlock risk) through `.Result` Common/Algorithm/Framework/Portfolio/SignalExports/CrunchDAOSignalExport.cs:192 — Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout.
  • Sync-over-async (deadlock risk) through `.Result` Common/Algorithm/Framework/Portfolio/SignalExports/CrunchDAOSignalExport.cs:195 — Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout.
  • Sync-over-async (deadlock risk) through `.Result` Common/Algorithm/Framework/Portfolio/SignalExports/CrunchDAOSignalExport.cs:220 — Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout.
  • Sync-over-async (deadlock risk) through `.Result` Common/Algorithm/Framework/Portfolio/SignalExports/CrunchDAOSignalExport.cs:223 — Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout.
  • Sync-over-async (deadlock risk) through `.Result` Common/Algorithm/Framework/Portfolio/SignalExports/CrunchDAOSignalExport.cs:234 — Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout.
  • Sync-over-async (deadlock risk) through `.Result` Common/Algorithm/Framework/Portfolio/SignalExports/CrunchDAOSignalExport.cs:248 — Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout.
  • Sync-over-async (deadlock risk) through `.Result` Common/Algorithm/Framework/Portfolio/SignalExports/CrunchDAOSignalExport.cs:257 — Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout.
  • Sync-over-async (deadlock risk) through `.Result` Common/Algorithm/Framework/Portfolio/SignalExports/CrunchDAOSignalExport.cs:277 — Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout.
  • Sync-over-async (deadlock risk) through `.Result` Common/Algorithm/Framework/Portfolio/SignalExports/CrunchDAOSignalExport.cs:280 — Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout.
  • Sync-over-async (deadlock risk) through `.Result` Common/Algorithm/Framework/Portfolio/SignalExports/NumeraiSignalExport.cs:200 — Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout.
  • Sync-over-async (deadlock risk) through `.Result` Common/Algorithm/Framework/Portfolio/SignalExports/NumeraiSignalExport.cs:201 — Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout.
  • Sync-over-async (deadlock risk) through `.Result` Common/Algorithm/Framework/Portfolio/SignalExports/NumeraiSignalExport.cs:229 — Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout.
  • Sync-over-async (deadlock risk) through `.Result` Common/Algorithm/Framework/Portfolio/SignalExports/NumeraiSignalExport.cs:263 — Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout.
  • Sync-over-async (deadlock risk) through `.Result` Common/Algorithm/Framework/Portfolio/SignalExports/NumeraiSignalExport.cs:264 — Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout.
  • Sync-over-async (deadlock risk) through `.Result` Common/Algorithm/Framework/Portfolio/SignalExports/VBaseSignalExport.cs:159 — Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout.
  • Sync-over-async (deadlock risk) through `.Result` Common/Algorithm/Framework/Portfolio/SignalExports/VBaseSignalExport.cs:160 — Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout.
  • Sync-over-async (deadlock risk) through `.Result` Common/Extensions.cs:422 — Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout.
  • Sync-over-async (deadlock risk) through `.Result` Api/Api.cs:1028 — Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout.
  • Sync-over-async (deadlock risk) through `.Result` Api/Api.cs:1139 — Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout.
  • Sync-over-async (deadlock risk) through `.Result` Api/Api.cs:1415 — Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout.
  • + 2 more in this group — see findings.md.
D3 · God Classes · TooManyMethods · ×26
  • TooManyMethods: QCAlgorithm Algorithm/QCAlgorithm.Indicators.cs — TooManyMethods — 5414 significant lines (blank, comment-only and punctuation-only lines excluded), 717 methods, declared across 10 files: Algorithm/QCAlgorithm.Indicators.cs (223), Algorithm/QCAlgorithm.cs (169), Algorithm/QCAlgorithm.Python.cs (92), Algorithm/QCAlgorithm.Trading.cs (72), +6 more file(s). The bar is 30 methods; this is 687 over it, 23.90× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AlgorithmPythonWrapper AlgorithmFactory/Python/Wrappers/AlgorithmPythonWrapper.cs — TooManyMethods — 340 significant lines (blank, comment-only and punctuation-only lines excluded), 83 methods. The bar is 30 methods; this is 53 over it, 2.77× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Api Api/Api.cs — TooManyMethods — 533 significant lines (blank, comment-only and punctuation-only lines excluded), 78 methods. The bar is 30 methods; this is 48 over it, 2.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ConstituentUniverseDefinitions Algorithm/ConstituentUniverseDefinitions.cs — TooManyMethods — 292 significant lines (blank, comment-only and punctuation-only lines excluded), 73 methods. The bar is 30 methods; this is 43 over it, 2.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: BaseOptionFilterUniverse Common/Securities/Option/OptionFilterUniverse.cs — TooManyMethods — 439 significant lines (blank, comment-only and punctuation-only lines excluded), 66 methods. The bar is 30 methods; this is 36 over it, 2.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: CandlestickPatterns Algorithm/CandlestickPatterns.cs — TooManyMethods — 309 significant lines (blank, comment-only and punctuation-only lines excluded), 62 methods. The bar is 30 methods; this is 32 over it, 2.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: BaseResultsHandler Engine/Results/BaseResultsHandler.cs — TooManyMethods — 512 significant lines (blank, comment-only and punctuation-only lines excluded), 58 methods. The bar is 30 methods; this is 28 over it, 1.93× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: IndicatorBase Indicators/IndicatorBase.Operators.cs — 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). The bar is 30 methods; this is 28 over it, 1.93× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: BrokerageTransactionHandler Engine/TransactionHandlers/BrokerageTransactionHandler.cs — TooManyMethods — 958 significant lines (blank, comment-only and punctuation-only lines excluded), 55 methods. The bar is 30 methods; this is 25 over it, 1.83× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Security Common/Securities/Security.cs — TooManyMethods — 427 significant lines (blank, comment-only and punctuation-only lines excluded), 54 methods. The bar is 30 methods; this is 24 over it, 1.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: LeanData Common/Util/LeanData.cs — TooManyMethods — 806 significant lines (blank, comment-only and punctuation-only lines excluded), 51 methods. The bar is 30 methods; this is 21 over it, 1.70× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
  • TooManyMethods: OptionChain Common/Data/Market/OptionChain.Filters.cs — TooManyMethods — 119 significant lines (blank, comment-only and punctuation-only lines excluded), 50 methods, declared across 2 files: Market/OptionChain.Filters.cs (44), Market/OptionChain.cs (6). The bar is 30 methods; this is 20 over it, 1.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: OptionStrategies Common/Securities/Option/OptionStrategies.cs — TooManyMethods — 418 significant lines (blank, comment-only and punctuation-only lines excluded), 46 methods. The bar is 30 methods; this is 16 over it, 1.53× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
  • TooManyMethods: LiveTradingResultHandler Engine/Results/LiveTradingResultHandler.cs — TooManyMethods — 567 significant lines (blank, comment-only and punctuation-only lines excluded), 41 methods. The bar is 30 methods; this is 11 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Compression REDACTED — TooManyMethods — 380 significant lines (blank, comment-only and punctuation-only lines excluded), 41 methods. The bar is 30 methods; this is 11 over it, 1.37× the bar. 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 — TooManyMethods — 199 significant lines (blank, comment-only and punctuation-only lines excluded), 40 methods. The bar is 30 methods; this is 10 over it, 1.33× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
  • TooManyMethods: TradeBar Common/Data/Market/TradeBar.cs — TooManyMethods — 312 significant lines (blank, comment-only and punctuation-only lines excluded), 39 methods. The bar is 30 methods; this is 9 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Symbol Common/Symbol.cs — TooManyMethods — 297 significant lines (blank, comment-only and punctuation-only lines excluded), 39 methods. The bar is 30 methods; this is 9 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: QuantBook Research/QuantBook.cs — TooManyMethods — 482 significant lines (blank, comment-only and punctuation-only lines excluded), 38 methods. The bar is 30 methods; this is 8 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: SecurityIdentifier Common/SecurityIdentifier.cs — TooManyMethods — 385 significant lines (blank, comment-only and punctuation-only lines excluded), 38 methods. The bar is 30 methods; this is 8 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Brokerage Brokerages/Brokerage.cs — TooManyMethods — 297 significant lines (blank, comment-only and punctuation-only lines excluded), 36 methods. The bar is 30 methods; this is 6 over it, 1.20× the bar. 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: SecurityTransactionManager Common/Securities/SecurityTransactionManager.cs — TooManyMethods — 186 significant lines (blank, comment-only and punctuation-only lines excluded), 35 methods. The bar is 30 methods; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ContractSecurityFilterUniverse Common/Securities/ContractSecurityFilterUniverse.cs — TooManyMethods — 177 significant lines (blank, comment-only and punctuation-only lines excluded), 35 methods. The bar is 30 methods; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Time Common/Time.cs — TooManyMethods — 234 significant lines (blank, comment-only and punctuation-only lines excluded), 34 methods. The bar is 30 methods; this is 4 over it, 1.13× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
  • TooManyMethods: ObjectStore Common/Storage/ObjectStore.cs — TooManyMethods — 140 significant lines (blank, comment-only and punctuation-only lines excluded), 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • + 1 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×26
  • Duplicated block (5 lines × 2) Algorithm.CSharp/IndexOptionCallCalendarSpreadAlgorithm.cs:61 — Algorithm.CSharp/IndexOptionCallCalendarSpreadAlgorithm.cs:61-65 | Algorithm.CSharp/IndexOptionPutCalendarSpreadAlgorithm.cs:67-71 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) Algorithm.CSharp/IndexOptionCallITMExpiryRegressionAlgorithm.cs:66 — Algorithm.CSharp/IndexOptionCallITMExpiryRegressionAlgorithm.cs:66-70 | Algorithm.CSharp/IndexOptionCallOTMExpiryRegressionAlgorithm.cs:71-75 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/IndexOptionCallITMExpiryRegressionAlgorithm.cs:66` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) REDACTED:85 — REDACTED:85-89 | REDACTED:99-103 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:85` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) Algorithm.CSharp/OptionPriceModelForSupportedAmericanOptionRegressionAlgorithm.cs:29 — Algorithm.CSharp/OptionPriceModelForSupportedAmericanOptionRegressionAlgorithm.cs:29-33 | Algorithm.CSharp/OptionPriceModelForUnsupportedAmericanOptionRegressionAlgorithm.cs:29-33 — before extracting anything, compare `Algorithm.CSharp/OptionPriceModelForSupportedAmericanOptionRegressionAlgorithm.cs` and `Algorithm.CSharp/OptionPriceModelForUnsupportedAmericanOptionRegressionAlgorithm.cs` as WHOLE FILES: 89% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) Common/Scheduling/TimeRules.cs:261 — Common/Scheduling/TimeRules.cs:261-265 | Common/Scheduling/TimeRules.cs:375-379 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) Algorithm.CSharp/OptionRenameRegressionAlgorithm.cs:70 — Algorithm.CSharp/OptionRenameRegressionAlgorithm.cs:70-74 | Algorithm.CSharp/OptionSplitRegressionAlgorithm.cs:65-69 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/OptionRenameRegressionAlgorithm.cs:70` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) Common/Orders/OrderTicket.cs:629 — Common/Orders/OrderTicket.cs:629-633 | Common/Orders/OrderTicket.cs:644-648 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `request` to `CancelOrderRequest` in one and `UpdateOrderRequest` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (5 lines × 2) Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs:159 — Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs:159-163 | Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs:346-350 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs:159` 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 first that the copies are not typed on the same thing: the declarations holding them bind `parameters` to `PositionGroupMaintenanceMarginParameters` in one and `PositionGroupInitialMarginParameters` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (5 lines × 2) Algorithm.CSharp/AddAndRemoveOptionContractRegressionAlgorithm.cs:44 — Algorithm.CSharp/AddAndRemoveOptionContractRegressionAlgorithm.cs:44-48 | Algorithm.CSharp/SecuritySessionWithOptionRegressionAlgorithm.cs:41-45 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/AddAndRemoveOptionContractRegressionAlgorithm.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 (5 lines × 2) Algorithm.CSharp/BubbleAlgorithm.cs:133 — Algorithm.CSharp/BubbleAlgorithm.cs:133-137 | Algorithm.CSharp/BubbleAlgorithm.cs:161-165 — both copies are in the same file, so extract the 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 `Algorithm.CSharp/BubbleAlgorithm.cs:133` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (5 lines × 2) Common/Securities/Option/StrategyMatcher/OptionStrategyDefinitions.cs:359 — Common/Securities/Option/StrategyMatcher/OptionStrategyDefinitions.cs:359-363 | Common/Securities/Option/StrategyMatcher/OptionStrategyDefinitions.cs:436-440 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) Common/Securities/Option/StrategyMatcher/OptionStrategyDefinitions.cs:374 — Common/Securities/Option/StrategyMatcher/OptionStrategyDefinitions.cs:374-378 | Common/Securities/Option/StrategyMatcher/OptionStrategyDefinitions.cs:420-424 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) Indicators/CandlestickPatterns/EveningStar.cs:57 — Indicators/CandlestickPatterns/EveningStar.cs:57-61 | Indicators/CandlestickPatterns/MorningStar.cs:57-61 — before extracting anything, compare `Indicators/CandlestickPatterns/EveningStar.cs` and `Indicators/CandlestickPatterns/MorningStar.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (5 lines × 2) Indicators/CandlestickPatterns/Hammer.cs:54 — Indicators/CandlestickPatterns/Hammer.cs:54-58 | Indicators/CandlestickPatterns/HangingMan.cs:54-58 — before extracting anything, compare `Indicators/CandlestickPatterns/Hammer.cs` and `Indicators/CandlestickPatterns/HangingMan.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 66 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (5 lines × 2) Algorithm.CSharp/HistoryWithDifferentContinuousContractDepthOffsetsRegressionAlgorithm.cs:34 — Algorithm.CSharp/HistoryWithDifferentContinuousContractDepthOffsetsRegressionAlgorithm.cs:34-38 | Algorithm.CSharp/HistoryWithDifferentDataMappingModeRegressionAlgorithm.cs:32-36 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) Report/ReportElements/ExposureReportElement.cs:101 — Report/ReportElements/ExposureReportElement.cs:101-105 | Report/ReportElements/ExposureReportElement.cs:106-110 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) Algorithm.Python/HistoryWithDifferentContinuousContractDepthOffsetsRegressionAlgorithm.py:37 — Algorithm.Python/HistoryWithDifferentContinuousContractDepthOffsetsRegressionAlgorithm.py:37-41 | Algorithm.Python/HistoryWithDifferentDataMappingModeRegressionAlgorithm.py:36-40 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) Algorithm.Python/LongAndShortCallCalendarSpreadStrategiesAlgorithm.py:52 — Algorithm.Python/LongAndShortCallCalendarSpreadStrategiesAlgorithm.py:52-56 | Algorithm.Python/LongAndShortPutCalendarSpreadStrategiesAlgorithm.py:52-56 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.Python/LongAndShortCallCalendarSpreadStrategiesAlgorithm.py:52` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) Algorithm.Python/OptionPriceModelForSupportedAmericanOptionRegressionAlgorithm.py:23 — Algorithm.Python/OptionPriceModelForSupportedAmericanOptionRegressionAlgorithm.py:23-27 | Algorithm.Python/OptionPriceModelForUnsupportedAmericanOptionRegressionAlgorithm.py:23-27 — before extracting anything, compare `Algorithm.Python/OptionPriceModelForSupportedAmericanOptionRegressionAlgorithm.py` and `Algorithm.Python/OptionPriceModelForUnsupportedAmericanOptionRegressionAlgorithm.py` as WHOLE FILES: 82% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) Algorithm.Python/CustomModelsAlgorithm.py:93 — Algorithm.Python/CustomModelsAlgorithm.py:93-97 | Algorithm.Python/CustomModelsPEP8Algorithm.py:91-95 — before extracting anything, compare `Algorithm.Python/CustomModelsAlgorithm.py` and `Algorithm.Python/CustomModelsPEP8Algorithm.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (5 lines × 2) Algorithm.Python/ETFConstituentUniverseCompositeDelistingRegressionAlgorithm.py:51 — Algorithm.Python/ETFConstituentUniverseCompositeDelistingRegressionAlgorithm.py:51-55 | Algorithm.Python/ETFConstituentUniverseCompositeDelistingRegressionAlgorithmNoAddEquityETF.py:51-55 — before extracting anything, compare `Algorithm.Python/ETFConstituentUniverseCompositeDelistingRegressionAlgorithm.py` and `Algorithm.Python/ETFConstituentUniverseCompositeDelistingRegressionAlgorithmNoAddEquityETF.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) Algorithm.Python/SetHoldingsRegressionAlgorithm.py:25 — Algorithm.Python/SetHoldingsRegressionAlgorithm.py:25-29 | Algorithm.Python/StringToSymbolImplicitConversionRegressionAlgorithm.py:22-26 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) Algorithm.Python/BasicCSharpIntegrationTemplateAlgorithm.py:20 — Algorithm.Python/BasicCSharpIntegrationTemplateAlgorithm.py:20-24 | Algorithm.Python/BrokerageActivityEventHandlingAlgorithm.py:26-30 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) Algorithm.Python/FutureOptionChainsMultipleFullDataRegressionAlgorithm.py:58 — Algorithm.Python/FutureOptionChainsMultipleFullDataRegressionAlgorithm.py:58-62 | Algorithm.Python/FuturesChainsMultipleFullDataRegressionAlgorithm.py:53-57 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) Algorithm.Python/FundamentalCustomSelectionTimeRegressionAlgorithm.py:55 — Algorithm.Python/FundamentalCustomSelectionTimeRegressionAlgorithm.py:55-59 | Algorithm.Python/FundamentalCustomSelectionTimeRegressionAlgorithm.py:64-68 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • + 1 more in this group — see findings.md.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×25
  • Edited copy of a member (9 corresponding lines) Common/Securities/ContractSecurityFilterUniverse.cs:271 — Common/Securities/ContractSecurityFilterUniverse.cs:271-279 | Common/Securities/ContractSecurityFilterUniverse.cs:314-322 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) Algorithm.CSharp/ForexInternalFeedOnDataHigherResolutionRegressionAlgorithm.cs:39 — Algorithm.CSharp/ForexInternalFeedOnDataHigherResolutionRegressionAlgorithm.cs:39-47 | Algorithm.CSharp/ForexInternalFeedOnDataSameResolutionRegressionAlgorithm.cs:39-47 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) Common/Extensions.cs:1107 — Common/Extensions.cs:1107-1115 | Common/Extensions.cs:1123-1131 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) Algorithm/QCAlgorithm.Indicators.cs:3991 — Algorithm/QCAlgorithm.Indicators.cs:3991-3999 | Algorithm/QCAlgorithm.Indicators.cs:4029-4037 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) Common/Data/Market/BaseChain.cs:220 — Common/Data/Market/BaseChain.cs:220-228 | Common/Data/Market/BaseChain.cs:276-284 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) Algorithm.Python/OptionOpenInterestRegressionAlgorithm.py:24 — Algorithm.Python/OptionOpenInterestRegressionAlgorithm.py:24-34 | Algorithm.Python/OptionRenameRegressionAlgorithm.py:25-33 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) Indicators/TomDemarkSequential.cs:324 — Indicators/TomDemarkSequential.cs:324-332 | Indicators/TomDemarkSequential.cs:335-343 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) Algorithm.CSharp/AddFutureOptionContractFromFutureChainRegressionAlgorithm.cs:32 — Algorithm.CSharp/AddFutureOptionContractFromFutureChainRegressionAlgorithm.cs:32-41 | Algorithm.CSharp/FutureOptionContinuousFutureRegressionAlgorithm.cs:34-42 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) Algorithm.CSharp/ConvertToFrameworkAlgorithm.cs:48 — Algorithm.CSharp/ConvertToFrameworkAlgorithm.cs:48-56 | Algorithm.CSharp/MACDTrendAlgorithm.cs:41-49 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) Algorithm.CSharp/FuturesExpiredContractRegression.cs:37 — Algorithm.CSharp/FuturesExpiredContractRegression.cs:37-45 | Algorithm.CSharp/SetHoldingsFutureRegressionAlgorithm.cs:40-49 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) REDACTED:42 — REDACTED:42-55 | Algorithm.CSharp/CustomDataSecurityCacheGetDataRegressionAlgorithm.cs:33-41 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) Algorithm.CSharp/MarketOnOpenOrderSlippageRegressionAlgorithm.cs:37 — Algorithm.CSharp/MarketOnOpenOrderSlippageRegressionAlgorithm.cs:37-45 | Algorithm.CSharp/OneUpdatesOtherOrderRegressionAlgorithm.cs:43-51 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) Algorithm.Framework/Alphas/EmaCrossAlphaModel.py:23 — Algorithm.Framework/Alphas/EmaCrossAlphaModel.py:23-33 | Algorithm.Framework/Alphas/RsiAlphaModel.py:25-33 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) Algorithm.Python/Alphas/ContingentClaimsAnalysisDefaultPredictionAlpha.py:77 — Algorithm.Python/Alphas/ContingentClaimsAnalysisDefaultPredictionAlpha.py:77-87 | Algorithm.Python/Alphas/PriceGapMeanReversionAlpha.py:57-65 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) Common/Orders/Slippage/AlphaStreamsSlippageModel.cs:38 — Common/Orders/Slippage/AlphaStreamsSlippageModel.cs:38-51 | Common/Orders/Slippage/ConstantSlippageModel.cs:41-49 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) Algorithm.CSharp/HourReverseSplitRegressionAlgorithm.cs:43 — Algorithm.CSharp/HourReverseSplitRegressionAlgorithm.cs:43-51 | Algorithm.CSharp/HourSplitRegressionAlgorithm.cs:48-58 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) Engine/Results/Analysis/Analyses/OrderResponseErrorsAnalyses/BrokerageModelRefusedToSubmitOrderOrderResponseErrorAnalysis.cs:104 — Engine/Results/Analysis/Analyses/OrderResponseErrorsAnalyses/BrokerageModelRefusedToSubmitOrderOrderResponseErrorAnalysis.cs:104-112 | Engine/Results/Analysis/Analyses/OrderResponseErrorsAnalyses/BrokerageModelRefusedToUpdateOrderOrderResponseErrorAnalysis.cs:69-77 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) Algorithm.Python/ConstituentsQC500GeneratorAlgorithm.py:28 — Algorithm.Python/ConstituentsQC500GeneratorAlgorithm.py:28-36 | Algorithm.Python/UniverseSelectionDefinitionsAlgorithm.py:26-36 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) Algorithm.CSharp/WarmupLowerResolutionSelectionRegressionAlgorithm.cs:49 — Algorithm.CSharp/WarmupLowerResolutionSelectionRegressionAlgorithm.cs:49-57 | Algorithm.CSharp/WarmupSelectionRegressionAlgorithm.cs:53-61 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) Common/Data/Market/DataDictionary.cs:77 — Common/Data/Market/DataDictionary.cs:77-85 | Common/Data/Slice.cs:336-344 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) Algorithm.Python/AddAlphaModelAlgorithm.py:48 — Algorithm.Python/AddAlphaModelAlgorithm.py:48-56 | Algorithm.Python/InsightTagAlphaRegressionAlgorithm.py:75-84 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) Algorithm.CSharp/CustomOptionAssignmentRegressionAlgorithm.cs:28 — Algorithm.CSharp/CustomOptionAssignmentRegressionAlgorithm.cs:28-37 | Algorithm.CSharp/NullOptionAssignmentRegressionAlgorithm.cs:28-36 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) Algorithm.Framework/Selection/FineFundamentalUniverseSelectionModel.cs:85 — Algorithm.Framework/Selection/FineFundamentalUniverseSelectionModel.cs:85-93 | Algorithm.Framework/Selection/FundamentalUniverseSelectionModel.cs:246-255 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) Algorithm.CSharp/CapacityTests/CheeseMilkHourlyRebalance.cs:37 — Algorithm.CSharp/CapacityTests/CheeseMilkHourlyRebalance.cs:37-46 | Algorithm.CSharp/CapacityTests/IntradayMinuteScalpingFuturesES.cs:41-49 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) Algorithm.CSharp/RegressionTests/CustomData/CustomDataLinkedIconicTypeAddDataCoarseSelectionRegressionAlgorithm.cs:38 — Algorithm.CSharp/RegressionTests/CustomData/CustomDataLinkedIconicTypeAddDataCoarseSelectionRegressionAlgorithm.cs:38-46 | Algorithm.CSharp/RegressionTests/CustomData/CustomDataLinkedIconicTypeAddDataOnSecuritiesChangedRegressionAlgorithm.cs:38-46 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D17 · Explicit Debt · CommentedOutCode · ×22
  • 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 Algorithm.CSharp/OptionStrategyFilteringUniverseCallButterflyRegressionAlgorithm.cs:77 — 3 consecutive commented-code lines
  • CommentedOutCode Algorithm.CSharp/OptionStrategyFilteringUniverseCallLadderRegressionAlgorithm.cs:77 — 3 consecutive commented-code lines
  • CommentedOutCode Algorithm.CSharp/OptionStrategyFilteringUniverseConversionRegressionAlgorithm.cs:69 — 3 consecutive commented-code lines
  • CommentedOutCode Algorithm.CSharp/OptionStrategyFilteringUniverseProtectiveCollarRegressionAlgorithm.cs:70 — 3 consecutive commented-code lines
  • CommentedOutCode Algorithm.CSharp/OptionStrategyFilteringUniversePutButterflyRegressionAlgorithm.cs:77 — 3 consecutive commented-code lines
  • CommentedOutCode Algorithm.CSharp/OptionStrategyFilteringUniversePutLadderRegressionAlgorithm.cs:77 — 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:328 — 3 consecutive commented-code lines
  • CommentedOutCode Algorithm.CSharp/CustomDataNIFTYAlgorithm.cs:97 — 4 consecutive commented-code lines
  • CommentedOutCode Algorithm.CSharp/OptionStrategyFilteringUniverseBoxSpreadRegressionAlgorithm.cs:80 — 4 consecutive commented-code lines
  • CommentedOutCode Algorithm.CSharp/OptionStrategyFilteringUniverseIronCondorRegressionAlgorithm.cs:82 — 4 consecutive commented-code lines
  • CommentedOutCode Algorithm.CSharp/OptionStrategyFilteringUniverseJellyRollRegressionAlgorithm.cs:80 — 4 consecutive commented-code lines
  • CommentedOutCode Tests/Engine/Results/BacktestingResultHandlerTests.cs:90 — 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 (8 lines × 2) · ×22
  • Duplicated block (8 lines × 2) Common/Orders/Fills/FillModel.cs:196 — Common/Orders/Fills/FillModel.cs:196-203 | Common/Orders/Fills/FillModel.cs:217-224 — both copies are in the same file, so extract the 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:196` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) Common/Orders/Fills/FillModel.cs:882 — Common/Orders/Fills/FillModel.cs:882-889 | Common/Orders/Fills/FillModel.cs:941-948 — both copies are in the same file, so extract the 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:882` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) Indicators/CandlestickPatterns/AdvanceBlock.cs:134 — Indicators/CandlestickPatterns/AdvanceBlock.cs:134-141 | Indicators/CandlestickPatterns/ThreeWhiteSoldiers.cs:131-138 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) Algorithm.CSharp/OptionEquityCallCalendarSpreadRegressionAlgorithm.cs:44 — Algorithm.CSharp/OptionEquityCallCalendarSpreadRegressionAlgorithm.cs:44-51 | Algorithm.CSharp/OptionEquityPutCalendarSpreadRegressionAlgorithm.cs:44-51 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `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 (8 lines × 2) Algorithm/QCAlgorithm.Python.cs:1053 — Algorithm/QCAlgorithm.Python.cs:1053-1060 | Algorithm/QCAlgorithm.Python.cs:1127-1134 — both copies are in the same file, so extract the 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 `Algorithm/QCAlgorithm.Python.cs:1053` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (8 lines × 2) Common/Data/Market/QuoteBar.cs:608 — Common/Data/Market/QuoteBar.cs:608-615 | Common/Data/Market/TradeBar.cs:636-643 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Common/Data/Market/QuoteBar.cs:608` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) Indicators/Rho.cs:224 — Indicators/Rho.cs:224-231 | Indicators/Theta.cs:223-230 — before extracting anything, compare `Indicators/Rho.cs` and `Indicators/Theta.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Indicators/Theta.cs:231` calls `Exp`, `Max`, `Density` and `Indicators/Rho.cs:233` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) Algorithm.CSharp/ForexInternalFeedOnDataHigherResolutionRegressionAlgorithm.cs:40 — Algorithm.CSharp/ForexInternalFeedOnDataHigherResolutionRegressionAlgorithm.cs:40-47 | Algorithm.CSharp/ForexInternalFeedOnDataSameResolutionRegressionAlgorithm.cs:40-47 — before extracting anything, compare `Algorithm.CSharp/ForexInternalFeedOnDataHigherResolutionRegressionAlgorithm.cs` and `Algorithm.CSharp/ForexInternalFeedOnDataSameResolutionRegressionAlgorithm.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (8 lines × 2) Algorithm.CSharp/IndexOptionPutOTMExpiryRegressionAlgorithm.cs:50 — Algorithm.CSharp/IndexOptionPutOTMExpiryRegressionAlgorithm.cs:50-57 | Algorithm.CSharp/IndexOptionShortPutOTMExpiryRegressionAlgorithm.cs:47-54 — before extracting anything, compare `Algorithm.CSharp/IndexOptionPutOTMExpiryRegressionAlgorithm.cs` and `Algorithm.CSharp/IndexOptionShortPutOTMExpiryRegressionAlgorithm.cs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 74 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/IndexOptionPutOTMExpiryRegressionAlgorithm.cs:50` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) Algorithm.CSharp/OptionEquityStrategyMatcherRegressionAlgorithm.cs:89 — Algorithm.CSharp/OptionEquityStrategyMatcherRegressionAlgorithm.cs:89-96 | Algorithm.CSharp/OptionEquityStrategyMatcherRegressionAlgorithm.cs:100-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 (8 lines × 2) Algorithm.CSharp/FutureOptionBuySellCallIntradayRegressionAlgorithm.cs:42 — Algorithm.CSharp/FutureOptionBuySellCallIntradayRegressionAlgorithm.cs:42-53 | Algorithm.CSharp/FutureOptionIndicatorsRegressionAlgorithm.cs:28-35 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/FutureOptionBuySellCallIntradayRegressionAlgorithm.cs:42` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (8 lines × 2) Engine/Results/Analysis/Analyses/OrderResponseErrorsAnalyses/BrokerageModelRefusedToSubmitOrderOrderResponseErrorAnalysis.cs:105 — Engine/Results/Analysis/Analyses/OrderResponseErrorsAnalyses/BrokerageModelRefusedToSubmitOrderOrderResponseErrorAnalysis.cs:105-112 | Engine/Results/Analysis/Analyses/OrderResponseErrorsAnalyses/BrokerageModelRefusedToUpdateOrderOrderResponseErrorAnalysis.cs:70-77 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (8 lines × 2) Algorithm.Framework/Selection/CoarseFundamentalUniverseSelectionModel.cs:62 — Algorithm.Framework/Selection/CoarseFundamentalUniverseSelectionModel.cs:62-69 | Algorithm.Framework/Selection/FineFundamentalUniverseSelectionModel.cs:73-81 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) Algorithm.Python/BasicTemplateCryptoFutureAlgorithm.py:59 — Algorithm.Python/BasicTemplateCryptoFutureAlgorithm.py:59-66 | Algorithm.Python/BasicTemplateCryptoFutureHourlyAlgorithm.py:57-64 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) Algorithm.Python/ComboOrdersFillModelAlgorithm.py:91 — Algorithm.Python/ComboOrdersFillModelAlgorithm.py:91-98 | Algorithm.Python/CustomPartialFillModelAlgorithm.py:62-69 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) Algorithm.Python/CustomOptionPriceModelRegressionAlgorithm.py:22 — Algorithm.Python/CustomOptionPriceModelRegressionAlgorithm.py:22-29 | Algorithm.Python/OptionStrategyFactoryMethodsBaseAlgorithm.py:23-30 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) Algorithm.Python/IndexOptionBearCallSpreadAlgorithm.py:21 — Algorithm.Python/IndexOptionBearCallSpreadAlgorithm.py:21-28 | Algorithm.Python/IndexOptionBullCallSpreadAlgorithm.py:21-28 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) Algorithm.Python/IndexOptionCallCalendarSpreadAlgorithm.py:41 — Algorithm.Python/IndexOptionCallCalendarSpreadAlgorithm.py:41-48 | Algorithm.Python/IndexOptionPutCalendarSpreadAlgorithm.py:44-51 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) Algorithm.Python/LongAndShortButterflyCallStrategiesAlgorithm.py:32 — Algorithm.Python/LongAndShortButterflyCallStrategiesAlgorithm.py:32-39 | Algorithm.Python/LongAndShortButterflyPutStrategiesAlgorithm.py:32-39 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) Algorithm.Python/LongAndShortCallCalendarSpreadStrategiesAlgorithm.py:31 — Algorithm.Python/LongAndShortCallCalendarSpreadStrategiesAlgorithm.py:31-38 | Algorithm.Python/LongAndShortPutCalendarSpreadStrategiesAlgorithm.py:31-38 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.Python/LongAndShortCallCalendarSpreadStrategiesAlgorithm.py:31` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) Algorithm.Python/CustomBrokerageSideOrderHandlingRegressionAlgorithm.py:39 — Algorithm.Python/CustomBrokerageSideOrderHandlingRegressionAlgorithm.py:39-46 | Algorithm.Python/CustomBrokerageSideOrderHandlingRegressionPartialAlgorithm.py:39-46 — before extracting anything, compare `Algorithm.Python/CustomBrokerageSideOrderHandlingRegressionAlgorithm.py` and `Algorithm.Python/CustomBrokerageSideOrderHandlingRegressionPartialAlgorithm.py` as WHOLE FILES: 93% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 3 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) Algorithm.CSharp/RegressionTests/CustomData/CustomDataLinkedIconicTypeAddDataCoarseSelectionRegressionAlgorithm.cs:39 — Algorithm.CSharp/RegressionTests/CustomData/CustomDataLinkedIconicTypeAddDataCoarseSelectionRegressionAlgorithm.cs:39-46 | Algorithm.CSharp/RegressionTests/CustomData/CustomDataLinkedIconicTypeAddDataOnSecuritiesChangedRegressionAlgorithm.cs:39-46 — before extracting anything, compare `Algorithm.CSharp/RegressionTests/CustomData/CustomDataLinkedIconicTypeAddDataCoarseSelectionRegressionAlgorithm.cs` and `Algorithm.CSharp/RegressionTests/CustomData/CustomDataLinkedIconicTypeAddDataOnSecuritiesChangedRegressionAlgorithm.cs` as WHOLE FILES: 92% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Edited copy of a member (10 corresponding lines) · ×21
  • Edited copy of a member (10 corresponding lines) Algorithm.Python/CustomModelsAlgorithm.py:44 — Algorithm.Python/CustomModelsAlgorithm.py:44-55 | Algorithm.Python/CustomModelsPEP8Algorithm.py:45-54 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) Common/Orders/OrderTicket.cs:628 — Common/Orders/OrderTicket.cs:628-637 | Common/Orders/OrderTicket.cs:643-652 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) Algorithm.Python/MeanReversionPortfolioAlgorithm.py:22 — Algorithm.Python/MeanReversionPortfolioAlgorithm.py:22-32 | Algorithm.Python/RiskParityPortfolioAlgorithm.py:21-30 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) Algorithm.Python/CustomModelsAlgorithm.py:32 — Algorithm.Python/CustomModelsAlgorithm.py:32-41 | Algorithm.Python/CustomModelsPEP8Algorithm.py:33-42 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) Algorithm.CSharp/DuplicatedIndexOptionSubscriptionRegressionAlgorithm.cs:33 — Algorithm.CSharp/DuplicatedIndexOptionSubscriptionRegressionAlgorithm.cs:33-67 | Algorithm.CSharp/IndexOptionIndicatorsRegressionAlgorithm.cs:26-35 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) Algorithm.Python/PytorchNeuralNetworkAlgorithm.py:82 — Algorithm.Python/PytorchNeuralNetworkAlgorithm.py:82-91 | Algorithm.Python/TensorFlowNeuralNetworkAlgorithm.py:101-113 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) Algorithm.Python/SectorExposureRiskFrameworkAlgorithm.py:31 — Algorithm.Python/SectorExposureRiskFrameworkAlgorithm.py:31-41 | Algorithm.Python/SectorWeightingFrameworkAlgorithm.py:27-36 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) Algorithm.Python/CustomOptionPriceModelRegressionAlgorithm.py:22 — Algorithm.Python/CustomOptionPriceModelRegressionAlgorithm.py:22-31 | Algorithm.Python/OptionStrategyFactoryMethodsBaseAlgorithm.py:23-32 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) Algorithm.CSharp/NullMarginMultipleOrdersRegressionAlgorithm.cs:37 — Algorithm.CSharp/NullMarginMultipleOrdersRegressionAlgorithm.cs:37-49 | Algorithm.CSharp/OptionModelsConsistencyRegressionAlgorithm.cs:40-49 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) Algorithm.CSharp/InceptionDateSelectionRegressionAlgorithm.cs:39 — Algorithm.CSharp/InceptionDateSelectionRegressionAlgorithm.cs:39-50 | Algorithm.CSharp/WeeklyUniverseSelectionRegressionAlgorithm.cs:37-46 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) Algorithm.CSharp/CustomOptionPriceModelRegressionAlgorithm.cs:35 — Algorithm.CSharp/CustomOptionPriceModelRegressionAlgorithm.cs:35-45 | Algorithm.CSharp/RemoveUnderlyingRegressionAlgorithm.cs:36-45 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) Algorithm.Python/OptionPriceModelForSupportedEuropeanOptionRegressionAlgorithm.py:23 — Algorithm.Python/OptionPriceModelForSupportedEuropeanOptionRegressionAlgorithm.py:23-32 | Algorithm.Python/OptionPriceModelForUnsupportedEuropeanOptionRegressionAlgorithm.py:23-32 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) Algorithm.CSharp/AddRemoveSecurityRegressionAlgorithm.cs:89 — Algorithm.CSharp/AddRemoveSecurityRegressionAlgorithm.cs:89-98 | Algorithm.CSharp/UniverseSelectionRegressionAlgorithm.cs:127-136 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) Algorithm.CSharp/ConsolidatorStartTimeRegressionAlgorithm.cs:44 — Algorithm.CSharp/ConsolidatorStartTimeRegressionAlgorithm.cs:44-54 | Algorithm.CSharp/ConsolidatorRollingWindowRegressionAlgorithm.cs:37-46 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) Algorithm.Python/TrainingExampleAlgorithm.py:27 — Algorithm.Python/TrainingExampleAlgorithm.py:27-36 | Algorithm.Python/TrainingInitializeRegressionAlgorithm.py:28-43 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) Algorithm.CSharp/OneCancelsOtherOrderCashAccountRegressionAlgorithm.cs:41 — Algorithm.CSharp/OneCancelsOtherOrderCashAccountRegressionAlgorithm.cs:41-50 | Algorithm.CSharp/StartingCapitalRegressionAlgorithm.cs:34-47 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) Algorithm.CSharp/CustomDataMultiFileObjectStoreRegressionAlgorithm.cs:170 — Algorithm.CSharp/CustomDataMultiFileObjectStoreRegressionAlgorithm.cs:170-179 | Algorithm.CSharp/CustomDataObjectStoreRegressionAlgorithm.cs:137-146 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) Common/Candlestick.cs:184 — Common/Candlestick.cs:184-193 | Common/Data/Market/Bar.cs:92-104 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) Algorithm.CSharp/ContinuousFutureHistoryRegressionAlgorithm.cs:39 — Algorithm.CSharp/ContinuousFutureHistoryRegressionAlgorithm.cs:39-49 | Algorithm.CSharp/ContinuousFutureOpenPositionsLiquidationOnDelistingRegressionAlgorithm.cs:45-54 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) Common/CandlestickSeries.cs:174 — Common/CandlestickSeries.cs:174-183 | Common/Series.cs:194-210 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) Algorithm.CSharp/CustomDataBitcoinAlgorithm.cs:124 — Algorithm.CSharp/CustomDataBitcoinAlgorithm.cs:124-133 | REDACTED:180-189 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D17 · Explicit Debt · BarePragmaDisable · ×20
  • BarePragmaDisable AlgorithmFactory/Loader.cs:385 — #pragma warning disable CS1574 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
  • BarePragmaDisable Common/CapacityEstimate.cs:115 — #pragma warning disable CS1574 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
  • BarePragmaDisable Common/Interfaces/IApi.cs:247 — #pragma warning disable CS1574 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
  • BarePragmaDisable Common/Interfaces/IApi.cs:273 — #pragma warning disable CS1574 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
  • BarePragmaDisable Common/Interfaces/IRegressionResearchDefinition.cs:23 — #pragma warning disable CS1574 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
  • BarePragmaDisable Common/Optimizer/Parameters/OptimizationStepParameter.cs:44 — #pragma warning disable CS1574 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
  • BarePragmaDisable Common/Brokerages/CoinbaseBrokerageModel.cs:239 — #pragma warning disable CA1062 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
  • BarePragmaDisable Common/Data/DataQueueHandlerSubscriptionManager.cs:113 — #pragma warning disable CA1309 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
  • BarePragmaDisable Common/Data/Fundamental/AssetClassificationHelper.cs:79 — #pragma warning disable 1591 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
  • BarePragmaDisable Messaging/EventMessagingHandler.cs:71 — #pragma warning disable 1591 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
  • BarePragmaDisable Common/Data/Fundamental/FundamentalProperty.cs:25 — #pragma warning disable CS1591, CA1707 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
  • BarePragmaDisable Common/Orders/Fees/InteractiveBrokersFeeModel.cs:35 — #pragma warning disable CS1570 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
  • BarePragmaDisable Common/Securities/Future/Futures.cs:1446 — #pragma warning disable CS1570 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
  • BarePragmaDisable Common/Securities/Future/Futures.cs:1490 — #pragma warning disable CS1570 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
  • BarePragmaDisable Tests/Common/Data/SliceTests.cs:819 — #pragma warning disable CA1829 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
  • BarePragmaDisable Tests/Common/Orders/Fills/PartialMarketFillModelTests.cs:104 — # pragma warning disable CA2000 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
  • BarePragmaDisable Tests/Engine/DataFeeds/SubscriptionCollectionTests.cs:411 — # pragma warning disable CA2000 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
  • BarePragmaDisable Tests/Engine/DataFeeds/SubscriptionSynchronizerTests.cs:98 — # pragma warning disable CA2000 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
  • BarePragmaDisable Tests/Engine/DataFeeds/SubscriptionTests.cs:185 — # pragma warning disable CA2000 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
  • BarePragmaDisable Tests/Engine/DataProviders/ApiDataProviderTests.cs:172 — # pragma warning disable CA2000 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
X18 · Disposal-pattern correctness · Disposes a dependency it does not own · ×20
  • Disposes a dependency it does not own Engine/DataFeeds/Enumerators/BaseDataCollectionAggregatorEnumerator.cs:160 — `_enumerator` is never created by `BaseDataCollectionAggregatorEnumerator` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 160). Its declared type `IEnumerator` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed.
  • Disposes a dependency it does not own Engine/DataFeeds/Enumerators/FastForwardEnumerator.cs:128 — `_enumerator` is never created by `FastForwardEnumerator` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 128). Its declared type `IEnumerator` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed.
  • Disposes a dependency it does not own Engine/DataFeeds/Enumerators/FillForwardEnumerator.cs:303 — `_enumerator` is never created by `FillForwardEnumerator` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 303). Its declared type `IEnumerator` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed.
  • Disposes a dependency it does not own Engine/DataFeeds/Enumerators/FilterEnumerator.cs:50 — `_enumerator` is never created by `FilterEnumerator` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 50). Its declared type `IEnumerator` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed.
  • Disposes a dependency it does not own Engine/DataFeeds/Enumerators/FrontierAwareEnumerator.cs:146 — `_enumerator` is never created by `FrontierAwareEnumerator` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 146). Its declared type `IEnumerator` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed.
  • Disposes a dependency it does not own Engine/DataFeeds/Enumerators/PriceScaleFactorEnumerator.cs:88 — `_rawDataEnumerator` is never created by `PriceScaleFactorEnumerator` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 88). Its declared type `IEnumerator` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed.
  • Disposes a dependency it does not own Engine/DataFeeds/Enumerators/QuoteBarFillForwardEnumerator.cs:101 — `_enumerator` is never created by `QuoteBarFillForwardEnumerator` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 101). Its declared type `IEnumerator` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed.
  • Disposes a dependency it does not own Engine/DataFeeds/Enumerators/RateLimitEnumerator.cs:125 — `_enumerator` is never created by `RateLimitEnumerator` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 125). Its declared type `IEnumerator` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed.
  • Disposes a dependency it does not own Engine/DataFeeds/Enumerators/ScheduledEnumerator.cs:172 — `_underlyingEnumerator` is never created by `ScheduledEnumerator` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 172). Its declared type `IEnumerator` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed.
  • Disposes a dependency it does not own Engine/DataFeeds/Enumerators/StrictDailyEndTimesEnumerator.cs:92 — `_underlying` is never created by `StrictDailyEndTimesEnumerator` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 92). Its declared type `IEnumerator` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed.
  • Disposes a dependency it does not own Engine/DataFeeds/Enumerators/SubscriptionDataEnumerator.cs:95 — `_enumerator` is never created by `SubscriptionDataEnumerator` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 95). Its declared type `IEnumerator` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed.
  • Disposes a dependency it does not own Engine/DataFeeds/Enumerators/SubscriptionFilterEnumerator.cs:173 — `_enumerator` is never created by `SubscriptionFilterEnumerator` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 173). Its declared type `IEnumerator` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed.
  • Disposes a dependency it does not own Common/Data/Consolidators/SequentialConsolidator.cs:113 — `First` is never created by `SequentialConsolidator` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 113). Its declared type `IDataConsolidator` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed.
  • Disposes a dependency it does not own Common/Data/Consolidators/SequentialConsolidator.cs:114 — `Second` is never created by `SequentialConsolidator` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 114). Its declared type `IDataConsolidator` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed.
  • Disposes a dependency it does not own Common/Scheduling/ScheduledEvent.cs:247 — `_orderedEventUtcTimes` is never created by `ScheduledEvent` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 247). Its declared type `IEnumerator` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed.
  • Disposes a dependency it does not own Common/Storage/ObjectStore.cs:345 — `_store` is never created by `ObjectStore` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 345). Its declared type `IObjectStore` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed.
  • Disposes a dependency it does not own ToolBox/ConsolidatorDataProcessor.cs:77 — `_destination` is never created by `ConsolidatorDataProcessor` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 77). Its declared type `IDataProcessor` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed.
  • Disposes a dependency it does not own ToolBox/FilteredDataProcessor.cs:58 — `_processor` is never created by `FilteredDataProcessor` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 58). Its declared type `IDataProcessor` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed.
  • Disposes a dependency it does not own ToolBox/RawFileProcessor.cs:110 — `_streamProvider` is never created by `RawFileProcessor` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 110). Its declared type `IStreamProvider` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed.
  • Disposes a dependency it does not own ToolBox/RawFileProcessor.cs:111 — `_parser` is never created by `RawFileProcessor` — every assignment to it takes a constructor parameter — yet this type disposes it here (line 111). Its declared type `IStreamParser` is an interface, so the instance came from whoever chose and created it, and that owner decides when it ends. Disposing it from here reaches outside this object's lifetime: a dependency shared with the rest of the process is torn down when THIS instance goes away, and the real owner's later `Dispose()` runs a second time on an object already disposed. Drop the call — a type disposes what it constructed, and only that. If this dependency genuinely is exclusive to this instance, construct it here (or take an owned factory) so the ownership is stated in the code rather than assumed.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×19
  • Duplicated block (9 lines × 2) Indicators/ImpliedVolatility.cs:113 — Indicators/ImpliedVolatility.cs:113-121 | Indicators/ImpliedVolatility.cs:144-152 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `riskFreeRateModel` to `IRiskFreeInterestRateModel` in one and `PyObject` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (9 lines × 2) Common/Securities/BuyingPowerModel.cs:397 — Common/Securities/BuyingPowerModel.cs:397-405 | Common/Securities/Positions/PositionGroupBuyingPowerModel.cs:305-313 — 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:397` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `parameters` to `GetMaximumOrderQuantityForTargetBuyingPowerParameters` in one and `GetMaximumLotsForTargetBuyingPowerParameters` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (9 lines × 2) Indicators/CandlestickPatterns/EveningDojiStar.cs:116 — Indicators/CandlestickPatterns/EveningDojiStar.cs:116-124 | Indicators/CandlestickPatterns/EveningStar.cs:109-117 — before extracting anything, compare `Indicators/CandlestickPatterns/EveningDojiStar.cs` and `Indicators/CandlestickPatterns/EveningStar.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/EveningDojiStar.cs:116` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (9 lines × 2) Indicators/CandlestickPatterns/MatHold.cs:115 — Indicators/CandlestickPatterns/MatHold.cs:115-123 | Indicators/CandlestickPatterns/RiseFallThreeMethods.cs:98-106 — before extracting anything, compare `Indicators/CandlestickPatterns/MatHold.cs` and `Indicators/CandlestickPatterns/RiseFallThreeMethods.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/MatHold.cs:115` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Indicators/CandlestickPatterns/RiseFallThreeMethods.cs:95` calls `GetCandleRange` and `Indicators/CandlestickPatterns/MatHold.cs:112` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) Common/Securities/Positions/SecurityPositionGroupBuyingPowerModel.cs:100 — Common/Securities/Positions/SecurityPositionGroupBuyingPowerModel.cs:100-108 | Common/Securities/Positions/SecurityPositionGroupBuyingPowerModel.cs:128-136 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `parameters` to `GetMaximumLotsForTargetBuyingPowerParameters` in one and `GetMaximumLotsForDeltaBuyingPowerParameters` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (9 lines × 2) Algorithm.CSharp/SectorExposureRiskFrameworkAlgorithm.cs:38 — Algorithm.CSharp/SectorExposureRiskFrameworkAlgorithm.cs:38-46 | Algorithm.CSharp/SectorWeightingFrameworkAlgorithm.cs:40-48 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (9 lines × 2) Algorithm.CSharp/RiskParityPortfolioAlgorithm.cs:33 — Algorithm.CSharp/RiskParityPortfolioAlgorithm.cs:33-41 | Algorithm.CSharp/RiskParityPortfolioWeightsCheckAlgorithm.cs:36-44 — before extracting anything, compare `Algorithm.CSharp/RiskParityPortfolioAlgorithm.cs` and `Algorithm.CSharp/RiskParityPortfolioWeightsCheckAlgorithm.cs` as WHOLE FILES: 94% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • 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) Report/ReportElements/DailyReturnsReportElement.cs:48 — Report/ReportElements/DailyReturnsReportElement.cs:48-56 | Report/ReportElements/MonthlyReturnsReportElement.cs:49-57 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Report/ReportElements/DailyReturnsReportElement.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. 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) Indicators/Beta.cs:62 — Indicators/Beta.cs:62-70 | Indicators/Covariance.cs:55-63 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (9 lines × 2) Algorithm.CSharp/CoarseFundamentalImmediateSelectionRegressionAlgorithm.cs:35 — Algorithm.CSharp/CoarseFundamentalImmediateSelectionRegressionAlgorithm.cs:35-43 | Algorithm.CSharp/CoarseFundamentalTop3Algorithm.cs:42-52 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (9 lines × 2) Algorithm.CSharp/CoarseFundamentalTop3Algorithm.cs:57 — Algorithm.CSharp/CoarseFundamentalTop3Algorithm.cs:57-65 | Algorithm.CSharp/RawPricesCoarseUniverseAlgorithm.cs:68-76 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (9 lines × 2) Algorithm.Framework/Execution/StandardDeviationExecutionModel.cs:167 — Algorithm.Framework/Execution/StandardDeviationExecutionModel.cs:167-175 | Algorithm.Framework/Execution/VolumeWeightedAveragePriceExecutionModel.cs:134-142 — before extracting anything, compare `Algorithm.Framework/Execution/StandardDeviationExecutionModel.cs` and `Algorithm.Framework/Execution/VolumeWeightedAveragePriceExecutionModel.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (9 lines × 2) Algorithm.Python/ETFConstituentUniverseCompositeDelistingRegressionAlgorithm.py:40 — Algorithm.Python/ETFConstituentUniverseCompositeDelistingRegressionAlgorithm.py:40-48 | Algorithm.Python/ETFConstituentUniverseCompositeDelistingRegressionAlgorithmNoAddEquityETF.py:40-48 — before extracting anything, compare `Algorithm.Python/ETFConstituentUniverseCompositeDelistingRegressionAlgorithm.py` and `Algorithm.Python/ETFConstituentUniverseCompositeDelistingRegressionAlgorithmNoAddEquityETF.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (9 lines × 2) Algorithm.Python/IndexOptionBearCallSpreadAlgorithm.py:44 — Algorithm.Python/IndexOptionBearCallSpreadAlgorithm.py:44-52 | Algorithm.Python/IndexOptionBullCallSpreadAlgorithm.py:44-52 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (9 lines × 2) Algorithm.Python/SectorExposureRiskFrameworkAlgorithm.py:31 — Algorithm.Python/SectorExposureRiskFrameworkAlgorithm.py:31-39 | Algorithm.Python/SectorWeightingFrameworkAlgorithm.py:27-35 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (9 lines × 2) Algorithm.Framework/Portfolio/MaximumSharpeRatioPortfolioOptimizer.py:79 — Algorithm.Framework/Portfolio/MaximumSharpeRatioPortfolioOptimizer.py:79-87 | Algorithm.Framework/Portfolio/MinimumVariancePortfolioOptimizer.py:74-82 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (9 lines × 2) Algorithm.Python/BasicTemplateFuturesAlgorithm.py:63 — Algorithm.Python/BasicTemplateFuturesAlgorithm.py:63-71 | Algorithm.Python/BasicTemplateFuturesWithExtendedMarketAlgorithm.py:66-74 — before extracting anything, compare `Algorithm.Python/BasicTemplateFuturesAlgorithm.py` and `Algorithm.Python/BasicTemplateFuturesWithExtendedMarketAlgorithm.py` as WHOLE FILES: 87% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) Algorithm.Python/FutureOptionChainFiltersRegressionAlgorithm.py:71 — Algorithm.Python/FutureOptionChainFiltersRegressionAlgorithm.py:71-79 | Algorithm.Python/IndexOptionChainFiltersRegressionAlgorithm.py:107-115 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Edited copy of a member (8 corresponding lines) · ×18
  • Edited copy of a member (8 corresponding lines) Algorithm.Python/FundamentalRegressionAlgorithm.py:106 — Algorithm.Python/FundamentalRegressionAlgorithm.py:106-113 | Algorithm.Python/FundamentalUniverseSelectionAlgorithm.py:42-49 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) Algorithm.Python/FundamentalUniverseSelectionAlgorithm.py:73 — Algorithm.Python/FundamentalUniverseSelectionAlgorithm.py:73-80 | Algorithm.Python/FundamentalUniverseSelectionRegressionAlgorithm.py:63-70 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) Algorithm.Python/IndexOptionModelsConsistencyRegressionAlgorithm.py:25 — Algorithm.Python/IndexOptionModelsConsistencyRegressionAlgorithm.py:25-32 | Algorithm.Python/OptionModelsConsistencyRegressionAlgorithm.py:34-41 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) Common/Orders/ContingentOrderExtensions.cs:204 — Common/Orders/ContingentOrderExtensions.cs:204-211 | Common/Orders/ContingentOrderExtensions.cs:220-227 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) Algorithm.CSharp/CustomDataZipFileEntryNamesRegressionAlgorithm.cs:42 — Algorithm.CSharp/CustomDataZipFileEntryNamesRegressionAlgorithm.cs:42-49 | Algorithm.CSharp/CustomDataZipFileRegressionAlgorithm.cs:45-52 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) Algorithm.Python/BasicTemplateIndiaAlgorithm.py:26 — Algorithm.Python/BasicTemplateIndiaAlgorithm.py:26-37 | Algorithm.Python/BasicTemplateAlgorithm.py:27-34 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) Algorithm.Python/UniverseOnlyRegressionAlgorithm.py:23 — Algorithm.Python/UniverseOnlyRegressionAlgorithm.py:23-32 | Algorithm.Python/VolumeShareSlippageModelAlgorithm.py:25-32 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) Algorithm.CSharp/WarmupLowerResolutionBarCountSettingRegressionAlgorithm.cs:24 — Algorithm.CSharp/WarmupLowerResolutionBarCountSettingRegressionAlgorithm.cs:24-31 | Algorithm.CSharp/WarmupLowerResolutionTimeSpanSettingRegressionAlgorithm.cs:27-34 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) Algorithm.CSharp/BasicPythonIntegrationTemplateAlgorithm.cs:27 — Algorithm.CSharp/BasicPythonIntegrationTemplateAlgorithm.cs:27-39 | Algorithm.CSharp/OnWarmupFinishedRegressionAlgorithm.cs:32-39 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) Algorithm.CSharp/BasicTemplateAxosAlgorithm.cs:35 — Algorithm.CSharp/BasicTemplateAxosAlgorithm.cs:35-42 | Algorithm.CSharp/DelistedEquityCashAccountSettlementRegressionAlgorithm.cs:40-48 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) Common/Brokerages/BinanceFuturesBrokerageModel.cs:67 — Common/Brokerages/BinanceFuturesBrokerageModel.cs:67-74 | Common/Brokerages/BybitBrokerageModel.cs:88-97 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) Common/Exceptions/DatetimeDateComparisonPythonExceptionInterpreter.cs:50 — Common/Exceptions/DatetimeDateComparisonPythonExceptionInterpreter.cs:50-57 | Common/Exceptions/MultipleInheritancePythonExceptionInterpreter.cs:51-58 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) Common/Data/Auxiliary/LocalZipFactorFileProvider.cs:114 — Common/Data/Auxiliary/LocalZipFactorFileProvider.cs:114-121 | Common/Data/Auxiliary/LocalZipMapFileProvider.cs:109-116 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) Common/Data/UniverseSelection/CoarseFundamentalUniverse.cs:74 — Common/Data/UniverseSelection/CoarseFundamentalUniverse.cs:74-81 | Algorithm.Framework/Selection/FundamentalUniverseSelectionModel.cs:98-105 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) Common/Securities/BuyingPowerModel.cs:231 — Common/Securities/BuyingPowerModel.cs:231-239 | Common/Securities/CashBuyingPowerModel.cs:68-75 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) Common/Data/UniverseSelection/UniverseDecorator.cs:79 — Common/Data/UniverseSelection/UniverseDecorator.cs:79-86 | Common/Data/UniverseSelection/UniverseExtensions.cs:38-45 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) Common/Brokerages/BinanceBrokerageModel.cs:72 — Common/Brokerages/BinanceBrokerageModel.cs:72-79 | Common/Brokerages/BybitBrokerageModel.cs:57-64 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) Common/Securities/CashBook.cs:293 — Common/Securities/CashBook.cs:293-300 | Common/Securities/Positions/SecurityPositionGroupModel.cs:256-263 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×18
  • Duplicated block (16 lines × 2) Indicators/CandlestickPatterns/BeltHold.cs:81 — Indicators/CandlestickPatterns/BeltHold.cs:81-96 | Indicators/CandlestickPatterns/ClosingMarubozu.cs:81-96 — before extracting anything, compare `Indicators/CandlestickPatterns/BeltHold.cs` and `Indicators/CandlestickPatterns/ClosingMarubozu.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/BeltHold.cs:81` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (16 lines × 2) Algorithm/QCAlgorithm.Framework.cs:180 — Algorithm/QCAlgorithm.Framework.cs:180-195 | Algorithm/QCAlgorithm.Framework.cs:201-216 — both copies are in the same file, so extract the 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 `Algorithm/QCAlgorithm.Framework.cs:180` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) Indicators/Delta.cs:55 — Indicators/Delta.cs:55-70 | Indicators/Delta.cs:87-102 — both copies are in the same file, so extract the 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/Delta.cs:55` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `dividendYieldModel` to `IDividendYieldModel` in one and `PyObject` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (16 lines × 2) Indicators/Delta.cs:119 — Indicators/Delta.cs:119-134 | Indicators/Delta.cs:151-166 — both copies are in the same file, so extract the 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/Delta.cs:119` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `riskFreeRateModel` to `IRiskFreeInterestRateModel` in one and `PyObject` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (16 lines × 2) Indicators/Gamma.cs:55 — Indicators/Gamma.cs:55-70 | Indicators/Gamma.cs:87-102 — both copies are in the same file, so extract the 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/Gamma.cs:55` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `dividendYieldModel` to `IDividendYieldModel` in one and `PyObject` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (16 lines × 2) Indicators/Gamma.cs:119 — Indicators/Gamma.cs:119-134 | Indicators/Gamma.cs:151-166 — both copies are in the same file, so extract the 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/Gamma.cs:119` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `riskFreeRateModel` to `IRiskFreeInterestRateModel` in one and `PyObject` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (16 lines × 2) Indicators/Rho.cs:55 — Indicators/Rho.cs:55-70 | Indicators/Rho.cs:87-102 — both copies are in the same file, so extract the 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/Rho.cs:55` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `dividendYieldModel` to `IDividendYieldModel` in one and `PyObject` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (16 lines × 2) Indicators/Rho.cs:119 — Indicators/Rho.cs:119-134 | Indicators/Rho.cs:151-166 — both copies are in the same file, so extract the 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/Rho.cs:119` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `riskFreeRateModel` to `IRiskFreeInterestRateModel` in one and `PyObject` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (16 lines × 2) Indicators/Theta.cs:55 — Indicators/Theta.cs:55-70 | Indicators/Theta.cs:87-102 — both copies are in the same file, so extract the 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/Theta.cs:55` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `dividendYieldModel` to `IDividendYieldModel` in one and `PyObject` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (16 lines × 2) Indicators/Theta.cs:119 — Indicators/Theta.cs:119-134 | Indicators/Theta.cs:151-166 — both copies are in the same file, so extract the 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/Theta.cs:119` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `riskFreeRateModel` to `IRiskFreeInterestRateModel` in one and `PyObject` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (16 lines × 2) Indicators/Vega.cs:55 — Indicators/Vega.cs:55-70 | Indicators/Vega.cs:87-102 — both copies are in the same file, so extract the 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/Vega.cs:55` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `dividendYieldModel` to `IDividendYieldModel` in one and `PyObject` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (16 lines × 2) Indicators/Vega.cs:119 — Indicators/Vega.cs:119-134 | Indicators/Vega.cs:151-166 — both copies are in the same file, so extract the 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/Vega.cs:119` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `riskFreeRateModel` to `IRiskFreeInterestRateModel` in one and `PyObject` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (16 lines × 2) Algorithm.CSharp/BasicTemplateCryptoFutureAlgorithm.cs:84 — Algorithm.CSharp/BasicTemplateCryptoFutureAlgorithm.cs:84-99 | Algorithm.CSharp/BasicTemplateCryptoFutureHourlyAlgorithm.cs:79-94 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/BasicTemplateCryptoFutureAlgorithm.cs:84` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) Indicators/CandlestickPatterns/DragonflyDoji.cs:95 — Indicators/CandlestickPatterns/DragonflyDoji.cs:95-110 | Indicators/CandlestickPatterns/GravestoneDoji.cs:95-110 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/DragonflyDoji.cs:95` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (16 lines × 2) Algorithm.CSharp/FutureContractsExtendedMarketHoursRegressionAlgorithm.cs:52 — Algorithm.CSharp/FutureContractsExtendedMarketHoursRegressionAlgorithm.cs:52-67 | Algorithm.CSharp/FuturesExtendedMarketHoursRegressionAlgorithm.cs:52-67 — before extracting anything, compare `Algorithm.CSharp/FutureContractsExtendedMarketHoursRegressionAlgorithm.cs` and `Algorithm.CSharp/FuturesExtendedMarketHoursRegressionAlgorithm.cs` as WHOLE FILES: 94% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (16 lines × 2) Indicators/CandlestickPatterns/BeltHold.cs:92 — Indicators/CandlestickPatterns/BeltHold.cs:92-107 | Indicators/CandlestickPatterns/SeparatingLines.cs:108-123 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/BeltHold.cs:92` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Indicators/CandlestickPatterns/SeparatingLines.cs:103` calls `GetCandleColor`, `GetCandleAverage` and `Indicators/CandlestickPatterns/BeltHold.cs:90` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (16 lines × 2) Indicators/CandlestickPatterns/EveningStar.cs:131 — Indicators/CandlestickPatterns/EveningStar.cs:131-146 | Indicators/CandlestickPatterns/MorningStar.cs:131-146 — before extracting anything, compare `Indicators/CandlestickPatterns/EveningStar.cs` and `Indicators/CandlestickPatterns/MorningStar.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/EveningStar.cs:131` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (16 lines × 2) Algorithm.Python/CustomDataBitcoinAlgorithm.py:83 — Algorithm.Python/CustomDataBitcoinAlgorithm.py:83-98 | Algorithm.Python/LiveFeaturesAlgorithm.py:118-133 — before extracting anything, compare `Algorithm.Python/CustomDataBitcoinAlgorithm.py` and `Algorithm.Python/LiveFeaturesAlgorithm.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×17
  • Edited copy of a member (12 corresponding lines) Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs:509 — Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs:509-521 | Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs:527-538 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) Algorithm/QCAlgorithm.Indicators.cs:151 — Algorithm/QCAlgorithm.Indicators.cs:151-164 | Algorithm/QCAlgorithm.Indicators.cs:2130-2141 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) Algorithm.Python/OptionPriceModelForSupportedAmericanOptionRegressionAlgorithm.py:23 — Algorithm.Python/OptionPriceModelForSupportedAmericanOptionRegressionAlgorithm.py:23-34 | Algorithm.Python/OptionPriceModelForUnsupportedAmericanOptionRegressionAlgorithm.py:23-34 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) Algorithm.Python/BasicTemplateFuturesFrameworkAlgorithm.py:27 — Algorithm.Python/BasicTemplateFuturesFrameworkAlgorithm.py:27-39 | Algorithm.Python/BasicTemplateOptionsFrameworkAlgorithm.py:29-40 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) Algorithm.CSharp/AddOptionUniverseSelectionModelRegressionAlgorithm.cs:45 — Algorithm.CSharp/AddOptionUniverseSelectionModelRegressionAlgorithm.cs:45-56 | Algorithm.CSharp/BasicTemplateFuturesFrameworkAlgorithm.cs:55-66 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) Algorithm.CSharp/OptionShortCallMarginCallEventsAlgorithm.cs:35 — Algorithm.CSharp/OptionShortCallMarginCallEventsAlgorithm.cs:35-49 | Algorithm.CSharp/SingleOptionPositionGroupBuyingPowerModelRegressionAlgorithm.cs:37-48 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) Algorithm.Python/MarketOnCloseOrderBufferExtendedMarketHoursRegressionAlgorithm.py:24 — Algorithm.Python/MarketOnCloseOrderBufferExtendedMarketHoursRegressionAlgorithm.py:24-35 | Algorithm.Python/MarketOnCloseOrderBufferRegressionAlgorithm.py:21-32 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) Algorithm.CSharp/FutureOptionChainsMultipleFullDataRegressionAlgorithm.cs:60 — Algorithm.CSharp/FutureOptionChainsMultipleFullDataRegressionAlgorithm.cs:60-72 | Algorithm.CSharp/FuturesChainsMultipleFullDataRegressionAlgorithm.cs:54-65 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) Algorithm.Framework/Portfolio/BlackLittermanOptimizationPortfolioConstructionModel.cs:217 — Algorithm.Framework/Portfolio/BlackLittermanOptimizationPortfolioConstructionModel.cs:217-230 | Algorithm.Framework/Portfolio/MeanVarianceOptimizationPortfolioConstructionModel.cs:196-207 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) Algorithm.CSharp/DelistingFutureOptionRegressionAlgorithm.cs:34 — Algorithm.CSharp/DelistingFutureOptionRegressionAlgorithm.cs:34-48 | Algorithm.CSharp/FuturesAutomaticSeedRegressionAlgorithm.cs:36-47 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) Algorithm/QCAlgorithm.Indicators.cs:4202 — Algorithm/QCAlgorithm.Indicators.cs:4202-4213 | Algorithm/QCAlgorithm.Indicators.cs:4226-4237 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) Algorithm.CSharp/OptionPriceModelForSupportedEuropeanOptionRegressionAlgorithm.cs:28 — Algorithm.CSharp/OptionPriceModelForSupportedEuropeanOptionRegressionAlgorithm.cs:28-39 | Algorithm.CSharp/OptionPriceModelForUnsupportedEuropeanOptionRegressionAlgorithm.cs:29-40 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) Common/Securities/Volatility/StandardDeviationOfReturnsVolatilityModel.cs:133 — Common/Securities/Volatility/StandardDeviationOfReturnsVolatilityModel.cs:133-149 | Common/Securities/Volatility/RelativeStandardDeviationVolatilityModel.cs:93-104 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) Algorithm.Python/BasicTemplateOptionTradesAlgorithm.py:27 — Algorithm.Python/BasicTemplateOptionTradesAlgorithm.py:27-40 | Algorithm.Python/BasicTemplateOptionsConsolidationAlgorithm.py:25-36 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) Common/Data/Custom/IconicTypes/IndexedLinkedData.cs:67 — Common/Data/Custom/IconicTypes/IndexedLinkedData.cs:67-78 | Common/Data/Custom/IconicTypes/IndexedLinkedData2.cs:67-83 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) Algorithm.CSharp/CustomDataPropertiesRegressionAlgorithm.cs:80 — Algorithm.CSharp/CustomDataPropertiesRegressionAlgorithm.cs:80-91 | REDACTED:63-74 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) Algorithm.CSharp/AddAlphaModelAlgorithm.cs:84 — Algorithm.CSharp/AddAlphaModelAlgorithm.cs:84-95 | Algorithm.CSharp/InsightTagAlphaRegressionAlgorithm.cs:109-121 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (11 corresponding lines) · ×17
  • Edited copy of a member (11 corresponding lines) Algorithm.Python/ETFConstituentUniverseCompositeDelistingRegressionAlgorithm.py:58 — Algorithm.Python/ETFConstituentUniverseCompositeDelistingRegressionAlgorithm.py:58-73 | Algorithm.Python/ETFConstituentUniverseCompositeDelistingRegressionAlgorithmNoAddEquityETF.py:58-68 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) Algorithm/QCAlgorithm.History.cs:492 — Algorithm/QCAlgorithm.History.cs:492-503 | Algorithm/QCAlgorithm.Python.cs:1320-1330 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) Algorithm.CSharp/MarketOnCloseOrderFillsOnCloseTradeWithTickResolutionAlgorithm.cs:33 — Algorithm.CSharp/MarketOnCloseOrderFillsOnCloseTradeWithTickResolutionAlgorithm.cs:33-43 | Algorithm.CSharp/MarketOnOpenOrderFillsOnOpenTradeWithTickResolutionAlgorithm.cs:33-43 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) Algorithm.CSharp/EuropeanOptionsCannotBeExercisedBeforeExpiryRegressionAlgorithm.cs:44 — Algorithm.CSharp/EuropeanOptionsCannotBeExercisedBeforeExpiryRegressionAlgorithm.cs:44-54 | Algorithm.CSharp/InteractiveBrokersBrokerageDisablesIndexOptionsExerciseRegressionAlgorithm.cs:46-58 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) Algorithm.Python/BasicTemplateOptionsFilterUniverseAlgorithm.py:50 — Algorithm.Python/BasicTemplateOptionsFilterUniverseAlgorithm.py:50-63 | Algorithm.Python/FilterUniverseRegressionAlgorithm.py:46-56 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) Algorithm.Python/HistoryAlgorithm.py:148 — Algorithm.Python/HistoryAlgorithm.py:148-158 | Algorithm.Python/IndicatorSuiteAlgorithm.py:191-201 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) Algorithm.CSharp/BasicTemplateFuturesHistoryAlgorithm.cs:108 — Algorithm.CSharp/BasicTemplateFuturesHistoryAlgorithm.cs:108-118 | Algorithm.CSharp/BasicTemplateOptionsHistoryAlgorithm.cs:91-103 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) Algorithm.CSharp/DuplicateOptionAssignmentRegressionAlgorithm.cs:43 — Algorithm.CSharp/DuplicateOptionAssignmentRegressionAlgorithm.cs:43-53 | Algorithm.CSharp/OptionIndicatorsRegressionAlgorithm.cs:38-48 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) Algorithm.CSharp/DailyOptionChainOpenInterestDataWithStrictDailyEndTimesRegressionAlgorithm.cs:36 — Algorithm.CSharp/DailyOptionChainOpenInterestDataWithStrictDailyEndTimesRegressionAlgorithm.cs:36-46 | Algorithm.CSharp/OptionChainedAndUniverseSelectionRegressionAlgorithm.cs:33-43 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) Algorithm.Framework/Portfolio/EqualWeightingPortfolioConstructionModel.py:45 — Algorithm.Framework/Portfolio/EqualWeightingPortfolioConstructionModel.py:45-55 | Algorithm.Framework/Portfolio/InsightWeightingPortfolioConstructionModel.py:47-59 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) Common/Securities/Cfd/Cfd.cs:179 — Common/Securities/Cfd/Cfd.cs:179-189 | Common/Securities/Crypto/Crypto.cs:138-148 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) Indicators/AdvanceDeclineIndicator.cs:131 — Indicators/AdvanceDeclineIndicator.cs:131-141 | Indicators/NewHighsNewLows.cs:177-187 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) Common/Data/Custom/IconicTypes/IndexedLinkedData.cs:47 — Common/Data/Custom/IconicTypes/IndexedLinkedData.cs:47-57 | Common/Data/Custom/IconicTypes/IndexedLinkedData2.cs:47-57 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) Common/Orders/LimitIfTouchedOrder.cs:100 — Common/Orders/LimitIfTouchedOrder.cs:100-111 | Common/Orders/StopLimitOrder.cs:119-129 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) Algorithm.CSharp/LimitOrdersAreFilledAfterHoursForFuturesRegressionAlgorithm.cs:71 — Algorithm.CSharp/LimitOrdersAreFilledAfterHoursForFuturesRegressionAlgorithm.cs:71-83 | Algorithm.CSharp/MarketOrdersAreSupportedOnExtendedHoursForFuturesRegressionAlgorithm.cs:50-60 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) Indicators/Beta.cs:60 — Indicators/Beta.cs:60-70 | Indicators/Covariance.cs:53-63 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) Common/Data/UniverseSelection/FutureUniverse.cs:156 — Common/Data/UniverseSelection/FutureUniverse.cs:156-166 | Common/Data/UniverseSelection/OptionUniverse.cs:301-311 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×17
  • Duplicated block (13 lines × 2) Indicators/CandlestickPatterns/MatchingLow.cs:89 — Indicators/CandlestickPatterns/MatchingLow.cs:89-101 | Indicators/CandlestickPatterns/StickSandwich.cs:96-108 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/MatchingLow.cs:89` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (13 lines × 2) Algorithm.CSharp/IndexOptionBearPutSpreadAlgorithm.cs:44 — Algorithm.CSharp/IndexOptionBearPutSpreadAlgorithm.cs:44-56 | Algorithm.CSharp/IndexOptionBullPutSpreadAlgorithm.cs:44-56 — before extracting anything, compare `Algorithm.CSharp/IndexOptionBearPutSpreadAlgorithm.cs` and `Algorithm.CSharp/IndexOptionBullPutSpreadAlgorithm.cs` as WHOLE FILES: 84% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 3 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) Common/Data/UniverseSelection/UniverseExtensions.cs:133 — Common/Data/UniverseSelection/UniverseExtensions.cs:133-145 | Common/Symbol.cs:76-88 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Common/Symbol.cs:91` calls `CreateOption` and `Common/Data/UniverseSelection/UniverseExtensions.cs:148` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (13 lines × 2) Indicators/CandlestickPatterns/AdvanceBlock.cs:123 — Indicators/CandlestickPatterns/AdvanceBlock.cs:123-135 | Indicators/CandlestickPatterns/StalledPattern.cs:112-124 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/AdvanceBlock.cs:123` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Indicators/CandlestickPatterns/StalledPattern.cs:126` calls `GetRealBody`, `GetCandleAverage`, `GetUpperShadow` and `Indicators/CandlestickPatterns/AdvanceBlock.cs:137` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (13 lines × 2) Algorithm.CSharp/OptionEquityBoxSpreadRegressionAlgorithm.cs:53 — Algorithm.CSharp/OptionEquityBoxSpreadRegressionAlgorithm.cs:53-65 | Algorithm.CSharp/OptionEquityShortBoxSpreadRegressionAlgorithm.cs:53-65 — before extracting anything, compare `Algorithm.CSharp/OptionEquityBoxSpreadRegressionAlgorithm.cs` and `Algorithm.CSharp/OptionEquityShortBoxSpreadRegressionAlgorithm.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) Algorithm.CSharp/ComboOrdersFillModelAlgorithm.cs:200 — Algorithm.CSharp/ComboOrdersFillModelAlgorithm.cs:200-212 | Algorithm.CSharp/CustomPartialFillModelAlgorithm.cs:92-104 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Algorithm.CSharp/ComboOrdersFillModelAlgorithm.cs:214` calls `Add` and `Algorithm.CSharp/CustomPartialFillModelAlgorithm.cs:105` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (13 lines × 2) Algorithm.CSharp/IndexOptionCallButterflyAlgorithm.cs:33 — Algorithm.CSharp/IndexOptionCallButterflyAlgorithm.cs:33-45 | Algorithm.CSharp/IndexOptionPutButterflyAlgorithm.cs:33-45 — before extracting anything, compare `Algorithm.CSharp/IndexOptionCallButterflyAlgorithm.cs` and `Algorithm.CSharp/IndexOptionPutButterflyAlgorithm.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13 lines × 2) Algorithm.CSharp/LongAndShortButterflyCallStrategiesAlgorithm.cs:41 — Algorithm.CSharp/LongAndShortButterflyCallStrategiesAlgorithm.cs:41-53 | Algorithm.CSharp/LongAndShortButterflyPutStrategiesAlgorithm.cs:41-53 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/LongAndShortButterflyCallStrategiesAlgorithm.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.
  • Duplicated block (13 lines × 2) Algorithm.CSharp/OptionEquityConversionRegressionAlgorithm.cs:41 — Algorithm.CSharp/OptionEquityConversionRegressionAlgorithm.cs:41-53 | Algorithm.CSharp/OptionEquityReverseConversionRegressionAlgorithm.cs:41-53 — before extracting anything, compare `Algorithm.CSharp/OptionEquityConversionRegressionAlgorithm.cs` and `Algorithm.CSharp/OptionEquityReverseConversionRegressionAlgorithm.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/OptionEquityConversionRegressionAlgorithm.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.
  • 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, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Indicators/CandlestickPatterns/EveningStar.cs:142` calls `GetCandleRange` and `Indicators/CandlestickPatterns/UpsideGapTwoCrows.cs:126` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (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, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/TwoCrows.cs:78` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Indicators/CandlestickPatterns/UpsideGapTwoCrows.cs:103` calls `GetRealBody`, `GetCandleAverage` and `Indicators/CandlestickPatterns/TwoCrows.cs:92` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (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, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Algorithm.CSharp/BasicTemplateMultiAssetAlgorithm.cs:127` calls `MarketOrder` and `Algorithm.CSharp/BasicTemplateOptionTradesAlgorithm.cs:75` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (13 lines × 2) Indicators/CandlestickPatterns/Harami.cs:97 — Indicators/CandlestickPatterns/Harami.cs:97-109 | Indicators/CandlestickPatterns/HaramiCross.cs:97-109 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/Harami.cs:97` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (13 lines × 2) Algorithm.Python/BasicTemplateOptionsFilterUniverseAlgorithm.py:28 — Algorithm.Python/BasicTemplateOptionsFilterUniverseAlgorithm.py:28-40 | Algorithm.Python/FilterUniverseRegressionAlgorithm.py:27-39 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (13 lines × 2) Algorithm.Python/ETFConstituentUniverseCompositeDelistingRegressionAlgorithm.py:22 — Algorithm.Python/ETFConstituentUniverseCompositeDelistingRegressionAlgorithm.py:22-34 | Algorithm.Python/ETFConstituentUniverseCompositeDelistingRegressionAlgorithmNoAddEquityETF.py:22-34 — before extracting anything, compare `Algorithm.Python/ETFConstituentUniverseCompositeDelistingRegressionAlgorithm.py` and `Algorithm.Python/ETFConstituentUniverseCompositeDelistingRegressionAlgorithmNoAddEquityETF.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) Algorithm.Python/IndexOptionBearPutSpreadAlgorithm.py:33 — Algorithm.Python/IndexOptionBearPutSpreadAlgorithm.py:33-45 | Algorithm.Python/IndexOptionBullPutSpreadAlgorithm.py:33-45 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (13 lines × 2) Algorithm.Python/IndexOptionShortCallITMExpiryRegressionAlgorithm.py:29 — Algorithm.Python/IndexOptionShortCallITMExpiryRegressionAlgorithm.py:29-41 | Algorithm.Python/IndexOptionShortPutITMExpiryRegressionAlgorithm.py:29-41 — before extracting anything, compare `Algorithm.Python/IndexOptionShortCallITMExpiryRegressionAlgorithm.py` and `Algorithm.Python/IndexOptionShortPutITMExpiryRegressionAlgorithm.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D10 · Test Quality · Skipped test · ×16
  • Skipped test: BuyingPowerForStrategyStartingFromOptionPositionInOppositeDirectionAndLiquidating Tests/Common/Securities/OptionStrategyPositionGroupBuyingPowerModelTests.cs:2510 — Skipped — [Explicit]
  • Skipped test: BuyingPowerForOptionStartingFromStrategyWithALegInTheOppositeDirection Tests/Common/Securities/OptionStrategyPositionGroupBuyingPowerModelTests.cs:2578 — Skipped — [Explicit]
  • Skipped test: BuyingPowerForOptionStartingFromStrategyWithALegInTheOppositeDirectionAndLiquidating Tests/Common/Securities/OptionStrategyPositionGroupBuyingPowerModelTests.cs:2613 — Skipped — [Explicit]
  • Skipped test: FetchSymbolPropertiesFromCoinbase Tests/Common/Securities/SymbolPropertiesDatabaseTests.cs:228 — Skipped — [Explicit]
  • Skipped test: FetchSymbolPropertiesFromBitfinex Tests/Common/Securities/SymbolPropertiesDatabaseTests.cs:342 — Skipped — [Explicit]
  • Skipped test: TestAlgorithmManagerSpeed Tests/Engine/AlgorithmManagerTests.cs:92 — Skipped — TravisExclude
  • Skipped test: Tsfel Tests/Python/PythonPackagesTests.cs:94 — Skipped — [Explicit]
  • Skipped test: Thinc Tests/Python/PythonPackagesTests.cs:187 — Skipped — Run separate
  • Skipped test: StatsForecast Tests/Python/PythonPackagesTests.cs:288 — Skipped — [Explicit]
  • Skipped test: alibi_detect Tests/Python/PythonPackagesTests.cs:525 — Skipped — Legacy
  • Skipped test: Mlforecast Tests/Python/PythonPackagesTests.cs:777 — Skipped — Run separate
  • Skipped test: PyvinecopulibTest Tests/Python/PythonPackagesTests.cs:1017 — Skipped — Run separate
  • Skipped test: MlxtendTest Tests/Python/PythonPackagesTests.cs:1332 — Skipped — Run separate
  • Skipped test: AesaraTest Tests/Python/PythonPackagesTests.cs:1656 — Skipped — Legacy
  • Skipped test: ScikitOptimizeTest Tests/Python/PythonPackagesTests.cs:2481 — Skipped — [Explicit]
  • Skipped test: NeuralTangentsTest Tests/Python/PythonPackagesTests.cs:2627 — Skipped — Legacy
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×16
  • Members sharing a duplicated core (4 members, 50+ identical tokens) Common/Data/Market/OpenInterest.cs:133 — Common/Data/Market/OpenInterest.cs:133-146 | Common/Data/Market/QuoteBar.cs:662-675 | Common/Data/Market/Tick.cs:752-765 | Common/Data/Market/TradeBar.cs:814-827 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) Common/Orders/Fees/AlphaStreamsFeeModel.cs:54 — Common/Orders/Fees/AlphaStreamsFeeModel.cs:54-137 | Common/Orders/Fees/BinanceFeeModel.cs:58-90 | Common/Orders/Fees/BitfinexFeeModel.cs:47-82 | Common/Orders/Fees/BybitFeeModel.cs:59-91 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) Common/Orders/Fills/EquityFillModel.cs:775 — Common/Orders/Fills/EquityFillModel.cs:775-867 | Common/Orders/Fills/EquityFillModel.cs:884-976 | Common/Orders/Fills/FillModel.cs:881-930 | Common/Orders/Fills/FillModel.cs:940-989 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) Indicators/CandlestickPatterns/ConcealedBabySwallow.cs:74 — Indicators/CandlestickPatterns/ConcealedBabySwallow.cs:74-126 | Indicators/CandlestickPatterns/IdenticalThreeCrows.cs:78-141 | Indicators/CandlestickPatterns/ThreeBlackCrows.cs:73-127 | Indicators/CandlestickPatterns/ThreeWhiteSoldiers.cs:87-175 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) Indicators/CandlestickPatterns/MorningStar.cs:95 — Indicators/CandlestickPatterns/MorningStar.cs:95-146 | Indicators/CandlestickPatterns/ThreeInside.cs:76-121 | Indicators/CandlestickPatterns/TwoCrows.cs:73-111 | Indicators/CandlestickPatterns/UpsideGapTwoCrows.cs:78-127 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) Indicators/Gamma.cs:193 — Indicators/Gamma.cs:193-253 | Indicators/Rho.cs:193-245 | Indicators/Theta.cs:193-253 | Indicators/Vega.cs:193-236 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) Algorithm.CSharp/BasicTemplateOptionStrategyAlgorithm.cs:42 — Algorithm.CSharp/BasicTemplateOptionStrategyAlgorithm.cs:42-62 | Algorithm.CSharp/NakedShortOptionStrategyOverMarginAlgorithm.cs:44-55 | Algorithm.CSharp/OptionStrategyFactoryMethodsBaseAlgorithm.cs:40-51 | Algorithm.CSharp/TradingNotAddedOptionsRegressionAlgorithm.cs:37-69 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) Algorithm.CSharp/CustomDataBitcoinAlgorithm.cs:146 — Algorithm.CSharp/CustomDataBitcoinAlgorithm.cs:146-182 | Algorithm.CSharp/CustomDataNIFTYAlgorithm.cs:173-196 | Algorithm.CSharp/CustomDataPropertiesRegressionAlgorithm.cs:236-270 | REDACTED:202-237 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) Algorithm.CSharp/FutureOptionCallOTMExpiryRegressionAlgorithm.cs:105 — Algorithm.CSharp/FutureOptionCallOTMExpiryRegressionAlgorithm.cs:105-132 | Algorithm.CSharp/FutureOptionPutOTMExpiryRegressionAlgorithm.cs:103-130 | Algorithm.CSharp/FutureOptionShortCallOTMExpiryRegressionAlgorithm.cs:100-128 | Algorithm.CSharp/FutureOptionShortPutOTMExpiryRegressionAlgorithm.cs:100-127 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) Algorithm.CSharp/IndexOptionCallButterflyAlgorithm.cs:48 — Algorithm.CSharp/IndexOptionCallButterflyAlgorithm.cs:48-86 | Algorithm.CSharp/IndexOptionPutButterflyAlgorithm.cs:48-86 | Algorithm.CSharp/LongAndShortButterflyCallStrategiesAlgorithm.cs:39-66 | Algorithm.CSharp/LongAndShortButterflyPutStrategiesAlgorithm.cs:39-66 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) Algorithm.CSharp/IndexOptionCallOTMExpiryRegressionAlgorithm.cs:101 — Algorithm.CSharp/IndexOptionCallOTMExpiryRegressionAlgorithm.cs:101-128 | Algorithm.CSharp/IndexOptionPutOTMExpiryRegressionAlgorithm.cs:98-125 | Algorithm.CSharp/IndexOptionShortCallOTMExpiryRegressionAlgorithm.cs:95-123 | Algorithm.CSharp/IndexOptionShortPutOTMExpiryRegressionAlgorithm.cs:95-122 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) Report/ReportElements/CumulativeReturnsReportElement.cs:51 — Report/ReportElements/CumulativeReturnsReportElement.cs:51-147 | Report/ReportElements/LeverageUtilizationReportElement.cs:62-82 | Report/ReportElements/RollingPortfolioBetaReportElement.cs:56-88 | Report/ReportElements/RollingSharpeReportElement.cs:55-87 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) Algorithm.Python/CoveredAndProtectiveCallStrategiesAlgorithm.py:28 — Algorithm.Python/CoveredAndProtectiveCallStrategiesAlgorithm.py:28-36 | Algorithm.Python/CoveredAndProtectivePutStrategiesAlgorithm.py:28-36 | Algorithm.Python/NakedCallStrategyAlgorithm.py:28-35 | Algorithm.Python/NakedPutStrategyAlgorithm.py:28-35 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) Algorithm.Python/CoveredAndProtectiveCallStrategiesAlgorithm.py:39 — Algorithm.Python/CoveredAndProtectiveCallStrategiesAlgorithm.py:39-55 | Algorithm.Python/CoveredAndProtectivePutStrategiesAlgorithm.py:40-56 | Algorithm.Python/NakedCallStrategyAlgorithm.py:38-49 | Algorithm.Python/NakedPutStrategyAlgorithm.py:38-49 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) Algorithm.Python/FutureOptionShortCallOTMExpiryRegressionAlgorithm.py:92 — Algorithm.Python/FutureOptionShortCallOTMExpiryRegressionAlgorithm.py:92-99 | Algorithm.Python/FutureOptionShortPutOTMExpiryRegressionAlgorithm.py:93-100 | Algorithm.Python/IndexOptionShortCallOTMExpiryRegressionAlgorithm.py:78-83 | Algorithm.Python/IndexOptionShortPutOTMExpiryRegressionAlgorithm.py:78-83 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) Algorithm.Python/IndexOptionCallITMExpiryRegressionAlgorithm.py:64 — Algorithm.Python/IndexOptionCallITMExpiryRegressionAlgorithm.py:64-79 | Algorithm.Python/IndexOptionPutITMExpiryRegressionAlgorithm.py:58-71 | Algorithm.Python/IndexOptionShortCallITMExpiryRegressionAlgorithm.py:65-79 | Algorithm.Python/IndexOptionShortPutITMExpiryRegressionAlgorithm.py:65-78 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×16
  • Edited copy of a member (15 corresponding lines) Algorithm.Python/LongAndShortCallCalendarSpreadStrategiesAlgorithm.py:46 — Algorithm.Python/LongAndShortCallCalendarSpreadStrategiesAlgorithm.py:46-60 | Algorithm.Python/LongAndShortPutCalendarSpreadStrategiesAlgorithm.py:46-60 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) Algorithm.Python/OptionChainConsistencyRegressionAlgorithm.py:42 — Algorithm.Python/OptionChainConsistencyRegressionAlgorithm.py:42-57 | Algorithm.Python/OptionExerciseAssignRegressionAlgorithm.py:41-55 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) Algorithm.Python/ExecutionModelOrderEventsRegressionAlgorithm.py:57 — Algorithm.Python/ExecutionModelOrderEventsRegressionAlgorithm.py:57-71 | Algorithm/Execution/ImmediateExecutionModel.py:27-52 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) Algorithm.CSharp/BasicTemplateCryptoFrameworkAlgorithm.cs:38 — Algorithm.CSharp/BasicTemplateCryptoFrameworkAlgorithm.cs:38-57 | Algorithm.CSharp/G10CurrencySelectionModelFrameworkAlgorithm.cs:38-52 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) Brokerages/LevelOneOrderBook/LevelOneServiceManager.cs:201 — Brokerages/LevelOneOrderBook/LevelOneServiceManager.cs:201-215 | Brokerages/LevelOneOrderBook/LevelOneServiceManager.cs:225-240 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) Algorithm.Python/CapmAlphaRankingFrameworkAlgorithm.py:24 — Algorithm.Python/CapmAlphaRankingFrameworkAlgorithm.py:24-38 | Algorithm.Python/ExpiryHelperAlphaModelFrameworkAlgorithm.py:23-41 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) Algorithm.CSharp/OptionExerciseRegressionAlgorithm.cs:38 — Algorithm.CSharp/OptionExerciseRegressionAlgorithm.cs:38-52 | Algorithm.CSharp/OptionSplitRegressionAlgorithm.cs:37-53 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) Algorithm.CSharp/MarketOnCloseOrderBufferExtendedMarketHoursRegressionAlgorithm.cs:37 — Algorithm.CSharp/MarketOnCloseOrderBufferExtendedMarketHoursRegressionAlgorithm.cs:37-51 | Algorithm.CSharp/MarketOnCloseOrderBufferRegressionAlgorithm.cs:32-46 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) Algorithm/QCAlgorithm.Indicators.cs:3480 — Algorithm/QCAlgorithm.Indicators.cs:3480-3494 | Algorithm/QCAlgorithm.Indicators.cs:3540-3554 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) Algorithm.Python/CustomDataObjectStoreRegressionAlgorithm.py:22 — Algorithm.Python/CustomDataObjectStoreRegressionAlgorithm.py:22-36 | Algorithm.Python/DescendingCustomDataObjectStoreRegressionAlgorithm.py:44-58 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) Algorithm.CSharp/OptionRenameDailyRegressionAlgorithm.cs:39 — Algorithm.CSharp/OptionRenameDailyRegressionAlgorithm.cs:39-53 | Algorithm.CSharp/OptionRenameRegressionAlgorithm.cs:37-51 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) Brokerages/DefaultOrderBook.cs:184 — Brokerages/DefaultOrderBook.cs:184-198 | Brokerages/DefaultOrderBook.cs:205-219 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) Algorithm.CSharp/FundamentalCustomSelectionTimeRegressionAlgorithm.cs:85 — Algorithm.CSharp/FundamentalCustomSelectionTimeRegressionAlgorithm.cs:85-99 | Algorithm.CSharp/FundamentalCustomSelectionTimeWarmupRegressionAlgorithm.cs:58-72 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) Algorithm.CSharp/DescendingCustomDataObjectStoreRegressionAlgorithm.cs:62 — Algorithm.CSharp/DescendingCustomDataObjectStoreRegressionAlgorithm.cs:62-76 | Algorithm.CSharp/CustomDataObjectStoreRegressionAlgorithm.cs:40-54 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) Algorithm.CSharp/ClassicRenkoConsolidatorWithFuturesQuoteTickTypeRegressionAlgorithm.cs:35 — Algorithm.CSharp/ClassicRenkoConsolidatorWithFuturesQuoteTickTypeRegressionAlgorithm.cs:35-51 | Algorithm.CSharp/ClassicRenkoConsolidatorWithFuturesAndDefaultTickTypeRegressionAlgorithm.cs:31-45 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) Algorithm.CSharp/SetAccountCurrencyCashBuyingPowerModelRegressionAlgorithm.cs:139 — Algorithm.CSharp/SetAccountCurrencyCashBuyingPowerModelRegressionAlgorithm.cs:139-159 | Algorithm.CSharp/SetAccountCurrencySecurityMarginModelRegressionAlgorithm.cs:111-125 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×16
  • Duplicated block (12 lines × 2) Common/Securities/Option/StrategyMatcher/OptionPositionCollection.cs:434 — Common/Securities/Option/StrategyMatcher/OptionPositionCollection.cs:434-445 | Common/Securities/Option/StrategyMatcher/OptionPositionCollection.cs:471-482 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) Algorithm.CSharp/EuropeanOptionsCannotBeExercisedBeforeExpiryRegressionAlgorithm.cs:63 — Algorithm.CSharp/EuropeanOptionsCannotBeExercisedBeforeExpiryRegressionAlgorithm.cs:63-74 | Algorithm.CSharp/InteractiveBrokersBrokerageDisablesIndexOptionsExerciseRegressionAlgorithm.cs:67-78 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (12 lines × 2) Algorithm.CSharp/WarmupLowerResolutionOptionRegressionAlgorithm.cs:103 — Algorithm.CSharp/WarmupLowerResolutionOptionRegressionAlgorithm.cs:103-114 | Algorithm.CSharp/WarmupOptionResolutionRegressionAlgorithm.cs:37-48 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/WarmupLowerResolutionOptionRegressionAlgorithm.cs:103` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) Algorithm.CSharp/BasicTemplateFuturesAlgorithm.cs:58 — Algorithm.CSharp/BasicTemplateFuturesAlgorithm.cs:58-69 | Algorithm.CSharp/BasicTemplateFuturesWithExtendedMarketAlgorithm.cs:58-69 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/BasicTemplateFuturesAlgorithm.cs:58` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) Common/Brokerages/SamcoBrokerageModel.cs:170 — Common/Brokerages/SamcoBrokerageModel.cs:170-181 | Common/Brokerages/ZerodhaBrokerageModel.cs:166-177 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 2) Indicators/CandlestickPatterns/MatHold.cs:101 — Indicators/CandlestickPatterns/MatHold.cs:101-112 | Indicators/CandlestickPatterns/RiseFallThreeMethods.cs:83-94 — before extracting anything, compare `Indicators/CandlestickPatterns/MatHold.cs` and `Indicators/CandlestickPatterns/RiseFallThreeMethods.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/MatHold.cs:101` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Indicators/CandlestickPatterns/RiseFallThreeMethods.cs:95` calls `GetCandleRange` and `Indicators/CandlestickPatterns/MatHold.cs:113` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) Engine/TransactionHandlers/BrokerageTransactionHandler.cs:489 — Engine/TransactionHandlers/BrokerageTransactionHandler.cs:489-500 | Engine/TransactionHandlers/BrokerageTransactionHandler.cs:561-572 — both copies are in the same file, so extract the 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 `Engine/TransactionHandlers/BrokerageTransactionHandler.cs:489` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note first that the copies are not typed on the same thing: the declarations holding them bind `request` to `UpdateOrderRequest` in one and `CancelOrderRequest` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (12 lines × 2) Common/Data/Market/QuoteBar.cs:529 — Common/Data/Market/QuoteBar.cs:529-540 | Common/Data/Market/TradeBar.cs:666-677 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Common/Data/Market/QuoteBar.cs:529` 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/BasicTemplateContinuousFutureAlgorithm.cs:77 — Algorithm.CSharp/BasicTemplateContinuousFutureAlgorithm.cs:77-88 | Algorithm.CSharp/BasicTemplateContinuousFutureWithExtendedMarketAlgorithm.cs:88-99 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (12 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, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `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/CustomDataBitcoinAlgorithm.cs:171 — Algorithm.CSharp/CustomDataBitcoinAlgorithm.cs:171-182 | REDACTED:226-237 — before extracting anything, compare `Algorithm.CSharp/CustomDataBitcoinAlgorithm.cs` and `REDACTED` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 90 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/CustomDataBitcoinAlgorithm.cs:171` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Algorithm.CSharp/CustomDataBitcoinAlgorithm.cs:169` calls `AddDays` and `REDACTED:224` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (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, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `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.CSharp/BasicTemplateFuturesAlgorithm.cs:109 — Algorithm.CSharp/BasicTemplateFuturesAlgorithm.cs:109-120 | Algorithm.CSharp/BasicTemplateFuturesWithExtendedMarketAlgorithm.cs:113-124 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 2) Algorithm.CSharp/SetDataNormalizationModeOnAddSecurityAlgorithm.cs:67 — Algorithm.CSharp/SetDataNormalizationModeOnAddSecurityAlgorithm.cs:67-78 | Algorithm.CSharp/SetEquityDataNormalizationModeOnAddEquity.cs:56-67 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 2) Algorithm.Python/IndexOptionCallButterflyAlgorithm.py:37 — Algorithm.Python/IndexOptionCallButterflyAlgorithm.py:37-48 | Algorithm.Python/IndexOptionPutButterflyAlgorithm.py:37-48 — before extracting anything, compare `Algorithm.Python/IndexOptionCallButterflyAlgorithm.py` and `Algorithm.Python/IndexOptionPutButterflyAlgorithm.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) Report/ReportCharts.py:717 — Report/ReportCharts.py:717-728 | Report/ReportCharts.py:806-817 — both copies are in the same file, so extract the 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 `Report/ReportCharts.py:717` 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 (14 lines × 2) · ×16
  • Duplicated block (14 lines × 2) Algorithm.CSharp/OptionEquityConversionRegressionAlgorithm.cs:63 — Algorithm.CSharp/OptionEquityConversionRegressionAlgorithm.cs:63-76 | Algorithm.CSharp/OptionEquityReverseConversionRegressionAlgorithm.cs:63-76 — before extracting anything, compare `Algorithm.CSharp/OptionEquityConversionRegressionAlgorithm.cs` and `Algorithm.CSharp/OptionEquityReverseConversionRegressionAlgorithm.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/OptionEquityConversionRegressionAlgorithm.cs:63` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) Common/BinaryComparisonExtensions.cs:83 — Common/BinaryComparisonExtensions.cs:83-96 | Common/BinaryComparisonExtensions.cs:134-147 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Common/BinaryComparisonExtensions.cs:83` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (14 lines × 2) Algorithm.Framework/Execution/StandardDeviationExecutionModel.cs:129 — Algorithm.Framework/Execution/StandardDeviationExecutionModel.cs:129-142 | Algorithm.Framework/Execution/VolumeWeightedAveragePriceExecutionModel.cs:114-127 — before extracting anything, compare `Algorithm.Framework/Execution/StandardDeviationExecutionModel.cs` and `Algorithm.Framework/Execution/VolumeWeightedAveragePriceExecutionModel.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.Framework/Execution/StandardDeviationExecutionModel.cs:129` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) Indicators/CandlestickPatterns/EveningDojiStar.cs:131 — Indicators/CandlestickPatterns/EveningDojiStar.cs:131-144 | Indicators/CandlestickPatterns/EveningStar.cs:124-137 — before extracting anything, compare `Indicators/CandlestickPatterns/EveningDojiStar.cs` and `Indicators/CandlestickPatterns/EveningStar.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/EveningDojiStar.cs:131` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (14 lines × 2) Indicators/CandlestickPatterns/IdenticalThreeCrows.cs:122 — Indicators/CandlestickPatterns/IdenticalThreeCrows.cs:122-135 | Indicators/CandlestickPatterns/ThreeWhiteSoldiers.cs:147-160 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/IdenticalThreeCrows.cs:122` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) Indicators/CandlestickPatterns/LongLeggedDoji.cs:94 — Indicators/CandlestickPatterns/LongLeggedDoji.cs:94-107 | Indicators/CandlestickPatterns/RickshawMan.cs:115-128 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/LongLeggedDoji.cs:94` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Indicators/CandlestickPatterns/RickshawMan.cs:130` calls `GetCandleRange` and `Indicators/CandlestickPatterns/LongLeggedDoji.cs:109` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (14 lines × 2) Indicators/CandlestickPatterns/MatHold.cs:146 — Indicators/CandlestickPatterns/MatHold.cs:146-159 | Indicators/CandlestickPatterns/RiseFallThreeMethods.cs:127-140 — before extracting anything, compare `Indicators/CandlestickPatterns/MatHold.cs` and `Indicators/CandlestickPatterns/RiseFallThreeMethods.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/MatHold.cs:146` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Indicators/CandlestickPatterns/RiseFallThreeMethods.cs:142` calls `GetCandleRange` and `Indicators/CandlestickPatterns/MatHold.cs:161` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (14 lines × 2) Indicators/CandlestickPatterns/MorningDojiStar.cs:131 — Indicators/CandlestickPatterns/MorningDojiStar.cs:131-144 | Indicators/CandlestickPatterns/MorningStar.cs:124-137 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/MorningDojiStar.cs:131` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (14 lines × 2) Algorithm.CSharp/OptionEquityCallButterflyRegressionAlgorithm.cs:37 — Algorithm.CSharp/OptionEquityCallButterflyRegressionAlgorithm.cs:37-50 | Algorithm.CSharp/OptionEquityShortButterflyCallRegressionAlgorithm.cs:37-50 — before extracting anything, compare `Algorithm.CSharp/OptionEquityCallButterflyRegressionAlgorithm.cs` and `Algorithm.CSharp/OptionEquityShortButterflyCallRegressionAlgorithm.cs` as WHOLE FILES: 84% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/OptionEquityCallButterflyRegressionAlgorithm.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 (14 lines × 2) Common/Util/LeanData.cs:112 — Common/Util/LeanData.cs:112-125 | Common/Util/LeanData.cs:128-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:112` 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) Common/Orders/LimitIfTouchedOrder.cs:145 — Common/Orders/LimitIfTouchedOrder.cs:145-158 | Common/Orders/StopLimitOrder.cs:99-112 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 2) Algorithm.CSharp/FundamentalCustomSelectionTimeRegressionAlgorithm.cs:69 — Algorithm.CSharp/FundamentalCustomSelectionTimeRegressionAlgorithm.cs:69-82 | Algorithm.CSharp/FundamentalCustomSelectionTimeWarmupRegressionAlgorithm.cs:76-89 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 2) Algorithm.CSharp/RawPricesCoarseUniverseAlgorithm.cs:81 — Algorithm.CSharp/RawPricesCoarseUniverseAlgorithm.cs:81-94 | Algorithm.CSharp/RawPricesUniverseRegressionAlgorithm.cs:66-79 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 2) Algorithm.Python/Alphas/GreenblattMagicFormulaAlpha.py:78 — Algorithm.Python/Alphas/GreenblattMagicFormulaAlpha.py:78-91 | Algorithm.Python/Alphas/PriceGapMeanReversionAlpha.py:94-107 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) Algorithm.Python/DropboxBaseDataUniverseSelectionAlgorithm.py:56 — Algorithm.Python/DropboxBaseDataUniverseSelectionAlgorithm.py:56-69 | Algorithm.Python/DropboxUniverseSelectionAlgorithm.py:70-83 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) Algorithm.CSharp/RegressionTests/CustomData/CustomDataLinkedIconicTypeAddDataCoarseSelectionRegressionAlgorithm.cs:72 — Algorithm.CSharp/RegressionTests/CustomData/CustomDataLinkedIconicTypeAddDataCoarseSelectionRegressionAlgorithm.cs:72-85 | Algorithm.CSharp/RegressionTests/CustomData/CustomDataLinkedIconicTypeAddDataOnSecuritiesChangedRegressionAlgorithm.cs:63-76 — before extracting anything, compare `Algorithm.CSharp/RegressionTests/CustomData/CustomDataLinkedIconicTypeAddDataCoarseSelectionRegressionAlgorithm.cs` and `Algorithm.CSharp/RegressionTests/CustomData/CustomDataLinkedIconicTypeAddDataOnSecuritiesChangedRegressionAlgorithm.cs` as WHOLE FILES: 92% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Edited copy of a member (18 corresponding lines) · ×15
  • Edited copy of a member (18 corresponding lines) Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs:640 — Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs:640-657 | Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs:663-680 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) Common/Scheduling/TimeRules.cs:257 — Common/Scheduling/TimeRules.cs:257-274 | Common/Scheduling/TimeRules.cs:371-388 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) Algorithm.Python/FutureOptionShortCallITMExpiryRegressionAlgorithm.py:72 — Algorithm.Python/FutureOptionShortCallITMExpiryRegressionAlgorithm.py:72-89 | Algorithm.Python/FutureOptionShortPutITMExpiryRegressionAlgorithm.py:72-89 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) Algorithm.Python/Alphas/MortgageRateVolatilityAlpha.py:34 — Algorithm.Python/Alphas/MortgageRateVolatilityAlpha.py:34-51 | Algorithm.Python/Alphas/ShareClassMeanReversionAlpha.py:35-58 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) Algorithm.CSharp/AddOptionContractTwiceRegressionAlgorithm.cs:34 — Algorithm.CSharp/AddOptionContractTwiceRegressionAlgorithm.cs:34-51 | Algorithm.CSharp/AddTwoAndRemoveOneOptionContractRegressionAlgorithm.cs:35-55 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) Algorithm.CSharp/CustomModelsAlgorithm.cs:224 — Algorithm.CSharp/CustomModelsAlgorithm.cs:224-241 | Algorithm.CSharp/CustomModelsAlgorithm.cs:244-261 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) Algorithm/QCAlgorithm.Indicators.cs:1541 — Algorithm/QCAlgorithm.Indicators.cs:1541-1558 | Algorithm/QCAlgorithm.Indicators.cs:1646-1663 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) Common/Securities/Option/StrategyMatcher/OptionStrategyMatcher.cs:166 — Common/Securities/Option/StrategyMatcher/OptionStrategyMatcher.cs:166-189 | Common/Securities/Option/StrategyMatcher/OptionStrategyMatcherOptions.cs:161-178 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) Algorithm.CSharp/AddBetaIndicatorNewAssetsRegressionAlgorithm.cs:37 — Algorithm.CSharp/AddBetaIndicatorNewAssetsRegressionAlgorithm.cs:37-54 | Algorithm.CSharp/AddBetaIndicatorRegressionAlgorithm.cs:35-52 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) Common/Securities/Option/StrategyMatcher/OptionPosition.cs:218 — Common/Securities/Option/StrategyMatcher/OptionPosition.cs:218-235 | Common/Securities/Option/StrategyMatcher/OptionPosition.cs:242-261 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) Algorithm.Python/BasicTemplateOptionsHistoryAlgorithm.py:28 — Algorithm.Python/BasicTemplateOptionsHistoryAlgorithm.py:28-45 | Algorithm.Python/BasicTemplateOptionsPriceModel.py:27-53 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) Common/Algorithm/Framework/Alphas/Insight.cs:196 — Common/Algorithm/Framework/Alphas/Insight.cs:196-213 | Common/Algorithm/Framework/Alphas/Insight.cs:280-303 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) ToolBox/FactorFileGenerator.cs:216 — ToolBox/FactorFileGenerator.cs:216-237 | ToolBox/FactorFileGenerator.cs:246-263 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) Algorithm.Framework/Selection/FutureUniverseSelectionModel.cs:96 — Algorithm.Framework/Selection/FutureUniverseSelectionModel.cs:96-116 | Algorithm.Framework/Selection/OptionUniverseSelectionModel.cs:96-113 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) Algorithm.CSharp/SecuritySessionDailyNoPreciseEndTimeRegressionAlgorithm.cs:32 — Algorithm.CSharp/SecuritySessionDailyNoPreciseEndTimeRegressionAlgorithm.cs:32-49 | Algorithm.CSharp/SecuritySessionRegressionAlgorithm.cs:92-119 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×15
  • Edited copy of a member (13 corresponding lines) Common/Scheduling/DateRules.cs:617 — Common/Scheduling/DateRules.cs:617-629 | Common/Scheduling/DateRules.cs:668-680 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) Algorithm.Python/BasicTemplateFuturesDailyAlgorithm.py:42 — Algorithm.Python/BasicTemplateFuturesDailyAlgorithm.py:42-55 | Algorithm.Python/BasicTemplateFuturesWithExtendedMarketAlgorithm.py:50-62 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) Algorithm.CSharp/BasicTemplateContinuousFutureAlgorithm.cs:46 — Algorithm.CSharp/BasicTemplateContinuousFutureAlgorithm.cs:46-58 | Algorithm.CSharp/BasicTemplateContinuousFutureWithExtendedMarketAlgorithm.cs:47-60 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) Algorithm.CSharp/FreePortfolioValueRegressionAlgorithm.cs:36 — Algorithm.CSharp/FreePortfolioValueRegressionAlgorithm.cs:36-52 | Algorithm.CSharp/SectorExposureRiskFrameworkAlgorithm.cs:37-49 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) Algorithm.CSharp/FutureOptionDailyRegressionAlgorithm.cs:70 — Algorithm.CSharp/FutureOptionDailyRegressionAlgorithm.cs:70-83 | Algorithm.CSharp/FutureOptionHourlyRegressionAlgorithm.cs:33-45 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) Engine/Results/LiveTradingResultHandler.cs:465 — Engine/Results/LiveTradingResultHandler.cs:465-477 | Engine/Results/BaseResultsHandler.cs:403-415 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) Common/Securities/Positions/SecurityPositionGroupBuyingPowerModel.cs:155 — Common/Securities/Positions/SecurityPositionGroupBuyingPowerModel.cs:155-168 | Common/Securities/Positions/SecurityPositionGroupBuyingPowerModel.cs:177-189 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) Algorithm.Python/NoUniverseSelectorRegressionAlgorithm.py:31 — Algorithm.Python/NoUniverseSelectorRegressionAlgorithm.py:31-43 | Algorithm.Python/UniverseSelectionDefinitionsAlgorithm.py:39-51 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) Algorithm.CSharp/DelistedFutureLiquidateRegressionAlgorithm.cs:54 — Algorithm.CSharp/DelistedFutureLiquidateRegressionAlgorithm.cs:54-68 | Algorithm.CSharp/HourMarketOrderFillsAtBarCloseRegressionAlgorithm.cs:53-65 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) Common/Exceptions/KeyErrorPythonExceptionInterpreter.cs:39 — Common/Exceptions/KeyErrorPythonExceptionInterpreter.cs:39-51 | Common/Exceptions/ModuleNotFoundPythonExceptionInterpreter.cs:42-54 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) Common/Orders/Fees/BinanceFeeModel.cs:106 — Common/Orders/Fees/BinanceFeeModel.cs:106-118 | Common/Orders/Fees/BybitFeeModel.cs:104-116 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) Common/Securities/Positions/SecurityPositionGroupBuyingPowerModel.cs:31 — Common/Securities/Positions/SecurityPositionGroupBuyingPowerModel.cs:31-47 | Common/Securities/Positions/SecurityPositionGroupBuyingPowerModel.cs:75-87 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) Common/Data/Market/RenkoBar.cs:79 — Common/Data/Market/RenkoBar.cs:79-91 | Common/Data/Market/VolumeRenkoBar.cs:50-62 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) Common/Securities/Positions/PositionGroupBuyingPowerModel.cs:527 — Common/Securities/Positions/PositionGroupBuyingPowerModel.cs:527-539 | Common/Securities/Positions/PositionGroupKey.cs:99-112 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) Algorithm/Selection/CustomUniverseSelectionModel.cs:130 — Algorithm/Selection/CustomUniverseSelectionModel.cs:130-143 | Algorithm.Framework/Selection/FundamentalUniverseSelectionModel.cs:206-218 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (7 corresponding lines) · ×15
  • Edited copy of a member (7 corresponding lines) Common/Packets/BacktestResultPacket.cs:191 — Common/Packets/BacktestResultPacket.cs:191-197 | Common/Packets/LiveResultPacket.cs:108-114 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) Algorithm.Python/FundamentalCustomSelectionTimeRegressionAlgorithm.py:53 — Algorithm.Python/FundamentalCustomSelectionTimeRegressionAlgorithm.py:53-59 | Algorithm.Python/FundamentalCustomSelectionTimeRegressionAlgorithm.py:62-68 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) Algorithm/QCAlgorithm.Python.cs:1163 — Algorithm/QCAlgorithm.Python.cs:1163-1169 | Algorithm/QCAlgorithm.Python.cs:1195-1204 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) Common/Securities/Future/FuturesExpiryUtilityFunctions.cs:245 — Common/Securities/Future/FuturesExpiryUtilityFunctions.cs:245-255 | Common/Securities/Future/FuturesExpiryUtilityFunctions.cs:265-271 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) Algorithm.CSharp/DividendAlgorithm.cs:70 — Algorithm.CSharp/DividendAlgorithm.cs:70-76 | Algorithm.CSharp/DividendRegressionAlgorithm.cs:64-72 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) Algorithm.Framework/Alphas/HistoricalReturnsAlphaModel.cs:154 — Algorithm.Framework/Alphas/HistoricalReturnsAlphaModel.cs:154-160 | Algorithm.Framework/Alphas/MacdAlphaModel.cs:191-200 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) Algorithm.Python/CustomBuyingPowerModelAlgorithm.py:28 — Algorithm.Python/CustomBuyingPowerModelAlgorithm.py:28-34 | Algorithm.Python/CustomPartialFillModelAlgorithm.py:24-32 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) Algorithm.CSharp/CustomShortableProviderRegressionAlgorithm.cs:35 — Algorithm.CSharp/CustomShortableProviderRegressionAlgorithm.cs:35-42 | Algorithm.CSharp/SetCustomSettlementModelRegressionAlgorithm.cs:31-37 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) Algorithm.CSharp/EquitySplitHoldingsMinuteRegressionAlgorithm.cs:48 — Algorithm.CSharp/EquitySplitHoldingsMinuteRegressionAlgorithm.cs:48-54 | Algorithm.CSharp/SplitEquityRegressionAlgorithm.cs:38-44 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) Algorithm.CSharp/WarmupLowerResolutionBarCountRegressionAlgorithm.cs:24 — Algorithm.CSharp/WarmupLowerResolutionBarCountRegressionAlgorithm.cs:24-30 | Algorithm.CSharp/WarmupLowerResolutionTimeSpanRegressionAlgorithm.cs:33-39 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) Algorithm.Python/NoUniverseSelectorRegressionAlgorithm.py:21 — Algorithm.Python/NoUniverseSelectorRegressionAlgorithm.py:21-27 | Algorithm.Python/UniverseSelectedRegressionAlgorithm.py:22-28 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) Algorithm.Framework/Alphas/HistoricalReturnsAlphaModel.cs:135 — Algorithm.Framework/Alphas/HistoricalReturnsAlphaModel.cs:135-141 | Algorithm.Framework/Alphas/MacdAlphaModel.cs:154-160 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) Indicators/CandlestickPatterns/AdvanceBlock.cs:213 — Indicators/CandlestickPatterns/AdvanceBlock.cs:213-220 | Indicators/CandlestickPatterns/ThreeWhiteSoldiers.cs:181-187 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) Algorithm.CSharp/MultipleUniverseSelectionOrderRegressionAlgorithm.cs:33 — Algorithm.CSharp/MultipleUniverseSelectionOrderRegressionAlgorithm.cs:33-41 | Algorithm.CSharp/NoUniverseSelectorRegressionAlgorithm.cs:35-41 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) Indicators/BollingerBands.cs:154 — Indicators/BollingerBands.cs:154-162 | Indicators/KeltnerChannels.cs:103-109 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×15
  • Duplicated block (10 lines × 2) Common/Securities/BuyingPowerModel.cs:148 — Common/Securities/BuyingPowerModel.cs:148-157 | Common/Securities/Future/FutureMarginModel.cs:132-141 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10 lines × 2) Common/Data/Fundamental/Generated/InventoryValuationMethod.cs:100 — Common/Data/Fundamental/Generated/InventoryValuationMethod.cs:100-109 | Common/Data/Fundamental/Generated/PeriodAuditor.cs:100-109 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (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/Rho.cs:220 — Indicators/Rho.cs:220-229 | Indicators/Vega.cs:220-229 — before extracting anything, compare `Indicators/Rho.cs` and `Indicators/Vega.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/Rho.cs:220` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) Algorithm.CSharp/LongAndShortCallCalendarSpreadStrategiesAlgorithm.cs:42 — Algorithm.CSharp/LongAndShortCallCalendarSpreadStrategiesAlgorithm.cs:42-51 | Algorithm.CSharp/LongAndShortPutCalendarSpreadStrategiesAlgorithm.cs:42-51 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `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 (10 lines × 2) Algorithm.CSharp/OptionShortCallMarginCallEventsAlgorithm.cs:53 — Algorithm.CSharp/OptionShortCallMarginCallEventsAlgorithm.cs:53-62 | Algorithm.CSharp/OptionStrategyMarginCallEventsAlgorithm.cs:58-67 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/OptionShortCallMarginCallEventsAlgorithm.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 (10 lines × 2) Engine/Results/LiveTradingResultHandler.cs:249 — Engine/Results/LiveTradingResultHandler.cs:249-258 | Engine/Results/LiveTradingResultHandler.cs:316-325 — both copies are in the same file, so extract the 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/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) Common/Orders/GroupOrderManager.cs:66 — Common/Orders/GroupOrderManager.cs:66-75 | Common/Orders/Order.cs:178-187 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (10 lines × 2) Algorithm.Python/BaseFrameworkRegressionAlgorithm.py:28 — Algorithm.Python/BaseFrameworkRegressionAlgorithm.py:28-37 | Algorithm.Python/PearsonCorrelationPairsTradingAlphaModelFrameworkAlgorithm.py:32-41 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.Python/BaseFrameworkRegressionAlgorithm.py: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.
  • Duplicated block (10 lines × 2) Algorithm.Python/BasicTemplateOptionsAlgorithm.py:47 — Algorithm.Python/BasicTemplateOptionsAlgorithm.py:47-56 | Algorithm.Python/BasicTemplateOptionsHourlyAlgorithm.py:47-56 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.Python/BasicTemplateOptionsAlgorithm.py:47` 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.Python/CustomConsolidatorRegressionAlgorithm.py:146 — Algorithm.Python/CustomConsolidatorRegressionAlgorithm.py:146-155 | Algorithm.Python/ManuallyRemovedConsolidatorsAlgorithm.py:88-97 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (10 lines × 2) Algorithm.Python/FutureOptionCallOTMExpiryRegressionAlgorithm.py:100 — Algorithm.Python/FutureOptionCallOTMExpiryRegressionAlgorithm.py:100-109 | Algorithm.Python/FutureOptionPutOTMExpiryRegressionAlgorithm.py:98-107 — before extracting anything, compare `Algorithm.Python/FutureOptionCallOTMExpiryRegressionAlgorithm.py` and `Algorithm.Python/FutureOptionPutOTMExpiryRegressionAlgorithm.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) Algorithm.Python/IndexOptionCallButterflyAlgorithm.py:52 — Algorithm.Python/IndexOptionCallButterflyAlgorithm.py:52-61 | Algorithm.Python/IndexOptionPutButterflyAlgorithm.py:52-61 — before extracting anything, compare `Algorithm.Python/IndexOptionCallButterflyAlgorithm.py` and `Algorithm.Python/IndexOptionPutButterflyAlgorithm.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) Algorithm.Python/MarketOnCloseOrderBufferExtendedMarketHoursRegressionAlgorithm.py:56 — Algorithm.Python/MarketOnCloseOrderBufferExtendedMarketHoursRegressionAlgorithm.py:56-65 | Algorithm.Python/MarketOnCloseOrderBufferRegressionAlgorithm.py:49-58 — before extracting anything, compare `Algorithm.Python/MarketOnCloseOrderBufferExtendedMarketHoursRegressionAlgorithm.py` and `Algorithm.Python/MarketOnCloseOrderBufferRegressionAlgorithm.py` as WHOLE FILES: 84% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
X18 · Disposal-pattern correctness · Disposable created and abandoned in the method that made it · ×15
  • Disposable created and abandoned in the method that made it Engine/DataFeeds/BaseDataExchange.cs:146 — `manualEvent` is a `ManualResetEventSlim`, which implements `IDisposable`, and it is created here (line 146). Every use of it in `Start` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var manualEvent = …;`), which releases it at the end of the scope on every path including a throw.
  • Disposable created and abandoned in the method that made it Engine/DataFeeds/DataDownloader/CanonicalDataDownloaderDecorator.cs:197 — `blockingCollection` is a `BlockingCollection`, which implements `IDisposable`, and it is created here (line 197). Every use of it in `GetContractsData` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var blockingCollection = …;`), which releases it at the end of the scope on every path including a throw.
  • Disposable created and abandoned in the method that made it Algorithm/QCAlgorithm.Python.cs:1920 — `testInstance` is a `CommandPythonWrapper`, which implements `IDisposable`, and it is created here (line 1920). Every use of it in `AddCommand` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var testInstance = …;`), which releases it at the end of the scope on every path including a throw.
  • Disposable created and abandoned in the method that made it Common/Extensions.cs:1898 — `writer` is a `StreamWriter`, which implements `IDisposable`, and it is created here (line 1898). Every use of it in `ToStream` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var writer = …;`), which releases it at the end of the scope on every path including a throw.
  • Disposable created and abandoned in the method that made it Messaging/StreamingMessageHandler.cs:117 — `tcpListener` is a `TcpListener`, which implements `IDisposable`, and it is created here (line 117). Every use of it in `CheckPort` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var tcpListener = …;`), which releases it at the end of the scope on every path including a throw.
  • Disposable created and abandoned in the method that made it Brokerages/BaseWebsocketsBrokerage.cs:221 — `resetEvent` is a `ManualResetEvent`, which implements `IDisposable`, and it is created here (line 221). Every use of it in `ConnectSync` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var resetEvent = …;`), which releases it at the end of the scope on every path including a throw.
  • Disposable created and abandoned in the method that made it Brokerages/BrokerageMultiWebSocketSubscriptionManager.cs:284 — `connectedEvent` is a `ManualResetEvent`, which implements `IDisposable`, and it is created here (line 284). Every use of it in `Connect` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var connectedEvent = …;`), which releases it at the end of the scope on every path including a throw.
  • Disposable created and abandoned in the method that made it Configuration/ApplicationParser.cs:27 — `application` is a `CommandLineApplication`, which implements `IDisposable`, and it is created here (line 27). Every use of it in `Parse` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var application = …;`), which releases it at the end of the scope on every path including a throw.
  • Disposable created and abandoned in the method that made it REDACTED:925 — `tarArchive` is a `TarArchive`, which implements `IDisposable`, and it is created here (line 925). Every use of it in `UnTarFiles` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var tarArchive = …;`), which releases it at the end of the scope on every path including a throw.
  • Disposable created and abandoned in the method that made it REDACTED:940 — `tarArchive` is a `TarArchive`, which implements `IDisposable`, and it is created here (line 940). Every use of it in `UnTarGzFiles` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var tarArchive = …;`), which releases it at the end of the scope on every path including a throw.
  • Disposable created and abandoned in the method that made it REDACTED:1063 — `process` is a `Process`, which implements `IDisposable`, and it is created here (line 1063). Every use of it in `Extract7ZipArchive` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var process = …;`), which releases it at the end of the scope on every path including a throw.
  • Disposable created and abandoned in the method that made it Research/QuantBook.cs:990 — `pyDict` is a `PyDict`, which implements `IDisposable`, and it is created here (line 990). Every use of it in `GetDictionaryFromSeries` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var pyDict = …;`), which releases it at the end of the scope on every path including a throw.
  • Disposable created and abandoned in the method that made it Report/PortfolioLooper/PortfolioLooper.cs:221 — `looper` is a `PortfolioLooper`, which implements `IDisposable`, and it is created here (line 221). Every use of it in `GetHistory` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var looper = …;`), which releases it at the end of the scope on every path including a throw.
  • Disposable created and abandoned in the method that made it Report/PortfolioLooper/PortfolioLooper.cs:310 — `looper` is a `PortfolioLooper`, which implements `IDisposable`, and it is created here (line 310). Every use of it in `FromOrders` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var looper = …;`), which releases it at the end of the scope on every path including a throw.
  • Disposable created and abandoned in the method that made it Report/Program.cs:140 — `process` is a `Process`, which implements `IDisposable`, and it is created here (line 140). Every use of it in `Main` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var process = …;`), which releases it at the end of the scope on every path including a throw.
D3 · God Classes · MethodTooLong · ×14
  • MethodTooLong: LeanData.GenerateLine Common/Util/LeanData.cs:90 — MethodTooLong — GenerateLine runs 257 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 157 over it, 2.57× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: AlgorithmManager.Run Engine/AlgorithmManager.cs:121 — MethodTooLong — Run runs 245 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 145 over it, 2.45× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Engine.Run Engine/Engine.cs:87 — MethodTooLong — Run runs 223 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 123 over it, 2.23× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Exchanges.GetPrimaryExchange Common/Global.cs:1012 — MethodTooLong — GetPrimaryExchange runs 169 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 69 over it, 1.69× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: RandomDataGeneratorSettings.FromCommandLineArguments ToolBox/RandomDataGenerator/RandomDataGeneratorSettings.cs:53 — MethodTooLong — FromCommandLineArguments runs 162 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 62 over it, 1.62× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: OptionStrategyPositionGroupBuyingPowerModel.GetMaintenanceMargin Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs:50 — MethodTooLong — GetMaintenanceMargin runs 148 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 48 over it, 1.48× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: TimeSliceFactory.Create Engine/DataFeeds/TimeSliceFactory.cs:89 — MethodTooLong — Create runs 144 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 44 over it, 1.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: RandomDataGenerator.Run ToolBox/RandomDataGenerator/RandomDataGenerator.cs:53 — MethodTooLong — Run runs 139 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 39 over it, 1.39× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: BrokerageTransactionHandler.HandleOrderEvents Engine/TransactionHandlers/BrokerageTransactionHandler.cs:1267 — MethodTooLong — HandleOrderEvents runs 136 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 36 over it, 1.36× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: QCAlgorithm.GetMatchingSubscriptions Algorithm/QCAlgorithm.History.cs:1194 — MethodTooLong — GetMatchingSubscriptions runs 108 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 8 over it, 1.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: LiveTradingResultHandler.Update Engine/Results/LiveTradingResultHandler.cs:161 — MethodTooLong — Update runs 108 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 8 over it, 1.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: EmaPortfolioRebalance100.Initialize Algorithm.CSharp/CapacityTests/EmaPortfolioRebalance100.cs:31 — MethodTooLong — Initialize runs 106 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 6 over it, 1.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: BrokerageSetupHandler.Setup Engine/Setup/BrokerageSetupHandler.cs:148 — MethodTooLong — Setup runs 105 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 5 over it, 1.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: SecurityService.CreateSecurity Common/Securities/SecurityService.cs:75 — MethodTooLong — CreateSecurity runs 104 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 4 over it, 1.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D4 · Code Duplication · Edited copy of a member (16 corresponding lines) · ×14
  • Edited copy of a member (16 corresponding lines) Algorithm.Python/HistoryWithDifferentContinuousContractDepthOffsetsRegressionAlgorithm.py:27 — Algorithm.Python/HistoryWithDifferentContinuousContractDepthOffsetsRegressionAlgorithm.py:27-43 | Algorithm.Python/HistoryWithDifferentDataMappingModeRegressionAlgorithm.py:27-42 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) Algorithm.Python/ETFConstituentUniverseCompositeDelistingRegressionAlgorithm.py:22 — Algorithm.Python/ETFConstituentUniverseCompositeDelistingRegressionAlgorithm.py:22-37 | Algorithm.Python/ETFConstituentUniverseCompositeDelistingRegressionAlgorithmNoAddEquityETF.py:22-37 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) Algorithm.Python/BlackLittermanPortfolioOptimizationFrameworkAlgorithm.py:35 — Algorithm.Python/BlackLittermanPortfolioOptimizationFrameworkAlgorithm.py:35-54 | Algorithm.Python/MeanVarianceOptimizationFrameworkAlgorithm.py:31-46 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) Algorithm.Python/Alphas/GreenblattMagicFormulaAlpha.py:78 — Algorithm.Python/Alphas/GreenblattMagicFormulaAlpha.py:78-93 | Algorithm.Python/Alphas/PriceGapMeanReversionAlpha.py:94-109 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) Algorithm.Python/BasicTemplateContinuousFutureAlgorithm.py:23 — Algorithm.Python/BasicTemplateContinuousFutureAlgorithm.py:23-38 | Algorithm.Python/BasicTemplateContinuousFutureWithExtendedMarketAlgorithm.py:23-39 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) Report/ReportElements/MaxDrawdownRecoveryReportElement.cs:47 — Report/ReportElements/MaxDrawdownRecoveryReportElement.cs:47-62 | Report/ReportElements/MaxDrawdownReportElement.cs:48-64 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) Algorithm.CSharp/OptionShortCallMarginCallEventsAlgorithm.cs:52 — Algorithm.CSharp/OptionShortCallMarginCallEventsAlgorithm.cs:52-67 | Algorithm.CSharp/OptionStrategyMarginCallEventsAlgorithm.cs:57-76 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) Engine/DataFeeds/Enumerators/LiveDelistingEventProvider.cs:35 — Engine/DataFeeds/Enumerators/LiveDelistingEventProvider.cs:35-52 | Engine/DataFeeds/Enumerators/LiveMappingEventProvider.cs:35-50 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) Common/Scheduling/DateRules.cs:440 — Common/Scheduling/DateRules.cs:440-455 | Common/Scheduling/DateRules.cs:494-509 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) Algorithm.CSharp/BybitCryptoRegressionAlgorithm.cs:39 — Algorithm.CSharp/BybitCryptoRegressionAlgorithm.cs:39-61 | Algorithm.CSharp/BybitCustomDataCryptoRegressionAlgorithm.cs:38-53 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) Algorithm.CSharp/BasicTemplateSPXWeeklyIndexOptionsAlgorithm.cs:41 — Algorithm.CSharp/BasicTemplateSPXWeeklyIndexOptionsAlgorithm.cs:41-58 | Algorithm.CSharp/BasicTemplateSPXWeeklyIndexOptionsStrategyAlgorithm.cs:42-57 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) Engine/DataFeeds/CachingFutureChainProvider.cs:48 — Engine/DataFeeds/CachingFutureChainProvider.cs:48-63 | Engine/DataFeeds/CachingOptionChainProvider.cs:49-64 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) Algorithm.CSharp/UpdateOrderLiveTestAlgorithm.cs:163 — Algorithm.CSharp/UpdateOrderLiveTestAlgorithm.cs:163-178 | Algorithm.CSharp/UpdateOrderRegressionAlgorithm.cs:148-178 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) Common/Data/Consolidators/RenkoConsolidator.cs:254 — Common/Data/Consolidators/RenkoConsolidator.cs:254-269 | Common/Data/Consolidators/RenkoConsolidator.cs:272-287 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (6 corresponding lines) · ×14
  • Edited copy of a member (6 corresponding lines) Algorithm/QCAlgorithm.Indicators.cs:1310 — Algorithm/QCAlgorithm.Indicators.cs:1310-1315 | Algorithm/QCAlgorithm.Indicators.cs:2181-2187 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) Algorithm.Python/ScheduledUniverseSelectionModelRegressionAlgorithm.py:104 — Algorithm.Python/ScheduledUniverseSelectionModelRegressionAlgorithm.py:104-109 | Algorithm.Python/ScheduledUniverseSelectionModelRegressionAlgorithm.py:112-117 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) Optimizer/Analysis/OptimizationAnalyzer.cs:86 — Optimizer/Analysis/OptimizationAnalyzer.cs:86-92 | Optimizer/Analysis/OptimizationClustering.cs:252-257 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) Indicators/CandlestickPatterns/AdvanceBlock.cs:59 — Indicators/CandlestickPatterns/AdvanceBlock.cs:59-65 | Indicators/CandlestickPatterns/ThreeWhiteSoldiers.cs:57-62 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) Algorithm.Python/OptionChainProviderAlgorithm.py:29 — Algorithm.Python/OptionChainProviderAlgorithm.py:29-37 | Algorithm.Python/CustomVolatilityModelAlgorithm.py:25-30 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) Indicators/TripleExponentialMovingAverage.cs:40 — Indicators/TripleExponentialMovingAverage.cs:40-45 | Indicators/Trix.cs:38-44 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) Algorithm.CSharp/CoarseFineFundamentalComboAlgorithm.cs:58 — Algorithm.CSharp/CoarseFineFundamentalComboAlgorithm.cs:58-69 | Algorithm.CSharp/ScheduledQueuingAlgorithm.cs:62-67 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) Algorithm.CSharp/CoarseFineFundamentalComboAlgorithm.cs:73 — Algorithm.CSharp/CoarseFineFundamentalComboAlgorithm.cs:73-82 | Algorithm.CSharp/ScheduledQueuingAlgorithm.cs:70-75 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) Algorithm.Python/ObjectStoreHelpersRegressionAlgorithm.py:26 — Algorithm.Python/ObjectStoreHelpersRegressionAlgorithm.py:26-31 | Algorithm.Python/ObjectStoreKeySanitizationRegressionAlgorithm.py:23-28 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) Algorithm.Python/SmaCrossUniverseSelectionAlgorithm.py:78 — Algorithm.Python/SmaCrossUniverseSelectionAlgorithm.py:78-83 | Algorithm.Python/UserDefinedUniverseAlgorithm.py:40-45 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) Engine/DataFeeds/DataManager.cs:590 — Engine/DataFeeds/DataManager.cs:590-595 | Common/Data/SubscriptionManager.cs:154-159 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) Algorithm.Python/OnWarmupFinishedNoWarmup.py:21 — Algorithm.Python/OnWarmupFinishedNoWarmup.py:21-26 | Algorithm.Python/SliceGetByTypeRegressionAlgorithm.py:23-29 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) Indicators/MidPoint.cs:67 — Indicators/MidPoint.cs:67-72 | Indicators/MidPrice.cs:69-74 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) Algorithm.Framework/Selection/QC500UniverseSelectionModel.py:24 — Algorithm.Framework/Selection/QC500UniverseSelectionModel.py:24-29 | Algorithm.Python/Alphas/GreenblattMagicFormulaAlpha.py:136-147 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×14
  • Duplicated block (15 lines × 2) Indicators/ImpliedVolatility.cs:168 — Indicators/ImpliedVolatility.cs:168-182 | Indicators/ImpliedVolatility.cs:199-213 — both copies are in the same file, so extract the 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/ImpliedVolatility.cs:168` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (15 lines × 2) Indicators/CandlestickPatterns/Hammer.cs:119 — Indicators/CandlestickPatterns/Hammer.cs:119-133 | Indicators/CandlestickPatterns/InvertedHammer.cs:111-125 — before extracting anything, compare `Indicators/CandlestickPatterns/Hammer.cs` and `Indicators/CandlestickPatterns/InvertedHammer.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/Hammer.cs:119` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Indicators/CandlestickPatterns/Hammer.cs:136` calls `GetCandleRange` and `Indicators/CandlestickPatterns/InvertedHammer.cs:128` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (15 lines × 2) Indicators/CandlestickPatterns/HangingMan.cs:119 — Indicators/CandlestickPatterns/HangingMan.cs:119-133 | Indicators/CandlestickPatterns/ShootingStar.cs:112-126 — before extracting anything, compare `Indicators/CandlestickPatterns/HangingMan.cs` and `Indicators/CandlestickPatterns/ShootingStar.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/HangingMan.cs:119` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Indicators/CandlestickPatterns/HangingMan.cs:136` calls `GetCandleRange` and `Indicators/CandlestickPatterns/ShootingStar.cs:129` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (15 lines × 2) Algorithm.CSharp/IndexOptionShortCallITMExpiryRegressionAlgorithm.cs:46 — Algorithm.CSharp/IndexOptionShortCallITMExpiryRegressionAlgorithm.cs:46-60 | Algorithm.CSharp/IndexOptionShortPutITMExpiryRegressionAlgorithm.cs:45-59 — before extracting anything, compare `Algorithm.CSharp/IndexOptionShortCallITMExpiryRegressionAlgorithm.cs` and `Algorithm.CSharp/IndexOptionShortPutITMExpiryRegressionAlgorithm.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 2) Algorithm.CSharp/OptionChainConsistencyRegressionAlgorithm.cs:41 — Algorithm.CSharp/OptionChainConsistencyRegressionAlgorithm.cs:41-55 | Algorithm.CSharp/OptionExerciseAssignRegressionAlgorithm.cs:41-55 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (15 lines × 2) Algorithm.CSharp/OptionEquityPutButterflyRegressionAlgorithm.cs:37 — Algorithm.CSharp/OptionEquityPutButterflyRegressionAlgorithm.cs:37-51 | Algorithm.CSharp/OptionEquityShortButterflyPutRegressionAlgorithm.cs:37-51 — before extracting anything, compare `Algorithm.CSharp/OptionEquityPutButterflyRegressionAlgorithm.cs` and `Algorithm.CSharp/OptionEquityShortButterflyPutRegressionAlgorithm.cs` as WHOLE FILES: 85% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/OptionEquityPutButterflyRegressionAlgorithm.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 (15 lines × 2) Api/Api.cs:488 — Api/Api.cs:488-502 | Api/Api.cs:858-872 — both copies are in the same file, so extract the 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 `Api/Api.cs:488` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (15 lines × 2) Algorithm.CSharp/ContinuousBackMonthRawFutureRegressionAlgorithm.cs:57 — Algorithm.CSharp/ContinuousBackMonthRawFutureRegressionAlgorithm.cs:57-72 | Algorithm.CSharp/ContinuousFutureBackMonthRegressionAlgorithm.cs:71-85 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/ContinuousBackMonthRawFutureRegressionAlgorithm.cs:57` 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 (15 lines × 2) Algorithm.CSharp/PortfolioRebalanceOnInsightChangesRegressionAlgorithm.cs:63 — Algorithm.CSharp/PortfolioRebalanceOnInsightChangesRegressionAlgorithm.cs:63-77 | Algorithm.CSharp/PortfolioRebalanceOnSecurityChangesRegressionAlgorithm.cs:72-86 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (15 lines × 2) Algorithm.Python/CustomDataUniverseRegressionAlgorithm.py:33 — Algorithm.Python/CustomDataUniverseRegressionAlgorithm.py:33-47 | Algorithm.Python/CustomDataUniverseScheduledRegressionAlgorithm.py:35-49 — before extracting anything, compare `Algorithm.Python/CustomDataUniverseRegressionAlgorithm.py` and `Algorithm.Python/CustomDataUniverseScheduledRegressionAlgorithm.py` as WHOLE FILES: 82% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 2) Algorithm.Python/CustomDataUniverseRegressionAlgorithm.py:90 — Algorithm.Python/CustomDataUniverseRegressionAlgorithm.py:90-104 | Algorithm.Python/CustomDataUniverseScheduledRegressionAlgorithm.py:79-93 — before extracting anything, compare `Algorithm.Python/CustomDataUniverseRegressionAlgorithm.py` and `Algorithm.Python/CustomDataUniverseScheduledRegressionAlgorithm.py` as WHOLE FILES: 82% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (15 lines × 2) Algorithm.Python/IndexOptionCallOTMExpiryRegressionAlgorithm.py:77 — Algorithm.Python/IndexOptionCallOTMExpiryRegressionAlgorithm.py:77-91 | Algorithm.Python/IndexOptionPutOTMExpiryRegressionAlgorithm.py:77-91 — before extracting anything, compare `Algorithm.Python/IndexOptionCallOTMExpiryRegressionAlgorithm.py` and `Algorithm.Python/IndexOptionPutOTMExpiryRegressionAlgorithm.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15 lines × 2) Algorithm.Python/IndexOptionShortCallOTMExpiryRegressionAlgorithm.py:61 — Algorithm.Python/IndexOptionShortCallOTMExpiryRegressionAlgorithm.py:61-75 | Algorithm.Python/IndexOptionShortPutOTMExpiryRegressionAlgorithm.py:61-75 — before extracting anything, compare `Algorithm.Python/IndexOptionShortCallOTMExpiryRegressionAlgorithm.py` and `Algorithm.Python/IndexOptionShortPutOTMExpiryRegressionAlgorithm.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15 lines × 2) Report/ReportCharts.py:691 — Report/ReportCharts.py:691-705 | Report/ReportCharts.py:785-799 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Edited copy of a member (14 corresponding lines) · ×13
  • Edited copy of a member (14 corresponding lines) Algorithm.Python/LongAndShortCallCalendarSpreadStrategiesAlgorithm.py:30 — Algorithm.Python/LongAndShortCallCalendarSpreadStrategiesAlgorithm.py:30-43 | Algorithm.Python/LongAndShortPutCalendarSpreadStrategiesAlgorithm.py:30-43 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs:600 — Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs:600-613 | Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs:619-634 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) Algorithm.Python/BybitCryptoRegressionAlgorithm.py:22 — Algorithm.Python/BybitCryptoRegressionAlgorithm.py:22-46 | Algorithm.Python/BybitCustomDataCryptoRegressionAlgorithm.py:24-37 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) Algorithm.CSharp/BasicTemplateFuturesFrameworkAlgorithm.cs:37 — Algorithm.CSharp/BasicTemplateFuturesFrameworkAlgorithm.cs:37-51 | Algorithm.CSharp/BasicTemplateOptionsFrameworkAlgorithm.cs:35-48 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) Algorithm.CSharp/BasicTemplateOptionsDailyAlgorithm.cs:42 — Algorithm.CSharp/BasicTemplateOptionsDailyAlgorithm.cs:42-55 | Algorithm.CSharp/BasicTemplateOptionsHourlyAlgorithm.cs:41-59 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) Algorithm.Framework/Selection/QC500UniverseSelectionModel.py:32 — Algorithm.Framework/Selection/QC500UniverseSelectionModel.py:32-50 | Algorithm.Python/Alphas/GreenblattMagicFormulaAlpha.py:150-163 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) Common/Securities/SecurityTransactionManager.cs:253 — Common/Securities/SecurityTransactionManager.cs:253-266 | Common/Securities/SecurityTransactionManager.cs:275-288 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) Algorithm.Python/ParameterizedAlgorithm.py:24 — Algorithm.Python/ParameterizedAlgorithm.py:24-37 | Algorithm.Python/WarmupAlgorithm.py:26-41 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) Brokerages/BrokerageMultiWebSocketSubscriptionManager.cs:137 — Brokerages/BrokerageMultiWebSocketSubscriptionManager.cs:137-150 | Brokerages/BrokerageMultiWebSocketSubscriptionManager.cs:158-175 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) Common/Time.cs:210 — Common/Time.cs:210-223 | Common/Time.cs:251-267 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) Algorithm.CSharp/UpdateOrderLiveTestAlgorithm.cs:67 — Algorithm.CSharp/UpdateOrderLiveTestAlgorithm.cs:67-80 | Algorithm.CSharp/UpdateOrderRegressionAlgorithm.cs:58-71 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) Algorithm.CSharp/CapacityTests/BeastVsPenny.cs:29 — Algorithm.CSharp/CapacityTests/BeastVsPenny.cs:29-42 | Algorithm.CSharp/CapacityTests/SpyBondPortfolioRebalance.cs:30-43 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) Algorithm.CSharp/RegressionTests/Universes/ETFConstituentUniverseFrameworkRegressionAlgorithm.cs:40 — Algorithm.CSharp/RegressionTests/Universes/ETFConstituentUniverseFrameworkRegressionAlgorithm.cs:40-53 | Algorithm.CSharp/RegressionTests/Universes/ETFConstituentUniverseRSIAlphaModelAlgorithm.cs:40-56 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D3 · God Classes · FileTooLong · ×12
  • FileTooLong: Algorithm/QCAlgorithm.Indicators.cs Algorithm/QCAlgorithm.Indicators.cs — FileTooLong — 1537 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1037 over it, 3.07× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: Algorithm/QCAlgorithm.cs Algorithm/QCAlgorithm.cs — FileTooLong — 1414 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 914 over it, 2.83× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: TransactionHandlers/BrokerageTransactionHandler.cs Engine/TransactionHandlers/BrokerageTransactionHandler.cs — FileTooLong — 988 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 488 over it, 1.98× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: Report/ReportCharts.py Report/ReportCharts.py — FileTooLong — 890 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 390 over it, 1.78× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: Util/LeanData.cs Common/Util/LeanData.cs — FileTooLong — 824 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 324 over it, 1.65× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: Algorithm/QCAlgorithm.Python.cs Algorithm/QCAlgorithm.Python.cs — FileTooLong — 731 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 231 over it, 1.46× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: Algorithm/QCAlgorithm.History.cs Algorithm/QCAlgorithm.History.cs — FileTooLong — 696 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 196 over it, 1.39× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: Results/LiveTradingResultHandler.cs Engine/Results/LiveTradingResultHandler.cs — FileTooLong — 603 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 103 over it, 1.21× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: Api/Api.cs Api/Api.cs — FileTooLong — 555 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 55 over it, 1.11× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: Results/BaseResultsHandler.cs Engine/Results/BaseResultsHandler.cs — FileTooLong — 538 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 38 over it, 1.08× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: Fills/FillModel.cs Common/Orders/Fills/FillModel.cs — FileTooLong — 532 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 32 over it, 1.06× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: Research/QuantBook.cs Research/QuantBook.cs — FileTooLong — 510 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 10 over it, 1.02× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
D29 · Static Analysis (SAST) · REDACTED · ×11
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
PF3 · Async & latency hygiene · Sync-over-async blocking · ×11
  • Sync-over-async blocking — 10 blocking call(s) on async work (.Wait()/.GetAwaiter().GetResult()) — these waste a thread and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
  • Sync-over-async blocking Engine/DataFeeds/BaseDataExchange.cs:155 — `manualEvent.Wait()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
  • Sync-over-async blocking Engine/DataFeeds/LiveSynchronizer.cs:112 — `_newLiveDataEmitted.Wait()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
  • Sync-over-async blocking Common/Data/LeanDataWriter.cs:184 — `task.Wait()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
  • Sync-over-async blocking Common/Extensions.cs:3464 — `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
  • Sync-over-async blocking Common/Extensions.cs:3474 — `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
  • Sync-over-async blocking Common/Extensions.cs:3498 — `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
  • Sync-over-async blocking Common/Extensions.cs:3512 — `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
  • Sync-over-async blocking Brokerages/BrokerageConcurrentMessageHandler.cs:110 — `_messagesProcessedEvent.Wait()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
  • Sync-over-async blocking REDACTED:245 — `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
  • Sync-over-async blocking REDACTED:303 — `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
AX2 · Stateful singletons · Stateful shared instance · ×10
  • Stateful shared instance: AlgorithmManager Engine/AlgorithmManager.cs:47 — `AlgorithmManager` is not registered, but `Program` creates it and keeps it in the static `algorithmManager`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_algorithm, _performanceTrackingTool, _cancellationTokenSource, AlgorithmId; e.g. `_algorithm` at line 125).
  • Stateful shared instance: CpuPerformance Common/OS.cs:173 — `CpuPerformance` is not registered, but `OS` creates it and keeps it in the static `CpuPerformanceCounter`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (CpuPercentage; e.g. `CpuPercentage` at line 217).
  • Stateful shared instance: SecurityIdentifier Common/SecurityIdentifier.cs:39 — `SecurityIdentifier` keeps one instance of itself in the static `Empty`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_date, _market, _strikePrice, _optionRight, _optionStyle, _hashCode; e.g. `_date` at line 179).
  • Stateful shared instance: Symbol Common/Symbol.cs:31 — `Symbol` keeps one instance of itself in the static `Empty`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_canonical, _isEmpty; e.g. `_canonical` at line 343).
  • Stateful shared instance: OptionPriceModelResultData Common/Data/Market/OptionContract.cs:260 — `OptionPriceModelResultData` keeps one instance of itself in the static `Null`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_tradeBar, _quoteBar, _openInterest, _underlying; e.g. `_tradeBar` at line 309).
  • Stateful shared instance: OptionPositionCollection Common/Securities/Option/StrategyMatcher/OptionPositionCollection.cs:29 — `OptionPositionCollection` keeps one instance of itself in the static `Empty`, so that one instance serves the whole process and is shared by every thread that reaches it — and it mutates instance state outside any lock (_orderedPositions; e.g. `_orderedPositions` at line 578).
  • Stateful shared instance: WeightedWorkQueue Engine/DataFeeds/WorkScheduling/WeightedWorkQueue.cs:25 — `WeightedWorkQueue` is not registered, but the singleton `WeightedWorkScheduler` creates it and keeps it in `_workerQueues`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (_singleCallWork, _workQueue, _removed, _pointer; e.g. `_singleCallWork` at line 79).
  • Stateful shared instance: WorkItem Engine/DataFeeds/WorkScheduling/WorkItem.cs:25 — `WorkItem` is not registered, but the singleton `WeightedWorkScheduler` creates it and keeps it in `_newWork`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (Weight; e.g. `Weight` at line 60).
  • Stateful shared instance: PerformanceTrackingTool Common/Util/PerformanceTrackingTool.cs:26 — `PerformanceTrackingTool` is not registered, but `Engine` creates it and hands it to the singleton `AlgorithmManager`, which keeps it in `_performanceTrackingTool`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (_algorithm, _sampleEnabled, _onData, _dataSubscription, _schedule, _selection; e.g. `_algorithm` at line 79).
  • Stateful shared instance: PerformanceTimer Common/Util/PerformanceTimer.cs:26 — `PerformanceTimer` is not registered, but the singleton `PerformanceTrackingTool` creates it and keeps it in `_onData`, so one instance outlives every request and is shared by every caller that reaches it — and it mutates instance state outside any lock (_start, _currentTicks, _totalSeconds; e.g. `_start` at line 36).
D4 · Code Duplication · Edited copy of a member (17 corresponding lines) · ×10
  • Edited copy of a member (17 corresponding lines) Algorithm.CSharp/FutureContractsExtendedMarketHoursRegressionAlgorithm.cs:51 — Algorithm.CSharp/FutureContractsExtendedMarketHoursRegressionAlgorithm.cs:51-68 | Algorithm.CSharp/FuturesExtendedMarketHoursRegressionAlgorithm.cs:51-78 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) Algorithm.Python/FutureOptionCallITMExpiryRegressionAlgorithm.py:69 — Algorithm.Python/FutureOptionCallITMExpiryRegressionAlgorithm.py:69-85 | Algorithm.Python/FutureOptionPutITMExpiryRegressionAlgorithm.py:68-84 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) Algorithm.CSharp/AddAndRemoveOptionContractRegressionAlgorithm.cs:34 — Algorithm.CSharp/AddAndRemoveOptionContractRegressionAlgorithm.cs:34-50 | Algorithm.CSharp/SecuritySessionWithOptionRegressionAlgorithm.cs:31-51 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) Algorithm.Python/FutureOptionChainFullDataRegressionAlgorithm.py:23 — Algorithm.Python/FutureOptionChainFullDataRegressionAlgorithm.py:23-39 | Algorithm.Python/FuturesChainFullDataRegressionAlgorithm.py:23-42 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) Common/Securities/Positions/SecurityPositionGroupBuyingPowerModel.cs:99 — Common/Securities/Positions/SecurityPositionGroupBuyingPowerModel.cs:99-115 | Common/Securities/Positions/SecurityPositionGroupBuyingPowerModel.cs:127-145 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) Algorithm.Python/ImmediateExecutionModelWorksWithBinanceFeeModel.py:29 — Algorithm.Python/ImmediateExecutionModelWorksWithBinanceFeeModel.py:29-46 | Algorithm.Python/PortfolioTargetTagsRegressionAlgorithm.py:23-39 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) Common/Orders/Fills/FillModel.cs:137 — Common/Orders/Fills/FillModel.cs:137-153 | Common/Orders/Fills/FillModel.cs:245-265 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) Engine/DataFeeds/Enumerators/LiveFillForwardEnumerator.cs:182 — Engine/DataFeeds/Enumerators/LiveFillForwardEnumerator.cs:182-198 | Common/Extensions.cs:2258-2275 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) Common/Algorithm/Framework/Alphas/InsightCollection.cs:260 — Common/Algorithm/Framework/Alphas/InsightCollection.cs:260-276 | Common/Algorithm/Framework/Alphas/InsightCollection.cs:302-322 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) Common/Brokerages/SamcoBrokerageModel.cs:68 — Common/Brokerages/SamcoBrokerageModel.cs:68-84 | Common/Brokerages/ZerodhaBrokerageModel.cs:70-86 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (23 corresponding lines) · ×10
  • Edited copy of a member (23 corresponding lines) Algorithm/Execution/ImmediateExecutionModel.cs:46 — Algorithm/Execution/ImmediateExecutionModel.cs:46-75 | Algorithm.CSharp/ExecutionModelOrderEventsRegressionAlgorithm.cs:90-112 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) Algorithm.Framework/Execution/StandardDeviationExecutionModel.cs:119 — Algorithm.Framework/Execution/StandardDeviationExecutionModel.cs:119-142 | Algorithm.Framework/Execution/VolumeWeightedAveragePriceExecutionModel.cs:105-127 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) Algorithm.CSharp/OptionChainConsistencyRegressionAlgorithm.cs:62 — Algorithm.CSharp/OptionChainConsistencyRegressionAlgorithm.cs:62-96 | Algorithm.CSharp/OptionExerciseAssignRegressionAlgorithm.cs:70-92 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) Common/Securities/Option/StrategyMatcher/OptionPositionCollection.cs:368 — Common/Securities/Option/StrategyMatcher/OptionPositionCollection.cs:368-390 | Common/Securities/Option/StrategyMatcher/OptionPositionCollection.cs:397-420 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) Algorithm.CSharp/CoarseFundamentalTop3Algorithm.cs:72 — Algorithm.CSharp/CoarseFundamentalTop3Algorithm.cs:72-94 | Algorithm.CSharp/WarmupSelectionRegressionAlgorithm.cs:88-113 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) Indicators/PivotPointsHighLow.cs:128 — Indicators/PivotPointsHighLow.cs:128-150 | Indicators/PivotPointsHighLow.cs:159-183 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) Algorithm.Framework/Risk/MaximumDrawdownPercentPerSecurity.cs:49 — Algorithm.Framework/Risk/MaximumDrawdownPercentPerSecurity.cs:49-71 | Algorithm.Framework/Risk/MaximumUnrealizedProfitPercentPerSecurity.cs:49-71 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) Common/Securities/Future/FutureMarginModel.cs:152 — Common/Securities/Future/FutureMarginModel.cs:152-174 | Common/Securities/Future/FutureMarginModel.cs:180-203 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) Common/Data/Consolidators/BaseDataConsolidator.cs:91 — Common/Data/Consolidators/BaseDataConsolidator.cs:91-113 | Common/Data/Consolidators/TradeBarConsolidator.cs:96-120 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) Algorithm.CSharp/StopLimitOrderRegressionAlgorithm.cs:91 — Algorithm.CSharp/StopLimitOrderRegressionAlgorithm.cs:91-124 | Algorithm.CSharp/TrailingStopOrderRegressionAlgorithm.cs:107-129 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (36 corresponding lines) · ×9
  • Edited copy of a member (36 corresponding lines) Indicators/CandlestickPatterns/ClosingMarubozu.cs:73 — Indicators/CandlestickPatterns/ClosingMarubozu.cs:73-119 | Indicators/CandlestickPatterns/Marubozu.cs:73-108 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) Algorithm.CSharp/BasicTemplateContinuousFutureAlgorithm.cs:65 — Algorithm.CSharp/BasicTemplateContinuousFutureAlgorithm.cs:65-100 | Algorithm.CSharp/BasicTemplateContinuousFutureWithExtendedMarketAlgorithm.cs:67-111 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) Algorithm.Framework/Portfolio/MeanVarianceOptimizationPortfolioConstructionModel.cs:296 — Algorithm.Framework/Portfolio/MeanVarianceOptimizationPortfolioConstructionModel.cs:296-331 | Algorithm.Framework/Portfolio/RiskParityPortfolioConstructionModel.cs:228-263 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) Indicators/CandlestickPatterns/DragonflyDoji.cs:75 — Indicators/CandlestickPatterns/DragonflyDoji.cs:75-110 | Indicators/CandlestickPatterns/GravestoneDoji.cs:75-110 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) Indicators/CandlestickPatterns/LongLineCandle.cs:73 — Indicators/CandlestickPatterns/LongLineCandle.cs:73-108 | Indicators/CandlestickPatterns/ShortLineCandle.cs:74-109 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) Indicators/CandlestickPatterns/HighWaveCandle.cs:74 — Indicators/CandlestickPatterns/HighWaveCandle.cs:74-109 | Indicators/CandlestickPatterns/Takuri.cs:79-122 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) Algorithm.CSharp/SetAccountCurrencyCashBuyingPowerModelRegressionAlgorithm.cs:81 — Algorithm.CSharp/SetAccountCurrencyCashBuyingPowerModelRegressionAlgorithm.cs:81-127 | Algorithm.CSharp/SetAccountCurrencySecurityMarginModelRegressionAlgorithm.cs:64-99 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) Common/Orders/ContingentOrderExtensions.cs:119 — Common/Orders/ContingentOrderExtensions.cs:119-163 | Common/Orders/GroupOrderExtensions.cs:40-75 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) Algorithm.Framework/Execution/StandardDeviationExecutionModel.cs:76 — Algorithm.Framework/Execution/StandardDeviationExecutionModel.cs:76-111 | Algorithm.Framework/Execution/VolumeWeightedAveragePriceExecutionModel.cs:60-97 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (19 corresponding lines) · ×9
  • Edited copy of a member (19 corresponding lines) Algorithm.Python/LongAndShortButterflyCallStrategiesAlgorithm.py:30 — Algorithm.Python/LongAndShortButterflyCallStrategiesAlgorithm.py:30-48 | Algorithm.Python/LongAndShortButterflyPutStrategiesAlgorithm.py:30-48 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) Algorithm.Python/BaseFrameworkRegressionAlgorithm.py:22 — Algorithm.Python/BaseFrameworkRegressionAlgorithm.py:22-43 | Algorithm.Python/PearsonCorrelationPairsTradingAlphaModelFrameworkAlgorithm.py:29-47 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) Algorithm.Python/PortfolioRebalanceOnCustomFuncRegressionAlgorithm.py:22 — Algorithm.Python/PortfolioRebalanceOnCustomFuncRegressionAlgorithm.py:22-40 | Algorithm.Python/PortfolioRebalanceOnDateRulesRegressionAlgorithm.py:22-43 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) Algorithm.CSharp/CustomDataUsingMapFileRegressionAlgorithm.cs:65 — Algorithm.CSharp/CustomDataUsingMapFileRegressionAlgorithm.cs:65-92 | Algorithm.CSharp/IndiaDataRegressionAlgorithm.cs:100-118 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) Algorithm.CSharp/AdjustedVolumeRegressionAlgorithm.cs:42 — Algorithm.CSharp/AdjustedVolumeRegressionAlgorithm.cs:42-60 | Algorithm.CSharp/RawDataRegressionAlgorithm.cs:41-63 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) Algorithm.Framework/Selection/FutureUniverseSelectionModel.py:40 — Algorithm.Framework/Selection/FutureUniverseSelectionModel.py:40-59 | Algorithm.Framework/Selection/OptionUniverseSelectionModel.py:39-57 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) Algorithm.CSharp/FutureOptionChainFullDataRegressionAlgorithm.cs:35 — Algorithm.CSharp/FutureOptionChainFullDataRegressionAlgorithm.cs:35-53 | Algorithm.CSharp/FuturesChainFullDataRegressionAlgorithm.cs:35-59 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) Algorithm.CSharp/ZeroDTEIndexOptionsRegressionAlgorithm.cs:29 — Algorithm.CSharp/ZeroDTEIndexOptionsRegressionAlgorithm.cs:29-47 | Algorithm.CSharp/ZeroDTEOptionsRegressionAlgorithm.cs:42-66 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) Engine/RealTime/BacktestingRealTimeHandler.cs:101 — Engine/RealTime/BacktestingRealTimeHandler.cs:101-119 | Engine/RealTime/BacktestingRealTimeHandler.cs:126-149 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
GD1 · Unfinished & placeholder code · Unfinished stub · ×9
  • Unfinished stub — throws NotImplementedException Common/Data/UniverseSelection/BaseFundamentalDataProvider.cs:58 — A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException Common/DefaultConverter.cs:55 — A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException Common/Util/NullStringValueConverter.cs:35 — A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException Common/Util/NullStringValueConverter.cs:66 — A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException Algorithm.Framework/Portfolio/AlphaStreamsPortfolioConstructionModel.cs:32 — A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException Algorithm.Framework/Portfolio/AlphaStreamsPortfolioConstructionModel.cs:42 — A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException Algorithm.Framework/Portfolio/AlphaStreamsPortfolioConstructionModel.cs:53 — A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException Report/NullResultValueTypeJsonConverter.cs:114 — A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException Report/OrderTypeNormalizingJsonConverter.cs:74 — A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
D4 · Code Duplication · Edited copy of a member (24 corresponding lines) · ×8
  • Edited copy of a member (24 corresponding lines) Algorithm/QCAlgorithm.Python.cs:1041 — Algorithm/QCAlgorithm.Python.cs:1041-1064 | Algorithm/QCAlgorithm.Python.cs:1115-1138 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) Indicators/CandlestickPatterns/Engulfing.cs:66 — Indicators/CandlestickPatterns/Engulfing.cs:66-89 | Indicators/CandlestickPatterns/ThreeOutside.cs:67-96 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) Common/Scheduling/TimeRules.cs:211 — Common/Scheduling/TimeRules.cs:211-238 | Common/Scheduling/TimeRules.cs:329-352 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) Algorithm.CSharp/LongAndShortCallCalendarSpreadStrategiesAlgorithm.cs:61 — Algorithm.CSharp/LongAndShortCallCalendarSpreadStrategiesAlgorithm.cs:61-84 | Algorithm.CSharp/LongAndShortPutCalendarSpreadStrategiesAlgorithm.cs:61-84 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) Api/Api.cs:477 — Api/Api.cs:477-502 | Api/Api.cs:849-872 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) Algorithm.Python/Alphas/ContingentClaimsAnalysisDefaultPredictionAlpha.py:49 — Algorithm.Python/Alphas/ContingentClaimsAnalysisDefaultPredictionAlpha.py:49-72 | Algorithm.Python/Alphas/PriceGapMeanReversionAlpha.py:29-52 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) Common/Securities/Option/OptionStrategies.cs:47 — Common/Securities/Option/OptionStrategies.cs:47-70 | Common/Securities/Option/OptionStrategies.cs:93-116 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) Algorithm.CSharp/MarketOnCloseOrderFillsOnCloseTradeWithTickResolutionAlgorithm.cs:46 — Algorithm.CSharp/MarketOnCloseOrderFillsOnCloseTradeWithTickResolutionAlgorithm.cs:46-69 | Algorithm.CSharp/MarketOnOpenOrderFillsOnOpenTradeWithTickResolutionAlgorithm.cs:46-69 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (21 corresponding lines) · ×8
  • Edited copy of a member (21 corresponding lines) Algorithm.CSharp/OptionAssignmentRegressionAlgorithm.cs:45 — Algorithm.CSharp/OptionAssignmentRegressionAlgorithm.cs:45-65 | Algorithm.CSharp/OptionAssignmentStatisticsRegressionAlgorithm.cs:44-67 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) Algorithm.Python/BasicTemplateFuturesAlgorithm.py:27 — Algorithm.Python/BasicTemplateFuturesAlgorithm.py:27-47 | Algorithm.Python/BasicTemplateFuturesWithExtendedMarketAlgorithm.py:27-47 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) Algorithm.Python/BasicTemplateIndexAlgorithm.py:18 — Algorithm.Python/BasicTemplateIndexAlgorithm.py:18-38 | Algorithm.Python/BasicTemplateIndexDailyAlgorithm.py:19-44 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) Algorithm.CSharp/PortfolioRebalanceOnInsightChangesRegressionAlgorithm.cs:39 — Algorithm.CSharp/PortfolioRebalanceOnInsightChangesRegressionAlgorithm.cs:39-59 | Algorithm.CSharp/PortfolioRebalanceOnSecurityChangesRegressionAlgorithm.cs:41-68 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) Algorithm.CSharp/CustomDataUniverseRegressionAlgorithm.cs:44 — Algorithm.CSharp/CustomDataUniverseRegressionAlgorithm.cs:44-64 | Algorithm.CSharp/CustomDataUniverseScheduledRegressionAlgorithm.cs:41-65 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) Common/Extensions.cs:747 — Common/Extensions.cs:747-774 | Common/Extensions.cs:783-803 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) Engine/HistoricalData/BrokerageHistoryProvider.cs:69 — Engine/HistoricalData/BrokerageHistoryProvider.cs:69-89 | Engine/HistoricalData/MappedSynchronizingHistoryProvider.cs:53-76 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) Algorithm.CSharp/BasicTemplateIndexAlgorithm.cs:74 — Algorithm.CSharp/BasicTemplateIndexAlgorithm.cs:74-94 | Algorithm.CSharp/BasicTemplateIndiaIndexAlgorithm.cs:66-89 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×8
  • Duplicated block (21 lines × 2) Common/Orders/Fees/BinanceFeeModel.cs:70 — Common/Orders/Fees/BinanceFeeModel.cs:70-90 | Common/Orders/Fees/BitfinexFeeModel.cs:62-82 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Common/Orders/Fees/BinanceFeeModel.cs:70` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (21 lines × 2) Common/Data/Market/QuoteBar.cs:304 — Common/Data/Market/QuoteBar.cs:304-324 | Common/Data/Market/QuoteBar.cs:353-373 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Common/Data/Market/QuoteBar.cs:304` 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 (21 lines × 2) Common/Securities/SecurityExchangeHours.cs:454 — Common/Securities/SecurityExchangeHours.cs:454-474 | Common/Securities/SecurityExchangeHours.cs:527-547 — both copies are in the same file, so extract the 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/Securities/SecurityExchangeHours.cs:454` 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 (21 lines × 2) Common/Brokerages/FxcmBrokerageModel.cs:79 — Common/Brokerages/FxcmBrokerageModel.cs:79-99 | Common/Brokerages/OandaBrokerageModel.cs:84-104 — before extracting anything, compare `Common/Brokerages/FxcmBrokerageModel.cs` and `Common/Brokerages/OandaBrokerageModel.cs` as WHOLE FILES: 88% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Common/Brokerages/FxcmBrokerageModel.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 (21 lines × 2) Common/Orders/Fills/FillModel.cs:799 — Common/Orders/Fills/FillModel.cs:799-819 | Common/Orders/Fills/FillModel.cs:851-871 — both copies are in the same file, so extract the 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:799` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `order` to `MarketOnOpenOrder` in one and `MarketOnCloseOrder` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Common/Orders/Fills/FillModel.cs:796` calls `IsExchangeOpen` and `Common/Orders/Fills/FillModel.cs:846` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (21 lines × 2) Indicators/CandlestickPatterns/DojiStar.cs:78 — Indicators/CandlestickPatterns/DojiStar.cs:78-98 | Indicators/CandlestickPatterns/HaramiCross.cs:76-96 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/DojiStar.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 (21 lines × 2) Algorithm.CSharp/LongAndShortStraddleStrategiesAlgorithm.cs:61 — Algorithm.CSharp/LongAndShortStraddleStrategiesAlgorithm.cs:61-81 | Algorithm.CSharp/LongAndShortStrangleStrategiesAlgorithm.cs:71-91 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (21 lines × 2) Algorithm.CSharp/CapacityTests/CheeseMilkHourlyRebalance.cs:50 — Algorithm.CSharp/CapacityTests/CheeseMilkHourlyRebalance.cs:50-70 | Algorithm.CSharp/CapacityTests/IntradayMinuteScalpingFuturesES.cs:53-73 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×8
  • Duplicated block (18 lines × 2) Common/Orders/Fills/EquityFillModel.cs:776 — Common/Orders/Fills/EquityFillModel.cs:776-793 | Common/Orders/Fills/EquityFillModel.cs:885-902 — both copies are in the same file, so extract the 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:776` 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 (18 lines × 2) Report/ReportElements/MonthlyReturnsReportElement.cs:69 — Report/ReportElements/MonthlyReturnsReportElement.cs:69-86 | Report/ReportElements/MonthlyReturnsReportElement.cs:91-108 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (18 lines × 2) Indicators/CandlestickPatterns/Harami.cs:76 — Indicators/CandlestickPatterns/Harami.cs:76-93 | Indicators/CandlestickPatterns/UniqueThreeRiver.cs:77-94 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/Harami.cs:76` 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 (18 lines × 2) Engine/DataFeeds/Enumerators/LiveDividendEventProvider.cs:38 — Engine/DataFeeds/Enumerators/LiveDividendEventProvider.cs:38-55 | Engine/DataFeeds/Enumerators/LiveSplitEventProvider.cs:38-55 — before extracting anything, compare `Engine/DataFeeds/Enumerators/LiveDividendEventProvider.cs` and `Engine/DataFeeds/Enumerators/LiveSplitEventProvider.cs` as WHOLE FILES: 93% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (18 lines × 2) Indicators/Rho.cs:196 — Indicators/Rho.cs:196-213 | Indicators/Vega.cs:196-213 — before extracting anything, compare `Indicators/Rho.cs` and `Indicators/Vega.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/Rho.cs:196` 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 (18 lines × 2) Algorithm.CSharp/NakedCallStrategyAlgorithm.cs:53 — Algorithm.CSharp/NakedCallStrategyAlgorithm.cs:53-70 | Algorithm.CSharp/NakedPutStrategyAlgorithm.cs:53-70 — before extracting anything, compare `Algorithm.CSharp/NakedCallStrategyAlgorithm.cs` and `Algorithm.CSharp/NakedPutStrategyAlgorithm.cs` as WHOLE FILES: 85% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (18 lines × 2) Algorithm.Python/FutureOptionCallOTMExpiryRegressionAlgorithm.py:78 — Algorithm.Python/FutureOptionCallOTMExpiryRegressionAlgorithm.py:78-95 | Algorithm.Python/FutureOptionPutOTMExpiryRegressionAlgorithm.py:76-93 — before extracting anything, compare `Algorithm.Python/FutureOptionCallOTMExpiryRegressionAlgorithm.py` and `Algorithm.Python/FutureOptionPutOTMExpiryRegressionAlgorithm.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (18 lines × 2) Algorithm.Python/FutureOptionShortCallOTMExpiryRegressionAlgorithm.py:72 — Algorithm.Python/FutureOptionShortCallOTMExpiryRegressionAlgorithm.py:72-89 | Algorithm.Python/FutureOptionShortPutOTMExpiryRegressionAlgorithm.py:73-90 — before extracting anything, compare `Algorithm.Python/FutureOptionShortCallOTMExpiryRegressionAlgorithm.py` and `Algorithm.Python/FutureOptionShortPutOTMExpiryRegressionAlgorithm.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D6 · Cohesion (LCOM4) · Low cohesion · ×8
  • Low cohesion: Security (LCOM4 9) Common/Securities/Security.cs:47 — Security's methods fall into 9 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 9 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Brokerage (LCOM4 8) Brokerages/Brokerage.cs:39 — Brokerage's methods fall into 8 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: DefaultBrokerageModel (LCOM4 7) Common/Brokerages/DefaultBrokerageModel.cs:39 — DefaultBrokerageModel's methods fall into 7 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 7 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: PythonData (LCOM4 7) Common/Python/PythonData.cs:27 — PythonData's methods fall into 7 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 7 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Option (LCOM4 7) Common/Securities/Option/Option.cs:38 — Option's methods fall into 7 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 7 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: SecurityHolding (LCOM4 6) Common/Securities/SecurityHolding.cs:24 — SecurityHolding's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: DateRules (LCOM4 5) Common/Scheduling/DateRules.cs:30 — DateRules's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: BaseData (LCOM4 4) REDACTED:33 — BaseData's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
IC1 · Incompleteness & stubs · Unfinished stub · ×8
  • Unfinished stub — throws NotImplementedException Algorithm.Framework/Portfolio/AlphaStreamsPortfolioConstructionModel.cs:32 — `GetAlphaWeight` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException Common/DefaultConverter.cs:55 — `CanConvert` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException Common/SymbolValueJsonConverter.cs:53 — `ReadJson` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException Common/SymbolValueJsonConverter.cs:65 — `CanConvert` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException Common/Util/NullStringValueConverter.cs:35 — `WriteJson` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException Common/Util/NullStringValueConverter.cs:66 — `CanConvert` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException Report/NullResultValueTypeJsonConverter.cs:114 — `WriteJson` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
  • Unfinished stub — throws NotImplementedException Report/OrderTypeNormalizingJsonConverter.cs:74 — `WriteJson` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
D15 · Churn × Complexity Hotspots · Hotspot · ×7
  • Hotspot: Engine/TransactionHandlers/BrokerageTransactionHandler.cs Engine/TransactionHandlers/BrokerageTransactionHandler.cs:1267 — Engine/TransactionHandlers/BrokerageTransactionHandler.cs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in BrokerageTransactionHandler.HandleOrderEvents at line 1267. 2 of those changes were fix/bug commits, and the other 5 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 23:36:44 +00:00' --until='2026-11-11 23:36:44 +00:00' --full-history --no-merges -- Engine/TransactionHandlers/BrokerageTransactionHandler.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: Engine/Results/BacktestingResultHandler.cs Engine/Results/BacktestingResultHandler.cs:160 — Engine/Results/BacktestingResultHandler.cs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in BacktestingResultHandler.Update at line 160. 1 of those changes was a fix/bug commit, and the other 8 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 23:36:44 +00:00' --until='2026-11-11 23:36:44 +00:00' --full-history --no-merges -- Engine/Results/BacktestingResultHandler.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: Engine/DataFeeds/UniverseSelection.cs Engine/DataFeeds/UniverseSelection.cs:119 — Engine/DataFeeds/UniverseSelection.cs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 38 in UniverseSelection.ApplyUniverseSelection at line 119. 1 of those changes was a fix/bug commit, and the other 3 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 23:36:44 +00:00' --until='2026-11-11 23:36:44 +00:00' --full-history --no-merges -- Engine/DataFeeds/UniverseSelection.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: Common/Brokerages/IBrokerageModel.cs Common/Brokerages/IBrokerageModel.cs:193 — Common/Brokerages/IBrokerageModel.cs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in BrokerageModel.Create at line 193. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 23:36:44 +00:00' --until='2026-11-11 23:36:44 +00:00' --full-history --no-merges -- Common/Brokerages/IBrokerageModel.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: Common/Securities/SecurityExchangeHours.cs Common/Securities/SecurityExchangeHours.cs:509 — Common/Securities/SecurityExchangeHours.cs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in SecurityExchangeHours.GetMarketHours at line 509. 2 of those changes were fix/bug commits, and the other 2 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 23:36:44 +00:00' --until='2026-11-11 23:36:44 +00:00' --full-history --no-merges -- Common/Securities/SecurityExchangeHours.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: Engine/Engine.cs Engine/Engine.cs:87 — Engine/Engine.cs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 38 in Engine.Run at line 87. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 23:36:44 +00:00' --until='2026-11-11 23:36:44 +00:00' --full-history --no-merges -- Engine/Engine.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: Report/Program.cs Report/Program.cs:35 — Report/Program.cs changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in Program.Main at line 35. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-13..2026-11-11, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-13 23:36:44 +00:00' --until='2026-11-11 23:36:44 +00:00' --full-history --no-merges -- Report/Program.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×7
  • Members sharing a duplicated core (5 members, 50+ identical tokens) Common/Data/Market/QuoteBar.cs:303 — Common/Data/Market/QuoteBar.cs:303-341 | Common/Data/Market/QuoteBar.cs:352-387 | Common/Data/Market/TradeBar.cs:196-249 | Common/Data/Market/TradeBar.cs:261-316 | Common/Data/Market/TradeBar.cs:322-338 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) Indicators/CandlestickPatterns/EveningDojiStar.cs:98 — Indicators/CandlestickPatterns/EveningDojiStar.cs:98-153 | Indicators/CandlestickPatterns/EveningStar.cs:95-146 | Indicators/CandlestickPatterns/Harami.cs:75-115 | Indicators/CandlestickPatterns/MorningDojiStar.cs:98-153 | Indicators/CandlestickPatterns/UniqueThreeRiver.cs:76-125 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) Algorithm.CSharp/BasicTemplateOptionEquityStrategyAlgorithm.cs:57 — Algorithm.CSharp/BasicTemplateOptionEquityStrategyAlgorithm.cs:57-80 | Algorithm.CSharp/ComboOrderAlgorithm.cs:66-100 | Algorithm.CSharp/ComboOrderTicketDemoAlgorithm.cs:55-96 | Algorithm.CSharp/ContingentComboOrderRegressionAlgorithm.cs:62-137 | Algorithm.CSharp/RevertComboOrderPositionsAlgorithm.cs:58-93 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) REDACTED:193 — REDACTED:193-229 | Algorithm.CSharp/CustomDataBitcoinAlgorithm.cs:146-182 | Algorithm.CSharp/CustomDataPropertiesRegressionAlgorithm.cs:236-270 | REDACTED:240-276 | REDACTED:202-237 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) Algorithm.CSharp/OptionEquityCallButterflyRegressionAlgorithm.cs:36 — Algorithm.CSharp/OptionEquityCallButterflyRegressionAlgorithm.cs:36-77 | Algorithm.CSharp/OptionEquityPutButterflyRegressionAlgorithm.cs:36-76 | Algorithm.CSharp/OptionEquityShortButterflyCallRegressionAlgorithm.cs:36-77 | Algorithm.CSharp/OptionEquityShortButterflyPutRegressionAlgorithm.cs:36-75 | Algorithm.CSharp/OptionEquityStrategyMatcherRegressionAlgorithm.cs:41-110 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) Algorithm.CSharp/OptionEquityConversionRegressionAlgorithm.cs:37 — Algorithm.CSharp/OptionEquityConversionRegressionAlgorithm.cs:37-76 | Algorithm.CSharp/OptionEquityProtectiveCollarRegressionAlgorithm.cs:38-77 | Algorithm.CSharp/OptionEquityReverseConversionRegressionAlgorithm.cs:37-76 | Algorithm.CSharp/OptionEquityStraddleRegressionAlgorithm.cs:37-73 | Algorithm.CSharp/OptionEquityStrangleRegressionAlgorithm.cs:37-73 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) Algorithm.Python/BasicTemplateOptionsAlgorithm.py:47 — Algorithm.Python/BasicTemplateOptionsAlgorithm.py:47-63 | Algorithm.Python/BasicTemplateOptionsHourlyAlgorithm.py:47-63 | Algorithm.Python/CustomOptionPriceModelRegressionAlgorithm.py:34-50 | Algorithm.Python/OptionChainedUniverseSelectionModelRegressionAlgorithm.py:39-52 | Algorithm.Python/OptionFilterReturnsNullRegressionAlgorithm.py:44-63 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Edited copy of a member (20 corresponding lines) · ×7
  • Edited copy of a member (20 corresponding lines) Algorithm.Python/AddFutureOptionContractDataStreamingRegressionAlgorithm.py:75 — Algorithm.Python/AddFutureOptionContractDataStreamingRegressionAlgorithm.py:75-94 | Algorithm.Python/AddFutureOptionSingleOptionChainSelectedInUniverseFilterRegressionAlgorithm.py:96-118 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) Algorithm.Python/FutureOptionCallITMExpiryRegressionAlgorithm.py:88 — Algorithm.Python/FutureOptionCallITMExpiryRegressionAlgorithm.py:88-107 | Algorithm.Python/FutureOptionPutITMExpiryRegressionAlgorithm.py:87-106 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) Algorithm.CSharp/LongAndShortCallCalendarSpreadStrategiesAlgorithm.cs:39 — Algorithm.CSharp/LongAndShortCallCalendarSpreadStrategiesAlgorithm.cs:39-58 | Algorithm.CSharp/LongAndShortPutCalendarSpreadStrategiesAlgorithm.cs:39-58 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) Algorithm.Python/AddAlphaModelAlgorithm.py:21 — Algorithm.Python/AddAlphaModelAlgorithm.py:21-40 | Algorithm.Python/InsightTagAlphaRegressionAlgorithm.py:26-47 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) Algorithm.CSharp/BasicTemplateFuturesAlgorithm.cs:50 — Algorithm.CSharp/BasicTemplateFuturesAlgorithm.cs:50-69 | Algorithm.CSharp/BasicTemplateFuturesWithExtendedMarketAlgorithm.cs:50-69 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) Common/Data/Auxiliary/CorporateFactorProvider.cs:111 — Common/Data/Auxiliary/CorporateFactorProvider.cs:111-130 | Common/Data/Auxiliary/CorporateFactorProvider.cs:148-167 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) Common/Data/Market/FuturesContract.cs:102 — Common/Data/Market/FuturesContract.cs:102-121 | Common/Data/Market/FuturesContract.cs:149-168 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (4 corresponding lines) · ×7
  • Edited copy of a member (4 corresponding lines) Algorithm.CSharp/WarmupFutureRegressionAlgorithm.cs:96 — Algorithm.CSharp/WarmupFutureRegressionAlgorithm.cs:96-99 | Algorithm.CSharp/WarmupFutureTimeSpanWarmupRegressionAlgorithm.cs:31-34 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) Algorithm.Python/AddRemoveSecurityRegressionAlgorithm.py:62 — Algorithm.Python/AddRemoveSecurityRegressionAlgorithm.py:62-65 | Algorithm.Python/UniverseSelectionRegressionAlgorithm.py:75-78 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) Algorithm.Python/VolumeRenkoConsolidatorAlgorithm.py:45 — Algorithm.Python/VolumeRenkoConsolidatorAlgorithm.py:45-48 | Algorithm.Python/VolumeRenkoConsolidatorAlgorithm.py:51-54 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) Algorithm.Python/Alphas/GlobalEquityMeanReversionIBSAlpha.py:70 — Algorithm.Python/Alphas/GlobalEquityMeanReversionIBSAlpha.py:70-73 | Algorithm.Python/Alphas/SykesShortMicroCapAlpha.py:53-56 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) Common/Securities/Future/FutureFilterUniverse.cs:62 — Common/Securities/Future/FutureFilterUniverse.cs:62-65 | Common/Securities/Option/OptionFilterUniverse.cs:324-327 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) Common/OS.cs:44 — Common/OS.cs:44-47 | REDACTED:47-50 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) Common/Brokerages/DefaultBrokerageModel.cs:212 — Common/Brokerages/DefaultBrokerageModel.cs:212-215 | Common/Brokerages/ExanteBrokerageModel.cs:46-49 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (5 corresponding lines) · ×7
  • Edited copy of a member (5 corresponding lines) Algorithm.Python/BasicTemplateFuturesHistoryAlgorithm.py:68 — Algorithm.Python/BasicTemplateFuturesHistoryAlgorithm.py:68-72 | Algorithm.Python/BasicTemplateOptionsHistoryAlgorithm.py:70-77 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) Common/Data/Fundamental/FundamentalUniverse.cs:109 — Common/Data/Fundamental/FundamentalUniverse.cs:109-113 | Common/Data/UniverseSelection/BaseDataCollection.cs:155-159 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) Common/Data/UniverseSelection/FineFundamentalFilteredUniverse.cs:57 — Common/Data/UniverseSelection/FineFundamentalFilteredUniverse.cs:57-61 | Common/Data/UniverseSelection/FundamentalFilteredUniverse.cs:52-56 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) Algorithm.Python/PEP8StyleBasicAlgorithm.py:19 — Algorithm.Python/PEP8StyleBasicAlgorithm.py:19-26 | Algorithm.Python/CustomSettlementModelRegressionAlgorithm.py:22-26 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) Common/Data/Channel.cs:71 — Common/Data/Channel.cs:71-75 | Common/Optimizer/Parameters/OptimizationParameter.cs:49-53 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) Indicators/AverageTrueRange.cs:61 — Indicators/AverageTrueRange.cs:61-65 | Indicators/SmoothedOnBalanceVolume.cs:55-61 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) Common/Orders/FixOrderProperties.cs:64 — Common/Orders/FixOrderProperties.cs:64-68 | Common/Orders/QuantBridgeOrderProperties.cs:137-141 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (3 corresponding lines) · ×7
  • Edited copy of a member (3 corresponding lines) Algorithm.Python/BasicTemplateFuturesAlgorithm.py:74 — Algorithm.Python/BasicTemplateFuturesAlgorithm.py:74-76 | Algorithm.Python/BasicTemplateFuturesWithExtendedMarketAlgorithm.py:77-79 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) Algorithm.Python/CustomDataPropertiesRegressionAlgorithm.py:53 — Algorithm.Python/CustomDataPropertiesRegressionAlgorithm.py:53-55 | Algorithm.Python/CustomDataRegressionAlgorithm.py:40-42 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) Algorithm.Python/HistoryWithDifferentContinuousContractDepthOffsetsRegressionAlgorithm.py:22 — Algorithm.Python/HistoryWithDifferentContinuousContractDepthOffsetsRegressionAlgorithm.py:22-24 | Algorithm.Python/HistoryWithDifferentDataMappingModeRegressionAlgorithm.py:22-24 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) Algorithm.Python/CustomModelsAlgorithm.py:105 — Algorithm.Python/CustomModelsAlgorithm.py:105-107 | Algorithm.Python/CustomModelsPEP8Algorithm.py:103-105 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) Algorithm.Python/HistoryAlgorithm.py:143 — Algorithm.Python/HistoryAlgorithm.py:143-145 | Algorithm.Python/IndicatorSuiteAlgorithm.py:186-188 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) Common/Data/Fundamental/MultiPeriodField.cs:114 — Common/Data/Fundamental/MultiPeriodField.cs:114-116 | Common/Optimizer/Parameters/ParameterSet.cs:59-61 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) Algorithm.Python/HistoricalReturnsAlphaModelFrameworkRegressionAlgorithm.py:28 — Algorithm.Python/HistoricalReturnsAlphaModelFrameworkRegressionAlgorithm.py:28-30 | Algorithm.Python/MacdAlphaModelFrameworkRegressionAlgorithm.py:28-30 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×7
  • Duplicated block (9 lines × 3) Algorithm.CSharp/BasicTemplateOptionEquityStrategyAlgorithm.cs:60 — Algorithm.CSharp/BasicTemplateOptionEquityStrategyAlgorithm.cs:60-68 | Algorithm.CSharp/ComboOrderAlgorithm.cs:69-77 | Algorithm.CSharp/ComboOrderTicketDemoAlgorithm.cs:58-66 — before extracting anything, compare `Algorithm.CSharp/ComboOrderAlgorithm.cs` and `Algorithm.CSharp/ComboOrderTicketDemoAlgorithm.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/BasicTemplateOptionEquityStrategyAlgorithm.cs:60` 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 × 3) Algorithm.CSharp/ComboOrderAlgorithm.cs:72 — Algorithm.CSharp/ComboOrderAlgorithm.cs:72-80 | Algorithm.CSharp/ComboOrderTicketDemoAlgorithm.cs:61-69 | Algorithm.CSharp/RevertComboOrderPositionsAlgorithm.cs:64-72 — before extracting anything, compare `Algorithm.CSharp/ComboOrderAlgorithm.cs` and `Algorithm.CSharp/ComboOrderTicketDemoAlgorithm.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 3) Algorithm.CSharp/IsMarketOpenCheckAlgorithm.cs:62 — Algorithm.CSharp/IsMarketOpenCheckAlgorithm.cs:62-70 | Algorithm.CSharp/IsMarketOpenCheckWithExtendedMarketHoursAlgorithm.cs:34-42 | Algorithm.CSharp/IsMarketOpenCheckWithExtendedMarketHoursAlgorithm.cs:49-57 — before extracting anything, compare `Algorithm.CSharp/IsMarketOpenCheckAlgorithm.cs` and `Algorithm.CSharp/IsMarketOpenCheckWithExtendedMarketHoursAlgorithm.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 3) Algorithm.CSharp/AddFutureOptionContractWithInternalMappedUnderlyingRegressionAlgorithm.cs:36 — Algorithm.CSharp/AddFutureOptionContractWithInternalMappedUnderlyingRegressionAlgorithm.cs:36-44 | Algorithm.CSharp/ContinuousFutureRegressionAlgorithm.cs:42-51 | Algorithm.CSharp/ManualContinuousFuturesPositionRolloverRegressionAlgorithm.cs:38-47 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (9 lines × 3) Algorithm.Python/BasicTemplateOptionsAlgorithm.py:55 — Algorithm.Python/BasicTemplateOptionsAlgorithm.py:55-63 | Algorithm.Python/OptionChainedUniverseSelectionModelRegressionAlgorithm.py:44-52 | Algorithm.Python/OptionFilterReturnsNullRegressionAlgorithm.py:55-63 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.Python/BasicTemplateOptionsAlgorithm.py:55` 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 × 3) Algorithm.Python/IndexOptionBearPutSpreadAlgorithm.py:32 — Algorithm.Python/IndexOptionBearPutSpreadAlgorithm.py:32-40 | Algorithm.Python/IndexOptionBullCallSpreadAlgorithm.py:39-47 | Algorithm.Python/IndexOptionBullPutSpreadAlgorithm.py:32-40 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. 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 × 3) Report/ReportCharts.py:606 — Report/ReportCharts.py:606-614 | Report/ReportCharts.py:738-746 | Report/ReportCharts.py:963-971 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Report/ReportCharts.py:960` calls `ylabel`, `xlabel`, `set_axisbelow` and `Report/ReportCharts.py:605` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
X1 · Async correctness · Sync-over-async (deadlock risk) · ×7
  • Sync-over-async (deadlock risk) Common/Data/LeanDataWriter.cs:184 — Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
  • Sync-over-async (deadlock risk) Common/Extensions.cs:3464 — Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
  • Sync-over-async (deadlock risk) Common/Extensions.cs:3474 — Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
  • Sync-over-async (deadlock risk) Common/Extensions.cs:3498 — Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
  • Sync-over-async (deadlock risk) Common/Extensions.cs:3512 — Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
  • Sync-over-async (deadlock risk) REDACTED:245 — Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
  • Sync-over-async (deadlock risk) REDACTED:303 — 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.
X20 · Mistyped argument guard · Argument guard throws the exception its own condition disproves · ×7
  • Argument guard throws the exception its own condition disproves Engine/DataFeeds/DataManager.cs:632 — The guard on line 630 rejects `dataTypes` and line 632 reports that rejection as `ArgumentNullException` — but the condition's own test `!dataTypes.Any()` is true of a value that is NOT null: it is satisfied by an EMPTY `dataTypes`, and on that path `dataTypes` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition.
  • Argument guard throws the exception its own condition disproves Common/Data/Auxiliary/MapFile.cs:63 — The guard on line 61 rejects `permtick` and line 63 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrEmpty(permtick)` is true of a value that is NOT null: it is satisfied by an EMPTY `permtick`, and on that path `permtick` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition.
  • Argument guard throws the exception its own condition disproves Common/Data/Channel.cs:51 — The guard on line 49 rejects `channelName` and line 51 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrEmpty(channelName)` is true of a value that is NOT null: it is satisfied by an EMPTY `channelName`, and on that path `channelName` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition.
  • Argument guard throws the exception its own condition disproves Common/Optimizer/Objectives/Constraint.cs:65 — The guard on line 63 rejects `jsonBacktestResult` and line 65 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrEmpty(jsonBacktestResult)` is true of a value that is NOT null: it is satisfied by an EMPTY `jsonBacktestResult`, and on that path `jsonBacktestResult` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition.
  • Argument guard throws the exception its own condition disproves Common/Optimizer/Objectives/Objective.cs:65 — The guard on line 63 rejects `target` and line 65 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrEmpty(target)` is true of a value that is NOT null: it is satisfied by an EMPTY `target`, and on that path `target` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition.
  • Argument guard throws the exception its own condition disproves Common/Optimizer/Objectives/Target.cs:76 — The guard on line 74 rejects `jsonBacktestResult` and line 76 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrEmpty(jsonBacktestResult)` is true of a value that is NOT null: it is satisfied by an EMPTY `jsonBacktestResult`, and on that path `jsonBacktestResult` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition.
  • Argument guard throws the exception its own condition disproves Logging/CompositeLogHandler.cs:43 — The guard on line 41 rejects `handlers` and line 43 reports that rejection as `ArgumentNullException` — but the condition's own test `handlers.Length == 0` is true of a value that is NOT null: it is satisfied by an EMPTY `handlers`, and on that path `handlers` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows this case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` (or `ArgumentOutOfRangeException` for a bound) for what the condition actually tests, or split the guard and throw each on its own condition.
D4 · Code Duplication · Edited copy of a member (33 corresponding lines) · ×6
  • Edited copy of a member (33 corresponding lines) Algorithm.Python/IndexOptionCallButterflyAlgorithm.py:37 — Algorithm.Python/IndexOptionCallButterflyAlgorithm.py:37-69 | Algorithm.Python/IndexOptionPutButterflyAlgorithm.py:37-69 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (33 corresponding lines) Indicators/CandlestickPatterns/MatchingLow.cs:69 — Indicators/CandlestickPatterns/MatchingLow.cs:69-101 | Indicators/CandlestickPatterns/StickSandwich.cs:72-108 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (33 corresponding lines) Algorithm.CSharp/ConvertToFrameworkAlgorithm.cs:63 — Algorithm.CSharp/ConvertToFrameworkAlgorithm.cs:63-116 | Algorithm.CSharp/MACDTrendAlgorithm.cs:56-88 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (33 corresponding lines) REDACTED:98 — REDACTED:98-137 | REDACTED:428-460 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (33 corresponding lines) Algorithm.Framework/Portfolio/MaximumSharpeRatioPortfolioOptimizer.py:41 — Algorithm.Framework/Portfolio/MaximumSharpeRatioPortfolioOptimizer.py:41-76 | Algorithm.Framework/Portfolio/MinimumVariancePortfolioOptimizer.py:39-71 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (33 corresponding lines) Engine/DataFeeds/ZipDataCacheProvider.cs:275 — Engine/DataFeeds/ZipDataCacheProvider.cs:275-308 | Engine/DataFeeds/ZipDataCacheProvider.cs:402-434 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (22 corresponding lines) · ×6
  • Edited copy of a member (22 corresponding lines) Algorithm.Python/IndexOptionShortCallITMExpiryRegressionAlgorithm.py:29 — Algorithm.Python/IndexOptionShortCallITMExpiryRegressionAlgorithm.py:29-50 | Algorithm.Python/IndexOptionShortPutITMExpiryRegressionAlgorithm.py:29-50 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) Algorithm.CSharp/BaseFrameworkRegressionAlgorithm.cs:34 — Algorithm.CSharp/BaseFrameworkRegressionAlgorithm.cs:34-58 | Algorithm.CSharp/PearsonCorrelationPairsTradingAlphaModelFrameworkAlgorithm.cs:36-57 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) Algorithm.CSharp/IndicatorBasedOptionPricingModelRegressionAlgorithm.cs:63 — Algorithm.CSharp/IndicatorBasedOptionPricingModelRegressionAlgorithm.cs:63-119 | Algorithm.CSharp/QLOptionPricingModelRegressionAlgorithm.cs:54-75 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) Common/Data/DataQueueHandlerSubscriptionManager.cs:40 — Common/Data/DataQueueHandlerSubscriptionManager.cs:40-61 | Common/Data/DataQueueHandlerSubscriptionManager.cs:68-92 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) Algorithm.CSharp/BlackLittermanPortfolioOptimizationFrameworkAlgorithm.cs:36 — Algorithm.CSharp/BlackLittermanPortfolioOptimizationFrameworkAlgorithm.cs:36-61 | Algorithm.CSharp/MeanVarianceOptimizationFrameworkAlgorithm.cs:37-58 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) Algorithm.Framework/Risk/MaximumDrawdownPercentPerSecurity.py:26 — Algorithm.Framework/Risk/MaximumDrawdownPercentPerSecurity.py:26-47 | Algorithm.Framework/Risk/MaximumUnrealizedProfitPercentPerSecurity.py:26-47 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (6 lines × 4) · ×6
  • Duplicated block (6 lines × 4) Common/Orders/Fills/EquityFillModel.cs:788 — Common/Orders/Fills/EquityFillModel.cs:788-793 | Common/Orders/Fills/EquityFillModel.cs:897-902 | Common/Orders/Fills/FillModel.cs:884-889 | Common/Orders/Fills/FillModel.cs:943-948 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Common/Orders/Fills/EquityFillModel.cs:788` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 4) Algorithm.CSharp/CustomDataBitcoinAlgorithm.cs:169 — Algorithm.CSharp/CustomDataBitcoinAlgorithm.cs:169-174 | Algorithm.CSharp/CustomDataNIFTYAlgorithm.cs:184-189 | Algorithm.CSharp/CustomDataPropertiesRegressionAlgorithm.cs:259-264 | REDACTED:224-229 — before extracting anything, compare `Algorithm.CSharp/CustomDataBitcoinAlgorithm.cs` and `Algorithm.CSharp/CustomDataPropertiesRegressionAlgorithm.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Algorithm.CSharp/CustomDataBitcoinAlgorithm.cs:175` calls `ToDecimal` and `Algorithm.CSharp/CustomDataPropertiesRegressionAlgorithm.cs:265` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 4) Algorithm.CSharp/IndexOptionPutOTMExpiryRegressionAlgorithm.cs:57 — Algorithm.CSharp/IndexOptionPutOTMExpiryRegressionAlgorithm.cs:57-62 | Algorithm.CSharp/IndexOptionShortCallITMExpiryRegressionAlgorithm.cs:64-69 | Algorithm.CSharp/IndexOptionShortPutITMExpiryRegressionAlgorithm.cs:63-68 | Algorithm.CSharp/IndexOptionShortPutOTMExpiryRegressionAlgorithm.cs:54-59 — before extracting anything, compare `Algorithm.CSharp/IndexOptionPutOTMExpiryRegressionAlgorithm.cs` and `Algorithm.CSharp/IndexOptionShortPutITMExpiryRegressionAlgorithm.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/IndexOptionPutOTMExpiryRegressionAlgorithm.cs:57` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 4) Algorithm.Python/BasicTemplateOptionsAlgorithm.py:55 — Algorithm.Python/BasicTemplateOptionsAlgorithm.py:55-60 | Algorithm.Python/CustomOptionPriceModelRegressionAlgorithm.py:42-47 | Algorithm.Python/OptionChainedUniverseSelectionModelRegressionAlgorithm.py:44-49 | Algorithm.Python/OptionFilterReturnsNullRegressionAlgorithm.py:55-60 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.Python/BasicTemplateOptionsAlgorithm.py:55` 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 (6 lines × 4) Algorithm.Python/CoveredAndProtectiveCallStrategiesAlgorithm.py:28 — Algorithm.Python/CoveredAndProtectiveCallStrategiesAlgorithm.py:28-33 | Algorithm.Python/CoveredAndProtectivePutStrategiesAlgorithm.py:28-33 | Algorithm.Python/NakedCallStrategyAlgorithm.py:28-33 | Algorithm.Python/NakedPutStrategyAlgorithm.py:28-33 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
  • Duplicated block (6 lines × 4) Algorithm.Python/CustomDataBenchmarkRegressionAlgorithm.py:49 — Algorithm.Python/CustomDataBenchmarkRegressionAlgorithm.py:49-54 | Algorithm.Python/CustomDataMultiFileObjectStoreRegressionAlgorithm.py:97-102 | Algorithm.Python/CustomDataObjectStoreRegressionAlgorithm.py:88-93 | Algorithm.Python/DescendingCustomDataObjectStoreRegressionAlgorithm.py:104-109 — before extracting anything, compare `Algorithm.Python/CustomDataMultiFileObjectStoreRegressionAlgorithm.py` and `Algorithm.Python/CustomDataObjectStoreRegressionAlgorithm.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
X2 · Cancellation propagation · Async method without CancellationToken · ×6
  • Async method without CancellationToken: UnzipDataAsync REDACTED:254 — No CancellationToken parameter — this work can't be stopped early once started.
  • Async method without CancellationToken: ZipBytesAsync REDACTED:316 — No CancellationToken parameter — this work can't be stopped early once started.
  • Async method without CancellationToken: ZipBytesAsync REDACTED:330 — No CancellationToken parameter — this work can't be stopped early once started.
  • Async method without CancellationToken: ZipStreamsAsync REDACTED:351 — No CancellationToken parameter — this work can't be stopped early once started.
  • Async method without CancellationToken: ZipStreamsAsync REDACTED:369 — No CancellationToken parameter — this work can't be stopped early once started.
  • Async method without CancellationToken: TryRequestAsync Api/ApiConnection.cs:185 — No CancellationToken parameter — this work can't be stopped early once started.
D10 · Test Quality · No assertions · ×5
  • No assertions: TestGetChartUpdatesWhileAdding Tests/Algorithm/AlgorithmPlottingTests.cs:92 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: Benchmark Tests/Common/Securities/SecurityExchangeHoursTests.cs:726 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: EnumerableIsThreadSafe Tests/Common/Util/ConcurrentSetTests.cs:240 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: Accuracy Tests/Engine/DataFeeds/RealTimeScheduleEventServiceTests.cs:29 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: WorksForIndicatorsOfDifferentTypes Tests/Indicators/IndicatorExtensionsTests.cs:389 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
D36 · Supply-chain Provenance & Signing · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (8 members, 50+ identical tokens) · ×5
  • Members sharing a duplicated core (8 members, 50+ identical tokens) Algorithm.CSharp/FutureOptionCallITMExpiryRegressionAlgorithm.cs:98 — Algorithm.CSharp/FutureOptionCallITMExpiryRegressionAlgorithm.cs:98-125 | Algorithm.CSharp/FutureOptionPutITMExpiryRegressionAlgorithm.cs:99-126 | Algorithm.CSharp/FutureOptionShortCallITMExpiryRegressionAlgorithm.cs:99-126 | Algorithm.CSharp/FutureOptionShortPutITMExpiryRegressionAlgorithm.cs:99-126 | Algorithm.CSharp/IndexOptionCallITMExpiryRegressionAlgorithm.cs:96-123 | Algorithm.CSharp/IndexOptionPutITMExpiryRegressionAlgorithm.cs:93-120 | Algorithm.CSharp/IndexOptionShortCallITMExpiryRegressionAlgorithm.cs:105-132 | Algorithm.CSharp/IndexOptionShortPutITMExpiryRegressionAlgorithm.cs:104-131 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
  • Members sharing a duplicated core (8 members, 50+ identical tokens) Algorithm.CSharp/IndexOptionCallITMExpiryRegressionAlgorithm.cs:46 — Algorithm.CSharp/IndexOptionCallITMExpiryRegressionAlgorithm.cs:46-70 | Algorithm.CSharp/IndexOptionCallOTMExpiryRegressionAlgorithm.cs:52-75 | Algorithm.CSharp/IndexOptionPutITMExpiryRegressionAlgorithm.cs:44-67 | Algorithm.CSharp/IndexOptionPutOTMExpiryRegressionAlgorithm.cs:49-72 | Algorithm.CSharp/IndexOptionShortCallITMExpiryRegressionAlgorithm.cs:45-79 | Algorithm.CSharp/IndexOptionShortCallOTMExpiryRegressionAlgorithm.cs:46-69 | Algorithm.CSharp/IndexOptionShortPutITMExpiryRegressionAlgorithm.cs:44-78 | Algorithm.CSharp/IndexOptionShortPutOTMExpiryRegressionAlgorithm.cs:46-69 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
  • Members sharing a duplicated core (8 members, 50+ identical tokens) Algorithm.CSharp/OptionEquityBoxSpreadRegressionAlgorithm.cs:36 — Algorithm.CSharp/OptionEquityBoxSpreadRegressionAlgorithm.cs:36-86 | Algorithm.CSharp/OptionEquityIronButterflyRegressionAlgorithm.cs:36-89 | Algorithm.CSharp/OptionEquityIronCondorRegressionAlgorithm.cs:36-86 | Algorithm.CSharp/OptionEquityJellyRollRegressionAlgorithm.cs:37-87 | Algorithm.CSharp/OptionEquityShortBoxSpreadRegressionAlgorithm.cs:36-93 | Algorithm.CSharp/OptionEquityShortIronButterflyRegressionAlgorithm.cs:36-89 | Algorithm.CSharp/OptionEquityShortIronCondorRegressionAlgorithm.cs:36-86 | Algorithm.CSharp/OptionEquityShortJellyRollRegressionAlgorithm.cs:37-87 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
  • Members sharing a duplicated core (8 members, 50+ identical tokens) Algorithm.CSharp/OptionStrategyFilteringUniverseCallButterflyRegressionAlgorithm.cs:40 — Algorithm.CSharp/OptionStrategyFilteringUniverseCallButterflyRegressionAlgorithm.cs:40-83 | Algorithm.CSharp/OptionStrategyFilteringUniverseCallCalendarSpreadRegressionAlgorithm.cs:40-76 | Algorithm.CSharp/OptionStrategyFilteringUniverseCallLadderRegressionAlgorithm.cs:40-83 | Algorithm.CSharp/OptionStrategyFilteringUniverseCallSpreadRegressionAlgorithm.cs:40-76 | Algorithm.CSharp/OptionStrategyFilteringUniversePutButterflyRegressionAlgorithm.cs:40-83 | Algorithm.CSharp/OptionStrategyFilteringUniversePutCalendarSpreadRegressionAlgorithm.cs:40-76 | Algorithm.CSharp/OptionStrategyFilteringUniversePutLadderRegressionAlgorithm.cs:40-83 | Algorithm.CSharp/OptionStrategyFilteringUniversePutSpreadRegressionAlgorithm.cs:40-76 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
  • Members sharing a duplicated core (8 members, 50+ identical tokens) Algorithm.Python/CustomDataBenchmarkRegressionAlgorithm.py:45 — Algorithm.Python/CustomDataBenchmarkRegressionAlgorithm.py:45-54 | Algorithm.Python/CustomDataBitcoinAlgorithm.py:64-118 | Algorithm.Python/CustomDataMultiFileObjectStoreRegressionAlgorithm.py:93-102 | Algorithm.Python/CustomDataObjectStoreRegressionAlgorithm.py:84-93 | Algorithm.Python/CustomDataPropertiesRegressionAlgorithm.py:75-120 | Algorithm.Python/CustomDataRegressionAlgorithm.py:70-120 | Algorithm.Python/DescendingCustomDataObjectStoreRegressionAlgorithm.py:100-109 | Algorithm.Python/LiveFeaturesAlgorithm.py:99-147 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
D4 · Code Duplication · Edited copy of a member (29 corresponding lines) · ×5
  • Edited copy of a member (29 corresponding lines) Algorithm.Python/FutureOptionDailyRegressionAlgorithm.py:22 — Algorithm.Python/FutureOptionDailyRegressionAlgorithm.py:22-52 | Algorithm.Python/FutureOptionHourlyRegressionAlgorithm.py:22-50 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) Algorithm.CSharp/Alphas/GreenblattMagicFormulaAlpha.cs:112 — Algorithm.CSharp/Alphas/GreenblattMagicFormulaAlpha.cs:112-142 | Algorithm.CSharp/Alphas/MeanReversionLunchBreakAlpha.cs:113-141 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) Common/Orders/Fees/InteractiveBrokersFeeModel.cs:322 — Common/Orders/Fees/InteractiveBrokersFeeModel.cs:322-355 | Common/Orders/Fees/InteractiveBrokersFeeModel.cs:399-427 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) Algorithm.CSharp/BasicTemplateSPXWeeklyIndexOptionsStrategyAlgorithm.cs:60 — Algorithm.CSharp/BasicTemplateSPXWeeklyIndexOptionsStrategyAlgorithm.cs:60-88 | Algorithm.CSharp/LargeQuantityOptionStrategyAlgorithm.cs:51-84 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) Algorithm.CSharp/BasicTemplateCryptoFutureAlgorithm.cs:44 — Algorithm.CSharp/BasicTemplateCryptoFutureAlgorithm.cs:44-76 | Algorithm.CSharp/BasicTemplateCryptoFutureHourlyAlgorithm.cs:43-71 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (25 corresponding lines) · ×5
  • Edited copy of a member (25 corresponding lines) Algorithm.Python/FutureUniverseHistoryRegressionAlgorithm.py:23 — Algorithm.Python/FutureUniverseHistoryRegressionAlgorithm.py:23-50 | Algorithm.Python/OptionUniverseHistoryRegressionAlgorithm.py:23-47 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) Algorithm.Python/PythonDictionaryFeatureRegressionAlgorithm.py:69 — Algorithm.Python/PythonDictionaryFeatureRegressionAlgorithm.py:69-97 | Algorithm.Python/PythonDictionaryFeatureRegressionAlgorithm.py:100-124 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) Algorithm.Python/BasicTemplateCryptoFutureAlgorithm.py:25 — Algorithm.Python/BasicTemplateCryptoFutureAlgorithm.py:25-51 | Algorithm.Python/BasicTemplateCryptoFutureHourlyAlgorithm.py:25-49 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) Algorithm.Python/SecuritySessionRegressionAlgorithm.py:64 — Algorithm.Python/SecuritySessionRegressionAlgorithm.py:64-88 | Algorithm.Python/SecuritySessionWithFuturesRegressionAlgorithm.py:90-116 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) Algorithm.CSharp/FeeModelNotUsingAccountCurrency.cs:91 — Algorithm.CSharp/FeeModelNotUsingAccountCurrency.cs:91-132 | Algorithm.CSharp/ZeroFeeRegressionAlgorithm.cs:66-90 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 12+ corresponding lines) · ×5
  • Edited copies of one member (3 members, 12+ corresponding lines) Algorithm.CSharp/IndexOptionBearCallSpreadAlgorithm.cs:30 — Algorithm.CSharp/IndexOptionBearCallSpreadAlgorithm.cs:30-41 | Algorithm.CSharp/IndexOptionCallCalendarSpreadAlgorithm.cs:32-46 | Algorithm.CSharp/IndexOptionPutCalendarSpreadAlgorithm.cs:32-43 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 12+ corresponding lines) Algorithm.Python/ComboOrderTicketDemoAlgorithm.py:23 — Algorithm.Python/ComboOrderTicketDemoAlgorithm.py:23-37 | Algorithm.Python/ContingentComboOrderRegressionAlgorithm.py:24-35 | Algorithm.Python/NullMarginMultipleOrdersRegressionAlgorithm.py:22-35 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 12+ corresponding lines) Algorithm.CSharp/MeanReversionPortfolioAlgorithm.cs:32 — Algorithm.CSharp/MeanReversionPortfolioAlgorithm.cs:32-46 | Algorithm.CSharp/RiskParityPortfolioAlgorithm.cs:32-43 | Algorithm.CSharp/RiskParityPortfolioWeightsCheckAlgorithm.cs:35-48 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 12+ corresponding lines) Algorithm.Python/FutureOptionChainsMultipleFullDataRegressionAlgorithm.py:43 — Algorithm.Python/FutureOptionChainsMultipleFullDataRegressionAlgorithm.py:43-54 | Algorithm.Python/FuturesChainsMultipleFullDataRegressionAlgorithm.py:38-49 | Algorithm.Python/OptionChainsMultipleFullDataRegressionAlgorithm.py:41-55 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 12+ corresponding lines) Common/Time.cs:296 — Common/Time.cs:296-307 | Common/Time.cs:315-326 | Common/Time.cs:334-345 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 10+ corresponding lines) · ×5
  • Edited copies of one member (3 members, 10+ corresponding lines) Algorithm.Python/IndexOptionBearPutSpreadAlgorithm.py:19 — Algorithm.Python/IndexOptionBearPutSpreadAlgorithm.py:19-28 | Algorithm.Python/IndexOptionBullPutSpreadAlgorithm.py:19-28 | Algorithm.Python/IndexOptionIronCondorAlgorithm.py:21-31 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) Algorithm.CSharp/OptionOrdersOnSplitRegressionAlgorithm.cs:37 — Algorithm.CSharp/OptionOrdersOnSplitRegressionAlgorithm.cs:37-46 | Algorithm.CSharp/OptionResolutionRegressionAlgorithm.cs:33-49 | Algorithm.CSharp/OptionsAutomaticSeedRegressionAlgorithm.cs:38-57 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) Algorithm.CSharp/LiquidatingMultipleOptionStrategiesRegressionAlgorithm.cs:47 — Algorithm.CSharp/LiquidatingMultipleOptionStrategiesRegressionAlgorithm.cs:47-56 | Algorithm.CSharp/RevertComboOrderPositionsAlgorithm.cs:44-55 | Algorithm.CSharp/RollOutFrontMonthToBackMonthOptionUsingCalendarSpreadRegressionAlgorithm.cs:44-53 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) Common/Data/Custom/IconicTypes/LinkedData.cs:41 — Common/Data/Custom/IconicTypes/LinkedData.cs:41-50 | Common/Data/Custom/IconicTypes/UnlinkedData.cs:50-59 | Common/Data/Custom/IconicTypes/UnlinkedDataTradeBar.cs:55-64 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) Algorithm.CSharp/RegressionTests/Universes/ETFConstituentUniverseFilterFunctionRegressionAlgorithm.cs:45 — Algorithm.CSharp/RegressionTests/Universes/ETFConstituentUniverseFilterFunctionRegressionAlgorithm.cs:45-56 | Algorithm.CSharp/RegressionTests/Universes/ETFConstituentUniverseImmediateSelectionRegressionAlgorithm.cs:42-51 | Algorithm.CSharp/RegressionTests/Universes/ETFConstituentUniverseMappedCompositeRegressionAlgorithm.cs:42-52 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 9+ corresponding lines) · ×5
  • Edited copies of one member (3 members, 9+ corresponding lines) Algorithm.Python/FutureOptionShortCallITMExpiryRegressionAlgorithm.py:92 — Algorithm.Python/FutureOptionShortCallITMExpiryRegressionAlgorithm.py:92-103 | Algorithm.Python/FutureOptionShortPutITMExpiryRegressionAlgorithm.py:92-103 | Algorithm.Python/IndexOptionShortPutITMExpiryRegressionAlgorithm.py:81-89 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 9+ corresponding lines) Common/Securities/FutureOption/FuturesOptionsExpiryFunctions.cs:173 — Common/Securities/FutureOption/FuturesOptionsExpiryFunctions.cs:173-188 | Common/Securities/FutureOption/FuturesOptionsExpiryFunctions.cs:227-238 | Common/Securities/FutureOption/FuturesOptionsExpiryFunctions.cs:244-252 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 9+ corresponding lines) Algorithm.CSharp/CustomBuyingPowerModelAlgorithm.cs:36 — Algorithm.CSharp/CustomBuyingPowerModelAlgorithm.cs:36-44 | Algorithm.CSharp/CustomMarginInterestRateModelAlgorithm.cs:36-45 | Algorithm.CSharp/CustomPartialFillModelAlgorithm.cs:37-47 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 9+ corresponding lines) Algorithm.CSharp/ClassicRenkoConsolidatorWithFuturesTickTypesRegressionAlgorithm.cs:55 — Algorithm.CSharp/ClassicRenkoConsolidatorWithFuturesTickTypesRegressionAlgorithm.cs:55-63 | Algorithm.CSharp/TickQuoteBarConsolidatorWithTickTypeRegressionAlgorithm.cs:52-60 | Algorithm.CSharp/TickTradeBarConsolidatorWithDefaultTickTypeRegressionAlgorithm.cs:52-60 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 9+ corresponding lines) Common/Data/Auxiliary/LocalZipFactorFileProvider.cs:43 — Common/Data/Auxiliary/LocalZipFactorFileProvider.cs:43-51 | Common/Data/Auxiliary/LocalZipMapFileProvider.cs:44-52 | Common/Data/DividendYieldProvider.cs:68-76 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 7+ corresponding lines) · ×5
  • Edited copies of one member (3 members, 7+ corresponding lines) Research/FutureHistory.cs:50 — Research/FutureHistory.cs:50-56 | Research/OptionHistory.cs:50-56 | Research/OptionHistory.cs:63-69 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 7+ corresponding lines) Algorithm.CSharp/ClassicRenkoConsolidatorWithFuturesTickTypesRegressionAlgorithm.cs:40 — Algorithm.CSharp/ClassicRenkoConsolidatorWithFuturesTickTypesRegressionAlgorithm.cs:40-47 | Algorithm.CSharp/TickQuoteBarConsolidatorWithTickTypeRegressionAlgorithm.cs:38-44 | Algorithm.CSharp/TickTradeBarConsolidatorWithDefaultTickTypeRegressionAlgorithm.cs:38-44 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 7+ corresponding lines) Algorithm.CSharp/BrokerageModelAlgorithm.cs:37 — Algorithm.CSharp/BrokerageModelAlgorithm.cs:37-55 | Algorithm.CSharp/CustomBenchmarkAlgorithm.cs:34-46 | Algorithm.CSharp/LimitFillRegressionAlgorithm.cs:38-44 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 7+ corresponding lines) Algorithm.CSharp/BacktestingAsynchronousOrdersRegressionAlgorithm.cs:31 — Algorithm.CSharp/BacktestingAsynchronousOrdersRegressionAlgorithm.cs:31-37 | Algorithm.CSharp/FinancialAdvisorDemoAlgorithm.cs:36-68 | Algorithm.CSharp/TrailingStopOrderRegressionAlgorithm.cs:43-49 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 7+ corresponding lines) Algorithm.CSharp/MappedBenchmarkRegressionAlgorithm.cs:31 — Algorithm.CSharp/MappedBenchmarkRegressionAlgorithm.cs:31-37 | Algorithm.CSharp/ObjectStoreHelpersRegressionAlgorithm.cs:34-41 | Algorithm.CSharp/ObjectStoreKeySanitizationRegressionAlgorithm.cs:32-39 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×5
  • Duplicated block (22 lines × 2) Common/Util/LeanData.cs:697 — Common/Util/LeanData.cs:697-718 | Common/Util/LeanData.cs:725-746 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (22 lines × 2) Common/Brokerages/BitfinexBrokerageModel.cs:135 — Common/Brokerages/BitfinexBrokerageModel.cs:135-156 | Common/Brokerages/KrakenBrokerageModel.cs:94-115 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Common/Brokerages/BitfinexBrokerageModel.cs:135` 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 (22 lines × 2) Algorithm.CSharp/FutureOptionCallITMGreeksExpiryRegressionAlgorithm.cs:75 — Algorithm.CSharp/FutureOptionCallITMGreeksExpiryRegressionAlgorithm.cs:75-96 | Algorithm.CSharp/IndexOptionCallITMGreeksExpiryRegressionAlgorithm.cs:65-86 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (22 lines × 2) Algorithm.CSharp/OptionEquityIronCondorRegressionAlgorithm.cs:40 — Algorithm.CSharp/OptionEquityIronCondorRegressionAlgorithm.cs:40-61 | Algorithm.CSharp/OptionEquityShortIronCondorRegressionAlgorithm.cs:40-61 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/OptionEquityIronCondorRegressionAlgorithm.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 (22 lines × 2) Algorithm.CSharp/BacktestingBrokerageRegressionAlgorithm.cs:259 — Algorithm.CSharp/BacktestingBrokerageRegressionAlgorithm.cs:259-280 | Algorithm.CSharp/CustomModelsAlgorithm.cs:92-113 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Algorithm.CSharp/CustomModelsAlgorithm.cs:115` calls `Log` and `Algorithm.CSharp/BacktestingBrokerageRegressionAlgorithm.cs:282` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×5
  • Duplicated block (19 lines × 2) Common/Orders/Fills/FillModel.cs:909 — Common/Orders/Fills/FillModel.cs:909-927 | Common/Orders/Fills/FillModel.cs:968-986 — both copies are in the same file, so extract the 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 (19 lines × 2) Common/Orders/Fees/BinanceFeeModel.cs:59 — Common/Orders/Fees/BinanceFeeModel.cs:59-77 | Common/Orders/Fees/BybitFeeModel.cs:60-78 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (19 lines × 2) Common/Securities/Security.cs:349 — Common/Securities/Security.cs:349-367 | Common/Securities/Security.cs:381-399 — both copies are in the same file, so extract the 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/Securities/Security.cs:349` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (19 lines × 2) Indicators/CandlestickPatterns/HikkakeModified.cs:94 — Indicators/CandlestickPatterns/HikkakeModified.cs:94-112 | Indicators/CandlestickPatterns/HikkakeModified.cs:139-157 — both copies are in the same file, so extract the 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:94` 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 (19 lines × 2) Algorithm.Python/CustomModelsAlgorithm.py:66 — Algorithm.Python/CustomModelsAlgorithm.py:66-84 | Algorithm.Python/CustomModelsPEP8Algorithm.py:64-82 — before extracting anything, compare `Algorithm.Python/CustomModelsAlgorithm.py` and `Algorithm.Python/CustomModelsPEP8Algorithm.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×5
  • Duplicated block (17 lines × 2) Indicators/CandlestickPatterns/DragonflyDoji.cs:76 — Indicators/CandlestickPatterns/DragonflyDoji.cs:76-92 | Indicators/CandlestickPatterns/GravestoneDoji.cs:76-92 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/DragonflyDoji.cs:76` 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 (17 lines × 2) Indicators/CandlestickPatterns/EveningDojiStar.cs:137 — Indicators/CandlestickPatterns/EveningDojiStar.cs:137-153 | Indicators/CandlestickPatterns/MorningDojiStar.cs:137-153 — before extracting anything, compare `Indicators/CandlestickPatterns/EveningDojiStar.cs` and `Indicators/CandlestickPatterns/MorningDojiStar.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/EveningDojiStar.cs:137` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (17 lines × 2) Algorithm.CSharp/AddBetaIndicatorNewAssetsRegressionAlgorithm.cs:77 — Algorithm.CSharp/AddBetaIndicatorNewAssetsRegressionAlgorithm.cs:77-93 | Algorithm.CSharp/AddBetaIndicatorRegressionAlgorithm.cs:74-90 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (17 lines × 2) Indicators/CandlestickPatterns/ThreeInside.cs:77 — Indicators/CandlestickPatterns/ThreeInside.cs:77-93 | Indicators/CandlestickPatterns/UpsideGapTwoCrows.cs:79-95 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/ThreeInside.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 (17 lines × 2) Algorithm.Python/FutureContractsExtendedMarketHoursRegressionAlgorithm.py:36 — Algorithm.Python/FutureContractsExtendedMarketHoursRegressionAlgorithm.py:36-52 | Algorithm.Python/FuturesExtendedMarketHoursRegressionAlgorithm.py:37-53 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×5
  • Duplicated block (9 lines × 4) Algorithm.CSharp/BasicTemplateOptionsAlgorithm.cs:68 — Algorithm.CSharp/BasicTemplateOptionsAlgorithm.cs:68-76 | Algorithm.CSharp/BasicTemplateOptionsHourlyAlgorithm.cs:69-77 | Algorithm.CSharp/OptionResolutionRegressionAlgorithm.cs:59-67 | Algorithm.CSharp/SamcoBasicTemplateOptionsAlgorithm.cs:67-75 — before extracting anything, compare `Algorithm.CSharp/BasicTemplateOptionsAlgorithm.cs` and `Algorithm.CSharp/OptionResolutionRegressionAlgorithm.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/BasicTemplateOptionsAlgorithm.cs:68` 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 × 4) Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs:63 — Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs:63-71 | Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs:82-90 | Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs:111-119 | Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs:317-325 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `parameters` to `PositionGroupMaintenanceMarginParameters` in one and `PositionGroupInitialMarginParameters` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (9 lines × 4) Algorithm.CSharp/BasicTemplateOptionStrategyAlgorithm.cs:42 — Algorithm.CSharp/BasicTemplateOptionStrategyAlgorithm.cs:42-55 | Algorithm.CSharp/NakedShortOptionStrategyOverMarginAlgorithm.cs:44-52 | Algorithm.CSharp/OptionStrategyFactoryMethodsBaseAlgorithm.cs:40-48 | Algorithm.CSharp/TradingNotAddedOptionsRegressionAlgorithm.cs:37-50 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/BasicTemplateOptionStrategyAlgorithm.cs:42` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 4) Algorithm.CSharp/OptionEquityIronButterflyRegressionAlgorithm.cs:54 — Algorithm.CSharp/OptionEquityIronButterflyRegressionAlgorithm.cs:54-62 | Algorithm.CSharp/OptionEquityJellyRollRegressionAlgorithm.cs:52-60 | Algorithm.CSharp/OptionEquityShortIronButterflyRegressionAlgorithm.cs:54-62 | Algorithm.CSharp/OptionEquityShortJellyRollRegressionAlgorithm.cs:52-60 — before extracting anything, compare `Algorithm.CSharp/OptionEquityIronButterflyRegressionAlgorithm.cs` and `Algorithm.CSharp/OptionEquityShortIronButterflyRegressionAlgorithm.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/OptionEquityIronButterflyRegressionAlgorithm.cs:54` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 4) Algorithm.Python/IndexOptionCallITMExpiryRegressionAlgorithm.py:64 — Algorithm.Python/IndexOptionCallITMExpiryRegressionAlgorithm.py:64-72 | Algorithm.Python/IndexOptionPutITMExpiryRegressionAlgorithm.py:58-66 | Algorithm.Python/IndexOptionShortCallITMExpiryRegressionAlgorithm.py:65-74 | Algorithm.Python/IndexOptionShortPutITMExpiryRegressionAlgorithm.py:65-73 — before extracting anything, compare `Algorithm.Python/IndexOptionPutITMExpiryRegressionAlgorithm.py` and `Algorithm.Python/IndexOptionShortCallITMExpiryRegressionAlgorithm.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×5
  • Duplicated block (12–13 lines × 2) Algorithm.CSharp/ExecutionModelOrderEventsRegressionAlgorithm.cs:90 — Algorithm.CSharp/ExecutionModelOrderEventsRegressionAlgorithm.cs:90-101 | Algorithm/Execution/ImmediateExecutionModel.cs:46-58 — 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.CSharp/ExecutionModelOrderEventsRegressionAlgorithm.cs:90` 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–13 lines × 2) Algorithm.CSharp/BasicTemplateOptionStrategyAlgorithm.cs:65 — Algorithm.CSharp/BasicTemplateOptionStrategyAlgorithm.cs:65-76 | Algorithm.CSharp/BasicTemplateOptionTradesAlgorithm.cs:58-70 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/BasicTemplateOptionStrategyAlgorithm.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 (12–13 lines × 2) Algorithm.CSharp/CoarseFineFundamentalRegressionAlgorithm.cs:97 — Algorithm.CSharp/CoarseFineFundamentalRegressionAlgorithm.cs:97-109 | Algorithm.CSharp/UniverseSelectionRegressionAlgorithm.cs:81-92 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Algorithm.CSharp/UniverseSelectionRegressionAlgorithm.cs:78` calls `Log`, `Join` and `Algorithm.CSharp/CoarseFineFundamentalRegressionAlgorithm.cs:95` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12–13 lines × 2) Algorithm.CSharp/LimitOrdersAreFilledAfterHoursForFuturesRegressionAlgorithm.cs:41 — Algorithm.CSharp/LimitOrdersAreFilledAfterHoursForFuturesRegressionAlgorithm.cs:41-52 | Algorithm.CSharp/MarketOrdersAreSupportedOnExtendedHoursForFuturesRegressionAlgorithm.cs:36-48 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (12–13 lines × 2) Report/ReportElements/LeverageUtilizationReportElement.cs:64 — Report/ReportElements/LeverageUtilizationReportElement.cs:64-76 | Report/ReportElements/RollingSharpeReportElement.cs:65-76 — before extracting anything, compare `Report/ReportElements/LeverageUtilizationReportElement.cs` and `Report/ReportElements/RollingSharpeReportElement.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `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 (8 lines × 3) · ×5
  • Duplicated block (8 lines × 3) Algorithm.CSharp/BasicTemplateOptionEquityStrategyAlgorithm.cs:40 — Algorithm.CSharp/BasicTemplateOptionEquityStrategyAlgorithm.cs:40-51 | Algorithm.CSharp/CoveredCallComboLimitOrderAlgorithm.cs:40-47 | Algorithm.CSharp/OptionEquityBaseStrategyRegressionAlgorithm.cs:39-50 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/BasicTemplateOptionEquityStrategyAlgorithm.cs:40` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Algorithm.CSharp/CoveredCallComboLimitOrderAlgorithm.cs:40` calls `SetCash` and `Algorithm.CSharp/BasicTemplateOptionEquityStrategyAlgorithm.cs:40` does not — after which the two agree again for 5 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 3) Algorithm.CSharp/IndexOptionBearPutSpreadAlgorithm.cs:30 — Algorithm.CSharp/IndexOptionBearPutSpreadAlgorithm.cs:30-37 | Algorithm.CSharp/IndexOptionBullPutSpreadAlgorithm.cs:30-37 | Algorithm.CSharp/IndexOptionIronCondorAlgorithm.cs:30-37 — before extracting anything, compare `Algorithm.CSharp/IndexOptionBearPutSpreadAlgorithm.cs` and `Algorithm.CSharp/IndexOptionBullPutSpreadAlgorithm.cs` as WHOLE FILES: 84% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 3 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/IndexOptionBearPutSpreadAlgorithm.cs:30` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (8 lines × 3) Common/Data/Auxiliary/LocalZipFactorFileProvider.cs:44 — Common/Data/Auxiliary/LocalZipFactorFileProvider.cs:44-51 | Common/Data/Auxiliary/LocalZipMapFileProvider.cs:45-52 | Common/Data/DividendYieldProvider.cs:69-76 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (8 lines × 3) Algorithm.Python/IndexOptionBullCallSpreadAlgorithm.py:39 — Algorithm.Python/IndexOptionBullCallSpreadAlgorithm.py:39-47 | Algorithm.Python/IndexOptionCallButterflyAlgorithm.py:41-48 | Algorithm.Python/IndexOptionPutButterflyAlgorithm.py:41-48 — before extracting anything, compare `Algorithm.Python/IndexOptionCallButterflyAlgorithm.py` and `Algorithm.Python/IndexOptionPutButterflyAlgorithm.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 3) Algorithm.Python/IndexOptionCallButterflyAlgorithm.py:21 — Algorithm.Python/IndexOptionCallButterflyAlgorithm.py:21-28 | Algorithm.Python/IndexOptionPutButterflyAlgorithm.py:21-28 | Algorithm.Python/IndexOptionPutCalendarSpreadAlgorithm.py:19-26 — before extracting anything, compare `Algorithm.Python/IndexOptionCallButterflyAlgorithm.py` and `Algorithm.Python/IndexOptionPutButterflyAlgorithm.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (5 lines × 4) · ×5
  • Duplicated block (5 lines × 4) Algorithm.CSharp/FutureOptionCallOTMExpiryRegressionAlgorithm.cs:64 — Algorithm.CSharp/FutureOptionCallOTMExpiryRegressionAlgorithm.cs:64-68 | Algorithm.CSharp/FutureOptionShortCallITMExpiryRegressionAlgorithm.cs:59-63 | Algorithm.CSharp/FutureOptionShortCallOTMExpiryRegressionAlgorithm.cs:60-64 | Algorithm.CSharp/OptionOTMExpiryOrderHasZeroPriceRegressionAlgorithm.cs:65-69 — before extracting anything, compare `Algorithm.CSharp/FutureOptionCallOTMExpiryRegressionAlgorithm.cs` and `Algorithm.CSharp/FutureOptionShortCallITMExpiryRegressionAlgorithm.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/FutureOptionCallOTMExpiryRegressionAlgorithm.cs:64` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 4) Algorithm.Python/CoveredAndProtectiveCallStrategiesAlgorithm.py:39 — Algorithm.Python/CoveredAndProtectiveCallStrategiesAlgorithm.py:39-43 | Algorithm.Python/CoveredAndProtectivePutStrategiesAlgorithm.py:40-44 | Algorithm.Python/NakedCallStrategyAlgorithm.py:38-42 | Algorithm.Python/NakedPutStrategyAlgorithm.py:38-42 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
  • Duplicated block (5 lines × 4) Algorithm.Python/FutureOptionShortCallITMExpiryRegressionAlgorithm.py:106 — Algorithm.Python/FutureOptionShortCallITMExpiryRegressionAlgorithm.py:106-110 | Algorithm.Python/FutureOptionShortPutITMExpiryRegressionAlgorithm.py:106-110 | Algorithm.Python/IndexOptionShortCallITMExpiryRegressionAlgorithm.py:90-94 | Algorithm.Python/IndexOptionShortPutITMExpiryRegressionAlgorithm.py:92-96 — before extracting anything, compare `Algorithm.Python/FutureOptionShortCallITMExpiryRegressionAlgorithm.py` and `Algorithm.Python/FutureOptionShortPutITMExpiryRegressionAlgorithm.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 4) Algorithm.Python/FutureOptionCallITMExpiryRegressionAlgorithm.py:46 — Algorithm.Python/FutureOptionCallITMExpiryRegressionAlgorithm.py:46-50 | Algorithm.Python/FutureOptionCallOTMExpiryRegressionAlgorithm.py:52-56 | Algorithm.Python/FutureOptionShortCallITMExpiryRegressionAlgorithm.py:48-52 | Algorithm.Python/FutureOptionShortCallOTMExpiryRegressionAlgorithm.py:48-52 — before extracting anything, compare `Algorithm.Python/FutureOptionCallITMExpiryRegressionAlgorithm.py` and `Algorithm.Python/FutureOptionShortCallITMExpiryRegressionAlgorithm.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.Python/FutureOptionCallITMExpiryRegressionAlgorithm.py:46` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 4) Algorithm.Python/FutureOptionPutITMExpiryRegressionAlgorithm.py:45 — Algorithm.Python/FutureOptionPutITMExpiryRegressionAlgorithm.py:45-49 | Algorithm.Python/FutureOptionPutOTMExpiryRegressionAlgorithm.py:52-56 | Algorithm.Python/FutureOptionShortPutITMExpiryRegressionAlgorithm.py:48-52 | Algorithm.Python/FutureOptionShortPutOTMExpiryRegressionAlgorithm.py:49-53 — before extracting anything, compare `Algorithm.Python/FutureOptionPutITMExpiryRegressionAlgorithm.py` and `Algorithm.Python/FutureOptionShortPutITMExpiryRegressionAlgorithm.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.Python/FutureOptionPutITMExpiryRegressionAlgorithm.py:45` 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.
D5 · Coupling · Off the main sequence · ×5
  • Off the main sequence: QuantConnect.Configuration Configuration/QuantConnect.Configuration.csproj:1 — QuantConnect.Configuration: abstractness 0.00, instability 0.07, distance 0.93 — zone of pain — concrete and depended on by 10 project(s), so it's rigid to change.
  • Off the main sequence: QuantConnect.Logging Logging/QuantConnect.Logging.csproj:1 — QuantConnect.Logging: abstractness 0.08, instability 0.00, distance 0.92 — zone of pain — concrete and depended on by 13 project(s), so it's rigid to change.
  • Off the main sequence: QuantConnect.Compression REDACTED:1 — QuantConnect.Compression: abstractness 0.00, instability 0.20, distance 0.80 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
  • Off the main sequence: QuantConnect Common/QuantConnect.csproj:1 — QuantConnect: abstractness 0.08, instability 0.15, distance 0.77 — zone of pain — concrete and depended on by 13 project(s), so it's rigid to change.
  • Off the main sequence: QuantConnect.Indicators Indicators/QuantConnect.Indicators.csproj:1 — QuantConnect.Indicators: abstractness 0.06, instability 0.22, distance 0.71 — zone of pain — concrete and depended on by 6 project(s), so it's rigid to change.
D4 · Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×4
  • Members sharing a duplicated core (6 members, 50+ identical tokens) Algorithm.CSharp/BasicTemplateFuturesDailyAlgorithm.cs:71 — Algorithm.CSharp/BasicTemplateFuturesDailyAlgorithm.cs:71-105 | Algorithm.CSharp/BasicTemplateFuturesWithExtendedMarketAlgorithm.cs:76-109 | Algorithm.CSharp/BasicTemplateMultiAssetAlgorithm.cs:87-210 | Algorithm.CSharp/FutureSharingTickerRegressionAlgorithm.cs:50-68 | Algorithm.CSharp/FuturesMomentumAlgorithm.cs:69-93 | Algorithm.CSharp/SetHoldingsFutureRegressionAlgorithm.cs:56-110 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
  • Members sharing a duplicated core (6 members, 50+ identical tokens) Algorithm.Python/AccumulativeInsightPortfolioRegressionAlgorithm.py:22 — Algorithm.Python/AccumulativeInsightPortfolioRegressionAlgorithm.py:22-37 | Algorithm.Python/AddRiskManagementAlgorithm.py:23-43 | Algorithm.Python/BasicTemplateFrameworkAlgorithm.py:26-56 | Algorithm.Python/ConfidenceWeightedFrameworkAlgorithm.py:22-41 | Algorithm.Python/InsightScoringRegressionAlgorithm.py:23-36 | Algorithm.Python/InsightWeightingFrameworkAlgorithm.py:28-47 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
  • Members sharing a duplicated core (6 members, 50+ identical tokens) Algorithm.Python/IndexOptionBearCallSpreadAlgorithm.py:21 — Algorithm.Python/IndexOptionBearCallSpreadAlgorithm.py:21-32 | Algorithm.Python/IndexOptionBullCallSpreadAlgorithm.py:21-32 | Algorithm.Python/IndexOptionCallButterflyAlgorithm.py:21-33 | Algorithm.Python/IndexOptionCallCalendarSpreadAlgorithm.py:19-33 | Algorithm.Python/IndexOptionPutButterflyAlgorithm.py:21-33 | Algorithm.Python/IndexOptionPutCalendarSpreadAlgorithm.py:19-31 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
  • Members sharing a duplicated core (6 members, 50+ identical tokens) Algorithm.Python/IndexOptionCallITMExpiryRegressionAlgorithm.py:29 — Algorithm.Python/IndexOptionCallITMExpiryRegressionAlgorithm.py:29-49 | Algorithm.Python/IndexOptionCallOTMExpiryRegressionAlgorithm.py:35-62 | Algorithm.Python/IndexOptionPutITMExpiryRegressionAlgorithm.py:29-44 | Algorithm.Python/IndexOptionPutOTMExpiryRegressionAlgorithm.py:35-62 | Algorithm.Python/IndexOptionShortCallOTMExpiryRegressionAlgorithm.py:31-46 | Algorithm.Python/IndexOptionShortPutOTMExpiryRegressionAlgorithm.py:31-46 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication · Edited copies of one member (3 members, 14+ corresponding lines) · ×4
  • Edited copies of one member (3 members, 14+ corresponding lines) Algorithm.Python/CompositeRiskManagementModelFrameworkAlgorithm.py:25 — Algorithm.Python/CompositeRiskManagementModelFrameworkAlgorithm.py:25-41 | Algorithm.Python/ExecutionModelOrderEventsRegressionAlgorithm.py:22-35 | Algorithm.Python/G10CurrencySelectionModelFrameworkAlgorithm.py:42-56 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) Algorithm.CSharp/OptionExpiryDateTodayRegressionAlgorithm.cs:36 — Algorithm.CSharp/OptionExpiryDateTodayRegressionAlgorithm.cs:36-49 | Algorithm.CSharp/OptionPriceModelForSupportedAmericanOptionRegressionAlgorithm.cs:28-41 | Algorithm.CSharp/OptionPriceModelForUnsupportedAmericanOptionRegressionAlgorithm.cs:28-41 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) Algorithm.CSharp/BasicTemplateOptionEquityStrategyAlgorithm.cs:38 — Algorithm.CSharp/BasicTemplateOptionEquityStrategyAlgorithm.cs:38-51 | Algorithm.CSharp/NullBuyingPowerOptionBullCallSpreadAlgorithm.cs:38-51 | Algorithm.CSharp/OptionStrategyMarginCallEventsAlgorithm.cs:40-54 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) Common/Securities/BuyingPowerModel.cs:147 — Common/Securities/BuyingPowerModel.cs:147-160 | Common/Securities/Future/FutureMarginModel.cs:131-144 | Common/Securities/Option/OptionMarginModel.cs:75-89 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (2 corresponding lines) · ×4
  • Edited copy of a member (2 corresponding lines) Algorithm.Python/FutureUniverseFiltersRegressionAlgorithm.py:68 — Algorithm.Python/FutureUniverseFiltersRegressionAlgorithm.py:68-69 | Algorithm.Python/FuturesChainFiltersRegressionAlgorithm.py:100-101 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (2 corresponding lines) Algorithm.Python/CoarseFineFundamentalComboAlgorithm.py:56 — Algorithm.Python/CoarseFineFundamentalComboAlgorithm.py:56-59 | Algorithm.Python/ScheduledQueuingAlgorithm.py:45-46 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (2 corresponding lines) Algorithm.Python/CustomDataUniverseRegressionAlgorithm.py:86 — Algorithm.Python/CustomDataUniverseRegressionAlgorithm.py:86-87 | Algorithm.Python/CustomDataUniverseScheduledRegressionAlgorithm.py:75-76 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (2 corresponding lines) Algorithm.Python/SectorExposureRiskFrameworkAlgorithm.py:44 — Algorithm.Python/SectorExposureRiskFrameworkAlgorithm.py:44-45 | Algorithm.Python/SectorWeightingFrameworkAlgorithm.py:39-40 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×4
  • Duplicated block (20 lines × 2) Common/Brokerages/BybitBrokerageModel.cs:128 — Common/Brokerages/BybitBrokerageModel.cs:128-147 | Common/Brokerages/CoinbaseBrokerageModel.cs:135-154 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Common/Brokerages/BybitBrokerageModel.cs:128` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (20 lines × 2) Algorithm.CSharp/FundamentalRegressionAlgorithm.cs:185 — Algorithm.CSharp/FundamentalRegressionAlgorithm.cs:185-204 | Algorithm.CSharp/FundamentalUniverseSelectionRegressionAlgorithm.cs:69-88 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (20 lines × 2) Algorithm.Python/AddFutureOptionContractDataStreamingRegressionAlgorithm.py:47 — Algorithm.Python/AddFutureOptionContractDataStreamingRegressionAlgorithm.py:47-66 | Algorithm.Python/AddFutureOptionSingleOptionChainSelectedInUniverseFilterRegressionAlgorithm.py:54-73 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (20 lines × 2) Algorithm.Python/LongAndShortStraddleStrategiesAlgorithm.py:48 — Algorithm.Python/LongAndShortStraddleStrategiesAlgorithm.py:48-67 | Algorithm.Python/LongAndShortStrangleStrategiesAlgorithm.py:53-72 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×4
  • Duplicated block (12 lines × 3) Indicators/CandlestickPatterns/EveningDojiStar.cs:111 — Indicators/CandlestickPatterns/EveningDojiStar.cs:111-122 | Indicators/CandlestickPatterns/MorningDojiStar.cs:111-122 | Indicators/CandlestickPatterns/UniqueThreeRiver.cs:84-95 — before extracting anything, compare `Indicators/CandlestickPatterns/EveningDojiStar.cs` and `Indicators/CandlestickPatterns/MorningDojiStar.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/EveningDojiStar.cs:111` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 3) Common/Securities/Option/OptionFilterUniverse.cs:466 — Common/Securities/Option/OptionFilterUniverse.cs:466-477 | Common/Securities/Option/OptionFilterUniverse.cs:525-536 | Common/Securities/Option/OptionFilterUniverse.cs:757-768 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (12 lines × 3) Indicators/CandlestickPatterns/DarkCloudCover.cs:110 — Indicators/CandlestickPatterns/DarkCloudCover.cs:110-121 | Indicators/CandlestickPatterns/EveningDojiStar.cs:132-144 | Indicators/CandlestickPatterns/EveningStar.cs:125-137 — before extracting anything, compare `Indicators/CandlestickPatterns/EveningDojiStar.cs` and `Indicators/CandlestickPatterns/EveningStar.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/DarkCloudCover.cs:110` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 3) Algorithm.CSharp/OptionEquityBoxSpreadRegressionAlgorithm.cs:57 — Algorithm.CSharp/OptionEquityBoxSpreadRegressionAlgorithm.cs:57-68 | Algorithm.CSharp/OptionEquityJellyRollRegressionAlgorithm.cs:58-69 | Algorithm.CSharp/OptionEquityShortBoxSpreadRegressionAlgorithm.cs:57-68 — before extracting anything, compare `Algorithm.CSharp/OptionEquityBoxSpreadRegressionAlgorithm.cs` and `Algorithm.CSharp/OptionEquityShortBoxSpreadRegressionAlgorithm.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (13 lines × 3) · ×4
  • Duplicated block (13 lines × 3) Common/Util/LeanData.cs:275 — Common/Util/LeanData.cs:275-287 | Common/Util/LeanData.cs:346-358 | Common/Util/LeanData.cs:417-429 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Common/Util/LeanData.cs:275` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 3) Common/Orders/Fills/EquityFillModel.cs:1063 — Common/Orders/Fills/EquityFillModel.cs:1063-1075 | Common/Orders/Fills/FillModel.cs:1179-1191 | Common/Orders/Fills/LatestPriceFillModel.cs:37-49 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. 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 × 3) Common/Brokerages/AlpacaBrokerageModel.cs:148 — Common/Brokerages/AlpacaBrokerageModel.cs:148-160 | Common/Brokerages/ClearStreetBrokerageModel.cs:62-74 | Common/Brokerages/WebullBrokerageModel.cs:110-122 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. 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 × 3) Algorithm.Python/FundamentalRegressionAlgorithm.py:117 — Algorithm.Python/FundamentalRegressionAlgorithm.py:117-129 | Algorithm.Python/FundamentalUniverseSelectionAlgorithm.py:53-65 | Algorithm.Python/FundamentalUniverseSelectionRegressionAlgorithm.py:41-53 — before extracting anything, compare `Algorithm.Python/FundamentalRegressionAlgorithm.py` and `Algorithm.Python/FundamentalUniverseSelectionRegressionAlgorithm.py` as WHOLE FILES: 83% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (13 lines × 4) · ×4
  • Duplicated block (13 lines × 4) Common/Data/Market/OpenInterest.cs:134 — Common/Data/Market/OpenInterest.cs:134-146 | Common/Data/Market/QuoteBar.cs:663-675 | Common/Data/Market/Tick.cs:753-765 | Common/Data/Market/TradeBar.cs:815-827 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13 lines × 4) Algorithm.CSharp/OptionEquityBearPutLadderRegressionAlgorithm.cs:38 — Algorithm.CSharp/OptionEquityBearPutLadderRegressionAlgorithm.cs:38-50 | Algorithm.CSharp/OptionEquityBullPutLadderRegressionAlgorithm.cs:37-49 | Algorithm.CSharp/OptionEquityPutBackspreadRegressionAlgorithm.cs:38-50 | Algorithm.CSharp/OptionEquityShortPutBackspreadRegressionAlgorithm.cs:39-51 — before extracting anything, compare `Algorithm.CSharp/OptionEquityPutBackspreadRegressionAlgorithm.cs` and `Algorithm.CSharp/OptionEquityShortPutBackspreadRegressionAlgorithm.cs` as WHOLE FILES: 83% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/OptionEquityBearPutLadderRegressionAlgorithm.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 (13 lines × 4) Algorithm.CSharp/BasicTemplateFuturesDailyAlgorithm.cs:72 — Algorithm.CSharp/BasicTemplateFuturesDailyAlgorithm.cs:72-87 | Algorithm.CSharp/BasicTemplateFuturesWithExtendedMarketAlgorithm.cs:86-99 | Algorithm.CSharp/BasicTemplateMultiAssetAlgorithm.cs:92-105 | Algorithm.CSharp/FutureSharingTickerRegressionAlgorithm.cs:51-63 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/BasicTemplateFuturesDailyAlgorithm.cs:72` 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 × 4) Algorithm.CSharp/OptionEquityBearCallLadderRegressionAlgorithm.cs:37 — Algorithm.CSharp/OptionEquityBearCallLadderRegressionAlgorithm.cs:37-49 | Algorithm.CSharp/OptionEquityBullCallLadderRegressionAlgorithm.cs:38-50 | Algorithm.CSharp/OptionEquityCallBackspreadRegressionAlgorithm.cs:38-50 | Algorithm.CSharp/OptionEquityShortCallBackspreadRegressionAlgorithm.cs:39-51 — before extracting anything, compare `Algorithm.CSharp/OptionEquityBearCallLadderRegressionAlgorithm.cs` and `Algorithm.CSharp/OptionEquityBullCallLadderRegressionAlgorithm.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/OptionEquityBearCallLadderRegressionAlgorithm.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.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×4
  • Duplicated block (10 lines × 3) Algorithm.CSharp/OptionEquityBearCallSpreadRegressionAlgorithm.cs:37 — Algorithm.CSharp/OptionEquityBearCallSpreadRegressionAlgorithm.cs:37-46 | Algorithm.CSharp/OptionEquityBearCallSpreadSetHoldingsRegressionAlgorithm.cs:45-54 | Algorithm.CSharp/OptionEquityBullCallSpreadRegressionAlgorithm.cs:37-46 — before extracting anything, compare `Algorithm.CSharp/OptionEquityBearCallSpreadRegressionAlgorithm.cs` and `Algorithm.CSharp/OptionEquityBullCallSpreadRegressionAlgorithm.cs` as WHOLE FILES: 85% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/OptionEquityBearCallSpreadRegressionAlgorithm.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 × 3) Algorithm/QCAlgorithm.Python.cs:1645 — Algorithm/QCAlgorithm.Python.cs:1645-1654 | Algorithm/QCAlgorithm.Python.cs:1685-1694 | Algorithm/QCAlgorithm.Python.cs:1749-1758 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm/QCAlgorithm.Python.cs:1645` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `period` to `Resolution` in one and `TimeSpan` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (10 lines × 3) Indicators/CandlestickPatterns/MorningStar.cs:96 — Indicators/CandlestickPatterns/MorningStar.cs:96-105 | Indicators/CandlestickPatterns/ThreeInside.cs:77-86 | Indicators/CandlestickPatterns/UpsideGapTwoCrows.cs:79-88 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/MorningStar.cs:96` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Indicators/CandlestickPatterns/MorningStar.cs:106` calls `GetCandleRange` and `Indicators/CandlestickPatterns/ThreeInside.cs:87` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 3) Common/Orders/Fees/AxosFeeModel.cs:37 — Common/Orders/Fees/AxosFeeModel.cs:37-46 | Common/Orders/Fees/RBIFeeModel.cs:39-48 | Common/Orders/Fees/WolverineFeeModel.cs:39-48 — before extracting anything, compare `Common/Orders/Fees/RBIFeeModel.cs` and `Common/Orders/Fees/WolverineFeeModel.cs` as WHOLE FILES: 89% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (11 lines × 4) · ×4
  • Duplicated block (11 lines × 4) Indicators/Gamma.cs:194 — Indicators/Gamma.cs:194-204 | Indicators/Rho.cs:194-204 | Indicators/Theta.cs:194-204 | Indicators/Vega.cs:194-204 — before extracting anything, compare `Indicators/Rho.cs` and `Indicators/Theta.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/Gamma.cs:194` 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 × 4) Algorithm.CSharp/BasicTemplateOptionsAlgorithm.cs:71 — Algorithm.CSharp/BasicTemplateOptionsAlgorithm.cs:71-81 | Algorithm.CSharp/OptionChainedUniverseSelectionModelRegressionAlgorithm.cs:56-66 | Algorithm.CSharp/OptionResolutionRegressionAlgorithm.cs:62-72 | Algorithm.CSharp/SamcoBasicTemplateOptionsAlgorithm.cs:70-80 — before extracting anything, compare `Algorithm.CSharp/BasicTemplateOptionsAlgorithm.cs` and `Algorithm.CSharp/OptionChainedUniverseSelectionModelRegressionAlgorithm.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/BasicTemplateOptionsAlgorithm.cs:71` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Algorithm.CSharp/BasicTemplateOptionsAlgorithm.cs:82` calls `MarketOnCloseOrder` and `Algorithm.CSharp/OptionResolutionRegressionAlgorithm.cs:73` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 4) Algorithm.CSharp/FutureOptionPutITMExpiryRegressionAlgorithm.cs:60 — Algorithm.CSharp/FutureOptionPutITMExpiryRegressionAlgorithm.cs:60-70 | Algorithm.CSharp/FutureOptionPutOTMExpiryRegressionAlgorithm.cs:64-74 | Algorithm.CSharp/FutureOptionShortPutITMExpiryRegressionAlgorithm.cs:60-70 | Algorithm.CSharp/FutureOptionShortPutOTMExpiryRegressionAlgorithm.cs:61-71 — before extracting anything, compare `Algorithm.CSharp/FutureOptionPutITMExpiryRegressionAlgorithm.cs` and `Algorithm.CSharp/FutureOptionPutOTMExpiryRegressionAlgorithm.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/FutureOptionPutITMExpiryRegressionAlgorithm.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 × 4) Algorithm.CSharp/IndexOptionPutITMExpiryRegressionAlgorithm.cs:54 — Algorithm.CSharp/IndexOptionPutITMExpiryRegressionAlgorithm.cs:54-64 | Algorithm.CSharp/IndexOptionPutOTMExpiryRegressionAlgorithm.cs:59-69 | Algorithm.CSharp/IndexOptionShortPutITMExpiryRegressionAlgorithm.cs:65-75 | Algorithm.CSharp/IndexOptionShortPutOTMExpiryRegressionAlgorithm.cs:56-66 — before extracting anything, compare `Algorithm.CSharp/IndexOptionPutITMExpiryRegressionAlgorithm.cs` and `Algorithm.CSharp/IndexOptionShortPutITMExpiryRegressionAlgorithm.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/IndexOptionPutITMExpiryRegressionAlgorithm.cs:54` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×4
  • Duplicated block (7 lines × 3) Algorithm.CSharp/IndexOptionBearPutSpreadAlgorithm.cs:45 — Algorithm.CSharp/IndexOptionBearPutSpreadAlgorithm.cs:45-51 | Algorithm.CSharp/IndexOptionBullCallSpreadAlgorithm.cs:51-57 | Algorithm.CSharp/IndexOptionBullPutSpreadAlgorithm.cs:45-51 — before extracting anything, compare `Algorithm.CSharp/IndexOptionBearPutSpreadAlgorithm.cs` and `Algorithm.CSharp/IndexOptionBullPutSpreadAlgorithm.cs` as WHOLE FILES: 84% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 3 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 3) Messaging/EventMessagingHandler.cs:124 — Messaging/EventMessagingHandler.cs:124-130 | Messaging/Messaging.cs:115-121 | Messaging/StreamingMessageHandler.cs:76-82 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (7 lines × 3) Algorithm.CSharp/BasicTemplateAlgorithm.cs:37 — Algorithm.CSharp/BasicTemplateAlgorithm.cs:37-50 | Algorithm.CSharp/BrokerageActivityEventHandlingAlgorithm.cs:31-37 | Algorithm.CSharp/NoMinimumOrderMarginRegressionAlgorithm.cs:32-38 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Algorithm.CSharp/BasicTemplateAlgorithm.cs:31` calls `Create` and `Algorithm.CSharp/NoMinimumOrderMarginRegressionAlgorithm.cs:27` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 3) Algorithm.Python/EmaCrossUniverseSelectionAlgorithm.py:71 — Algorithm.Python/EmaCrossUniverseSelectionAlgorithm.py:71-77 | Algorithm.Python/RawPricesCoarseUniverseAlgorithm.py:63-69 | Algorithm.Python/RawPricesUniverseRegressionAlgorithm.py:58-64 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×4
  • Duplicated block (6 lines × 3) Algorithm.CSharp/IndexOptionBearCallSpreadAlgorithm.cs:35 — Algorithm.CSharp/IndexOptionBearCallSpreadAlgorithm.cs:35-40 | Algorithm.CSharp/IndexOptionCallCalendarSpreadAlgorithm.cs:38-44 | Algorithm.CSharp/IndexOptionPutCalendarSpreadAlgorithm.cs:37-42 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (6 lines × 3) Indicators/CandlestickPatterns/AbandonedBaby.cs:61 — Indicators/CandlestickPatterns/AbandonedBaby.cs:61-66 | Indicators/CandlestickPatterns/EveningDojiStar.cs:59-64 | Indicators/CandlestickPatterns/MorningDojiStar.cs:59-64 — before extracting anything, compare `Indicators/CandlestickPatterns/EveningDojiStar.cs` and `Indicators/CandlestickPatterns/MorningDojiStar.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (6 lines × 3) Algorithm.Python/CustomDataPropertiesRegressionAlgorithm.py:88 — Algorithm.Python/CustomDataPropertiesRegressionAlgorithm.py:88-93 | Algorithm.Python/CustomDataRegressionAlgorithm.py:84-89 | Algorithm.Python/LiveFeaturesAlgorithm.py:112-117 — before extracting anything, compare `Algorithm.Python/CustomDataPropertiesRegressionAlgorithm.py` and `Algorithm.Python/CustomDataRegressionAlgorithm.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 3) Algorithm.Python/IndexOptionBearPutSpreadAlgorithm.py:19 — Algorithm.Python/IndexOptionBearPutSpreadAlgorithm.py:19-24 | Algorithm.Python/IndexOptionBullPutSpreadAlgorithm.py:19-24 | Algorithm.Python/IndexOptionIronCondorAlgorithm.py:21-26 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×4
  • Outbound HTTP without resilience Algorithm.CSharp/CustomSignalExportDemonstrationAlgorithm.cs:76 — `new()` builds an outbound HTTP client and nothing bounds it: no timeout is set on it and no retry or resilience policy wraps its calls in the type that owns it. This codebase ships libraries/tools rather than a service it operates, so the failure lands as a hung caller — a build step, a CLI run, a UI thread — with no way out.
  • Outbound HTTP without resilience Common/Extensions.cs:350 — `new HttpClient()` builds an outbound HTTP client and nothing bounds it: no timeout is set on it and no retry or resilience policy wraps its calls in the type that owns it. This codebase ships libraries/tools rather than a service it operates, so the failure lands as a hung caller — a build step, a CLI run, a UI thread — with no way out.
  • Outbound HTTP without resilience Common/Extensions.cs:418 — `new HttpClient()` builds an outbound HTTP client and nothing bounds it: no timeout is set on it and no retry or resilience policy wraps its calls in the type that owns it. This codebase ships libraries/tools rather than a service it operates, so the failure lands as a hung caller — a build step, a CLI run, a UI thread — with no way out.
  • Outbound HTTP without resilience Engine/DataFeeds/Transport/RestSubscriptionStreamReader.cs:31 — `new HttpClient()` builds an outbound HTTP client and nothing bounds it: no timeout is set on it and no retry or resilience policy wraps its calls in the type that owns it. This codebase ships libraries/tools rather than a service it operates, so the failure lands as a hung caller — a build step, a CLI run, a UI thread — with no way out.
D3 · God Classes · ClassTooLong · ×3
  • ClassTooLong: FillModel Common/Orders/Fills/FillModel.cs — ClassTooLong — 510 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods. The bar is 400 significant lines; this is 110 over it, 1.28× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: EquityFillModel Common/Orders/Fills/EquityFillModel.cs — ClassTooLong — 452 significant lines (blank, comment-only and punctuation-only lines excluded), 15 methods. The bar is 400 significant lines; this is 52 over it, 1.13× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
  • ClassTooLong: AlgorithmManager Engine/AlgorithmManager.cs — ClassTooLong — 430 significant lines (blank, comment-only and punctuation-only lines excluded), 11 methods. The bar is 400 significant lines; this is 30 over it, 1.08× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D36 · Supply-chain Provenance & Signing · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (9 members, 50+ identical tokens) · ×3
  • Members sharing a duplicated core (9 members, 50+ identical tokens) Algorithm.CSharp/AccumulativeInsightPortfolioRegressionAlgorithm.cs:36 — Algorithm.CSharp/AccumulativeInsightPortfolioRegressionAlgorithm.cs:36-49 | Algorithm.CSharp/AddRiskManagementAlgorithm.cs:36-50 | Algorithm.CSharp/BasicTemplateFrameworkAlgorithm.cs:40-67 | Algorithm.CSharp/CompositeRiskManagementModelFrameworkAlgorithm.cs:32-51 | Algorithm.CSharp/ConfidenceWeightedFrameworkAlgorithm.cs:36-53 | Algorithm.CSharp/ExecutionModelOrderEventsRegressionAlgorithm.cs:39-53 | Algorithm.CSharp/InsightScoringRegressionAlgorithm.cs:39-51 | Algorithm.CSharp/InsightWeightingFrameworkAlgorithm.cs:36-53 | Algorithm.CSharp/PortfolioTargetTagsRegressionAlgorithm.cs:35-46 — These 9 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 9 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 9 times.
  • Members sharing a duplicated core (9 members, 50+ identical tokens) Algorithm.CSharp/FutureOptionCallITMExpiryRegressionAlgorithm.cs:44 — Algorithm.CSharp/FutureOptionCallITMExpiryRegressionAlgorithm.cs:44-72 | Algorithm.CSharp/FutureOptionCallOTMExpiryRegressionAlgorithm.cs:50-79 | Algorithm.CSharp/FutureOptionPutITMExpiryRegressionAlgorithm.cs:45-73 | Algorithm.CSharp/FutureOptionPutOTMExpiryRegressionAlgorithm.cs:49-77 | Algorithm.CSharp/FutureOptionShortCallITMExpiryRegressionAlgorithm.cs:45-73 | Algorithm.CSharp/FutureOptionShortCallOTMExpiryRegressionAlgorithm.cs:46-74 | Algorithm.CSharp/FutureOptionShortPutITMExpiryRegressionAlgorithm.cs:45-73 | Algorithm.CSharp/FutureOptionShortPutOTMExpiryRegressionAlgorithm.cs:46-74 | Algorithm.CSharp/OptionOTMExpiryOrderHasZeroPriceRegressionAlgorithm.cs:51-74 — These 9 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 9 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 9 times.
  • Members sharing a duplicated core (9 members, 50+ identical tokens) Algorithm.CSharp/OptionEquityBearCallLadderRegressionAlgorithm.cs:36 — Algorithm.CSharp/OptionEquityBearCallLadderRegressionAlgorithm.cs:36-80 | Algorithm.CSharp/OptionEquityBearPutLadderRegressionAlgorithm.cs:37-83 | Algorithm.CSharp/OptionEquityBullCallLadderRegressionAlgorithm.cs:37-83 | Algorithm.CSharp/OptionEquityBullPutLadderRegressionAlgorithm.cs:36-80 | Algorithm.CSharp/OptionEquityCallBackspreadRegressionAlgorithm.cs:37-82 | Algorithm.CSharp/OptionEquityOverlappingBullCallSpreadsRegressionAlgorithm.cs:41-95 | Algorithm.CSharp/OptionEquityPutBackspreadRegressionAlgorithm.cs:37-82 | Algorithm.CSharp/OptionEquityShortCallBackspreadRegressionAlgorithm.cs:38-84 | Algorithm.CSharp/OptionEquityShortPutBackspreadRegressionAlgorithm.cs:38-84 — These 9 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 9 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 9 times.
D4 · Code Duplication · Edited copy of a member (54 corresponding lines) · ×3
  • Edited copy of a member (54 corresponding lines) Common/Orders/Fills/FillModel.cs:407 — Common/Orders/Fills/FillModel.cs:407-470 | Common/Orders/Fills/FutureFillModel.cs:115-168 — These two members are one piece of code written twice and then edited apart: 54 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (54 corresponding lines) Algorithm.CSharp/OrderTicketDemoAlgorithm.cs:208 — Algorithm.CSharp/OrderTicketDemoAlgorithm.cs:208-261 | Algorithm.CSharp/OrderTicketDemoAlgorithm.cs:361-419 — These two members are one piece of code written twice and then edited apart: 54 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (54 corresponding lines) Algorithm.CSharp/SetAccountCurrencyCashBuyingPowerModelRegressionAlgorithm.cs:162 — Algorithm.CSharp/SetAccountCurrencyCashBuyingPowerModelRegressionAlgorithm.cs:162-222 | Algorithm.CSharp/SetAccountCurrencySecurityMarginModelRegressionAlgorithm.cs:128-181 — These two members are one piece of code written twice and then edited apart: 54 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (38 corresponding lines) · ×3
  • Edited copy of a member (38 corresponding lines) Common/Brokerages/AlpacaBrokerageModel.cs:91 — Common/Brokerages/AlpacaBrokerageModel.cs:91-133 | Common/Brokerages/BinanceBrokerageModel.cs:123-160 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (38 corresponding lines) Algorithm.Framework/Alphas/HistoricalReturnsAlphaModel.cs:93 — Algorithm.Framework/Alphas/HistoricalReturnsAlphaModel.cs:93-132 | Algorithm.Framework/Alphas/RsiAlphaModel.cs:97-134 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (38 corresponding lines) Algorithm.CSharp/OptionUniverseFilterOptionsDataLinqRegressionAlgorithm.cs:30 — Algorithm.CSharp/OptionUniverseFilterOptionsDataLinqRegressionAlgorithm.cs:30-70 | Algorithm.CSharp/OptionUniverseFilterOptionsDataRegressionAlgorithm.cs:29-66 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (26 corresponding lines) · ×3
  • Edited copy of a member (26 corresponding lines) Algorithm.Python/BasicTemplateContinuousFutureAlgorithm.py:41 — Algorithm.Python/BasicTemplateContinuousFutureAlgorithm.py:41-66 | Algorithm.Python/BasicTemplateContinuousFutureWithExtendedMarketAlgorithm.py:42-72 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) Algorithm.Framework/Alphas/HistoricalReturnsAlphaModel.py:58 — Algorithm.Framework/Alphas/HistoricalReturnsAlphaModel.py:58-83 | Algorithm.Framework/Portfolio/RiskParityPortfolioConstructionModel.py:95-120 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) Algorithm.CSharp/CoveredAndProtectiveCallStrategiesAlgorithm.cs:54 — Algorithm.CSharp/CoveredAndProtectiveCallStrategiesAlgorithm.cs:54-79 | Algorithm.CSharp/CoveredAndProtectivePutStrategiesAlgorithm.cs:54-79 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (41 corresponding lines) · ×3
  • Edited copy of a member (41 corresponding lines) Indicators/CandlestickPatterns/DojiStar.cs:77 — Indicators/CandlestickPatterns/DojiStar.cs:77-119 | Indicators/CandlestickPatterns/HaramiCross.cs:75-115 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (41 corresponding lines) Algorithm.CSharp/ForexInternalFeedOnDataHigherResolutionRegressionAlgorithm.cs:54 — Algorithm.CSharp/ForexInternalFeedOnDataHigherResolutionRegressionAlgorithm.cs:54-94 | Algorithm.CSharp/ForexInternalFeedOnDataSameResolutionRegressionAlgorithm.cs:54-94 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (41 corresponding lines) Algorithm.CSharp/AddFutureOptionContractDataStreamingRegressionAlgorithm.cs:112 — Algorithm.CSharp/AddFutureOptionContractDataStreamingRegressionAlgorithm.cs:112-152 | Algorithm.CSharp/AddFutureOptionSingleOptionChainSelectedInUniverseFilterRegressionAlgorithm.cs:166-208 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (27 corresponding lines) · ×3
  • Edited copy of a member (27 corresponding lines) Common/Data/Market/TradeBar.cs:628 — Common/Data/Market/TradeBar.cs:628-655 | Common/Data/Market/TradeBar.cs:661-687 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) Algorithm.CSharp/BasicTemplateOptionStrategyAlgorithm.cs:65 — Algorithm.CSharp/BasicTemplateOptionStrategyAlgorithm.cs:65-91 | Algorithm.CSharp/BasicTemplateOptionTradesAlgorithm.cs:58-85 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) Algorithm.Framework/Portfolio/MeanVarianceOptimizationPortfolioConstructionModel.py:78 — Algorithm.Framework/Portfolio/MeanVarianceOptimizationPortfolioConstructionModel.py:78-108 | Algorithm.Framework/Portfolio/RiskParityPortfolioConstructionModel.py:66-92 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (34 corresponding lines) · ×3
  • Edited copy of a member (34 corresponding lines) Algorithm.Framework/Portfolio/BlackLittermanOptimizationPortfolioConstructionModel.py:40 — Algorithm.Framework/Portfolio/BlackLittermanOptimizationPortfolioConstructionModel.py:40-78 | Algorithm.Framework/Portfolio/MeanVarianceOptimizationPortfolioConstructionModel.py:30-63 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (34 corresponding lines) Indicators/Maximum.cs:61 — Indicators/Maximum.cs:61-94 | Indicators/Minimum.cs:61-94 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (34 corresponding lines) Algorithm.CSharp/WarmupDailyResolutionRegressionAlgorithm.cs:53 — Algorithm.CSharp/WarmupDailyResolutionRegressionAlgorithm.cs:53-117 | Algorithm.CSharp/WarmupLowerResolutionTimeSpanRegressionAlgorithm.cs:42-75 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (32 corresponding lines) · ×3
  • Edited copy of a member (32 corresponding lines) Algorithm.CSharp/WarmupLowerResolutionOptionRegressionAlgorithm.cs:52 — Algorithm.CSharp/WarmupLowerResolutionOptionRegressionAlgorithm.cs:52-92 | Algorithm.CSharp/WarmupOptionRegressionAlgorithm.cs:53-84 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) Common/Time.cs:715 — Common/Time.cs:715-746 | Common/Time.cs:757-791 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) Algorithm.CSharp/CapacityTests/CheeseMilkHourlyRebalance.cs:49 — Algorithm.CSharp/CapacityTests/CheeseMilkHourlyRebalance.cs:49-87 | Algorithm.CSharp/CapacityTests/IntradayMinuteScalpingFuturesES.cs:52-83 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 12+ corresponding lines) · ×3
  • Edited copies of one member (4 members, 12+ corresponding lines) Algorithm.CSharp/CoveredAndProtectiveCallStrategiesAlgorithm.cs:39 — Algorithm.CSharp/CoveredAndProtectiveCallStrategiesAlgorithm.cs:39-51 | Algorithm.CSharp/CoveredAndProtectivePutStrategiesAlgorithm.cs:39-51 | Algorithm.CSharp/NakedCallStrategyAlgorithm.cs:38-49 | Algorithm.CSharp/NakedPutStrategyAlgorithm.cs:38-49 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 12+ corresponding lines) REDACTED:49 — REDACTED:49-60 | REDACTED:70-81 | REDACTED:91-102 | REDACTED:113-124 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 12+ corresponding lines) Algorithm.Python/BasicTemplateOptionEquityStrategyAlgorithm.py:28 — Algorithm.Python/BasicTemplateOptionEquityStrategyAlgorithm.py:28-39 | Algorithm.Python/BasicTemplateOptionStrategyAlgorithm.py:29-45 | Algorithm.Python/BasicTemplateOptionsAlgorithm.py:28-44 | Algorithm.Python/BasicTemplateOptionsHourlyAlgorithm.py:28-44 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 13+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 13+ corresponding lines) Algorithm.CSharp/CustomUniverseSelectionRegressionAlgorithm.cs:35 — Algorithm.CSharp/CustomUniverseSelectionRegressionAlgorithm.cs:35-48 | Algorithm.CSharp/UniverseSharingSubscriptionRequestRegressionAlgorithm.cs:40-55 | Algorithm.CSharp/UniverseSharingSubscriptionTradableRegressionAlgorithm.cs:41-53 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 13+ corresponding lines) Algorithm.Python/CoarseFineFundamentalComboAlgorithm.py:26 — Algorithm.Python/CoarseFineFundamentalComboAlgorithm.py:26-42 | Algorithm.Python/CoarseFineFundamentalRegressionAlgorithm.py:26-38 | Algorithm.Python/CoarseFundamentalTop3Algorithm.py:26-40 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 13+ corresponding lines) Common/Securities/Option/StrategyMatcher/OptionPosition.cs:154 — Common/Securities/Option/StrategyMatcher/OptionPosition.cs:154-166 | Common/Securities/Option/StrategyMatcher/OptionStrategyDefinitionMatch.cs:137-154 | Common/Securities/Positions/PositionGroupBuyingPowerModel.cs:545-562 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 8+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 8+ corresponding lines) Algorithm.CSharp/FutureUniverseOpenInterestRegressionAlgorithm.cs:29 — Algorithm.CSharp/FutureUniverseOpenInterestRegressionAlgorithm.cs:29-36 | Algorithm.CSharp/IndexOptionUniverseOpenInterestRegressionAlgorithm.cs:28-35 | Algorithm.CSharp/OptionUniverseOpenInterestRegressionAlgorithm.cs:38-46 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 8+ corresponding lines) Algorithm.Python/DelistingEventsAlgorithm.py:26 — Algorithm.Python/DelistingEventsAlgorithm.py:26-33 | Algorithm.Python/QuitAfterInitializationRegressionAlgorithm.py:23-30 | Algorithm.Python/QuitInInitializationRegressionAlgorithm.py:23-30 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 8+ corresponding lines) Messaging/EventMessagingHandler.cs:123 — Messaging/EventMessagingHandler.cs:123-130 | Messaging/Messaging.cs:114-121 | Messaging/StreamingMessageHandler.cs:75-82 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 6+ corresponding lines) · ×3
  • Edited copies of one member (5 members, 6+ corresponding lines) Algorithm/QCAlgorithm.Indicators.cs:216 — Algorithm/QCAlgorithm.Indicators.cs:216-222 | Algorithm/QCAlgorithm.Indicators.cs:780-786 | Algorithm/QCAlgorithm.Indicators.cs:1131-1137 | Algorithm/QCAlgorithm.Indicators.cs:2090-2095 | Algorithm/QCAlgorithm.Indicators.cs:2204-2209 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
  • Edited copies of one member (5 members, 6+ corresponding lines) Algorithm.Python/BracketOrderLimitEntryRegressionAlgorithm.py:23 — Algorithm.Python/BracketOrderLimitEntryRegressionAlgorithm.py:23-31 | Algorithm.Python/BracketOrderRegressionAlgorithm.py:23-29 | Algorithm.Python/ContingentOrderCancelRegressionAlgorithm.py:25-31 | Algorithm.Python/ContingentOrderUpdateRegressionAlgorithm.py:24-29 | Algorithm.Python/ContingentTrailingStopOrderRegressionAlgorithm.py:25-32 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
  • Edited copies of one member (5 members, 6+ corresponding lines) Indicators/CandlestickPatterns/AbandonedBaby.cs:60 — Indicators/CandlestickPatterns/AbandonedBaby.cs:60-66 | Indicators/CandlestickPatterns/EveningDojiStar.cs:58-64 | Indicators/CandlestickPatterns/EveningStar.cs:56-61 | Indicators/CandlestickPatterns/MorningDojiStar.cs:58-64 | Indicators/CandlestickPatterns/MorningStar.cs:56-61 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 6+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 6+ corresponding lines) Common/Data/Market/Bar.cs:118 — Common/Data/Market/Bar.cs:118-123 | Common/Data/Market/SessionBar.cs:220-227 | Common/Data/Market/TradeBar.cs:860-867 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 6+ corresponding lines) Algorithm.CSharp/EquityOptionsUniverseSettingsRegressionAlgorithm.cs:51 — Algorithm.CSharp/EquityOptionsUniverseSettingsRegressionAlgorithm.cs:51-57 | Algorithm.CSharp/IndexOptionsUniverseSettingsRegressionAlgorithm.cs:30-36 | Algorithm.CSharp/IndicatorBasedOptionPricingModelRegressionAlgorithm.cs:55-60 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 6+ corresponding lines) Algorithm.CSharp/OptionStrategyFilteringUniverseCallSpreadRegressionAlgorithm.cs:32 — Algorithm.CSharp/OptionStrategyFilteringUniverseCallSpreadRegressionAlgorithm.cs:32-37 | Algorithm.CSharp/OptionStrategyFilteringUniversePutSpreadRegressionAlgorithm.cs:32-37 | Algorithm.CSharp/OptionStrategyFilteringUniverseStrangleRegressionAlgorithm.cs:32-37 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 4+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 4+ corresponding lines) Algorithm.Framework/Portfolio/BlackLittermanOptimizationPortfolioConstructionModel.py:275 — Algorithm.Framework/Portfolio/BlackLittermanOptimizationPortfolioConstructionModel.py:275-278 | Algorithm.Framework/Portfolio/MeanVarianceOptimizationPortfolioConstructionModel.py:135-138 | Algorithm.Framework/Portfolio/RiskParityPortfolioConstructionModel.py:125-128 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 4+ corresponding lines) Algorithm.Python/MaximumDrawdownPercentPerSecurityFrameworkRegressionAlgorithm.py:24 — Algorithm.Python/MaximumDrawdownPercentPerSecurityFrameworkRegressionAlgorithm.py:24-27 | Algorithm.Python/MaximumDrawdownPercentPortfolioFrameworkRegressionAlgorithm.py:25-32 | Algorithm.Python/MaximumUnrealizedProfitPercentPerSecurityFrameworkRegressionAlgorithm.py:24-27 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 4+ corresponding lines) Algorithm.CSharp/BasicTemplateCryptoAlgorithm.cs:182 — Algorithm.CSharp/BasicTemplateCryptoAlgorithm.cs:182-185 | Algorithm.CSharp/BybitCryptoFuturesRegressionAlgorithm.cs:198-206 | Algorithm.CSharp/BybitCryptoRegressionAlgorithm.cs:109-118 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (32 lines × 2) · ×3
  • Duplicated block (32 lines × 2) Common/Securities/BuyingPowerModel.cs:188 — Common/Securities/BuyingPowerModel.cs:188-219 | Common/Securities/CryptoFuture/CryptoFutureMarginModel.cs:103-134 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (32 lines × 2) Algorithm.CSharp/LongAndShortButterflyCallStrategiesAlgorithm.cs:70 — Algorithm.CSharp/LongAndShortButterflyCallStrategiesAlgorithm.cs:70-101 | Algorithm.CSharp/LongAndShortButterflyPutStrategiesAlgorithm.cs:70-101 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (32 lines × 2) Algorithm.CSharp/FutureOptionCallITMExpiryRegressionAlgorithm.cs:129 — Algorithm.CSharp/FutureOptionCallITMExpiryRegressionAlgorithm.cs:129-160 | Algorithm.CSharp/FutureOptionPutITMExpiryRegressionAlgorithm.cs:130-161 — before extracting anything, compare `Algorithm.CSharp/FutureOptionCallITMExpiryRegressionAlgorithm.cs` and `Algorithm.CSharp/FutureOptionPutITMExpiryRegressionAlgorithm.cs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 77 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (26 lines × 2) · ×3
  • Duplicated block (26 lines × 2) Algorithm.CSharp/OptionEquityIronButterflyRegressionAlgorithm.cs:39 — Algorithm.CSharp/OptionEquityIronButterflyRegressionAlgorithm.cs:39-64 | Algorithm.CSharp/OptionEquityShortIronButterflyRegressionAlgorithm.cs:39-64 — before extracting anything, compare `Algorithm.CSharp/OptionEquityIronButterflyRegressionAlgorithm.cs` and `Algorithm.CSharp/OptionEquityShortIronButterflyRegressionAlgorithm.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/OptionEquityIronButterflyRegressionAlgorithm.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 (26 lines × 2) Common/Orders/Fills/EquityFillModel.cs:587 — Common/Orders/Fills/EquityFillModel.cs:587-612 | Common/Orders/Fills/EquityFillModel.cs:698-723 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `order` to `MarketOnOpenOrder` in one and `MarketOnCloseOrder` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (26 lines × 2) Indicators/CandlestickPatterns/InvertedHammer.cs:83 — Indicators/CandlestickPatterns/InvertedHammer.cs:83-108 | Indicators/CandlestickPatterns/ShootingStar.cs:84-109 — before extracting anything, compare `Indicators/CandlestickPatterns/InvertedHammer.cs` and `Indicators/CandlestickPatterns/ShootingStar.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/InvertedHammer.cs:83` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (25–26 lines × 2) · ×3
  • Duplicated block (25–26 lines × 2) Common/Data/Market/TradeBar.cs:199 — Common/Data/Market/TradeBar.cs:199-224 | Common/Data/Market/TradeBar.cs:264-288 — both copies are in the same file, so extract the 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/Market/TradeBar.cs:199` 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 (25–26 lines × 2) Indicators/CandlestickPatterns/Hikkake.cs:114 — Indicators/CandlestickPatterns/Hikkake.cs:114-139 | Indicators/CandlestickPatterns/HikkakeModified.cs:152-176 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/Hikkake.cs:114` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Indicators/CandlestickPatterns/HikkakeModified.cs:181` calls `GetCandleRange` and `Indicators/CandlestickPatterns/Hikkake.cs:141` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (25–26 lines × 2) Algorithm.Python/BasicTemplateCryptoFutureAlgorithm.py:91 — Algorithm.Python/BasicTemplateCryptoFutureAlgorithm.py:91-115 | Algorithm.Python/BasicTemplateCryptoFutureHourlyAlgorithm.py:73-98 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×3
  • Duplicated block (23 lines × 2) Algorithm.CSharp/Collective2PortfolioSignalExportDemonstrationAlgorithm.cs:106 — Algorithm.CSharp/Collective2PortfolioSignalExportDemonstrationAlgorithm.cs:106-128 | Algorithm.CSharp/Collective2SignalExportDemonstrationAlgorithm.cs:127-149 — before extracting anything, compare `Algorithm.CSharp/Collective2PortfolioSignalExportDemonstrationAlgorithm.cs` and `Algorithm.CSharp/Collective2SignalExportDemonstrationAlgorithm.cs` as WHOLE FILES: 84% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/Collective2PortfolioSignalExportDemonstrationAlgorithm.cs:106` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (23 lines × 2) Algorithm.Python/CustomDataMultiFileObjectStoreRegressionAlgorithm.py:56 — Algorithm.Python/CustomDataMultiFileObjectStoreRegressionAlgorithm.py:56-78 | Algorithm.Python/CustomDataObjectStoreRegressionAlgorithm.py:47-69 — before extracting anything, compare `Algorithm.Python/CustomDataMultiFileObjectStoreRegressionAlgorithm.py` and `Algorithm.Python/CustomDataObjectStoreRegressionAlgorithm.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (23 lines × 2) Algorithm.CSharp/CapacityTests/MonthlyRebalanceDaily.cs:29 — Algorithm.CSharp/CapacityTests/MonthlyRebalanceDaily.cs:29-51 | Algorithm.CSharp/CapacityTests/MonthlyRebalanceHourly.cs:29-51 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (22–23 lines × 2) · ×3
  • Duplicated block (22–23 lines × 2) Common/Algorithm/Framework/Portfolio/SignalExports/NumeraiSignalExport.cs:182 — Common/Algorithm/Framework/Portfolio/SignalExports/NumeraiSignalExport.cs:182-204 | Common/Algorithm/Framework/Portfolio/SignalExports/NumeraiSignalExport.cs:246-267 — both copies are in the same file, so extract the 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/Algorithm/Framework/Portfolio/SignalExports/NumeraiSignalExport.cs:182` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `filename` to `$filename modelId: $modelId` in one and `$filename modelId: $modelId triggerId: $triggerId source: ""numerapi""` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (22–23 lines × 2) Common/Orders/Fills/FillModel.cs:348 — Common/Orders/Fills/FillModel.cs:348-370 | Common/Orders/Fills/FillModel.cs:407-428 — both copies are in the same file, so extract the 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:348` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `order` to `StopMarketOrder` in one and `TrailingStopOrder` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (22–23 lines × 2) Algorithm.Framework/Execution/StandardDeviationExecutionModel.cs:76 — Algorithm.Framework/Execution/StandardDeviationExecutionModel.cs:76-97 | Algorithm.Framework/Execution/VolumeWeightedAveragePriceExecutionModel.cs:60-82 — before extracting anything, compare `Algorithm.Framework/Execution/StandardDeviationExecutionModel.cs` and `Algorithm.Framework/Execution/VolumeWeightedAveragePriceExecutionModel.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.Framework/Execution/StandardDeviationExecutionModel.cs:76` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×3
  • Duplicated block (15 lines × 3) Common/Data/Market/QuoteBar.cs:316 — Common/Data/Market/QuoteBar.cs:316-330 | Common/Data/Market/QuoteBar.cs:365-379 | Common/Data/Market/TradeBar.cs:291-305 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Common/Data/Market/QuoteBar.cs:316` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 3) Indicators/CandlestickPatterns/Counterattack.cs:83 — Indicators/CandlestickPatterns/Counterattack.cs:83-97 | Indicators/CandlestickPatterns/Kicking.cs:84-98 | Indicators/CandlestickPatterns/KickingByLength.cs:85-99 — before extracting anything, compare `Indicators/CandlestickPatterns/Kicking.cs` and `Indicators/CandlestickPatterns/KickingByLength.cs` as WHOLE FILES: 87% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/Counterattack.cs:83` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (15 lines × 3) Common/Brokerages/AlpacaBrokerageModel.cs:92 — Common/Brokerages/AlpacaBrokerageModel.cs:92-106 | Common/Brokerages/BinanceBrokerageModel.cs:124-138 | Common/Brokerages/EtoroBrokerageModel.cs:185-199 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (16–17 lines × 3) · ×3
  • Duplicated block (16–17 lines × 3) Common/Orders/Fees/AlphaStreamsFeeModel.cs:89 — Common/Orders/Fees/AlphaStreamsFeeModel.cs:89-105 | Common/Orders/Fees/BinanceFeeModel.cs:74-89 | Common/Orders/Fees/BitfinexFeeModel.cs:66-81 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Common/Orders/Fees/AlphaStreamsFeeModel.cs:89` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (16–17 lines × 3) Common/Orders/Fills/EquityFillModel.cs:53 — Common/Orders/Fills/EquityFillModel.cs:53-68 | Common/Orders/Fills/EquityFillModel.cs:281-297 | Common/Orders/Fills/EquityFillModel.cs:407-422 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Common/Orders/Fills/EquityFillModel.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. Note first that the copies are not typed on the same thing: the declarations holding them bind `order` to `LimitIfTouchedOrder` in one and `StopLimitOrder` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (16–17 lines × 3) Indicators/CandlestickPatterns/BeltHold.cs:104 — Indicators/CandlestickPatterns/BeltHold.cs:104-119 | Indicators/CandlestickPatterns/ClosingMarubozu.cs:104-119 | Indicators/CandlestickPatterns/Marubozu.cs:92-108 — before extracting anything, compare `Indicators/CandlestickPatterns/BeltHold.cs` and `Indicators/CandlestickPatterns/ClosingMarubozu.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/BeltHold.cs:104` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×3
  • Duplicated block (16–17 lines × 2) Indicators/CandlestickPatterns/DojiStar.cs:104 — Indicators/CandlestickPatterns/DojiStar.cs:104-119 | Indicators/CandlestickPatterns/HaramiCross.cs:99-115 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/DojiStar.cs:104` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (16–17 lines × 2) Algorithm.CSharp/BacktestingBrokerageRegressionAlgorithm.cs:88 — Algorithm.CSharp/BacktestingBrokerageRegressionAlgorithm.cs:88-104 | Algorithm.CSharp/OptionExerciseAssignRegressionAlgorithm.cs:71-86 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/BacktestingBrokerageRegressionAlgorithm.cs:88` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16–17 lines × 2) Algorithm.CSharp/DropboxBaseDataUniverseSelectionAlgorithm.cs:91 — Algorithm.CSharp/DropboxBaseDataUniverseSelectionAlgorithm.cs:91-107 | Algorithm.CSharp/DropboxUniverseSelectionAlgorithm.cs:122-137 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×3
  • Duplicated block (14 lines × 3) Common/Util/LeanData.cs:297 — Common/Util/LeanData.cs:297-310 | Common/Util/LeanData.cs:368-381 | Common/Util/LeanData.cs:439-452 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Common/Util/LeanData.cs:297` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 × 3) Indicators/CandlestickPatterns/Harami.cs:102 — Indicators/CandlestickPatterns/Harami.cs:102-115 | Indicators/CandlestickPatterns/HomingPigeon.cs:106-119 | Indicators/CandlestickPatterns/UniqueThreeRiver.cs:112-125 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/Harami.cs:102` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (14 lines × 3) Common/Orders/Fills/FillModel.cs:360 — Common/Orders/Fills/FillModel.cs:360-374 | Common/Orders/Fills/FillModel.cs:419-432 | Common/Orders/Fills/FutureFillModel.cs:130-144 — before extracting anything, compare `Common/Orders/Fills/FillModel.cs` and `Common/Orders/Fills/FutureFillModel.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Common/Orders/Fills/FillModel.cs:360` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `order` to `StopMarketOrder` in one and `TrailingStopOrder` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×3
  • Duplicated block (11 lines × 3) Common/Data/Market/QuoteBar.cs:306 — Common/Data/Market/QuoteBar.cs:306-316 | Common/Data/Market/QuoteBar.cs:355-365 | Common/Data/Market/TradeBar.cs:323-333 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Common/Data/Market/QuoteBar.cs:306` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 3) Indicators/CandlestickPatterns/EveningStar.cs:130 — Indicators/CandlestickPatterns/EveningStar.cs:130-140 | Indicators/CandlestickPatterns/MorningStar.cs:130-140 | Indicators/CandlestickPatterns/UpsideGapTwoCrows.cs:114-124 — before extracting anything, compare `Indicators/CandlestickPatterns/EveningStar.cs` and `Indicators/CandlestickPatterns/MorningStar.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/EveningStar.cs:130` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Indicators/CandlestickPatterns/EveningStar.cs:142` calls `GetCandleRange` and `Indicators/CandlestickPatterns/UpsideGapTwoCrows.cs:126` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 3) Algorithm.CSharp/IndexOptionCallOTMExpiryRegressionAlgorithm.cs:63 — Algorithm.CSharp/IndexOptionCallOTMExpiryRegressionAlgorithm.cs:63-73 | Algorithm.CSharp/IndexOptionShortCallITMExpiryRegressionAlgorithm.cs:67-77 | Algorithm.CSharp/IndexOptionShortCallOTMExpiryRegressionAlgorithm.cs:57-67 — before extracting anything, compare `Algorithm.CSharp/IndexOptionCallOTMExpiryRegressionAlgorithm.cs` and `Algorithm.CSharp/IndexOptionShortCallOTMExpiryRegressionAlgorithm.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 66 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/IndexOptionCallOTMExpiryRegressionAlgorithm.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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (8 lines × 4) · ×3
  • Duplicated block (8 lines × 4) Indicators/CandlestickPatterns/ConcealedBabySwallow.cs:74 — Indicators/CandlestickPatterns/ConcealedBabySwallow.cs:74-81 | Indicators/CandlestickPatterns/IdenticalThreeCrows.cs:78-85 | Indicators/CandlestickPatterns/ThreeBlackCrows.cs:73-80 | Indicators/CandlestickPatterns/ThreeWhiteSoldiers.cs:87-94 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/ConcealedBabySwallow.cs:74` 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 (8 lines × 4) Algorithm.Python/CustomDataBitcoinAlgorithm.py:83 — Algorithm.Python/CustomDataBitcoinAlgorithm.py:83-90 | Algorithm.Python/CustomDataBitcoinAlgorithm.py:110-118 | Algorithm.Python/LiveFeaturesAlgorithm.py:118-125 | Algorithm.Python/LiveFeaturesAlgorithm.py:139-147 — before extracting anything, compare `Algorithm.Python/CustomDataBitcoinAlgorithm.py` and `Algorithm.Python/LiveFeaturesAlgorithm.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 4) Algorithm.Python/CustomDataPropertiesRegressionAlgorithm.py:94 — Algorithm.Python/CustomDataPropertiesRegressionAlgorithm.py:94-101 | Algorithm.Python/CustomDataPropertiesRegressionAlgorithm.py:112-120 | Algorithm.Python/CustomDataRegressionAlgorithm.py:90-97 | Algorithm.Python/CustomDataRegressionAlgorithm.py:112-120 — before extracting anything, compare `Algorithm.Python/CustomDataPropertiesRegressionAlgorithm.py` and `Algorithm.Python/CustomDataRegressionAlgorithm.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Algorithm.Python/CustomDataRegressionAlgorithm.py:102` calls `strip`, `isdigit` and `Algorithm.Python/CustomDataPropertiesRegressionAlgorithm.py:106` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (6–7 lines × 2) · ×3
  • Duplicated block (6–7 lines × 2) Engine/HistoricalData/HistoryProviderManager.cs:117 — Engine/HistoricalData/HistoryProviderManager.cs:117-122 | Engine/HistoricalData/SubscriptionDataReaderHistoryProvider.cs:125-131 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Engine/HistoricalData/SubscriptionDataReaderHistoryProvider.cs:125` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (6–7 lines × 2) Algorithm.Python/FutureOptionDailyRegressionAlgorithm.py:39 — Algorithm.Python/FutureOptionDailyRegressionAlgorithm.py:39-45 | Algorithm.Python/FutureOptionHourlyRegressionAlgorithm.py:38-43 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.Python/FutureOptionDailyRegressionAlgorithm.py:39` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6–7 lines × 2) Algorithm.Python/OptionRenameRegressionAlgorithm.py:43 — Algorithm.Python/OptionRenameRegressionAlgorithm.py:43-49 | Algorithm.Python/OptionRenameRegressionAlgorithm.py:61-66 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×3
  • Duplicated block (5 lines × 3) Algorithm.CSharp/BasicTemplateFrameworkAlgorithm.cs:46 — Algorithm.CSharp/BasicTemplateFrameworkAlgorithm.cs:46-59 | Algorithm.CSharp/ExecutionModelOrderEventsRegressionAlgorithm.cs:44-48 | Algorithm.CSharp/InsightScoringRegressionAlgorithm.cs:41-45 — before extracting anything, compare `Algorithm.CSharp/BasicTemplateFrameworkAlgorithm.cs` and `Algorithm.CSharp/ExecutionModelOrderEventsRegressionAlgorithm.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Algorithm.CSharp/BasicTemplateFrameworkAlgorithm.cs:46` calls `SetCash` and `Algorithm.CSharp/InsightScoringRegressionAlgorithm.cs:41` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 3) Algorithm.Python/FundamentalRegressionAlgorithm.py:106 — Algorithm.Python/FundamentalRegressionAlgorithm.py:106-110 | Algorithm.Python/FundamentalUniverseSelectionAlgorithm.py:42-46 | Algorithm.Python/FundamentalUniverseSelectionRegressionAlgorithm.py:63-67 — before extracting anything, compare `Algorithm.Python/FundamentalRegressionAlgorithm.py` and `Algorithm.Python/FundamentalUniverseSelectionRegressionAlgorithm.py` as WHOLE FILES: 83% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 3) Algorithm.Python/IndexOptionBearCallSpreadAlgorithm.py:27 — Algorithm.Python/IndexOptionBearCallSpreadAlgorithm.py:27-31 | Algorithm.Python/IndexOptionCallCalendarSpreadAlgorithm.py:26-30 | Algorithm.Python/IndexOptionPutCalendarSpreadAlgorithm.py:25-29 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Algorithm.Python/IndexOptionCallCalendarSpreadAlgorithm.py:23` calls `add_equity` and `Algorithm.Python/IndexOptionBearCallSpreadAlgorithm.py:23` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
IC1 · Incompleteness & stubs · Condition was already decided · ×3
  • Condition was already decided — an earlier guard makes this test constant Algorithm.CSharp/CryptoFutureLeverageBasedMarginRegressionAlgorithm.cs:99 — Control only reaches here when `marginRemaining > 0` is false, because the guard on line 62 exits otherwise. This test is therefore always false and everything it guards is unreachable. Implement the distinction that was intended, or delete the test.
  • Condition was already decided — an earlier guard makes this test constant Algorithm.CSharp/IndicatorHistoryRegressionAlgorithm.cs:53 — Control only reaches here when `bollingerBands.Window.IsReady` is false, because the guard on line 46 exits otherwise. This test is therefore always true and its `else`, and any code it is meant to skip, is unreachable. Implement the distinction that was intended, or delete the test.
  • Condition was already decided — an earlier guard makes this test constant Algorithm/QCAlgorithm.History.cs:1458 — Control only reaches here when `resolution != null` is false, because the guard on line 1428 exits otherwise. This test is therefore always false and everything it guards is unreachable. Implement the distinction that was intended, or delete the test.
P12 · CI test-gate honesty · CI test gate excludes suites by filter · ×3
  • CI test gate excludes suites by filter REDACTED:44 — `dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --blame-hang-timeout 300seconds --blame-crash --filter "TestCategory!=TravisExclud…` filters with `TestCategory!=TravisExclude&TestCategory!=ResearchRegressionTests` — the suites it excludes. Run what it drops in another job before merge (a complementary filter), or remove the filter.
  • CI test gate excludes suites by filter REDACTED:51 — `dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter "FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests&Name!=P…` filters with `FullyQualifiedName=QuantConnect.Tests.Python.PythonPackagesTests&Name!=PyStan` — the suites it excludes. Run what it drops in another job before merge (a complementary filter), or remove the filter.
  • CI test gate excludes suites by filter .travis.yml:23 — `dotnet test ./Tests/bin/Release/QuantConnect.Tests.dll --filter TestCategory!=TravisExclude -- TestRunParameters.Parameter\(name=\"log-ha…` filters with `TestCategory!=TravisExclude` — the suites it excludes. Run what it drops in another job before merge (a complementary filter), or remove the filter.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×3
  • Swallowed exception (caught, then discarded) Engine/DataFeeds/DownloaderDataProvider.cs:155 — `catch (InvalidOperationException)` does nothing with the exception it caught — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch. Log it through whatever this codebase already uses to report problems, or let it propagate; if one specific failure genuinely cannot matter, catch exactly that exception type and say why in a comment on the catch.
  • Swallowed exception (caught, then discarded) Algorithm/Portfolio/PortfolioConstructionModel.cs:233 — `catch` does nothing with the exception it caught — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch. Log it through whatever this codebase already uses to report problems, or let it propagate; if one specific failure genuinely cannot matter, catch exactly that exception type and say why in a comment on the catch.
  • Swallowed exception (caught, then discarded) Common/Python/FeeModelPythonWrapper.cs:55 — `catch (PythonException)` does nothing with the exception it caught — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch. Log it through whatever this codebase already uses to report problems, or let it propagate; if one specific failure genuinely cannot matter, catch exactly that exception type and say why in a comment on the catch.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D31 · IaC & Container Security · Medium IaC · ×2
  • REDACTED
  • REDACTED
D35 · Change Coupling · Change coupling · ×2
  • Change coupling: BlackLittermanOptimizationPortfolioConstructionModel.py ↔ MeanVarianceOptimizationPortfolioConstructionModel.py Algorithm.Framework/Portfolio/BlackLittermanOptimizationPortfolioConstructionModel.py:1 — `Algorithm.Framework/Portfolio/BlackLittermanOptimizationPortfolioConstructionModel.py` and `Algorithm.Framework/Portfolio/MeanVarianceOptimizationPortfolioConstructionModel.py` change together 58% of the time (11 of the 19 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `5729be46` Make RollingWindow compatible with any data type (#8836); `7c68e3f3` Refactor Portfolio Construction Models to Use Insight Manager (#7077); `75ca2862` Address reviews — run `git show` on any of them.
  • Change coupling: DefaultBrokerageModel.cs ↔ BrokerageModelPythonWrapper.cs Common/Brokerages/DefaultBrokerageModel.cs:1 — `Common/Brokerages/DefaultBrokerageModel.cs` and `Common/Python/BrokerageModelPythonWrapper.cs` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `5e9901c6` Shortable modeling improvements (#7579); `94d766ff` Refactor Default Benchmark (#5158); `3e7af17e` Implements Easy To Borrow Reality Modeling (WIP) (#5159) — run `git show` on any of them.
D4 · Code Duplication · Near-duplicate member family (4 members, 19 shared lines) · ×2
  • Near-duplicate member family (4 members, 19 shared lines) Algorithm.Python/FutureOptionCallITMExpiryRegressionAlgorithm.py:30 — Algorithm.Python/FutureOptionCallITMExpiryRegressionAlgorithm.py:30-52 | Algorithm.Python/FutureOptionCallOTMExpiryRegressionAlgorithm.py:34-59 | Algorithm.Python/FutureOptionShortCallITMExpiryRegressionAlgorithm.py:30-54 | Algorithm.Python/FutureOptionShortCallOTMExpiryRegressionAlgorithm.py:31-54 — These 4 members are variants of one another: a block of 19 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Near-duplicate member family (4 members, 19 shared lines) Algorithm.Python/FutureOptionPutITMExpiryRegressionAlgorithm.py:29 — Algorithm.Python/FutureOptionPutITMExpiryRegressionAlgorithm.py:29-51 | Algorithm.Python/FutureOptionPutOTMExpiryRegressionAlgorithm.py:34-58 | Algorithm.Python/FutureOptionShortPutITMExpiryRegressionAlgorithm.py:30-54 | Algorithm.Python/FutureOptionShortPutOTMExpiryRegressionAlgorithm.py:31-55 — These 4 members are variants of one another: a block of 19 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Members sharing a duplicated core (7 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (7 members, 50+ identical tokens) Common/Brokerages/CharlesSchwabBrokerageModel.cs:95 — Common/Brokerages/CharlesSchwabBrokerageModel.cs:95-119 | Common/Brokerages/EzeBrokerageModel.cs:91-122 | Common/Brokerages/PublicBrokerageModel.cs:82-121 | Common/Brokerages/RBIBrokerageModel.cs:59-88 | Common/Brokerages/TDAmeritradeBrokerageModel.cs:60-90 | Common/Brokerages/TastytradeBrokerageModel.cs:90-118 | Common/Brokerages/TradeStationBrokerageModel.cs:129-186 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
  • Members sharing a duplicated core (7 members, 50+ identical tokens) Algorithm.CSharp/OptionStrategyFilteringUniverseBoxSpreadRegressionAlgorithm.cs:40 — Algorithm.CSharp/OptionStrategyFilteringUniverseBoxSpreadRegressionAlgorithm.cs:40-87 | Algorithm.CSharp/OptionStrategyFilteringUniverseConversionRegressionAlgorithm.cs:40-75 | Algorithm.CSharp/OptionStrategyFilteringUniverseIronCondorRegressionAlgorithm.cs:40-89 | Algorithm.CSharp/OptionStrategyFilteringUniverseJellyRollRegressionAlgorithm.cs:40-87 | Algorithm.CSharp/OptionStrategyFilteringUniverseProtectiveCollarRegressionAlgorithm.cs:40-76 | Algorithm.CSharp/OptionStrategyFilteringUniverseStraddleRegressionAlgorithm.cs:40-74 | Algorithm.CSharp/OptionStrategyFilteringUniverseStrangleRegressionAlgorithm.cs:40-75 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
D4 · Code Duplication · Edited copy of a member (42 corresponding lines) · ×2
  • Edited copy of a member (42 corresponding lines) Common/Securities/Option/OptionFilterUniverse.cs:798 — Common/Securities/Option/OptionFilterUniverse.cs:798-839 | Common/Securities/Option/OptionFilterUniverse.cs:851-902 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (42 corresponding lines) Algorithm.CSharp/EuropeanOptionsCannotBeExercisedBeforeExpiryRegressionAlgorithm.cs:57 — Algorithm.CSharp/EuropeanOptionsCannotBeExercisedBeforeExpiryRegressionAlgorithm.cs:57-112 | Algorithm.CSharp/InteractiveBrokersBrokerageDisablesIndexOptionsExerciseRegressionAlgorithm.cs:61-102 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (35 corresponding lines) · ×2
  • Edited copy of a member (35 corresponding lines) Algorithm.Python/ComboOrderTicketDemoAlgorithm.py:84 — Algorithm.Python/ComboOrderTicketDemoAlgorithm.py:84-118 | Algorithm.Python/ComboOrderTicketDemoAlgorithm.py:121-162 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) Algorithm/QCAlgorithm.Indicators.cs:3754 — Algorithm/QCAlgorithm.Indicators.cs:3754-3799 | Algorithm/QCAlgorithm.Indicators.cs:4363-4397 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (62 corresponding lines) · ×2
  • Edited copy of a member (62 corresponding lines) Common/Orders/Fills/EquityFillModel.cs:203 — Common/Orders/Fills/EquityFillModel.cs:203-264 | Common/Orders/Fills/EquityFillModel.cs:407-474 — These two members are one piece of code written twice and then edited apart: 62 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (62 corresponding lines) Algorithm.CSharp/OptionRenameDailyRegressionAlgorithm.cs:60 — Algorithm.CSharp/OptionRenameDailyRegressionAlgorithm.cs:60-131 | Algorithm.CSharp/OptionRenameRegressionAlgorithm.cs:58-119 — These two members are one piece of code written twice and then edited apart: 62 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (39 corresponding lines) · ×2
  • Edited copy of a member (39 corresponding lines) Algorithm.CSharp/OptionEquityCoveredCallRegressionAlgorithm.cs:37 — Algorithm.CSharp/OptionEquityCoveredCallRegressionAlgorithm.cs:37-75 | Algorithm.CSharp/OptionEquityCoveredPutRegressionAlgorithm.cs:37-76 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (39 corresponding lines) Common/BinaryComparisonExtensions.cs:65 — Common/BinaryComparisonExtensions.cs:65-106 | Common/BinaryComparisonExtensions.cs:119-157 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (30 corresponding lines) · ×2
  • Edited copy of a member (30 corresponding lines) Algorithm.CSharp/BacktestingBrokerageRegressionAlgorithm.cs:250 — Algorithm.CSharp/BacktestingBrokerageRegressionAlgorithm.cs:250-283 | Algorithm.CSharp/CustomModelsAlgorithm.cs:89-118 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) Algorithm.CSharp/BasicTemplateFuturesAlgorithm.cs:76 — Algorithm.CSharp/BasicTemplateFuturesAlgorithm.cs:76-105 | Algorithm.CSharp/HSIFutureHourRegressionAlgorithm.cs:69-102 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (37 corresponding lines) · ×2
  • Edited copy of a member (37 corresponding lines) Engine/RealTime/ScheduledEventFactory.cs:67 — Engine/RealTime/ScheduledEventFactory.cs:67-103 | Engine/RealTime/ScheduledEventFactory.cs:117-154 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (37 corresponding lines) Algorithm.CSharp/FutureUniverseHistoryRegressionAlgorithm.cs:32 — Algorithm.CSharp/FutureUniverseHistoryRegressionAlgorithm.cs:32-70 | Algorithm.CSharp/OptionUniverseHistoryRegressionAlgorithm.cs:31-67 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (28 corresponding lines) · ×2
  • Edited copy of a member (28 corresponding lines) Algorithm.Framework/Execution/StandardDeviationExecutionModel.py:45 — Algorithm.Framework/Execution/StandardDeviationExecutionModel.py:45-72 | Algorithm.Framework/Execution/VolumeWeightedAveragePriceExecutionModel.py:32-60 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) Algorithm.CSharp/EmitInsightNoAlphaModelAlgorithm.cs:65 — Algorithm.CSharp/EmitInsightNoAlphaModelAlgorithm.cs:65-92 | Algorithm.CSharp/EmitInsightsAlgorithm.cs:62-93 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 11+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 11+ corresponding lines) Algorithm.Python/PytorchNeuralNetworkAlgorithm.py:21 — Algorithm.Python/PytorchNeuralNetworkAlgorithm.py:21-33 | Algorithm.Python/ScikitLearnLinearRegressionAlgorithm.py:20-31 | Algorithm.Python/TensorFlowNeuralNetworkAlgorithm.py:20-30 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 11+ corresponding lines) Algorithm.Python/AuxiliaryDataHandlersRegressionAlgorithm.py:22 — Algorithm.Python/AuxiliaryDataHandlersRegressionAlgorithm.py:22-35 | Algorithm.Python/FundamentalUniverseSelectionAlgorithm.py:26-37 | Algorithm.Python/FundamentalUniverseSelectionRegressionAlgorithm.py:27-37 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 16+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 16+ corresponding lines) Algorithm/QCAlgorithm.Python.cs:1644 — Algorithm/QCAlgorithm.Python.cs:1644-1659 | Algorithm/QCAlgorithm.Python.cs:1684-1699 | Algorithm/QCAlgorithm.Python.cs:1748-1763 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 16+ corresponding lines) Algorithm.Python/SpreadExecutionModelRegressionAlgorithm.py:33 — Algorithm.Python/SpreadExecutionModelRegressionAlgorithm.py:33-48 | Algorithm.Python/StandardDeviationExecutionModelRegressionAlgorithm.py:33-51 | Algorithm.Python/VolumeWeightedAveragePriceExecutionModelRegressionAlgorithm.py:34-52 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 20+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 20+ corresponding lines) Common/Util/StreamReaderExtensions.cs:107 — Common/Util/StreamReaderExtensions.cs:107-126 | Common/Util/StreamReaderExtensions.cs:136-157 | Common/Util/StreamReaderExtensions.cs:167-188 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 20+ corresponding lines) Algorithm.Python/Alphas/GreenblattMagicFormulaAlpha.py:38 — Algorithm.Python/Alphas/GreenblattMagicFormulaAlpha.py:38-57 | Algorithm.Python/Alphas/MeanReversionLunchBreakAlpha.py:35-56 | Algorithm.Python/Alphas/SykesShortMicroCapAlpha.py:25-46 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 11+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 11+ corresponding lines) Algorithm.CSharp/IndexOptionBearPutSpreadAlgorithm.cs:30 — Algorithm.CSharp/IndexOptionBearPutSpreadAlgorithm.cs:30-40 | Algorithm.CSharp/IndexOptionBullCallSpreadAlgorithm.cs:30-41 | Algorithm.CSharp/IndexOptionBullPutSpreadAlgorithm.cs:30-40 | Algorithm.CSharp/IndexOptionIronCondorAlgorithm.cs:30-42 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 11+ corresponding lines) Algorithm.CSharp/CapmAlphaRankingFrameworkAlgorithm.cs:41 — Algorithm.CSharp/CapmAlphaRankingFrameworkAlgorithm.cs:41-55 | Algorithm.CSharp/EmitInsightsAlgorithm.cs:42-55 | Algorithm.CSharp/FuturesFrameworkRegressionAlgorithm.cs:45-55 | Algorithm.CSharp/UniverseUnchangedRegressionAlgorithm.cs:36-49 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 15+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 15+ corresponding lines) Algorithm.Python/BubbleAlgorithm.py:171 — Algorithm.Python/BubbleAlgorithm.py:171-193 | Algorithm.Python/CustomDataNIFTYAlgorithm.py:114-131 | Algorithm.Python/PersistentCustomDataUniverseRegressionAlgorithm.py:63-77 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 15+ corresponding lines) Algorithm.CSharp/WarmupLowerResolutionOptionRegressionAlgorithm.cs:100 — Algorithm.CSharp/WarmupLowerResolutionOptionRegressionAlgorithm.cs:100-114 | Algorithm.CSharp/WarmupOptionRegressionAlgorithm.cs:87-101 | Algorithm.CSharp/WarmupOptionResolutionRegressionAlgorithm.cs:34-48 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 7+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 7+ corresponding lines) Engine/Results/Analysis/Analyses/Messages/MessageAnalysis.cs:61 — Engine/Results/Analysis/Analyses/Messages/MessageAnalysis.cs:61-67 | Engine/Results/Analysis/Analyses/OrderResponseErrorsAnalyses/ExceedsShortableQuantityOrderResponseErrorAnalysis.cs:57-64 | Engine/Results/Analysis/Analyses/StaleOrderFillsAnalysis.cs:50-57 | Engine/Results/Analysis/Analyses/TakeProfitAndStopLossOrdersAnalysis.cs:107-114 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 7+ corresponding lines) Algorithm.CSharp/BinanceCashAccountFeeRegressionAlgorithm.cs:32 — Algorithm.CSharp/BinanceCashAccountFeeRegressionAlgorithm.cs:32-39 | Algorithm.CSharp/BinanceMarginAccountFeeRegressionAlgorithm.cs:32-39 | Algorithm.CSharp/BitfinexCashAccountFeeRegressionAlgorithm.cs:32-38 | Algorithm.CSharp/BitfinexMarginAccountFeeRegressionAlgorithm.cs:32-38 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 6+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 6+ corresponding lines) Common/Data/Auxiliary/MapFileRow.cs:137 — Common/Data/Auxiliary/MapFileRow.cs:137-142 | Common/Data/SubscriptionDataConfig.cs:341-346 | Common/Data/SubscriptionDataSource.cs:140-145 | Common/Securities/SecurityDatabaseKey.cs:113-118 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 6+ corresponding lines) Algorithm.CSharp/MaximumDrawdownPercentPerSecurityFrameworkRegressionAlgorithm.cs:28 — Algorithm.CSharp/MaximumDrawdownPercentPerSecurityFrameworkRegressionAlgorithm.cs:28-33 | Algorithm.CSharp/MaximumDrawdownPercentPortfolioFrameworkRegressionAlgorithm.cs:28-37 | Algorithm.CSharp/MaximumUnrealizedProfitPercentPerSecurityFrameworkRegressionAlgorithm.cs:28-33 | Algorithm.CSharp/TrailingStopRiskFrameworkRegressionAlgorithm.cs:31-36 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 3+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 3+ corresponding lines) Algorithm.Python/AccumulativeInsightPortfolioRegressionAlgorithm.py:41 — Algorithm.Python/AccumulativeInsightPortfolioRegressionAlgorithm.py:41-43 | Algorithm.Python/ConfidenceWeightedFrameworkAlgorithm.py:45-47 | Algorithm.Python/InsightWeightingFrameworkAlgorithm.py:51-53 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 3+ corresponding lines) Algorithm.Framework/Portfolio/BlackLittermanOptimizationPortfolioConstructionModel.py:301 — Algorithm.Framework/Portfolio/BlackLittermanOptimizationPortfolioConstructionModel.py:301-303 | Algorithm.Framework/Portfolio/MeanVarianceOptimizationPortfolioConstructionModel.py:161-163 | Algorithm.Framework/Portfolio/RiskParityPortfolioConstructionModel.py:149-151 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (29 lines × 2) · ×2
  • Duplicated block (29 lines × 2) Common/Orders/Fills/FillModel.cs:295 — Common/Orders/Fills/FillModel.cs:295-323 | Common/Orders/Fills/FutureFillModel.cs:48-76 — before extracting anything, compare `Common/Orders/Fills/FillModel.cs` and `Common/Orders/Fills/FutureFillModel.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note first that the copies are not typed on the same thing: the declarations holding them bind `order` to `Order` in one and `MarketOrder` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (29 lines × 2) Algorithm.CSharp/AddFutureOptionContractDataStreamingRegressionAlgorithm.cs:124 — Algorithm.CSharp/AddFutureOptionContractDataStreamingRegressionAlgorithm.cs:124-152 | Algorithm.CSharp/AddFutureOptionSingleOptionChainSelectedInUniverseFilterRegressionAlgorithm.cs:180-208 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/AddFutureOptionContractDataStreamingRegressionAlgorithm.cs:124` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (28–29 lines × 4) · ×2
  • Duplicated block (28–29 lines × 4) Algorithm.CSharp/FutureOptionCallOTMExpiryRegressionAlgorithm.cs:105 — Algorithm.CSharp/FutureOptionCallOTMExpiryRegressionAlgorithm.cs:105-132 | Algorithm.CSharp/FutureOptionPutOTMExpiryRegressionAlgorithm.cs:103-130 | Algorithm.CSharp/FutureOptionShortCallOTMExpiryRegressionAlgorithm.cs:100-128 | Algorithm.CSharp/FutureOptionShortPutOTMExpiryRegressionAlgorithm.cs:100-127 — before extracting anything, compare `Algorithm.CSharp/FutureOptionCallOTMExpiryRegressionAlgorithm.cs` and `Algorithm.CSharp/FutureOptionPutOTMExpiryRegressionAlgorithm.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (28–29 lines × 4) Algorithm.CSharp/IndexOptionCallOTMExpiryRegressionAlgorithm.cs:101 — Algorithm.CSharp/IndexOptionCallOTMExpiryRegressionAlgorithm.cs:101-128 | Algorithm.CSharp/IndexOptionPutOTMExpiryRegressionAlgorithm.cs:98-125 | Algorithm.CSharp/IndexOptionShortCallOTMExpiryRegressionAlgorithm.cs:95-123 | Algorithm.CSharp/IndexOptionShortPutOTMExpiryRegressionAlgorithm.cs:95-122 — before extracting anything, compare `Algorithm.CSharp/IndexOptionCallOTMExpiryRegressionAlgorithm.cs` and `Algorithm.CSharp/IndexOptionShortCallOTMExpiryRegressionAlgorithm.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 66 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (21 lines × 4) · ×2
  • Duplicated block (21 lines × 4) Algorithm.CSharp/OptionStrategyFilteringUniverseCallButterflyRegressionAlgorithm.cs:51 — Algorithm.CSharp/OptionStrategyFilteringUniverseCallButterflyRegressionAlgorithm.cs:51-71 | Algorithm.CSharp/OptionStrategyFilteringUniverseCallLadderRegressionAlgorithm.cs:51-71 | Algorithm.CSharp/OptionStrategyFilteringUniversePutButterflyRegressionAlgorithm.cs:51-71 | Algorithm.CSharp/OptionStrategyFilteringUniversePutLadderRegressionAlgorithm.cs:51-71 — before extracting anything, compare `Algorithm.CSharp/OptionStrategyFilteringUniverseCallButterflyRegressionAlgorithm.cs` and `Algorithm.CSharp/OptionStrategyFilteringUniversePutButterflyRegressionAlgorithm.cs` as WHOLE FILES: 83% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (21 lines × 4) REDACTED:194 — REDACTED:194-214 | Algorithm.CSharp/CustomDataBitcoinAlgorithm.cs:147-167 | REDACTED:241-261 | REDACTED:203-223 — before extracting anything, compare `REDACTED` and `Algorithm.CSharp/CustomDataBitcoinAlgorithm.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:194` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:216` calls `AddDays` and `REDACTED:225` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (24 lines × 3) · ×2
  • Duplicated block (24 lines × 3) Algorithm.CSharp/FutureOptionPutITMExpiryRegressionAlgorithm.cs:100 — Algorithm.CSharp/FutureOptionPutITMExpiryRegressionAlgorithm.cs:100-123 | Algorithm.CSharp/FutureOptionShortCallITMExpiryRegressionAlgorithm.cs:100-123 | Algorithm.CSharp/FutureOptionShortPutITMExpiryRegressionAlgorithm.cs:100-123 — before extracting anything, compare `Algorithm.CSharp/FutureOptionPutITMExpiryRegressionAlgorithm.cs` and `Algorithm.CSharp/FutureOptionShortCallITMExpiryRegressionAlgorithm.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (24 lines × 3) Algorithm.CSharp/IndexOptionPutITMExpiryRegressionAlgorithm.cs:94 — Algorithm.CSharp/IndexOptionPutITMExpiryRegressionAlgorithm.cs:94-117 | Algorithm.CSharp/IndexOptionShortCallITMExpiryRegressionAlgorithm.cs:106-129 | Algorithm.CSharp/IndexOptionShortPutITMExpiryRegressionAlgorithm.cs:105-128 — before extracting anything, compare `Algorithm.CSharp/IndexOptionPutITMExpiryRegressionAlgorithm.cs` and `Algorithm.CSharp/IndexOptionShortPutITMExpiryRegressionAlgorithm.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (26–27 lines × 2) · ×2
  • Duplicated block (26–27 lines × 2) Common/Orders/Fills/EquityFillModel.cs:55 — Common/Orders/Fills/EquityFillModel.cs:55-81 | Common/Orders/Fills/EquityFillModel.cs:409-434 — both copies are in the same file, so extract the 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:55` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `order` to `LimitIfTouchedOrder` in one and `Order` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (26–27 lines × 2) Common/Orders/Fills/EquityFillModel.cs:1068 — Common/Orders/Fills/EquityFillModel.cs:1068-1093 | Common/Orders/Fills/LatestPriceFillModel.cs:42-68 — before extracting anything, compare `Common/Orders/Fills/EquityFillModel.cs` and `Common/Orders/Fills/LatestPriceFillModel.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Common/Orders/Fills/EquityFillModel.cs:1068` 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 (24 lines × 2) · ×2
  • Duplicated block (24 lines × 2) Indicators/CandlestickPatterns/EveningDojiStar.cs:99 — Indicators/CandlestickPatterns/EveningDojiStar.cs:99-122 | Indicators/CandlestickPatterns/MorningDojiStar.cs:99-122 — before extracting anything, compare `Indicators/CandlestickPatterns/EveningDojiStar.cs` and `Indicators/CandlestickPatterns/MorningDojiStar.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/EveningDojiStar.cs:99` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (24 lines × 2) Algorithm.CSharp/ForexInternalFeedOnDataHigherResolutionRegressionAlgorithm.cs:100 — Algorithm.CSharp/ForexInternalFeedOnDataHigherResolutionRegressionAlgorithm.cs:100-124 | Algorithm.CSharp/ForexInternalFeedOnDataSameResolutionRegressionAlgorithm.cs:100-123 — before extracting anything, compare `Algorithm.CSharp/ForexInternalFeedOnDataHigherResolutionRegressionAlgorithm.cs` and `Algorithm.CSharp/ForexInternalFeedOnDataSameResolutionRegressionAlgorithm.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×2
  • Duplicated block (27 lines × 2) REDACTED:203 — REDACTED:203-229 | REDACTED:250-276 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 99 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:203` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (27 lines × 2) Algorithm.CSharp/CustomDataMultiFileObjectStoreRegressionAlgorithm.cs:105 — Algorithm.CSharp/CustomDataMultiFileObjectStoreRegressionAlgorithm.cs:105-131 | Algorithm.CSharp/CustomDataObjectStoreRegressionAlgorithm.cs:72-98 — before extracting anything, compare `Algorithm.CSharp/CustomDataMultiFileObjectStoreRegressionAlgorithm.cs` and `Algorithm.CSharp/CustomDataObjectStoreRegressionAlgorithm.cs` as WHOLE FILES: 92% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (25–27 lines × 2) · ×2
  • Duplicated block (25–27 lines × 2) Algorithm.CSharp/OptionEquityShortButterflyCallRegressionAlgorithm.cs:51 — Algorithm.CSharp/OptionEquityShortButterflyCallRegressionAlgorithm.cs:51-77 | Algorithm.CSharp/OptionEquityShortButterflyPutRegressionAlgorithm.cs:51-75 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/OptionEquityShortButterflyCallRegressionAlgorithm.cs:51` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (25–27 lines × 2) Report/ReportCharts.py:1016 — Report/ReportCharts.py:1016-1042 | Report/ReportCharts.py:1055-1079 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (23–24 lines × 2) · ×2
  • Duplicated block (23–24 lines × 2) Common/Brokerages/RBIBrokerageModel.cs:59 — Common/Brokerages/RBIBrokerageModel.cs:59-81 | Common/Brokerages/TDAmeritradeBrokerageModel.cs:60-83 — before extracting anything, compare `Common/Brokerages/RBIBrokerageModel.cs` and `Common/Brokerages/TDAmeritradeBrokerageModel.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Common/Brokerages/RBIBrokerageModel.cs:59` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (23–24 lines × 2) Algorithm.Python/SecuritySessionRegressionAlgorithm.py:64 — Algorithm.Python/SecuritySessionRegressionAlgorithm.py:64-86 | Algorithm.Python/SecuritySessionWithFuturesRegressionAlgorithm.py:90-113 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.Python/SecuritySessionRegressionAlgorithm.py: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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (16 lines × 4) · ×2
  • Duplicated block (16 lines × 4) Algorithm.CSharp/OptionStrategyFilteringUniverseConversionRegressionAlgorithm.cs:48 — Algorithm.CSharp/OptionStrategyFilteringUniverseConversionRegressionAlgorithm.cs:48-63 | Algorithm.CSharp/OptionStrategyFilteringUniverseProtectiveCollarRegressionAlgorithm.cs:49-64 | Algorithm.CSharp/OptionStrategyFilteringUniverseStraddleRegressionAlgorithm.cs:48-63 | Algorithm.CSharp/OptionStrategyFilteringUniverseStrangleRegressionAlgorithm.cs:49-64 — before extracting anything, compare `Algorithm.CSharp/OptionStrategyFilteringUniverseProtectiveCollarRegressionAlgorithm.cs` and `Algorithm.CSharp/OptionStrategyFilteringUniverseStrangleRegressionAlgorithm.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (16 lines × 4) Indicators/CandlestickPatterns/Hammer.cs:84 — Indicators/CandlestickPatterns/Hammer.cs:84-99 | Indicators/CandlestickPatterns/HangingMan.cs:84-99 | Indicators/CandlestickPatterns/InvertedHammer.cs:81-96 | Indicators/CandlestickPatterns/ShootingStar.cs:82-97 — before extracting anything, compare `Indicators/CandlestickPatterns/Hammer.cs` and `Indicators/CandlestickPatterns/HangingMan.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 66 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/Hammer.cs:84` 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 (18–19 lines × 2) · ×2
  • Duplicated block (18–19 lines × 2) Common/Brokerages/PublicBrokerageModel.cs:82 — Common/Brokerages/PublicBrokerageModel.cs:82-99 | Common/Brokerages/TastytradeBrokerageModel.cs:90-108 — before extracting anything, compare `Common/Brokerages/PublicBrokerageModel.cs` and `Common/Brokerages/TastytradeBrokerageModel.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Common/Brokerages/PublicBrokerageModel.cs:82` 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 (18–19 lines × 2) Algorithm.Python/CustomDataPropertiesRegressionAlgorithm.py:75 — Algorithm.Python/CustomDataPropertiesRegressionAlgorithm.py:75-92 | Algorithm.Python/CustomDataRegressionAlgorithm.py:70-88 — before extracting anything, compare `Algorithm.Python/CustomDataPropertiesRegressionAlgorithm.py` and `Algorithm.Python/CustomDataRegressionAlgorithm.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (17–18 lines × 2) · ×2
  • Duplicated block (17–18 lines × 2) Engine/Results/BacktestingResultHandler.cs:709 — Engine/Results/BacktestingResultHandler.cs:709-726 | Engine/Results/LiveTradingResultHandler.cs:735-751 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Engine/Results/BacktestingResultHandler.cs:709` 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 (17–18 lines × 2) Algorithm.Python/Collective2PortfolioSignalExportDemonstrationAlgorithm.py:76 — Algorithm.Python/Collective2PortfolioSignalExportDemonstrationAlgorithm.py:76-92 | Algorithm.Python/Collective2SignalExportDemonstrationAlgorithm.py:87-104 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (12–17 lines × 4) · ×2
  • Duplicated block (12–17 lines × 4) Common/Util/LeanData.cs:166 — Common/Util/LeanData.cs:166-177 | Common/Util/LeanData.cs:182-198 | Common/Util/LeanData.cs:355-367 | Common/Util/LeanData.cs:426-438 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Common/Util/LeanData.cs:178` calls `ArgumentException`, `nameof` and `Common/Util/LeanData.cs:368` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12–17 lines × 4) Algorithm.CSharp/OptionStrategyFilteringUniverseBoxSpreadRegressionAlgorithm.cs:41 — Algorithm.CSharp/OptionStrategyFilteringUniverseBoxSpreadRegressionAlgorithm.cs:41-57 | Algorithm.CSharp/OptionStrategyFilteringUniverseIronCondorRegressionAlgorithm.cs:48-59 | Algorithm.CSharp/OptionStrategyFilteringUniverseProtectiveCollarRegressionAlgorithm.cs:41-57 | Algorithm.CSharp/OptionStrategyFilteringUniverseStrangleRegressionAlgorithm.cs:41-57 — before extracting anything, compare `Algorithm.CSharp/OptionStrategyFilteringUniverseBoxSpreadRegressionAlgorithm.cs` and `Algorithm.CSharp/OptionStrategyFilteringUniverseIronCondorRegressionAlgorithm.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/OptionStrategyFilteringUniverseBoxSpreadRegressionAlgorithm.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.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×2
  • Duplicated block (15–16 lines × 2) Algorithm.CSharp/ConstituentsUniverseImmediateSelectionRegressionAlgorithm.cs:38 — Algorithm.CSharp/ConstituentsUniverseImmediateSelectionRegressionAlgorithm.cs:38-53 | Algorithm.CSharp/ConstituentsUniverseRegressionAlgorithm.cs:39-53 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (15–16 lines × 2) Algorithm.Python/StandardDeviationExecutionModelRegressionAlgorithm.py:36 — Algorithm.Python/StandardDeviationExecutionModelRegressionAlgorithm.py:36-50 | Algorithm.Python/VolumeWeightedAveragePriceExecutionModelRegressionAlgorithm.py:34-49 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (14 lines × 4) · ×2
  • Duplicated block (14 lines × 4) Indicators/CandlestickPatterns/Hammer.cs:121 — Indicators/CandlestickPatterns/Hammer.cs:121-134 | Indicators/CandlestickPatterns/HangingMan.cs:121-134 | Indicators/CandlestickPatterns/InvertedHammer.cs:113-126 | Indicators/CandlestickPatterns/ShootingStar.cs:114-127 — before extracting anything, compare `Indicators/CandlestickPatterns/Hammer.cs` and `Indicators/CandlestickPatterns/HangingMan.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 66 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/Hammer.cs:121` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Indicators/CandlestickPatterns/Hammer.cs:136` calls `GetCandleRange` and `Indicators/CandlestickPatterns/InvertedHammer.cs:128` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (14 lines × 4) Algorithm.CSharp/BasicTemplateOptionsAlgorithm.cs:73 — Algorithm.CSharp/BasicTemplateOptionsAlgorithm.cs:73-86 | Algorithm.CSharp/OptionChainedUniverseSelectionModelRegressionAlgorithm.cs:58-71 | Algorithm.CSharp/OptionFilterReturnsNullRegressionAlgorithm.cs:70-83 | Algorithm.CSharp/SamcoBasicTemplateOptionsAlgorithm.cs:72-85 — before extracting anything, compare `Algorithm.CSharp/BasicTemplateOptionsAlgorithm.cs` and `Algorithm.CSharp/OptionChainedUniverseSelectionModelRegressionAlgorithm.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/BasicTemplateOptionsAlgorithm.cs:73` 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 (13–14 lines × 3) · ×2
  • Duplicated block (13–14 lines × 3) Indicators/Rho.cs:195 — Indicators/Rho.cs:195-208 | Indicators/Theta.cs:195-207 | Indicators/Vega.cs:195-208 — before extracting anything, compare `Indicators/Rho.cs` and `Indicators/Theta.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/Rho.cs:195` 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 (13–14 lines × 3) Algorithm.CSharp/FutureOptionCallOTMExpiryRegressionAlgorithm.cs:64 — Algorithm.CSharp/FutureOptionCallOTMExpiryRegressionAlgorithm.cs:64-77 | Algorithm.CSharp/FutureOptionShortCallITMExpiryRegressionAlgorithm.cs:59-71 | Algorithm.CSharp/FutureOptionShortCallOTMExpiryRegressionAlgorithm.cs:60-72 — before extracting anything, compare `Algorithm.CSharp/FutureOptionCallOTMExpiryRegressionAlgorithm.cs` and `Algorithm.CSharp/FutureOptionShortCallITMExpiryRegressionAlgorithm.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/FutureOptionCallOTMExpiryRegressionAlgorithm.cs:64` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (10–14 lines × 2) · ×2
  • Duplicated block (10–14 lines × 2) Algorithm.CSharp/BasicTemplateOptionsAlgorithm.cs:41 — Algorithm.CSharp/BasicTemplateOptionsAlgorithm.cs:41-54 | Algorithm.CSharp/NonDynamicOptionsFilterRegressionAlgorithm.cs:38-47 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `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–14 lines × 2) Algorithm.CSharp/CoveredCallComboLimitOrderAlgorithm.cs:37 — Algorithm.CSharp/CoveredCallComboLimitOrderAlgorithm.cs:37-46 | Algorithm.CSharp/OptionEquityBaseStrategyRegressionAlgorithm.cs:36-49 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `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.
D4 · Code Duplication · Duplicated block (12–13 lines × 3) · ×2
  • Duplicated block (12–13 lines × 3) Algorithm.CSharp/SpreadExecutionModelRegressionAlgorithm.cs:42 — Algorithm.CSharp/SpreadExecutionModelRegressionAlgorithm.cs:42-53 | Algorithm.CSharp/StandardDeviationExecutionModelRegressionAlgorithm.cs:40-52 | Algorithm.CSharp/VolumeWeightedAveragePriceExecutionModelRegressionAlgorithm.cs:41-53 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Algorithm.CSharp/StandardDeviationExecutionModelRegressionAlgorithm.cs:40` calls `SetCash` and `Algorithm.CSharp/SpreadExecutionModelRegressionAlgorithm.cs:42` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12–13 lines × 3) Algorithm.Python/IndexOptionPutITMExpiryRegressionAlgorithm.py:60 — Algorithm.Python/IndexOptionPutITMExpiryRegressionAlgorithm.py:60-71 | Algorithm.Python/IndexOptionShortCallITMExpiryRegressionAlgorithm.py:67-79 | Algorithm.Python/IndexOptionShortPutITMExpiryRegressionAlgorithm.py:67-78 — before extracting anything, compare `Algorithm.Python/IndexOptionPutITMExpiryRegressionAlgorithm.py` and `Algorithm.Python/IndexOptionShortCallITMExpiryRegressionAlgorithm.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (10 lines × 5) · ×2
  • Duplicated block (10 lines × 5) Algorithm.CSharp/BasicTemplateOptionsAlgorithm.cs:72 — Algorithm.CSharp/BasicTemplateOptionsAlgorithm.cs:72-81 | Algorithm.CSharp/OptionChainedUniverseSelectionModelRegressionAlgorithm.cs:57-66 | Algorithm.CSharp/OptionFilterReturnsNullRegressionAlgorithm.cs:69-78 | Algorithm.CSharp/OptionResolutionRegressionAlgorithm.cs:63-72 | Algorithm.CSharp/SamcoBasicTemplateOptionsAlgorithm.cs:71-80 — before extracting anything, compare `Algorithm.CSharp/BasicTemplateOptionsAlgorithm.cs` and `Algorithm.CSharp/OptionChainedUniverseSelectionModelRegressionAlgorithm.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/BasicTemplateOptionsAlgorithm.cs:72` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Algorithm.CSharp/BasicTemplateOptionsAlgorithm.cs:82` calls `MarketOnCloseOrder` and `Algorithm.CSharp/OptionResolutionRegressionAlgorithm.cs:73` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 5) REDACTED:116 — REDACTED:116-125 | Algorithm.CSharp/CustomDataBitcoinAlgorithm.cs:73-82 | Algorithm.CSharp/CustomDataPropertiesRegressionAlgorithm.cs:163-172 | REDACTED:163-172 | REDACTED:129-138 — before extracting anything, compare `REDACTED` and `Algorithm.CSharp/CustomDataBitcoinAlgorithm.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:116` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10 lines × 4) · ×2
  • Duplicated block (10 lines × 4) Common/Securities/Option/StrategyMatcher/OptionStrategyDefinitions.cs:259 — Common/Securities/Option/StrategyMatcher/OptionStrategyDefinitions.cs:259-268 | Common/Securities/Option/StrategyMatcher/OptionStrategyDefinitions.cs:273-282 | Common/Securities/Option/StrategyMatcher/OptionStrategyDefinitions.cs:287-297 | Common/Securities/Option/StrategyMatcher/OptionStrategyDefinitions.cs:302-311 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Common/Securities/Option/StrategyMatcher/OptionStrategyDefinitions.cs:259` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (10 lines × 4) Algorithm.CSharp/ComboOrderAlgorithm.cs:72 — Algorithm.CSharp/ComboOrderAlgorithm.cs:72-83 | Algorithm.CSharp/ComboOrderTicketDemoAlgorithm.cs:61-72 | Algorithm.CSharp/ContingentComboOrderRegressionAlgorithm.cs:70-79 | Algorithm.CSharp/RevertComboOrderPositionsAlgorithm.cs:64-75 — before extracting anything, compare `Algorithm.CSharp/ComboOrderAlgorithm.cs` and `Algorithm.CSharp/ComboOrderTicketDemoAlgorithm.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Algorithm.CSharp/RevertComboOrderPositionsAlgorithm.cs:77` calls `Debug` and `Algorithm.CSharp/ComboOrderAlgorithm.cs:85` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×2
  • Duplicated block (7 lines × 4) Algorithm.CSharp/FutureOptionCallITMExpiryRegressionAlgorithm.cs:119 — Algorithm.CSharp/FutureOptionCallITMExpiryRegressionAlgorithm.cs:119-125 | Algorithm.CSharp/FutureOptionPutITMExpiryRegressionAlgorithm.cs:120-126 | Algorithm.CSharp/IndexOptionCallITMExpiryRegressionAlgorithm.cs:117-123 | Algorithm.CSharp/IndexOptionPutITMExpiryRegressionAlgorithm.cs:114-120 — before extracting anything, compare `Algorithm.CSharp/FutureOptionCallITMExpiryRegressionAlgorithm.cs` and `Algorithm.CSharp/FutureOptionPutITMExpiryRegressionAlgorithm.cs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 77 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/FutureOptionCallITMExpiryRegressionAlgorithm.cs:119` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 4) Algorithm.CSharp/IsMarketOpenCheckAlgorithm.cs:52 — Algorithm.CSharp/IsMarketOpenCheckAlgorithm.cs:52-58 | Algorithm.CSharp/IsMarketOpenCheckAlgorithm.cs:72-78 | Algorithm.CSharp/IsMarketOpenCheckWithExtendedMarketHoursAlgorithm.cs:29-35 | Algorithm.CSharp/IsMarketOpenCheckWithExtendedMarketHoursAlgorithm.cs:64-70 — before extracting anything, compare `Algorithm.CSharp/IsMarketOpenCheckAlgorithm.cs` and `Algorithm.CSharp/IsMarketOpenCheckWithExtendedMarketHoursAlgorithm.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/IsMarketOpenCheckAlgorithm.cs:52` 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 (6 lines × 8) · ×2
  • Duplicated block (6 lines × 8) Algorithm.CSharp/AccumulativeInsightPortfolioRegressionAlgorithm.cs:40 — Algorithm.CSharp/AccumulativeInsightPortfolioRegressionAlgorithm.cs:40-46 | Algorithm.CSharp/AddRiskManagementAlgorithm.cs:39-44 | Algorithm.CSharp/BasicTemplateFrameworkAlgorithm.cs:44-55 | Algorithm.CSharp/CompositeRiskManagementModelFrameworkAlgorithm.cs:36-42 | Algorithm.CSharp/ConfidenceWeightedFrameworkAlgorithm.cs:44-50 | Algorithm.CSharp/ExecutionModelOrderEventsRegressionAlgorithm.cs:42-47 | Algorithm.CSharp/InsightWeightingFrameworkAlgorithm.cs:44-50 | Algorithm.CSharp/PortfolioTargetTagsRegressionAlgorithm.cs:36-41 — before extracting anything, compare `Algorithm.CSharp/BasicTemplateFrameworkAlgorithm.cs` and `Algorithm.CSharp/ExecutionModelOrderEventsRegressionAlgorithm.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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 (6 lines × 8) Algorithm.Python/CustomDataBitcoinAlgorithm.py:83 — Algorithm.Python/CustomDataBitcoinAlgorithm.py:83-88 | Algorithm.Python/CustomDataBitcoinAlgorithm.py:110-116 | Algorithm.Python/CustomDataPropertiesRegressionAlgorithm.py:94-99 | Algorithm.Python/CustomDataPropertiesRegressionAlgorithm.py:112-118 | Algorithm.Python/CustomDataRegressionAlgorithm.py:90-95 | Algorithm.Python/CustomDataRegressionAlgorithm.py:112-118 | Algorithm.Python/LiveFeaturesAlgorithm.py:118-123 | Algorithm.Python/LiveFeaturesAlgorithm.py:139-145 — before extracting anything, compare `Algorithm.Python/CustomDataBitcoinAlgorithm.py` and `Algorithm.Python/LiveFeaturesAlgorithm.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Algorithm.Python/CustomDataRegressionAlgorithm.py:102` calls `strip`, `isdigit` and `Algorithm.Python/CustomDataPropertiesRegressionAlgorithm.py:106` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (6 lines × 5) · ×2
  • Duplicated block (6 lines × 5) Report/ReportElements/CumulativeReturnsReportElement.cs:131 — Report/ReportElements/CumulativeReturnsReportElement.cs:131-136 | Report/ReportElements/LeverageUtilizationReportElement.cs:70-76 | Report/ReportElements/RollingPortfolioBetaReportElement.cs:69-74 | Report/ReportElements/RollingPortfolioBetaReportElement.cs:77-82 | Report/ReportElements/RollingSharpeReportElement.cs:71-76 — before extracting anything, compare `Report/ReportElements/LeverageUtilizationReportElement.cs` and `Report/ReportElements/RollingSharpeReportElement.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Report/ReportElements/RollingPortfolioBetaReportElement.cs:76` calls `Beta` and `Report/ReportElements/CumulativeReturnsReportElement.cs:138` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 5) Algorithm.CSharp/BasicTemplateDailyAlgorithm.cs:35 — Algorithm.CSharp/BasicTemplateDailyAlgorithm.cs:35-41 | Algorithm.CSharp/NamedArgumentsRegression.cs:33-46 | Algorithm.CSharp/OrderImmutabilityRegressionAlgorithm.cs:42-47 | Algorithm.CSharp/ResolutionSwitchingAlgorithm.cs:48-54 | Algorithm.CSharp/SetCashOnDataRegressionAlgorithm.cs:39-45 — before extracting anything, compare `Algorithm.CSharp/BasicTemplateDailyAlgorithm.cs` and `Algorithm.CSharp/NamedArgumentsRegression.cs` as WHOLE FILES: 86% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Algorithm.CSharp/BasicTemplateDailyAlgorithm.cs:29` calls `Create` and `Algorithm.CSharp/NamedArgumentsRegression.cs:28` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×2
  • Duplicated block (13–14 lines × 2) Algorithm.Python/CustomModelsAlgorithm.py:154 — Algorithm.Python/CustomModelsAlgorithm.py:154-166 | Algorithm.Python/CustomModelsPEP8Algorithm.py:149-162 — before extracting anything, compare `Algorithm.Python/CustomModelsAlgorithm.py` and `Algorithm.Python/CustomModelsPEP8Algorithm.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13–14 lines × 2) Algorithm.Python/CustomModelsAlgorithm.py:169 — Algorithm.Python/CustomModelsAlgorithm.py:169-181 | Algorithm.Python/CustomModelsPEP8Algorithm.py:165-178 — before extracting anything, compare `Algorithm.Python/CustomModelsAlgorithm.py` and `Algorithm.Python/CustomModelsPEP8Algorithm.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
IC1 · Incompleteness & stubs · Both branches are identical · ×2
  • Both branches are identical — the condition decides nothing Algorithm.CSharp/ScheduledUniverseSelectionModelRegressionAlgorithm.cs:109 — The `if` and its `else` contain the same 1 statement, so no input can make the condition matter. Implement the distinction that was intended, or drop the branch and keep the body.
  • Both branches are identical — the condition decides nothing Common/Securities/Future/FuturesExpiryFunctions.cs:2299 — The `if` and its `else` contain the same 1 statement, so no input can make the condition matter. Implement the distinction that was intended, or drop the branch and keep the body.
X1 · Async correctness · Sync-over-async (deadlock risk) through `.Wait(…)` · ×2
  • Sync-over-async (deadlock risk) through `.Wait(…)` Engine/DataFeeds/WorkScheduling/WeightedWorkScheduler.cs:104 — `.Wait(…)` blocks this thread until the task completes or the bound expires — sync-over-async: it can deadlock under a synchronization context and it parks a thread while it waits. `await` the task (with `.WaitAsync(timeout, token)` where the bound matters).
  • Sync-over-async (deadlock risk) through `.Wait(…)` Common/Isolator.cs:150 — `.Wait(…)` blocks this thread until the task completes or the bound expires — sync-over-async: it can deadlock under a synchronization context and it parks a thread while it waits. `await` the task (with `.WaitAsync(timeout, token)` where the bound matters).
X12 · Unreachable branch · Branch is unreachable · ×2
  • Branch is unreachable — its condition cannot hold here Algorithm/QCAlgorithm.History.cs:1458 — `resolution != null` can never be true where it stands: the guard on line 1428 (`resolution != null`) left this block when it was true. No value of `resolution` satisfies all of that, so this arm never runs. Reorder the tests, drop the dead branch, or fix the bound that was meant.
  • Branch is unreachable — its condition cannot hold here Algorithm.CSharp/CryptoFutureLeverageBasedMarginRegressionAlgorithm.cs:99 — `marginRemaining > 0` can never be true where it stands: the guard on line 62 (`marginRemaining > 0`) left this block when it was true. No value of `marginRemaining` satisfies all of that, so this arm never runs. Reorder the tests, drop the dead branch, or fix the bound that was meant.
X18 · Disposal-pattern correctness · Owned disposable field overwritten without releasing the previous instance · ×2
  • Owned disposable field overwritten without releasing the previous instance Common/Brokerages/DefaultBrokerageMessageHandler.cs:193 — `_cancellationTokenSource` is a `CancellationTokenSource` this type creates itself, and here (line 193) a new instance is written over it — but `StartCheckReconnected` itself reads through `_cancellationTokenSource` before replacing it, so it expects an instance to be there, and nothing earlier in `StartCheckReconnected` disposes, closes, saves or hands on the instance being replaced. The assignment makes it unreachable while it still holds what it holds (a timer that keeps firing, a callback registered on a longer-lived token, a socket, a handle), and no later `Dispose` can reach it: the type's own disposal releases only the CURRENT instance. The cost accumulates once per overwrite. Release the previous instance first (`_cancellationTokenSource?.Dispose();` before the assignment), or swap it out with `Interlocked.Exchange` and dispose what comes back.
  • Owned disposable field overwritten without releasing the previous instance Api/ApiConnection.cs:114 — `_httpClient` is a `HttpClient` this type creates itself, and here (line 114) a new instance is written over it — but `SetClient` itself reads through `_httpClient` before replacing it, so it expects an instance to be there, and nothing earlier in `SetClient` disposes, closes, saves or hands on the instance being replaced. The assignment makes it unreachable while it still holds what it holds (a timer that keeps firing, a callback registered on a longer-lived token, a socket, a handle), and no later `Dispose` can reach it: the type's own disposal releases only the CURRENT instance. The cost accumulates once per overwrite. Release the previous instance first (`_httpClient?.Dispose();` before the assignment), or swap it out with `Interlocked.Exchange` and dispose what comes back.
X3 · Exception handling · Unguarded deserialized result under a catch list that cannot catch it · ×2
  • Unguarded deserialized result under a catch list that cannot catch it Engine/DataFeeds/LiveOptionChainProvider.cs:157 — `productResults` is used without ever being checked for null, but `JsonConvert` returns null for the document `null` — and no catch clause around it catches NullReferenceException, so that one input throws past every handler here and out of the method. The try already answers unreadable files and malformed JSON; answer the empty document too, by testing the result before using it (or by rejecting null where the value is produced) rather than by widening the catch to swallow the deref.
  • Unguarded deserialized result under a catch list that cannot catch it Engine/DataFeeds/LiveOptionChainProvider.cs:176 — `tradesAndExpiriesResponse` is used without ever being checked for null, but `JsonConvert` returns null for the document `null` — and no catch clause around it catches NullReferenceException, so that one input throws past every handler here and out of the method. The try already answers unreadable files and malformed JSON; answer the empty document too, by testing the result before using it (or by rejecting null where the value is produced) rather than by widening the catch to swallow the deref.
C1 · Data Protection · No data-protection/encryption · ×1
  • No data-protection/encryption — No data-protection or encryption usage (ASP.NET Data Protection, AES, column encryption, PBKDF2) was found — sensitive data at rest may be unprotected. If TDE/KMS/vault is delegated to infrastructure, ignore.
D1 · Cyclomatic Complexity · Exchanges.GetPrimaryExchange (cyclomatic 106) · ×1
  • Exchanges.GetPrimaryExchange (cyclomatic 106) Common/Global.cs:1012 — Exchanges.GetPrimaryExchange has cyclomatic complexity 106 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. Note what this body is, though: it carries an aggressive-inlining request, so its author has asked in the source for this body to be inlined into every caller. Each part pulled out of it becomes a call the runtime has to decide to inline again, against a size budget — so the split can quietly turn one inlined body into several real calls, on the path the marker exists to protect. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
D1 · Cyclomatic Complexity · LeanData.GenerateLine (cyclomatic 100) · ×1
  • LeanData.GenerateLine (cyclomatic 100) Common/Util/LeanData.cs:90 — LeanData.GenerateLine has cyclomatic complexity 100 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AlgorithmManager.Run (cyclomatic 72) · ×1
  • AlgorithmManager.Run (cyclomatic 72) Engine/AlgorithmManager.cs:121 — AlgorithmManager.Run has cyclomatic complexity 72 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TimeSliceFactory.Create (cyclomatic 64) · ×1
  • TimeSliceFactory.Create (cyclomatic 64) Engine/DataFeeds/TimeSliceFactory.cs:89 — TimeSliceFactory.Create has cyclomatic complexity 64 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OptionStrategyPositionGroupBuyingPowerModel.GetMaintenanceMargin (cyclomatic 47) · ×1
  • OptionStrategyPositionGroupBuyingPowerModel.GetMaintenanceMargin (cyclomatic 47) Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs:50 — OptionStrategyPositionGroupBuyingPowerModel.GetMaintenanceMargin has cyclomatic complexity 47 (threshold 15). Of this number, 40 points are the body's own statements and 7 belong to 7 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · BrokerageTransactionHandler.HandleOrderEvents (cyclomatic 42) · ×1
  • BrokerageTransactionHandler.HandleOrderEvents (cyclomatic 42) Engine/TransactionHandlers/BrokerageTransactionHandler.cs:1267 — BrokerageTransactionHandler.HandleOrderEvents has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · QCAlgorithm.PreOrderChecksImpl (cyclomatic 42) · ×1
  • QCAlgorithm.PreOrderChecksImpl (cyclomatic 42) Algorithm/QCAlgorithm.Trading.cs:842 — QCAlgorithm.PreOrderChecksImpl has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OptionStrategyPositionGroupBuyingPowerModel.GetInitialMarginRequirement (cyclomatic 42) · ×1
  • OptionStrategyPositionGroupBuyingPowerModel.GetInitialMarginRequirement (cyclomatic 42) Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs:294 — OptionStrategyPositionGroupBuyingPowerModel.GetInitialMarginRequirement has cyclomatic complexity 42 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · RandomDataGeneratorSettings.FromCommandLineArguments (cyclomatic 41) · ×1
  • RandomDataGeneratorSettings.FromCommandLineArguments (cyclomatic 41) ToolBox/RandomDataGenerator/RandomDataGeneratorSettings.cs:53 — RandomDataGeneratorSettings.FromCommandLineArguments has cyclomatic complexity 41 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SecurityCache.ProcessDataPoint (cyclomatic 39) · ×1
  • SecurityCache.ProcessDataPoint (cyclomatic 39) Common/Securities/SecurityCache.cs:192 — SecurityCache.ProcessDataPoint has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SecurityService.CreateSecurity (cyclomatic 39) · ×1
  • SecurityService.CreateSecurity (cyclomatic 39) Common/Securities/SecurityService.cs:75 — SecurityService.CreateSecurity has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TradeStatistics.TradeStatistics.ctor (cyclomatic 39) · ×1
  • TradeStatistics.TradeStatistics.ctor (cyclomatic 39) Common/Statistics/TradeStatistics.cs:276 — TradeStatistics.TradeStatistics.ctor has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OptionChainFiltersRegressionAlgorithm.Initialize (cyclomatic 39) · ×1
  • OptionChainFiltersRegressionAlgorithm.Initialize (cyclomatic 39) Algorithm.CSharp/OptionChainFiltersRegressionAlgorithm.cs:38 — OptionChainFiltersRegressionAlgorithm.Initialize has cyclomatic complexity 39 (threshold 15). Of this number, 33 points are the body's own statements and 6 belong to 6 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · UniverseSelection.ApplyUniverseSelection (cyclomatic 38) · ×1
  • UniverseSelection.ApplyUniverseSelection (cyclomatic 38) Engine/DataFeeds/UniverseSelection.cs:119 — UniverseSelection.ApplyUniverseSelection has cyclomatic complexity 38 (threshold 15). Of this number, 36 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Engine.Run (cyclomatic 38) · ×1
  • Engine.Run (cyclomatic 38) Engine/Engine.cs:87 — Engine.Run has cyclomatic complexity 38 (threshold 15). Of this number, 31 points are the body's own statements and 7 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HikkakeModified.ComputeNextValue (cyclomatic 38) · ×1
  • HikkakeModified.ComputeNextValue (cyclomatic 38) Indicators/CandlestickPatterns/HikkakeModified.cs:81 — HikkakeModified.ComputeNextValue has cyclomatic complexity 38 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · BacktestingBrokerage.Scan (cyclomatic 37) · ×1
  • BacktestingBrokerage.Scan (cyclomatic 37) Brokerages/Backtesting/BacktestingBrokerage.cs:240 — BacktestingBrokerage.Scan has cyclomatic complexity 37 (threshold 15). Of this number, 34 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OrderJsonConverter.CreateOrderFromJObject (cyclomatic 32) · ×1
  • OrderJsonConverter.CreateOrderFromJObject (cyclomatic 32) Common/Orders/OrderJsonConverter.cs:84 — OrderJsonConverter.CreateOrderFromJObject has cyclomatic complexity 32 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · RandomDataGenerator.Run (cyclomatic 32) · ×1
  • RandomDataGenerator.Run (cyclomatic 32) ToolBox/RandomDataGenerator/RandomDataGenerator.cs:53 — RandomDataGenerator.Run has cyclomatic complexity 32 (threshold 15). Of this number, 29 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SubscriptionSynchronizer.Sync (cyclomatic 31) · ×1
  • SubscriptionSynchronizer.Sync (cyclomatic 31) Engine/DataFeeds/SubscriptionSynchronizer.cs:88 — SubscriptionSynchronizer.Sync has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · QCAlgorithm.GetMatchingSubscriptions (cyclomatic 31) · ×1
  • QCAlgorithm.GetMatchingSubscriptions (cyclomatic 31) Algorithm/QCAlgorithm.History.cs:1194 — QCAlgorithm.GetMatchingSubscriptions has cyclomatic complexity 31 (threshold 15). Of this number, 28 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AdvanceBlock.ComputeNextValue (cyclomatic 30) · ×1
  • AdvanceBlock.ComputeNextValue (cyclomatic 30) Indicators/CandlestickPatterns/AdvanceBlock.cs:89 — AdvanceBlock.ComputeNextValue has cyclomatic complexity 30 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · SubscriptionDataReader.MoveNext (cyclomatic 29) · ×1
  • SubscriptionDataReader.MoveNext (cyclomatic 29) Engine/DataFeeds/SubscriptionDataReader.cs:276 — SubscriptionDataReader.MoveNext has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InteractiveBrokersBrokerageModel.CanSubmitOrder (cyclomatic 29) · ×1
  • InteractiveBrokersBrokerageModel.CanSubmitOrder (cyclomatic 29) Common/Brokerages/InteractiveBrokersBrokerageModel.cs:164 — InteractiveBrokersBrokerageModel.CanSubmitOrder has cyclomatic complexity 29 (threshold 15). Of this number, 28 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · SecurityExchangeHours.GetMarketHours (cyclomatic 29) · ×1
  • SecurityExchangeHours.GetMarketHours (cyclomatic 29) Common/Securities/SecurityExchangeHours.cs:509 — SecurityExchangeHours.GetMarketHours has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ReportCharts.GetExposure (cyclomatic 29) · ×1
  • ReportCharts.GetExposure (cyclomatic 29) Report/ReportCharts.py:973 — ReportCharts.GetExposure has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Hikkake.ComputeNextValue (cyclomatic 28) · ×1
  • Hikkake.ComputeNextValue (cyclomatic 28) Indicators/CandlestickPatterns/Hikkake.cs:71 — Hikkake.ComputeNextValue has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BubbleAlgorithm.OnData (cyclomatic 28) · ×1
  • BubbleAlgorithm.OnData (cyclomatic 28) Algorithm.CSharp/BubbleAlgorithm.cs:121 — BubbleAlgorithm.OnData has cyclomatic complexity 28 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · DividendSplitMapGenerator.GenerateSplitsDividends (cyclomatic 28) · ×1
  • DividendSplitMapGenerator.GenerateSplitsDividends (cyclomatic 28) ToolBox/RandomDataGenerator/DividendSplitMapGenerator.cs:84 — DividendSplitMapGenerator.GenerateSplitsDividends has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PeriodCountConsolidatorBase.Update (cyclomatic 27) · ×1
  • PeriodCountConsolidatorBase.Update (cyclomatic 27) Common/Data/Consolidators/PeriodCountConsolidatorBase.cs:147 — PeriodCountConsolidatorBase.Update has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InteractiveBrokersFeeModel.GetOrderFee (cyclomatic 27) · ×1
  • InteractiveBrokersFeeModel.GetOrderFee (cyclomatic 27) Common/Orders/Fees/InteractiveBrokersFeeModel.cs:77 — InteractiveBrokersFeeModel.GetOrderFee has cyclomatic complexity 27 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
D1 · Cyclomatic Complexity · UncoveredShortQuantityOptionStrategyMatchObjectiveFunction.GetUncoveredQuantity (cyclomatic 27) · ×1
  • UncoveredShortQuantityOptionStrategyMatchObjectiveFunction.GetUncoveredQuantity (cyclomatic 27) Common/Securities/Option/StrategyMatcher/UncoveredShortQuantityOptionStrategyMatchObjectiveFunction.cs:79 — UncoveredShortQuantityOptionStrategyMatchObjectiveFunction.GetUncoveredQuantity has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TradeBuilder.ProcessFillUsingFillToFill (cyclomatic 27) · ×1
  • TradeBuilder.ProcessFillUsingFillToFill (cyclomatic 27) Common/Statistics/TradeBuilder.cs:256 — TradeBuilder.ProcessFillUsingFillToFill has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ContingentComboOrderRegressionAlgorithm.on_data (cyclomatic 27) · ×1
  • ContingentComboOrderRegressionAlgorithm.on_data (cyclomatic 27) Algorithm.Python/ContingentComboOrderRegressionAlgorithm.py:37 — ContingentComboOrderRegressionAlgorithm.on_data has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SessionBar.Update (cyclomatic 26) · ×1
  • SessionBar.Update (cyclomatic 26) Common/Data/Market/SessionBar.cs:98 — SessionBar.Update has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SeriesSampler.SampleCandlestickSeries (cyclomatic 26) · ×1
  • SeriesSampler.SampleCandlestickSeries (cyclomatic 26) Common/SeriesSampler.cs:221 — SeriesSampler.SampleCandlestickSeries has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BracketOrderRegressionAlgorithm.OnData (cyclomatic 26) · ×1
  • BracketOrderRegressionAlgorithm.OnData (cyclomatic 26) Algorithm.CSharp/BracketOrderRegressionAlgorithm.cs:50 — BracketOrderRegressionAlgorithm.OnData has cyclomatic complexity 26 (threshold 15). Of this number, 21 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · OptionChainFiltersRegressionAlgorithm.initialize (cyclomatic 26) · ×1
  • OptionChainFiltersRegressionAlgorithm.initialize (cyclomatic 26) Algorithm.Python/OptionChainFiltersRegressionAlgorithm.py:22 — OptionChainFiltersRegressionAlgorithm.initialize has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ApiDataProvider.NeedToDownload (cyclomatic 25) · ×1
  • ApiDataProvider.NeedToDownload (cyclomatic 25) Engine/DataFeeds/ApiDataProvider.cs:157 — ApiDataProvider.NeedToDownload has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ContingentComboOrderRegressionAlgorithm.OnData (cyclomatic 25) · ×1
  • ContingentComboOrderRegressionAlgorithm.OnData (cyclomatic 25) Algorithm.CSharp/ContingentComboOrderRegressionAlgorithm.cs:61 — ContingentComboOrderRegressionAlgorithm.OnData has cyclomatic complexity 25 (threshold 15). Of this number, 20 points are the body's own statements and 5 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DataManager.DataManager.ctor (cyclomatic 24) · ×1
  • DataManager.DataManager.ctor (cyclomatic 24) Engine/DataFeeds/DataManager.cs:68 — DataManager.DataManager.ctor has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 2 of the 24 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 90, 201, 205). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · Tick.Tick.ctor (cyclomatic 24) · ×1
  • Tick.Tick.ctor (cyclomatic 24) Common/Data/Market/Tick.cs:555 — Tick.Tick.ctor has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Slice.GetImpl (cyclomatic 24) · ×1
  • Slice.GetImpl (cyclomatic 24) Common/Data/Slice.cs:403 — Slice.GetImpl has cyclomatic complexity 24 (threshold 15). Of this number, 21 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CashBuyingPowerModel.GetOpenOrdersReservedQuantity (cyclomatic 24) · ×1
  • CashBuyingPowerModel.GetOpenOrdersReservedQuantity (cyclomatic 24) Common/Securities/CashBuyingPowerModel.cs:400 — CashBuyingPowerModel.GetOpenOrdersReservedQuantity has cyclomatic complexity 24 (threshold 15). Of this number, 16 points are the body's own statements and 8 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · QLOptionPriceModel.Evaluate (cyclomatic 24) · ×1
  • QLOptionPriceModel.Evaluate (cyclomatic 24) Common/Securities/Option/QLOptionPriceModel.cs:108 — QLOptionPriceModel.Evaluate has cyclomatic complexity 24 (threshold 15). Of this number, 23 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SecurityPortfolioModel.ProcessFill (cyclomatic 24) · ×1
  • SecurityPortfolioModel.ProcessFill (cyclomatic 24) Common/Securities/SecurityPortfolioModel.cs:36 — SecurityPortfolioModel.ProcessFill has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RiseFallThreeMethods.ComputeNextValue (cyclomatic 24) · ×1
  • RiseFallThreeMethods.ComputeNextValue (cyclomatic 24) Indicators/CandlestickPatterns/RiseFallThreeMethods.cs:81 — RiseFallThreeMethods.ComputeNextValue has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ThreeWhiteSoldiers.ComputeNextValue (cyclomatic 24) · ×1
  • ThreeWhiteSoldiers.ComputeNextValue (cyclomatic 24) Indicators/CandlestickPatterns/ThreeWhiteSoldiers.cs:86 — ThreeWhiteSoldiers.ComputeNextValue has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · BracketOrderLimitEntryRegressionAlgorithm.OnData (cyclomatic 24) · ×1
  • BracketOrderLimitEntryRegressionAlgorithm.OnData (cyclomatic 24) Algorithm.CSharp/BracketOrderLimitEntryRegressionAlgorithm.cs:53 — BracketOrderLimitEntryRegressionAlgorithm.OnData has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · FuturesChainFiltersRegressionAlgorithm.OnData (cyclomatic 24) · ×1
  • FuturesChainFiltersRegressionAlgorithm.OnData (cyclomatic 24) Algorithm.CSharp/FuturesChainFiltersRegressionAlgorithm.cs:85 — FuturesChainFiltersRegressionAlgorithm.OnData has cyclomatic complexity 24 (threshold 15). Of this number, 23 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · HistoryAuxiliaryDataRegressionAlgorithm.Initialize (cyclomatic 24) · ×1
  • HistoryAuxiliaryDataRegressionAlgorithm.Initialize (cyclomatic 24) Algorithm.CSharp/HistoryAuxiliaryDataRegressionAlgorithm.cs:34 — HistoryAuxiliaryDataRegressionAlgorithm.Initialize has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · OptionPriceModelForOptionStylesBaseRegressionAlgorithm.CheckGreeks (cyclomatic 24) · ×1
  • OptionPriceModelForOptionStylesBaseRegressionAlgorithm.CheckGreeks (cyclomatic 24) Algorithm.CSharp/OptionPriceModelForOptionStylesBaseRegressionAlgorithm.cs:77 — OptionPriceModelForOptionStylesBaseRegressionAlgorithm.CheckGreeks has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · FillForwardEnumerator.MoveNext (cyclomatic 23) · ×1
  • FillForwardEnumerator.MoveNext (cyclomatic 23) Engine/DataFeeds/Enumerators/FillForwardEnumerator.cs:183 — FillForwardEnumerator.MoveNext has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LiveTradingResultHandler.Update (cyclomatic 23) · ×1
  • LiveTradingResultHandler.Update (cyclomatic 23) Engine/Results/LiveTradingResultHandler.cs:161 — LiveTradingResultHandler.Update has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BrokerageSetupHandler.Setup (cyclomatic 23) · ×1
  • BrokerageSetupHandler.Setup (cyclomatic 23) Engine/Setup/BrokerageSetupHandler.cs:148 — BrokerageSetupHandler.Setup has cyclomatic complexity 23 (threshold 15). Of this number, 17 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · QCAlgorithm.GetLastKnownPricesImpl (cyclomatic 23) · ×1
  • QCAlgorithm.GetLastKnownPricesImpl (cyclomatic 23) Algorithm/QCAlgorithm.History.cs:812 — QCAlgorithm.GetLastKnownPricesImpl has cyclomatic complexity 23 (threshold 15). Of this number, 15 points are the body's own statements and 8 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · EquityFillModel.MarketOnOpenFill (cyclomatic 23) · ×1
  • EquityFillModel.MarketOnOpenFill (cyclomatic 23) Common/Orders/Fills/EquityFillModel.cs:482 — EquityFillModel.MarketOnOpenFill has cyclomatic complexity 23 (threshold 15). Of this number, 19 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FillModel.Fill (cyclomatic 23) · ×1
  • FillModel.Fill (cyclomatic 23) Common/Orders/Fills/FillModel.cs:59 — FillModel.Fill has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Breakaway.ComputeNextValue (cyclomatic 23) · ×1
  • Breakaway.ComputeNextValue (cyclomatic 23) Indicators/CandlestickPatterns/Breakaway.cs:73 — Breakaway.ComputeNextValue has cyclomatic complexity 23 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ThreeStarsInSouth.ComputeNextValue (cyclomatic 23) · ×1
  • ThreeStarsInSouth.ComputeNextValue (cyclomatic 23) Indicators/CandlestickPatterns/ThreeStarsInSouth.cs:84 — ThreeStarsInSouth.ComputeNextValue has cyclomatic complexity 23 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · BasicTemplateCryptoAlgorithm.OnData (cyclomatic 23) · ×1
  • BasicTemplateCryptoAlgorithm.OnData (cyclomatic 23) Algorithm.CSharp/BasicTemplateCryptoAlgorithm.cs:83 — BasicTemplateCryptoAlgorithm.OnData has cyclomatic complexity 23 (threshold 15). Of this number, 21 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BubbleAlgorithm.on_data (cyclomatic 23) · ×1
  • BubbleAlgorithm.on_data (cyclomatic 23) Algorithm.Python/BubbleAlgorithm.py:65 — BubbleAlgorithm.on_data has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · IndicatorSelectorWorksWithDifferentOptions.on_data (cyclomatic 23) · ×1
  • IndicatorSelectorWorksWithDifferentOptions.on_data (cyclomatic 23) Algorithm.Python/IndicatorSelectorsWorkWithDifferentOptions.py:59 — IndicatorSelectorWorksWithDifferentOptions.on_data has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DataManager.Add (cyclomatic 22) · ×1
  • DataManager.Add (cyclomatic 22) Engine/DataFeeds/DataManager.cs:602 — DataManager.Add has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FillForwardEnumerator.RequiresFillForwardData (cyclomatic 22) · ×1
  • FillForwardEnumerator.RequiresFillForwardData (cyclomatic 22) Engine/DataFeeds/Enumerators/FillForwardEnumerator.cs:323 — FillForwardEnumerator.RequiresFillForwardData has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BrokerageTransactionHandler.HandleOrderUpdated (cyclomatic 22) · ×1
  • BrokerageTransactionHandler.HandleOrderUpdated (cyclomatic 22) Engine/TransactionHandlers/BrokerageTransactionHandler.cs:1516 — BrokerageTransactionHandler.HandleOrderUpdated has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BrokerageTransactionHandler.HandleOptionNotification (cyclomatic 22) · ×1
  • BrokerageTransactionHandler.HandleOptionNotification (cyclomatic 22) Engine/TransactionHandlers/BrokerageTransactionHandler.cs:1810 — BrokerageTransactionHandler.HandleOptionNotification has cyclomatic complexity 22 (threshold 15). Of this number, 14 points are the body's own statements and 8 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · QCAlgorithm.OnEndOfTimeStep (cyclomatic 22) · ×1
  • QCAlgorithm.OnEndOfTimeStep (cyclomatic 22) Algorithm/QCAlgorithm.Universe.cs:69 — QCAlgorithm.OnEndOfTimeStep has cyclomatic complexity 22 (threshold 15). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AlpacaBrokerageModel.CanSubmitContingentOrder (cyclomatic 22) · ×1
  • AlpacaBrokerageModel.CanSubmitContingentOrder (cyclomatic 22) Common/Brokerages/AlpacaBrokerageModel.cs:90 — AlpacaBrokerageModel.CanSubmitContingentOrder has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · Extensions.Scale (cyclomatic 22) · ×1
  • Extensions.Scale (cyclomatic 22) Common/Extensions.cs:3751 — Extensions.Scale has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LeanData.GenerateZipEntryName (cyclomatic 22) · ×1
  • LeanData.GenerateZipEntryName (cyclomatic 22) Common/Util/LeanData.cs:669 — LeanData.GenerateZipEntryName has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AddFutureOptionSingleOptionChainSelectedInUniverseFilterRegressionAlgorithm.OnData (cyclomatic 22) · ×1
  • AddFutureOptionSingleOptionChainSelectedInUniverseFilterRegressionAlgorithm.OnData (cyclomatic 22) Algorithm.CSharp/AddFutureOptionSingleOptionChainSelectedInUniverseFilterRegressionAlgorithm.cs:78 — AddFutureOptionSingleOptionChainSelectedInUniverseFilterRegressionAlgorithm.OnData has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FuturesAndFuturesOptionsExpiryTimeAndLiquidationRegressionAlgorithm.OnData (cyclomatic 22) · ×1
  • FuturesAndFuturesOptionsExpiryTimeAndLiquidationRegressionAlgorithm.OnData (cyclomatic 22) Algorithm.CSharp/FuturesAndFuturesOptionsExpiryTimeAndLiquidationRegressionAlgorithm.cs:66 — FuturesAndFuturesOptionsExpiryTimeAndLiquidationRegressionAlgorithm.OnData has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · IndicatorBasedOptionPricingModelRegressionAlgorithm.OnData (cyclomatic 22) · ×1
  • IndicatorBasedOptionPricingModelRegressionAlgorithm.OnData (cyclomatic 22) Algorithm.CSharp/IndicatorBasedOptionPricingModelRegressionAlgorithm.cs:62 — IndicatorBasedOptionPricingModelRegressionAlgorithm.OnData has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TextSubscriptionDataSourceReader.Read (cyclomatic 21) · ×1
  • TextSubscriptionDataSourceReader.Read (cyclomatic 21) Engine/DataFeeds/TextSubscriptionDataSourceReader.cs:82 — TextSubscriptionDataSourceReader.Read has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Tick.Tick.ctor (cyclomatic 21) · ×1
  • Tick.Tick.ctor (cyclomatic 21) Common/Data/Market/Tick.cs:415 — Tick.Tick.ctor has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · EquityFillModel.GetBestEffortAskPrice (cyclomatic 21) · ×1
  • EquityFillModel.GetBestEffortAskPrice (cyclomatic 21) Common/Orders/Fills/EquityFillModel.cs:774 — EquityFillModel.GetBestEffortAskPrice has cyclomatic complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (EquityFillModel.GetBestEffortBidPrice) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · EquityFillModel.GetBestEffortBidPrice (cyclomatic 21) · ×1
  • EquityFillModel.GetBestEffortBidPrice (cyclomatic 21) Common/Orders/Fills/EquityFillModel.cs:883 — EquityFillModel.GetBestEffortBidPrice has cyclomatic complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (EquityFillModel.GetBestEffortAskPrice) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · PortfolioStatistics.PortfolioStatistics.ctor (cyclomatic 21) · ×1
  • PortfolioStatistics.PortfolioStatistics.ctor (cyclomatic 21) Common/Statistics/PortfolioStatistics.cs:211 — PortfolioStatistics.PortfolioStatistics.ctor has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · MatHold.ComputeNextValue (cyclomatic 21) · ×1
  • MatHold.ComputeNextValue (cyclomatic 21) Indicators/CandlestickPatterns/MatHold.cs:99 — MatHold.ComputeNextValue has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ThreeLineStrike.ComputeNextValue (cyclomatic 21) · ×1
  • ThreeLineStrike.ComputeNextValue (cyclomatic 21) Indicators/CandlestickPatterns/ThreeLineStrike.cs:73 — ThreeLineStrike.ComputeNextValue has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · BasicTemplateCryptoFutureAlgorithm.OnData (cyclomatic 21) · ×1
  • BasicTemplateCryptoFutureAlgorithm.OnData (cyclomatic 21) Algorithm.CSharp/BasicTemplateCryptoFutureAlgorithm.cs:82 — BasicTemplateCryptoFutureAlgorithm.OnData has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BybitCryptoFuturesRegressionAlgorithm.OnData (cyclomatic 21) · ×1
  • BybitCryptoFuturesRegressionAlgorithm.OnData (cyclomatic 21) Algorithm.CSharp/BybitCryptoFuturesRegressionAlgorithm.cs:71 — BybitCryptoFuturesRegressionAlgorithm.OnData has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DuplicateOptionAssignmentRegressionAlgorithm.OnOrderEvent (cyclomatic 21) · ×1
  • DuplicateOptionAssignmentRegressionAlgorithm.OnOrderEvent (cyclomatic 21) Algorithm.CSharp/DuplicateOptionAssignmentRegressionAlgorithm.cs:69 — DuplicateOptionAssignmentRegressionAlgorithm.OnOrderEvent has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OptimizationClustering.KMeans (cyclomatic 21) · ×1
  • OptimizationClustering.KMeans (cyclomatic 21) Optimizer/Analysis/OptimizationClustering.cs:131 — OptimizationClustering.KMeans has cyclomatic complexity 21 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · BasicTemplateCryptoFutureAlgorithm.on_data (cyclomatic 21) · ×1
  • BasicTemplateCryptoFutureAlgorithm.on_data (cyclomatic 21) Algorithm.Python/BasicTemplateCryptoFutureAlgorithm.py:57 — BasicTemplateCryptoFutureAlgorithm.on_data has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BybitCryptoFuturesRegressionAlgorithm.on_data (cyclomatic 21) · ×1
  • BybitCryptoFuturesRegressionAlgorithm.on_data (cyclomatic 21) Algorithm.Python/BybitCryptoFuturesRegressionAlgorithm.py:53 — BybitCryptoFuturesRegressionAlgorithm.on_data has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HistoryAuxiliaryDataRegressionAlgorithm.initialize (cyclomatic 21) · ×1
  • HistoryAuxiliaryDataRegressionAlgorithm.initialize (cyclomatic 21) Algorithm.Python/HistoryAuxiliaryDataRegressionAlgorithm.py:21 — HistoryAuxiliaryDataRegressionAlgorithm.initialize has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · QCAlgorithm.CreateConsolidator (cyclomatic 20) · ×1
  • QCAlgorithm.CreateConsolidator (cyclomatic 20) Algorithm/QCAlgorithm.Indicators.cs:4291 — QCAlgorithm.CreateConsolidator has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ContingentOrderUpdateRegressionAlgorithm.OnData (cyclomatic 20) · ×1
  • ContingentOrderUpdateRegressionAlgorithm.OnData (cyclomatic 20) Algorithm.CSharp/ContingentOrderUpdateRegressionAlgorithm.cs:54 — ContingentOrderUpdateRegressionAlgorithm.OnData has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
D1 · Cyclomatic Complexity · OptionRenameRegressionAlgorithm.OnData (cyclomatic 20) · ×1
  • OptionRenameRegressionAlgorithm.OnData (cyclomatic 20) Algorithm.CSharp/OptionRenameRegressionAlgorithm.cs:57 — OptionRenameRegressionAlgorithm.OnData has cyclomatic complexity 20 (threshold 15). Of this number, 16 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SecuritySessionWithFuturesRegressionAlgorithm.AccumulateSessionData (cyclomatic 20) · ×1
  • SecuritySessionWithFuturesRegressionAlgorithm.AccumulateSessionData (cyclomatic 20) Algorithm.CSharp/SecuritySessionWithFuturesRegressionAlgorithm.cs:53 — SecuritySessionWithFuturesRegressionAlgorithm.AccumulateSessionData has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · UpdateOrderLiveTestAlgorithm.OnData (cyclomatic 20) · ×1
  • UpdateOrderLiveTestAlgorithm.OnData (cyclomatic 20) Algorithm.CSharp/UpdateOrderLiveTestAlgorithm.cs:86 — UpdateOrderLiveTestAlgorithm.OnData has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WarmupDailyResolutionRegressionAlgorithm.OnData (cyclomatic 20) · ×1
  • WarmupDailyResolutionRegressionAlgorithm.OnData (cyclomatic 20) Algorithm.CSharp/WarmupDailyResolutionRegressionAlgorithm.cs:52 — WarmupDailyResolutionRegressionAlgorithm.OnData has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OptimizationModes.Find (cyclomatic 20) · ×1
  • OptimizationModes.Find (cyclomatic 20) Optimizer/Analysis/OptimizationModes.cs:29 — OptimizationModes.Find has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BasicTemplateCryptoAlgorithm.on_data (cyclomatic 20) · ×1
  • BasicTemplateCryptoAlgorithm.on_data (cyclomatic 20) Algorithm.Python/BasicTemplateCryptoAlgorithm.py:63 — BasicTemplateCryptoAlgorithm.on_data has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ObjectStoreHelpersRegressionAlgorithm.on_end_of_algorithm (cyclomatic 20) · ×1
  • ObjectStoreHelpersRegressionAlgorithm.on_end_of_algorithm (cyclomatic 20) Algorithm.Python/ObjectStoreHelpersRegressionAlgorithm.py:33 — ObjectStoreHelpersRegressionAlgorithm.on_end_of_algorithm has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ContingentOrderProcessor.ProcessFill (cyclomatic 19) · ×1
  • ContingentOrderProcessor.ProcessFill (cyclomatic 19) Common/Orders/ContingentOrderProcessor.cs:153 — ContingentOrderProcessor.ProcessFill has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DataFrameGenerator.AddData (cyclomatic 19) · ×1
  • DataFrameGenerator.AddData (cyclomatic 19) Common/Python/PandasConverter.DataFrameGenerator.cs:77 — DataFrameGenerator.AddData has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BaseOptionFilterUniverse.IronCondor (cyclomatic 19) · ×1
  • BaseOptionFilterUniverse.IronCondor (cyclomatic 19) Common/Securities/Option/OptionFilterUniverse.cs:850 — BaseOptionFilterUniverse.IronCondor has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 9 of the 19 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 890, 871, 872). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · LeanData.GenerateZipFileName (cyclomatic 19) · ×1
  • LeanData.GenerateZipFileName (cyclomatic 19) Common/Util/LeanData.cs:791 — LeanData.GenerateZipFileName has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · StalledPattern.ComputeNextValue (cyclomatic 19) · ×1
  • StalledPattern.ComputeNextValue (cyclomatic 19) Indicators/CandlestickPatterns/StalledPattern.cs:86 — StalledPattern.ComputeNextValue has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · BasicTemplateCryptoFutureHourlyAlgorithm.OnData (cyclomatic 19) · ×1
  • BasicTemplateCryptoFutureHourlyAlgorithm.OnData (cyclomatic 19) Algorithm.CSharp/BasicTemplateCryptoFutureHourlyAlgorithm.cs:77 — BasicTemplateCryptoFutureHourlyAlgorithm.OnData has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · UpdateOrderRegressionAlgorithm.OnData (cyclomatic 19) · ×1
  • UpdateOrderRegressionAlgorithm.OnData (cyclomatic 19) Algorithm.CSharp/UpdateOrderRegressionAlgorithm.cs:77 — UpdateOrderRegressionAlgorithm.OnData has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AlgoSeekFuturesReader.Parse (cyclomatic 19) · ×1
  • AlgoSeekFuturesReader.Parse (cyclomatic 19) ToolBox/AlgoSeekFuturesConverter/AlgoSeekFuturesReader.cs:140 — AlgoSeekFuturesReader.Parse has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · BasicTemplateCryptoFutureHourlyAlgorithm.on_data (cyclomatic 19) · ×1
  • BasicTemplateCryptoFutureHourlyAlgorithm.on_data (cyclomatic 19) Algorithm.Python/BasicTemplateCryptoFutureHourlyAlgorithm.py:55 — BasicTemplateCryptoFutureHourlyAlgorithm.on_data has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BracketOrderRegressionAlgorithm.on_data (cyclomatic 19) · ×1
  • BracketOrderRegressionAlgorithm.on_data (cyclomatic 19) Algorithm.Python/BracketOrderRegressionAlgorithm.py:31 — BracketOrderRegressionAlgorithm.on_data has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · UpdateOrderRegressionAlgorithm.on_data (cyclomatic 19) · ×1
  • UpdateOrderRegressionAlgorithm.on_data (cyclomatic 19) Algorithm.Python/UpdateOrderRegressionAlgorithm.py:53 — UpdateOrderRegressionAlgorithm.on_data has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DownloaderDataProvider.Fetch (cyclomatic 18) · ×1
  • DownloaderDataProvider.Fetch (cyclomatic 18) Engine/DataFeeds/DownloaderDataProvider.cs:80 — DownloaderDataProvider.Fetch has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to one function literal inside it that branches (line 82). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · LiveSynchronizer.StreamData (cyclomatic 18) · ×1
  • LiveSynchronizer.StreamData (cyclomatic 18) Engine/DataFeeds/LiveSynchronizer.cs:85 — LiveSynchronizer.StreamData has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BaseResultsHandler.GenerateStatisticsResults (cyclomatic 18) · ×1
  • BaseResultsHandler.GenerateStatisticsResults (cyclomatic 18) Engine/Results/BaseResultsHandler.cs:1198 — BaseResultsHandler.GenerateStatisticsResults has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · EtoroBrokerageModel.CanSubmitContingentOrder (cyclomatic 18) · ×1
  • EtoroBrokerageModel.CanSubmitContingentOrder (cyclomatic 18) Common/Brokerages/EtoroBrokerageModel.cs:183 — EtoroBrokerageModel.CanSubmitContingentOrder has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · AlphaStreamsFeeModel.GetOrderFee (cyclomatic 18) · ×1
  • AlphaStreamsFeeModel.GetOrderFee (cyclomatic 18) Common/Orders/Fees/AlphaStreamsFeeModel.cs:53 — AlphaStreamsFeeModel.GetOrderFee has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PandasData.ToPandasDataFrame (cyclomatic 18) · ×1
  • PandasData.ToPandasDataFrame (cyclomatic 18) Common/Python/PandasData.cs:284 — PandasData.ToPandasDataFrame has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LeanData.GenerateRelativeZipFileDirectory (cyclomatic 18) · ×1
  • LeanData.GenerateRelativeZipFileDirectory (cyclomatic 18) Common/Util/LeanData.cs:549 — LeanData.GenerateRelativeZipFileDirectory has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · LeanDataPathComponents.Parse (cyclomatic 18) · ×1
  • LeanDataPathComponents.Parse (cyclomatic 18) Common/Util/LeanDataPathComponents.cs:103 — LeanDataPathComponents.Parse has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AbandonedBaby.ComputeNextValue (cyclomatic 18) · ×1
  • AbandonedBaby.ComputeNextValue (cyclomatic 18) Indicators/CandlestickPatterns/AbandonedBaby.cs:104 — AbandonedBaby.ComputeNextValue has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · IdenticalThreeCrows.ComputeNextValue (cyclomatic 18) · ×1
  • IdenticalThreeCrows.ComputeNextValue (cyclomatic 18) Indicators/CandlestickPatterns/IdenticalThreeCrows.cs:77 — IdenticalThreeCrows.ComputeNextValue has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · AddOptionContractExpiresRegressionAlgorithm.OnData (cyclomatic 18) · ×1
  • AddOptionContractExpiresRegressionAlgorithm.OnData (cyclomatic 18) Algorithm.CSharp/AddOptionContractExpiresRegressionAlgorithm.cs:45 — AddOptionContractExpiresRegressionAlgorithm.OnData has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ContingentOrderCancelRegressionAlgorithm.OnData (cyclomatic 18) · ×1
  • ContingentOrderCancelRegressionAlgorithm.OnData (cyclomatic 18) Algorithm.CSharp/ContingentOrderCancelRegressionAlgorithm.cs:53 — ContingentOrderCancelRegressionAlgorithm.OnData has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
D1 · Cyclomatic Complexity · OptionChainUniverseRemovalRegressionAlgorithm.OnSecuritiesChanged (cyclomatic 18) · ×1
  • OptionChainUniverseRemovalRegressionAlgorithm.OnSecuritiesChanged (cyclomatic 18) Algorithm.CSharp/OptionChainUniverseRemovalRegressionAlgorithm.cs:101 — OptionChainUniverseRemovalRegressionAlgorithm.OnSecuritiesChanged has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OptionRenameDailyRegressionAlgorithm.OnData (cyclomatic 18) · ×1
  • OptionRenameDailyRegressionAlgorithm.OnData (cyclomatic 18) Algorithm.CSharp/OptionRenameDailyRegressionAlgorithm.cs:59 — OptionRenameDailyRegressionAlgorithm.OnData has cyclomatic complexity 18 (threshold 15). Of this number, 14 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SecurityInitializationOnReAdditionForSelectedOptionRegressionAlgorithm.OnSecuritiesChanged (cyclomatic 18) · ×1
  • SecurityInitializationOnReAdditionForSelectedOptionRegressionAlgorithm.OnSecuritiesChanged (cyclomatic 18) Algorithm.CSharp/SecurityInitializationOnReAdditionForSelectedOptionRegressionAlgorithm.cs:101 — SecurityInitializationOnReAdditionForSelectedOptionRegressionAlgorithm.OnSecuritiesChanged has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ContingentOrderCancelRegressionAlgorithm.on_data (cyclomatic 18) · ×1
  • ContingentOrderCancelRegressionAlgorithm.on_data (cyclomatic 18) Algorithm.Python/ContingentOrderCancelRegressionAlgorithm.py:33 — ContingentOrderCancelRegressionAlgorithm.on_data has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · IronCondorStrategyAlgorithm.assert_strategy_position_group (cyclomatic 18) · ×1
  • IronCondorStrategyAlgorithm.assert_strategy_position_group (cyclomatic 18) Algorithm.Python/IronCondorStrategyAlgorithm.py:51 — IronCondorStrategyAlgorithm.assert_strategy_position_group has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DataQueueHandlerManager.Subscribe (cyclomatic 17) · ×1
  • DataQueueHandlerManager.Subscribe (cyclomatic 17) Engine/DataFeeds/DataQueueHandlerManager.cs:74 — DataQueueHandlerManager.Subscribe has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ScheduledEnumerator.MoveNext (cyclomatic 17) · ×1
  • ScheduledEnumerator.MoveNext (cyclomatic 17) Engine/DataFeeds/Enumerators/ScheduledEnumerator.cs:73 — ScheduledEnumerator.MoveNext has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BacktestingResultHandler.Update (cyclomatic 17) · ×1
  • BacktestingResultHandler.Update (cyclomatic 17) Engine/Results/BacktestingResultHandler.cs:160 — BacktestingResultHandler.Update has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BaseResultsHandler.IsEncodedRuntimeStatistic (cyclomatic 17) · ×1
  • BaseResultsHandler.IsEncodedRuntimeStatistic (cyclomatic 17) Engine/Results/BaseResultsHandler.cs:1078 — BaseResultsHandler.IsEncodedRuntimeStatistic has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · QCAlgorithm.GetResolution (cyclomatic 17) · ×1
  • QCAlgorithm.GetResolution (cyclomatic 17) Algorithm/QCAlgorithm.History.cs:1426 — QCAlgorithm.GetResolution has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BinanceBrokerageModel.CanSubmitContingentOrder (cyclomatic 17) · ×1
  • BinanceBrokerageModel.CanSubmitContingentOrder (cyclomatic 17) Common/Brokerages/BinanceBrokerageModel.cs:122 — BinanceBrokerageModel.CanSubmitContingentOrder has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · CashBuyingPowerModel.GetMaximumOrderQuantityForTargetBuyingPower (cyclomatic 17) · ×1
  • CashBuyingPowerModel.GetMaximumOrderQuantityForTargetBuyingPower (cyclomatic 17) Common/Securities/CashBuyingPowerModel.cs:191 — CashBuyingPowerModel.GetMaximumOrderQuantityForTargetBuyingPower has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · StreamReaderExtensions.GetDecimal (cyclomatic 17) · ×1
  • StreamReaderExtensions.GetDecimal (cyclomatic 17) Common/Util/StreamReaderExtensions.cs:56 — StreamReaderExtensions.GetDecimal has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. Note what this body is, though: it carries an aggressive-inlining request, so its author has asked in the source for this body to be inlined into every caller. Each part pulled out of it becomes a call the runtime has to decide to inline again, against a size budget — so the split can quietly turn one inlined body into several real calls, on the path the marker exists to protect. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
D1 · Cyclomatic Complexity · KickingByLength.ComputeNextValue (cyclomatic 17) · ×1
  • KickingByLength.ComputeNextValue (cyclomatic 17) Indicators/CandlestickPatterns/KickingByLength.cs:75 — KickingByLength.ComputeNextValue has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · AddOptionContractTwiceRegressionAlgorithm.OnData (cyclomatic 17) · ×1
  • AddOptionContractTwiceRegressionAlgorithm.OnData (cyclomatic 17) Algorithm.CSharp/AddOptionContractTwiceRegressionAlgorithm.cs:53 — AddOptionContractTwiceRegressionAlgorithm.OnData has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConstituentsUniverseRegressionAlgorithm.OnData (cyclomatic 17) · ×1
  • ConstituentsUniverseRegressionAlgorithm.OnData (cyclomatic 17) Algorithm.CSharp/ConstituentsUniverseRegressionAlgorithm.cs:59 — ConstituentsUniverseRegressionAlgorithm.OnData has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ContinuousFutureRolloverBaseRegressionAlgorithm.OnData (cyclomatic 17) · ×1
  • ContinuousFutureRolloverBaseRegressionAlgorithm.OnData (cyclomatic 17) Algorithm.CSharp/ContinuousFutureRolloverBaseRegressionAlgorithm.cs:86 — ContinuousFutureRolloverBaseRegressionAlgorithm.OnData has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CustomUniverseWithBenchmarkRegressionAlgorithm.OnData (cyclomatic 17) · ×1
  • CustomUniverseWithBenchmarkRegressionAlgorithm.OnData (cyclomatic 17) Algorithm.CSharp/CustomUniverseWithBenchmarkRegressionAlgorithm.cs:78 — CustomUniverseWithBenchmarkRegressionAlgorithm.OnData has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OptionOpenInterestRegressionAlgorithm.OnData (cyclomatic 17) · ×1
  • OptionOpenInterestRegressionAlgorithm.OnData (cyclomatic 17) Algorithm.CSharp/OptionOpenInterestRegressionAlgorithm.cs:53 — OptionOpenInterestRegressionAlgorithm.OnData has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Program.Main (cyclomatic 17) · ×1
  • Program.Main (cyclomatic 17) ToolBox/Program.cs:31 — Program.Main has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · EulerSearchOptimizationStrategy.PushNewResults (cyclomatic 17) · ×1
  • EulerSearchOptimizationStrategy.PushNewResults (cyclomatic 17) Optimizer/Strategies/EulerSearchOptimizationStrategy.cs:63 — EulerSearchOptimizationStrategy.PushNewResults has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · IndexOptionCallITMGreeksExpiryRegressionAlgorithm.on_data (cyclomatic 17) · ×1
  • IndexOptionCallITMGreeksExpiryRegressionAlgorithm.on_data (cyclomatic 17) Algorithm.Python/IndexOptionCallITMGreeksExpiryRegressionAlgorithm.py:44 — IndexOptionCallITMGreeksExpiryRegressionAlgorithm.on_data has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · OptionOpenInterestRegressionAlgorithm.on_data (cyclomatic 17) · ×1
  • OptionOpenInterestRegressionAlgorithm.on_data (cyclomatic 17) Algorithm.Python/OptionOpenInterestRegressionAlgorithm.py:36 — OptionOpenInterestRegressionAlgorithm.on_data has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · EtoroBrokerageModel.CanSubmitOrder (cyclomatic 16) · ×1
  • EtoroBrokerageModel.CanSubmitOrder (cyclomatic 16) Common/Brokerages/EtoroBrokerageModel.cs:119 — EtoroBrokerageModel.CanSubmitOrder has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · TradierBrokerageModel.CanSubmitOrder (cyclomatic 16) · ×1
  • TradierBrokerageModel.CanSubmitOrder (cyclomatic 16) Common/Brokerages/TradierBrokerageModel.cs:70 — TradierBrokerageModel.CanSubmitOrder has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Isolator.MonitorTask (cyclomatic 16) · ×1
  • Isolator.MonitorTask (cyclomatic 16) Common/Isolator.cs:82 — Isolator.MonitorTask has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FillModel.LimitIfTouchedFill (cyclomatic 16) · ×1
  • FillModel.LimitIfTouchedFill (cyclomatic 16) Common/Orders/Fills/FillModel.cs:603 — FillModel.LimitIfTouchedFill has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Serie.Add (cyclomatic 16) · ×1
  • Serie.Add (cyclomatic 16) Common/Python/PandasData.cs:761 — Serie.Add has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SecurityCacheProvider.GetSecurityCache (cyclomatic 16) · ×1
  • SecurityCacheProvider.GetSecurityCache (cyclomatic 16) Common/Securities/SecurityCacheProvider.cs:58 — SecurityCacheProvider.GetSecurityCache has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SeriesSampler.SampleSeries (cyclomatic 16) · ×1
  • SeriesSampler.SampleSeries (cyclomatic 16) Common/SeriesSampler.cs:128 — SeriesSampler.SampleSeries has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Kicking.ComputeNextValue (cyclomatic 16) · ×1
  • Kicking.ComputeNextValue (cyclomatic 16) Indicators/CandlestickPatterns/Kicking.cs:74 — Kicking.ComputeNextValue has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ThreeInside.ComputeNextValue (cyclomatic 16) · ×1
  • ThreeInside.ComputeNextValue (cyclomatic 16) Indicators/CandlestickPatterns/ThreeInside.cs:75 — ThreeInside.ComputeNextValue has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · AddRemoveOptionUniverseRegressionAlgorithm.OnData (cyclomatic 16) · ×1
  • AddRemoveOptionUniverseRegressionAlgorithm.OnData (cyclomatic 16) Algorithm.CSharp/AddRemoveOptionUniverseRegressionAlgorithm.cs:63 — AddRemoveOptionUniverseRegressionAlgorithm.OnData has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · BasicTemplateMultiAssetAlgorithm.OnData (cyclomatic 16) · ×1
  • BasicTemplateMultiAssetAlgorithm.OnData (cyclomatic 16) Algorithm.CSharp/BasicTemplateMultiAssetAlgorithm.cs:86 — BasicTemplateMultiAssetAlgorithm.OnData has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CheeseMilkHourlyRebalance.OnData (cyclomatic 16) · ×1
  • CheeseMilkHourlyRebalance.OnData (cyclomatic 16) Algorithm.CSharp/CapacityTests/CheeseMilkHourlyRebalance.cs:48 — CheeseMilkHourlyRebalance.OnData has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · HistoryWithDifferentContinuousContractDepthOffsetsRegressionAlgorithm.OnEndOfAlgorithm (cyclomatic 16) · ×1
  • HistoryWithDifferentContinuousContractDepthOffsetsRegressionAlgorithm.OnEndOfAlgorithm (cyclomatic 16) Algorithm.CSharp/HistoryWithDifferentContinuousContractDepthOffsetsRegressionAlgorithm.cs:40 — HistoryWithDifferentContinuousContractDepthOffsetsRegressionAlgorithm.OnEndOfAlgorithm has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OneTriggersOtherOrderRegressionAlgorithm.OnData (cyclomatic 16) · ×1
  • OneTriggersOtherOrderRegressionAlgorithm.OnData (cyclomatic 16) Algorithm.CSharp/OneTriggersOtherOrderRegressionAlgorithm.cs:59 — OneTriggersOtherOrderRegressionAlgorithm.OnData has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SplitEquityRegressionAlgorithm.OnEndOfAlgorithm (cyclomatic 16) · ×1
  • SplitEquityRegressionAlgorithm.OnEndOfAlgorithm (cyclomatic 16) Algorithm.CSharp/SplitEquityRegressionAlgorithm.cs:65 — SplitEquityRegressionAlgorithm.OnEndOfAlgorithm has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · KaikoDataConverterProgram.KaikoDataConverter (cyclomatic 16) · ×1
  • KaikoDataConverterProgram.KaikoDataConverter (cyclomatic 16) ToolBox/KaikoDataConverter/KaikoDataConverterProgram.cs:41 — KaikoDataConverterProgram.KaikoDataConverter has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Program.Main (cyclomatic 16) · ×1
  • Program.Main (cyclomatic 16) Report/Program.cs:35 — Program.Main has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConstituentsUniverseRegressionAlgorithm.on_data (cyclomatic 16) · ×1
  • ConstituentsUniverseRegressionAlgorithm.on_data (cyclomatic 16) Algorithm.Python/ConstituentsUniverseRegressionAlgorithm.py:42 — ConstituentsUniverseRegressionAlgorithm.on_data has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FuturesChainFiltersRegressionAlgorithm.on_data (cyclomatic 16) · ×1
  • FuturesChainFiltersRegressionAlgorithm.on_data (cyclomatic 16) Algorithm.Python/FuturesChainFiltersRegressionAlgorithm.py:65 — FuturesChainFiltersRegressionAlgorithm.on_data has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LongAndShortButterflyCallStrategiesAlgorithm.assert_strategy_position_group (cyclomatic 16) · ×1
  • LongAndShortButterflyCallStrategiesAlgorithm.assert_strategy_position_group (cyclomatic 16) Algorithm.Python/LongAndShortButterflyCallStrategiesAlgorithm.py:50 — LongAndShortButterflyCallStrategiesAlgorithm.assert_strategy_position_group has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · LongAndShortButterflyPutStrategiesAlgorithm.assert_strategy_position_group (cyclomatic 16) · ×1
  • LongAndShortButterflyPutStrategiesAlgorithm.assert_strategy_position_group (cyclomatic 16) Algorithm.Python/LongAndShortButterflyPutStrategiesAlgorithm.py:50 — LongAndShortButterflyPutStrategiesAlgorithm.assert_strategy_position_group has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · OptionPriceModelForOptionStylesBaseRegressionAlgorithm.check_greeks (cyclomatic 16) · ×1
  • OptionPriceModelForOptionStylesBaseRegressionAlgorithm.check_greeks (cyclomatic 16) Algorithm.Python/OptionPriceModelForOptionStylesBaseRegressionAlgorithm.py:51 — OptionPriceModelForOptionStylesBaseRegressionAlgorithm.check_greeks has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OptionRenameRegressionAlgorithm.on_data (cyclomatic 16) · ×1
  • OptionRenameRegressionAlgorithm.on_data (cyclomatic 16) Algorithm.Python/OptionRenameRegressionAlgorithm.py:35 — OptionRenameRegressionAlgorithm.on_data has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SecuritySessionWithFuturesRegressionAlgorithm.accumulate_session_data (cyclomatic 16) · ×1
  • SecuritySessionWithFuturesRegressionAlgorithm.accumulate_session_data (cyclomatic 16) Algorithm.Python/SecuritySessionWithFuturesRegressionAlgorithm.py:38 — SecuritySessionWithFuturesRegressionAlgorithm.accumulate_session_data has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D10 · Test Quality · Test cannot fail · ×1
  • Test cannot fail: DoesNotParseCSV Tests/Common/Securities/SecurityDefinitionTests.cs:43 — This test's act runs inside `catch` at line 55 of this file, which catches every exception and neither rethrows nor verifies — so the method passes whether or not the behaviour it names actually happens. The 1 assertion(s) this test does make are inside that region, and an xUnit/NUnit assertion reports by THROWING — so they are caught and discarded too, which is why nothing else here flags this test. Assert the outcome instead of catching it: `Assert.Throws<T>(() => …)` (or the framework equivalent) when a throw is the expected result, or narrow the catch to the one exception type and assert on it. A catch-all that only logs belongs in production code, not between a test and its verdict.
D10 · Test Quality · Fixed-sleep synchronisation · ×1
  • Fixed-sleep synchronisation: DoesNotSetRunTimeErrorWhenReconnectMessageComesThrough Tests/Engine/DefaultBrokerageMessageHandlerTests.cs:54 — This test starts a background task through `DefaultBrokerageMessageHandler.HandleMessage` and then orders itself against it with `Thread.Sleep(100)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
D12 · Dependency Hygiene · Deprecated · ×1
  • Deprecated: DotNetZip REDACTED:32 — REDACTED — Legacy
D17 · Explicit Debt · BarePragmaDisable repeated across 15 files · ×1
  • BarePragmaDisable repeated across 15 files Tests/Algorithm/AlgorithmAddDataTests.cs:621 — The identical BarePragmaDisable (`#pragma warning disable CS0618`) appears in 15 files (17 occurrences) — a single repo-wide policy (e.g. a Directory.Build.props decision or an idiomatic suppression), not 17 independent debts. Decide it once centrally rather than file-by-file. (Every occurrence still counts toward the score and metrics.)
D17 · Explicit Debt · BarePragmaDisable repeated 17 times in 3 files · ×1
  • BarePragmaDisable repeated 17 times in 3 files REDACTED:50 — The identical BarePragmaDisable (`#pragma warning disable CA2000`) appears 17 times in 3 files — one decision applied repeatedly (e.g. the same rule silenced on every overload of a fluent API), not 17 independent debts. Decide it once — at the type or project level, or by fixing the underlying pattern — rather than occurrence-by-occurrence. (Every occurrence still counts toward the score and metrics.)
D2 · Cognitive Complexity · LeanData.GenerateLine (cognitive 187) · ×1
  • LeanData.GenerateLine (cognitive 187) Common/Util/LeanData.cs:90 — LeanData.GenerateLine has cognitive complexity 187 (threshold 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · TimeSliceFactory.Create (cognitive 182) · ×1
  • TimeSliceFactory.Create (cognitive 182) Engine/DataFeeds/TimeSliceFactory.cs:89 — TimeSliceFactory.Create has cognitive complexity 182 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · AlgorithmManager.Run (cognitive 175) · ×1
  • AlgorithmManager.Run (cognitive 175) Engine/AlgorithmManager.cs:121 — AlgorithmManager.Run has cognitive complexity 175 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SubscriptionSynchronizer.Sync (cognitive 106) · ×1
  • SubscriptionSynchronizer.Sync (cognitive 106) Engine/DataFeeds/SubscriptionSynchronizer.cs:88 — SubscriptionSynchronizer.Sync has cognitive complexity 106 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · RandomDataGenerator.Run (cognitive 97) · ×1
  • RandomDataGenerator.Run (cognitive 97) ToolBox/RandomDataGenerator/RandomDataGenerator.cs:53 — RandomDataGenerator.Run has cognitive complexity 97 (threshold 15). Of this number, 93 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BacktestingBrokerage.Scan (cognitive 77) · ×1
  • BacktestingBrokerage.Scan (cognitive 77) Brokerages/Backtesting/BacktestingBrokerage.cs:240 — BacktestingBrokerage.Scan has cognitive complexity 77 (threshold 15). Of this number, 74 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TradeStatistics.TradeStatistics.ctor (cognitive 76) · ×1
  • TradeStatistics.TradeStatistics.ctor (cognitive 76) Common/Statistics/TradeStatistics.cs:276 — TradeStatistics.TradeStatistics.ctor has cognitive complexity 76 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DividendSplitMapGenerator.GenerateSplitsDividends (cognitive 74) · ×1
  • DividendSplitMapGenerator.GenerateSplitsDividends (cognitive 74) ToolBox/RandomDataGenerator/DividendSplitMapGenerator.cs:84 — DividendSplitMapGenerator.GenerateSplitsDividends has cognitive complexity 74 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · SecurityCache.ProcessDataPoint (cognitive 71) · ×1
  • SecurityCache.ProcessDataPoint (cognitive 71) Common/Securities/SecurityCache.cs:192 — SecurityCache.ProcessDataPoint has cognitive complexity 71 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UniverseSelection.ApplyUniverseSelection (cognitive 70) · ×1
  • UniverseSelection.ApplyUniverseSelection (cognitive 70) Engine/DataFeeds/UniverseSelection.cs:119 — UniverseSelection.ApplyUniverseSelection has cognitive complexity 70 (threshold 15). Of this number, 61 points are the body's own statements and 9 belong to one function literal inside it that branches. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · SessionBar.Update (cognitive 67) · ×1
  • SessionBar.Update (cognitive 67) Common/Data/Market/SessionBar.cs:98 — SessionBar.Update has cognitive complexity 67 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · BrokerageTransactionHandler.HandleOrderEvents (cognitive 57) · ×1
  • BrokerageTransactionHandler.HandleOrderEvents (cognitive 57) Engine/TransactionHandlers/BrokerageTransactionHandler.cs:1267 — BrokerageTransactionHandler.HandleOrderEvents has cognitive complexity 57 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SubscriptionDataReader.MoveNext (cognitive 56) · ×1
  • SubscriptionDataReader.MoveNext (cognitive 56) Engine/DataFeeds/SubscriptionDataReader.cs:276 — SubscriptionDataReader.MoveNext has cognitive complexity 56 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QCAlgorithm.PreOrderChecksImpl (cognitive 53) · ×1
  • QCAlgorithm.PreOrderChecksImpl (cognitive 53) Algorithm/QCAlgorithm.Trading.cs:842 — QCAlgorithm.PreOrderChecksImpl has cognitive complexity 53 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DataManager.DataManager.ctor (cognitive 51) · ×1
  • DataManager.DataManager.ctor (cognitive 51) Engine/DataFeeds/DataManager.cs:68 — DataManager.DataManager.ctor has cognitive complexity 51 (threshold 15). Most of this is not in the body itself: 1 of the 51 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 90, 201, 205). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · QCAlgorithm.GetLastKnownPricesImpl (cognitive 51) · ×1
  • QCAlgorithm.GetLastKnownPricesImpl (cognitive 51) Algorithm/QCAlgorithm.History.cs:812 — QCAlgorithm.GetLastKnownPricesImpl has cognitive complexity 51 (threshold 15). Of this number, 33 points are the body's own statements and 18 belong to 3 function literals inside it that branch. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · BasicTemplateCryptoFutureAlgorithm.OnData (cognitive 50) · ×1
  • BasicTemplateCryptoFutureAlgorithm.OnData (cognitive 50) Algorithm.CSharp/BasicTemplateCryptoFutureAlgorithm.cs:82 — BasicTemplateCryptoFutureAlgorithm.OnData has cognitive complexity 50 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SeriesSampler.SampleCandlestickSeries (cognitive 49) · ×1
  • SeriesSampler.SampleCandlestickSeries (cognitive 49) Common/SeriesSampler.cs:221 — SeriesSampler.SampleCandlestickSeries has cognitive complexity 49 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Engine.Run (cognitive 47) · ×1
  • Engine.Run (cognitive 47) Engine/Engine.cs:87 — Engine.Run has cognitive complexity 47 (threshold 15). Of this number, 36 points are the body's own statements and 11 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DataFrameGenerator.AddData (cognitive 47) · ×1
  • DataFrameGenerator.AddData (cognitive 47) Common/Python/PandasConverter.DataFrameGenerator.cs:77 — DataFrameGenerator.AddData has cognitive complexity 47 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OptimizationClustering.KMeans (cognitive 47) · ×1
  • OptimizationClustering.KMeans (cognitive 47) Optimizer/Analysis/OptimizationClustering.cs:131 — OptimizationClustering.KMeans has cognitive complexity 47 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · QCAlgorithm.GetMatchingSubscriptions (cognitive 46) · ×1
  • QCAlgorithm.GetMatchingSubscriptions (cognitive 46) Algorithm/QCAlgorithm.History.cs:1194 — QCAlgorithm.GetMatchingSubscriptions has cognitive complexity 46 (threshold 15). Of this number, 41 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BrokerageTransactionHandler.HandleOptionNotification (cognitive 44) · ×1
  • BrokerageTransactionHandler.HandleOptionNotification (cognitive 44) Engine/TransactionHandlers/BrokerageTransactionHandler.cs:1810 — BrokerageTransactionHandler.HandleOptionNotification has cognitive complexity 44 (threshold 15). Of this number, 37 points are the body's own statements and 7 belong to 2 function literals inside it that branch. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · ContingentOrderProcessor.ProcessFill (cognitive 44) · ×1
  • ContingentOrderProcessor.ProcessFill (cognitive 44) Common/Orders/ContingentOrderProcessor.cs:153 — ContingentOrderProcessor.ProcessFill has cognitive complexity 44 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · OptionStrategyPositionGroupBuyingPowerModel.GetMaintenanceMargin (cognitive 44) · ×1
  • OptionStrategyPositionGroupBuyingPowerModel.GetMaintenanceMargin (cognitive 44) Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs:50 — OptionStrategyPositionGroupBuyingPowerModel.GetMaintenanceMargin has cognitive complexity 44 (threshold 15). Of this number, 37 points are the body's own statements and 7 belong to 7 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · BybitCryptoFuturesRegressionAlgorithm.OnData (cognitive 44) · ×1
  • BybitCryptoFuturesRegressionAlgorithm.OnData (cognitive 44) Algorithm.CSharp/BybitCryptoFuturesRegressionAlgorithm.cs:71 — BybitCryptoFuturesRegressionAlgorithm.OnData has cognitive complexity 44 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OptionOpenInterestRegressionAlgorithm.on_data (cognitive 44) · ×1
  • OptionOpenInterestRegressionAlgorithm.on_data (cognitive 44) Algorithm.Python/OptionOpenInterestRegressionAlgorithm.py:36 — OptionOpenInterestRegressionAlgorithm.on_data has cognitive complexity 44 (threshold 15). Drivers by points: if/else 8 (33 pts), boolean chains 6, loops 2 (5 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveTradingResultHandler.Update (cognitive 43) · ×1
  • LiveTradingResultHandler.Update (cognitive 43) Engine/Results/LiveTradingResultHandler.cs:161 — LiveTradingResultHandler.Update has cognitive complexity 43 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OptionOpenInterestRegressionAlgorithm.OnData (cognitive 43) · ×1
  • OptionOpenInterestRegressionAlgorithm.OnData (cognitive 43) Algorithm.CSharp/OptionOpenInterestRegressionAlgorithm.cs:53 — OptionOpenInterestRegressionAlgorithm.OnData has cognitive complexity 43 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BasicTemplateCryptoFutureAlgorithm.on_data (cognitive 43) · ×1
  • BasicTemplateCryptoFutureAlgorithm.on_data (cognitive 43) Algorithm.Python/BasicTemplateCryptoFutureAlgorithm.py:57 — BasicTemplateCryptoFutureAlgorithm.on_data has cognitive complexity 43 (threshold 15). Drivers by points: if/else 16 (40 pts), boolean chains 2, loops 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BybitCryptoFuturesRegressionAlgorithm.on_data (cognitive 43) · ×1
  • BybitCryptoFuturesRegressionAlgorithm.on_data (cognitive 43) Algorithm.Python/BybitCryptoFuturesRegressionAlgorithm.py:53 — BybitCryptoFuturesRegressionAlgorithm.on_data has cognitive complexity 43 (threshold 15). Drivers by points: if/else 17 (41 pts), boolean chains 1, loops 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ContingentComboOrderRegressionAlgorithm.on_data (cognitive 43) · ×1
  • ContingentComboOrderRegressionAlgorithm.on_data (cognitive 43) Algorithm.Python/ContingentComboOrderRegressionAlgorithm.py:37 — ContingentComboOrderRegressionAlgorithm.on_data has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (31 pts), boolean chains 10, loops 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DataManager.Add (cognitive 42) · ×1
  • DataManager.Add (cognitive 42) Engine/DataFeeds/DataManager.cs:602 — DataManager.Add has cognitive complexity 42 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · UncoveredShortQuantityOptionStrategyMatchObjectiveFunction.GetUncoveredQuantity (cognitive 42) · ×1
  • UncoveredShortQuantityOptionStrategyMatchObjectiveFunction.GetUncoveredQuantity (cognitive 42) Common/Securities/Option/StrategyMatcher/UncoveredShortQuantityOptionStrategyMatchObjectiveFunction.cs:79 — UncoveredShortQuantityOptionStrategyMatchObjectiveFunction.GetUncoveredQuantity has cognitive complexity 42 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RandomDataGeneratorSettings.FromCommandLineArguments (cognitive 42) · ×1
  • RandomDataGeneratorSettings.FromCommandLineArguments (cognitive 42) ToolBox/RandomDataGenerator/RandomDataGeneratorSettings.cs:53 — RandomDataGeneratorSettings.FromCommandLineArguments has cognitive complexity 42 (threshold 15). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · DownloaderDataProvider.Fetch (cognitive 41) · ×1
  • DownloaderDataProvider.Fetch (cognitive 41) Engine/DataFeeds/DownloaderDataProvider.cs:80 — DownloaderDataProvider.Fetch has cognitive complexity 41 (threshold 15). None of this is in the body itself: all 41 points belong to one function literal inside it that branches (line 82). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · BasicTemplateCryptoFutureHourlyAlgorithm.OnData (cognitive 41) · ×1
  • BasicTemplateCryptoFutureHourlyAlgorithm.OnData (cognitive 41) Algorithm.CSharp/BasicTemplateCryptoFutureHourlyAlgorithm.cs:77 — BasicTemplateCryptoFutureHourlyAlgorithm.OnData has cognitive complexity 41 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BasicTemplateCryptoFutureHourlyAlgorithm.on_data (cognitive 41) · ×1
  • BasicTemplateCryptoFutureHourlyAlgorithm.on_data (cognitive 41) Algorithm.Python/BasicTemplateCryptoFutureHourlyAlgorithm.py:55 — BasicTemplateCryptoFutureHourlyAlgorithm.on_data has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (37 pts), boolean chains 3, loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReportCharts.GetExposure (cognitive 41) · ×1
  • ReportCharts.GetExposure (cognitive 41) Report/ReportCharts.py:973 — ReportCharts.GetExposure has cognitive complexity 41 (threshold 15). Drivers by points: if/else 20 (26 pts), loops 8 (11 pts), ternaries 4 (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · FillForwardEnumerator.RequiresFillForwardData (cognitive 40) · ×1
  • FillForwardEnumerator.RequiresFillForwardData (cognitive 40) Engine/DataFeeds/Enumerators/FillForwardEnumerator.cs:323 — FillForwardEnumerator.RequiresFillForwardData has cognitive complexity 40 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · TextSubscriptionDataSourceReader.Read (cognitive 40) · ×1
  • TextSubscriptionDataSourceReader.Read (cognitive 40) Engine/DataFeeds/TextSubscriptionDataSourceReader.cs:82 — TextSubscriptionDataSourceReader.Read has cognitive complexity 40 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Slice.GetImpl (cognitive 40) · ×1
  • Slice.GetImpl (cognitive 40) Common/Data/Slice.cs:403 — Slice.GetImpl has cognitive complexity 40 (threshold 15). Of this number, 37 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UniverseExtensions.RunUniverseDownloader (cognitive 40) · ×1
  • UniverseExtensions.RunUniverseDownloader (cognitive 40) Common/Data/UniverseSelection/UniverseExtensions.cs:172 — UniverseExtensions.RunUniverseDownloader has cognitive complexity 40 (threshold 15). Of this number, 34 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OrderJsonConverter.CreateOrderFromJObject (cognitive 40) · ×1
  • OrderJsonConverter.CreateOrderFromJObject (cognitive 40) Common/Orders/OrderJsonConverter.cs:84 — OrderJsonConverter.CreateOrderFromJObject has cognitive complexity 40 (threshold 15). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · HikkakeModified.ComputeNextValue (cognitive 40) · ×1
  • HikkakeModified.ComputeNextValue (cognitive 40) Indicators/CandlestickPatterns/HikkakeModified.cs:81 — HikkakeModified.ComputeNextValue has cognitive complexity 40 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · AddFutureOptionSingleOptionChainSelectedInUniverseFilterRegressionAlgorithm.OnData (cognitive 40) · ×1
  • AddFutureOptionSingleOptionChainSelectedInUniverseFilterRegressionAlgorithm.OnData (cognitive 40) Algorithm.CSharp/AddFutureOptionSingleOptionChainSelectedInUniverseFilterRegressionAlgorithm.cs:78 — AddFutureOptionSingleOptionChainSelectedInUniverseFilterRegressionAlgorithm.OnData has cognitive complexity 40 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OptionStrategyPositionGroupBuyingPowerModel.GetInitialMarginRequirement (cognitive 39) · ×1
  • OptionStrategyPositionGroupBuyingPowerModel.GetInitialMarginRequirement (cognitive 39) Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs:294 — OptionStrategyPositionGroupBuyingPowerModel.GetInitialMarginRequirement has cognitive complexity 39 (threshold 15). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · OptimizationModes.Find (cognitive 38) · ×1
  • OptimizationModes.Find (cognitive 38) Optimizer/Analysis/OptimizationModes.cs:29 — OptimizationModes.Find has cognitive complexity 38 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IndicatorSelectorWorksWithDifferentOptions.on_data (cognitive 38) · ×1
  • IndicatorSelectorWorksWithDifferentOptions.on_data (cognitive 38) Algorithm.Python/IndicatorSelectorsWorkWithDifferentOptions.py:59 — IndicatorSelectorWorksWithDifferentOptions.on_data has cognitive complexity 38 (threshold 15). Drivers by points: if/else 19 (35 pts), boolean chains 3 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QCAlgorithm.CreateConsolidator (cognitive 37) · ×1
  • QCAlgorithm.CreateConsolidator (cognitive 37) Algorithm/QCAlgorithm.Indicators.cs:4291 — QCAlgorithm.CreateConsolidator has cognitive complexity 37 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · QCAlgorithm.OnEndOfTimeStep (cognitive 37) · ×1
  • QCAlgorithm.OnEndOfTimeStep (cognitive 37) Algorithm/QCAlgorithm.Universe.cs:69 — QCAlgorithm.OnEndOfTimeStep has cognitive complexity 37 (threshold 15). Of this number, 36 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PeriodCountConsolidatorBase.Update (cognitive 37) · ×1
  • PeriodCountConsolidatorBase.Update (cognitive 37) Common/Data/Consolidators/PeriodCountConsolidatorBase.cs:147 — PeriodCountConsolidatorBase.Update has cognitive complexity 37 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SplitEquityRegressionAlgorithm.OnEndOfAlgorithm (cognitive 37) · ×1
  • SplitEquityRegressionAlgorithm.OnEndOfAlgorithm (cognitive 37) Algorithm.CSharp/SplitEquityRegressionAlgorithm.cs:65 — SplitEquityRegressionAlgorithm.OnEndOfAlgorithm has cognitive complexity 37 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BubbleAlgorithm.on_data (cognitive 37) · ×1
  • BubbleAlgorithm.on_data (cognitive 37) Algorithm.Python/BubbleAlgorithm.py:65 — BubbleAlgorithm.on_data has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 6, loops 2 (6 pts), error handling 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FillForwardEnumerator.MoveNext (cognitive 36) · ×1
  • FillForwardEnumerator.MoveNext (cognitive 36) Engine/DataFeeds/Enumerators/FillForwardEnumerator.cs:183 — FillForwardEnumerator.MoveNext has cognitive complexity 36 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SynchronizingEnumerator.GetBruteForceMethod (cognitive 36) · ×1
  • SynchronizingEnumerator.GetBruteForceMethod (cognitive 36) Engine/DataFeeds/Enumerators/SynchronizingEnumerator.cs:137 — SynchronizingEnumerator.GetBruteForceMethod has cognitive complexity 36 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SecuritySessionWithFuturesRegressionAlgorithm.AccumulateSessionData (cognitive 36) · ×1
  • SecuritySessionWithFuturesRegressionAlgorithm.AccumulateSessionData (cognitive 36) Algorithm.CSharp/SecuritySessionWithFuturesRegressionAlgorithm.cs:53 — SecuritySessionWithFuturesRegressionAlgorithm.AccumulateSessionData has cognitive complexity 36 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SecuritySessionWithFuturesRegressionAlgorithm.accumulate_session_data (cognitive 36) · ×1
  • SecuritySessionWithFuturesRegressionAlgorithm.accumulate_session_data (cognitive 36) Algorithm.Python/SecuritySessionWithFuturesRegressionAlgorithm.py:38 — SecuritySessionWithFuturesRegressionAlgorithm.accumulate_session_data has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (31 pts), boolean chains 4, loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RegressionResultHandler.ProcessSynchronousEvents (cognitive 35) · ×1
  • RegressionResultHandler.ProcessSynchronousEvents (cognitive 35) Engine/Results/RegressionResultHandler.cs:317 — RegressionResultHandler.ProcessSynchronousEvents has cognitive complexity 35 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · PandasData.ToPandasDataFrame (cognitive 35) · ×1
  • PandasData.ToPandasDataFrame (cognitive 35) Common/Python/PandasData.cs:408 — PandasData.ToPandasDataFrame has cognitive complexity 35 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HistoryWithDifferentContinuousContractDepthOffsetsRegressionAlgorithm.OnEndOfAlgorithm (cognitive 35) · ×1
  • HistoryWithDifferentContinuousContractDepthOffsetsRegressionAlgorithm.OnEndOfAlgorithm (cognitive 35) Algorithm.CSharp/HistoryWithDifferentContinuousContractDepthOffsetsRegressionAlgorithm.cs:40 — HistoryWithDifferentContinuousContractDepthOffsetsRegressionAlgorithm.OnEndOfAlgorithm has cognitive complexity 35 (threshold 15). Of this number, 34 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OrderContingency.Link (cognitive 34) · ×1
  • OrderContingency.Link (cognitive 34) Common/Orders/OrderContingency.cs:318 — OrderContingency.Link has cognitive complexity 34 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SecurityService.CreateSecurity (cognitive 34) · ×1
  • SecurityService.CreateSecurity (cognitive 34) Common/Securities/SecurityService.cs:75 — SecurityService.CreateSecurity has cognitive complexity 34 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Hikkake.ComputeNextValue (cognitive 34) · ×1
  • Hikkake.ComputeNextValue (cognitive 34) Indicators/CandlestickPatterns/Hikkake.cs:71 — Hikkake.ComputeNextValue has cognitive complexity 34 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · BasicTemplateMultiAssetAlgorithm.OnData (cognitive 34) · ×1
  • BasicTemplateMultiAssetAlgorithm.OnData (cognitive 34) Algorithm.CSharp/BasicTemplateMultiAssetAlgorithm.cs:86 — BasicTemplateMultiAssetAlgorithm.OnData has cognitive complexity 34 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · UpdateOrderRegressionAlgorithm.OnData (cognitive 34) · ×1
  • UpdateOrderRegressionAlgorithm.OnData (cognitive 34) Algorithm.CSharp/UpdateOrderRegressionAlgorithm.cs:77 — UpdateOrderRegressionAlgorithm.OnData has cognitive complexity 34 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · KaikoDataConverterProgram.KaikoDataConverter (cognitive 34) · ×1
  • KaikoDataConverterProgram.KaikoDataConverter (cognitive 34) ToolBox/KaikoDataConverter/KaikoDataConverterProgram.cs:41 — KaikoDataConverterProgram.KaikoDataConverter has cognitive complexity 34 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CashBuyingPowerModel.GetOpenOrdersReservedQuantity (cognitive 33) · ×1
  • CashBuyingPowerModel.GetOpenOrdersReservedQuantity (cognitive 33) Common/Securities/CashBuyingPowerModel.cs:400 — CashBuyingPowerModel.GetOpenOrdersReservedQuantity has cognitive complexity 33 (threshold 15). Of this number, 28 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OptionRenameDailyRegressionAlgorithm.OnData (cognitive 33) · ×1
  • OptionRenameDailyRegressionAlgorithm.OnData (cognitive 33) Algorithm.CSharp/OptionRenameDailyRegressionAlgorithm.cs:59 — OptionRenameDailyRegressionAlgorithm.OnData has cognitive complexity 33 (threshold 15). Of this number, 31 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · OptionRenameRegressionAlgorithm.OnData (cognitive 33) · ×1
  • OptionRenameRegressionAlgorithm.OnData (cognitive 33) Algorithm.CSharp/OptionRenameRegressionAlgorithm.cs:57 — OptionRenameRegressionAlgorithm.OnData has cognitive complexity 33 (threshold 15). Of this number, 31 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · UpdateOrderLiveTestAlgorithm.OnData (cognitive 33) · ×1
  • UpdateOrderLiveTestAlgorithm.OnData (cognitive 33) Algorithm.CSharp/UpdateOrderLiveTestAlgorithm.cs:86 — UpdateOrderLiveTestAlgorithm.OnData has cognitive complexity 33 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OptionRenameRegressionAlgorithm.on_data (cognitive 33) · ×1
  • OptionRenameRegressionAlgorithm.on_data (cognitive 33) Algorithm.Python/OptionRenameRegressionAlgorithm.py:35 — OptionRenameRegressionAlgorithm.on_data has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (25 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · BacktestingResultHandler.SampleRange (cognitive 32) · ×1
  • BacktestingResultHandler.SampleRange (cognitive 32) Engine/Results/BacktestingResultHandler.cs:708 — BacktestingResultHandler.SampleRange has cognitive complexity 32 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EquityFillModel.GetBestEffortAskPrice (cognitive 32) · ×1
  • EquityFillModel.GetBestEffortAskPrice (cognitive 32) Common/Orders/Fills/EquityFillModel.cs:774 — EquityFillModel.GetBestEffortAskPrice has cognitive complexity 32 (threshold 15). Of this number, 31 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (EquityFillModel.GetBestEffortBidPrice) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · EquityFillModel.GetBestEffortBidPrice (cognitive 32) · ×1
  • EquityFillModel.GetBestEffortBidPrice (cognitive 32) Common/Orders/Fills/EquityFillModel.cs:883 — EquityFillModel.GetBestEffortBidPrice has cognitive complexity 32 (threshold 15). Of this number, 31 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (EquityFillModel.GetBestEffortAskPrice) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · PandasData.ToPandasDataFrame (cognitive 32) · ×1
  • PandasData.ToPandasDataFrame (cognitive 32) Common/Python/PandasData.cs:284 — PandasData.ToPandasDataFrame has cognitive complexity 32 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TradeBuilder.ProcessFillUsingFillToFill (cognitive 32) · ×1
  • TradeBuilder.ProcessFillUsingFillToFill (cognitive 32) Common/Statistics/TradeBuilder.cs:256 — TradeBuilder.ProcessFillUsingFillToFill has cognitive complexity 32 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BaseResultsHandler.GenerateStatisticsResults (cognitive 31) · ×1
  • BaseResultsHandler.GenerateStatisticsResults (cognitive 31) Engine/Results/BaseResultsHandler.cs:1198 — BaseResultsHandler.GenerateStatisticsResults has cognitive complexity 31 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · EquityFillModel.MarketOnOpenFill (cognitive 31) · ×1
  • EquityFillModel.MarketOnOpenFill (cognitive 31) Common/Orders/Fills/EquityFillModel.cs:482 — EquityFillModel.MarketOnOpenFill has cognitive complexity 31 (threshold 15). Of this number, 29 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QLOptionPriceModel.Evaluate (cognitive 31) · ×1
  • QLOptionPriceModel.Evaluate (cognitive 31) Common/Securities/Option/QLOptionPriceModel.cs:108 — QLOptionPriceModel.Evaluate has cognitive complexity 31 (threshold 15). Of this number, 30 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SeriesSampler.SampleSeries (cognitive 31) · ×1
  • SeriesSampler.SampleSeries (cognitive 31) Common/SeriesSampler.cs:128 — SeriesSampler.SampleSeries has cognitive complexity 31 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Log.VarDump (cognitive 31) · ×1
  • Log.VarDump (cognitive 31) Logging/Log.cs:224 — Log.VarDump has cognitive complexity 31 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveFillForwardEnumerator.RequiresFillForwardData (cognitive 30) · ×1
  • LiveFillForwardEnumerator.RequiresFillForwardData (cognitive 30) Engine/DataFeeds/Enumerators/LiveFillForwardEnumerator.cs:81 — LiveFillForwardEnumerator.RequiresFillForwardData has cognitive complexity 30 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · LocalObjectStore.GetObjectStoreEntries (cognitive 30) · ×1
  • LocalObjectStore.GetObjectStoreEntries (cognitive 30) Engine/Storage/LocalObjectStore.cs:182 — LocalObjectStore.GetObjectStoreEntries has cognitive complexity 30 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · Tick.Tick.ctor (cognitive 30) · ×1
  • Tick.Tick.ctor (cognitive 30) Common/Data/Market/Tick.cs:555 — Tick.Tick.ctor has cognitive complexity 30 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TradeBuilder.ProcessFillUsingFlatToFlat (cognitive 30) · ×1
  • TradeBuilder.ProcessFillUsingFlatToFlat (cognitive 30) Common/Statistics/TradeBuilder.cs:397 — TradeBuilder.ProcessFillUsingFlatToFlat has cognitive complexity 30 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TradeBuilder.ProcessFillUsingFlatToReduced (cognitive 30) · ×1
  • TradeBuilder.ProcessFillUsingFlatToReduced (cognitive 30) Common/Statistics/TradeBuilder.cs:508 — TradeBuilder.ProcessFillUsingFlatToReduced has cognitive complexity 30 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ScheduledEnumerator.MoveNext (cognitive 29) · ×1
  • ScheduledEnumerator.MoveNext (cognitive 29) Engine/DataFeeds/Enumerators/ScheduledEnumerator.cs:73 — ScheduledEnumerator.MoveNext has cognitive complexity 29 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveSynchronizer.StreamData (cognitive 29) · ×1
  • LiveSynchronizer.StreamData (cognitive 29) Engine/DataFeeds/LiveSynchronizer.cs:85 — LiveSynchronizer.StreamData has cognitive complexity 29 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SubscriptionDataReader.Initialize (cognitive 29) · ×1
  • SubscriptionDataReader.Initialize (cognitive 29) Engine/DataFeeds/SubscriptionDataReader.cs:172 — SubscriptionDataReader.Initialize has cognitive complexity 29 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · CustomUniverseWithBenchmarkRegressionAlgorithm.OnData (cognitive 29) · ×1
  • CustomUniverseWithBenchmarkRegressionAlgorithm.OnData (cognitive 29) Algorithm.CSharp/CustomUniverseWithBenchmarkRegressionAlgorithm.cs:78 — CustomUniverseWithBenchmarkRegressionAlgorithm.OnData has cognitive complexity 29 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · LiveAuxiliaryDataSynchronizingEnumerator.DataPointEmitted (cognitive 28) · ×1
  • LiveAuxiliaryDataSynchronizingEnumerator.DataPointEmitted (cognitive 28) Engine/DataFeeds/Enumerators/LiveAuxiliaryDataSynchronizingEnumerator.cs:123 — LiveAuxiliaryDataSynchronizingEnumerator.DataPointEmitted has cognitive complexity 28 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UniverseSelection.AddPendingInternalDataFeeds (cognitive 28) · ×1
  • UniverseSelection.AddPendingInternalDataFeeds (cognitive 28) Engine/DataFeeds/UniverseSelection.cs:336 — UniverseSelection.AddPendingInternalDataFeeds has cognitive complexity 28 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · SecurityExchangeHours.GetMarketHours (cognitive 28) · ×1
  • SecurityExchangeHours.GetMarketHours (cognitive 28) Common/Securities/SecurityExchangeHours.cs:509 — SecurityExchangeHours.GetMarketHours has cognitive complexity 28 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LeanData.TryParsePath (cognitive 28) · ×1
  • LeanData.TryParsePath (cognitive 28) Common/Util/LeanData.cs:1155 — LeanData.TryParsePath has cognitive complexity 28 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · OptionChainUniverseRemovalRegressionAlgorithm.OnSecuritiesChanged (cognitive 28) · ×1
  • OptionChainUniverseRemovalRegressionAlgorithm.OnSecuritiesChanged (cognitive 28) Algorithm.CSharp/OptionChainUniverseRemovalRegressionAlgorithm.cs:101 — OptionChainUniverseRemovalRegressionAlgorithm.OnSecuritiesChanged has cognitive complexity 28 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UpdateOrderRegressionAlgorithm.on_data (cognitive 28) · ×1
  • UpdateOrderRegressionAlgorithm.on_data (cognitive 28) Algorithm.Python/UpdateOrderRegressionAlgorithm.py:53 — UpdateOrderRegressionAlgorithm.on_data has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 4 (11 pts), boolean chains 5 (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · BrokerageTransactionHandler.SyncOptionHoldings (cognitive 27) · ×1
  • BrokerageTransactionHandler.SyncOptionHoldings (cognitive 27) Engine/TransactionHandlers/BrokerageTransactionHandler.cs:1741 — BrokerageTransactionHandler.SyncOptionHoldings has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Extensions.Scale (cognitive 27) · ×1
  • Extensions.Scale (cognitive 27) Common/Extensions.cs:3751 — Extensions.Scale has cognitive complexity 27 (threshold 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · Serie.Add (cognitive 27) · ×1
  • Serie.Add (cognitive 27) Common/Python/PandasData.cs:761 — Serie.Add has cognitive complexity 27 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · WarmupDailyResolutionRegressionAlgorithm.OnData (cognitive 27) · ×1
  • WarmupDailyResolutionRegressionAlgorithm.OnData (cognitive 27) Algorithm.CSharp/WarmupDailyResolutionRegressionAlgorithm.cs:52 — WarmupDailyResolutionRegressionAlgorithm.OnData has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Program.Main (cognitive 27) · ×1
  • Program.Main (cognitive 27) Report/Program.cs:35 — Program.Main has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SynchronizingHistoryProvider.CreateSliceEnumerableFromSubscriptions (cognitive 26) · ×1
  • SynchronizingHistoryProvider.CreateSliceEnumerableFromSubscriptions (cognitive 26) Engine/HistoricalData/SynchronizingHistoryProvider.cs:57 — SynchronizingHistoryProvider.CreateSliceEnumerableFromSubscriptions has cognitive complexity 26 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BrokerageTransactionHandler.HandleOrderUpdated (cognitive 26) · ×1
  • BrokerageTransactionHandler.HandleOrderUpdated (cognitive 26) Engine/TransactionHandlers/BrokerageTransactionHandler.cs:1516 — BrokerageTransactionHandler.HandleOrderUpdated has cognitive complexity 26 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QCAlgorithm.SubmitOrders (cognitive 26) · ×1
  • QCAlgorithm.SubmitOrders (cognitive 26) Algorithm/QCAlgorithm.Trading.ContingentOrders.cs:161 — QCAlgorithm.SubmitOrders has cognitive complexity 26 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QuoteBarConsolidator.AggregateBar (cognitive 26) · ×1
  • QuoteBarConsolidator.AggregateBar (cognitive 26) Common/Data/Consolidators/QuoteBarConsolidator.cs:91 — QuoteBarConsolidator.AggregateBar has cognitive complexity 26 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SecurityPortfolioModel.ProcessFill (cognitive 26) · ×1
  • SecurityPortfolioModel.ProcessFill (cognitive 26) Common/Securities/SecurityPortfolioModel.cs:36 — SecurityPortfolioModel.ProcessFill has cognitive complexity 26 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BacktestingBrokerage.ProcessDelistings (cognitive 26) · ×1
  • BacktestingBrokerage.ProcessDelistings (cognitive 26) Brokerages/Backtesting/BacktestingBrokerage.cs:646 — BacktestingBrokerage.ProcessDelistings has cognitive complexity 26 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AddOptionContractExpiresRegressionAlgorithm.OnData (cognitive 26) · ×1
  • AddOptionContractExpiresRegressionAlgorithm.OnData (cognitive 26) Algorithm.CSharp/AddOptionContractExpiresRegressionAlgorithm.cs:45 — AddOptionContractExpiresRegressionAlgorithm.OnData has cognitive complexity 26 (threshold 15). Of this number, 25 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BasicTemplateCryptoAlgorithm.OnData (cognitive 26) · ×1
  • BasicTemplateCryptoAlgorithm.OnData (cognitive 26) Algorithm.CSharp/BasicTemplateCryptoAlgorithm.cs:83 — BasicTemplateCryptoAlgorithm.OnData has cognitive complexity 26 (threshold 15). Of this number, 24 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ContingentComboOrderRegressionAlgorithm.OnData (cognitive 26) · ×1
  • ContingentComboOrderRegressionAlgorithm.OnData (cognitive 26) Algorithm.CSharp/ContingentComboOrderRegressionAlgorithm.cs:61 — ContingentComboOrderRegressionAlgorithm.OnData has cognitive complexity 26 (threshold 15). Of this number, 22 points are the body's own statements and 4 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ContinuousFutureRolloverBaseRegressionAlgorithm.OnData (cognitive 26) · ×1
  • ContinuousFutureRolloverBaseRegressionAlgorithm.OnData (cognitive 26) Algorithm.CSharp/ContinuousFutureRolloverBaseRegressionAlgorithm.cs:86 — ContinuousFutureRolloverBaseRegressionAlgorithm.OnData has cognitive complexity 26 (threshold 15). Of this number, 25 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FuturesAndFuturesOptionsExpiryTimeAndLiquidationRegressionAlgorithm.OnData (cognitive 26) · ×1
  • FuturesAndFuturesOptionsExpiryTimeAndLiquidationRegressionAlgorithm.OnData (cognitive 26) Algorithm.CSharp/FuturesAndFuturesOptionsExpiryTimeAndLiquidationRegressionAlgorithm.cs:66 — FuturesAndFuturesOptionsExpiryTimeAndLiquidationRegressionAlgorithm.OnData has cognitive complexity 26 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SecurityInitializationOnReAdditionForSelectedOptionRegressionAlgorithm.OnSecuritiesChanged (cognitive 26) · ×1
  • SecurityInitializationOnReAdditionForSelectedOptionRegressionAlgorithm.OnSecuritiesChanged (cognitive 26) Algorithm.CSharp/SecurityInitializationOnReAdditionForSelectedOptionRegressionAlgorithm.cs:101 — SecurityInitializationOnReAdditionForSelectedOptionRegressionAlgorithm.OnSecuritiesChanged has cognitive complexity 26 (threshold 15). Of this number, 25 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QCAlgorithm.RemoveSecurity (cognitive 25) · ×1
  • QCAlgorithm.RemoveSecurity (cognitive 25) Algorithm/QCAlgorithm.cs:2729 — QCAlgorithm.RemoveSecurity has cognitive complexity 25 (threshold 15). Of this number, 24 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SliceExtensions.PushThrough (cognitive 25) · ×1
  • SliceExtensions.PushThrough (cognitive 25) Common/Data/SliceExtensions.cs:286 — SliceExtensions.PushThrough has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MemoizingEnumerable.GetEnumerator (cognitive 25) · ×1
  • MemoizingEnumerable.GetEnumerator (cognitive 25) Common/Util/MemoizingEnumerable.cs:95 — MemoizingEnumerable.GetEnumerator has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Config.Flatten (cognitive 25) · ×1
  • Config.Flatten (cognitive 25) REDACTED:371 — Config.Flatten has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AdjustedVolumeRegressionAlgorithm.OnData (cognitive 25) · ×1
  • AdjustedVolumeRegressionAlgorithm.OnData (cognitive 25) Algorithm.CSharp/AdjustedVolumeRegressionAlgorithm.cs:66 — AdjustedVolumeRegressionAlgorithm.OnData has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ContinuousFutureRegressionAlgorithm.OnData (cognitive 25) · ×1
  • ContinuousFutureRegressionAlgorithm.OnData (cognitive 25) Algorithm.CSharp/ContinuousFutureRegressionAlgorithm.cs:57 — ContinuousFutureRegressionAlgorithm.OnData has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OptionPriceModelForOptionStylesBaseRegressionAlgorithm.CheckGreeks (cognitive 25) · ×1
  • OptionPriceModelForOptionStylesBaseRegressionAlgorithm.CheckGreeks (cognitive 25) Algorithm.CSharp/OptionPriceModelForOptionStylesBaseRegressionAlgorithm.cs:77 — OptionPriceModelForOptionStylesBaseRegressionAlgorithm.CheckGreeks has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OptionChainFiltersRegressionAlgorithm.initialize (cognitive 25) · ×1
  • OptionChainFiltersRegressionAlgorithm.initialize (cognitive 25) Algorithm.Python/OptionChainFiltersRegressionAlgorithm.py:22 — OptionChainFiltersRegressionAlgorithm.initialize has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13, boolean chains 10, ternaries 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ApiDataProvider.NeedToDownload (cognitive 24) · ×1
  • ApiDataProvider.NeedToDownload (cognitive 24) Engine/DataFeeds/ApiDataProvider.cs:157 — ApiDataProvider.NeedToDownload has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BaseDataExchange.ConsumeEnumerators (cognitive 24) · ×1
  • BaseDataExchange.ConsumeEnumerators (cognitive 24) Engine/DataFeeds/BaseDataExchange.cs:169 — BaseDataExchange.ConsumeEnumerators has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DataQueueHandlerManager.Subscribe (cognitive 24) · ×1
  • DataQueueHandlerManager.Subscribe (cognitive 24) Engine/DataFeeds/DataQueueHandlerManager.cs:74 — DataQueueHandlerManager.Subscribe has cognitive complexity 24 (threshold 15). Of this number, 20 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BrokerageSetupHandler.Setup (cognitive 24) · ×1
  • BrokerageSetupHandler.Setup (cognitive 24) Engine/Setup/BrokerageSetupHandler.cs:148 — BrokerageSetupHandler.Setup has cognitive complexity 24 (threshold 15). Of this number, 17 points are the body's own statements and 7 belong to 2 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · QCAlgorithm.Liquidate (cognitive 24) · ×1
  • QCAlgorithm.Liquidate (cognitive 24) Algorithm/QCAlgorithm.Trading.cs:1139 — QCAlgorithm.Liquidate has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Extensions.Batch (cognitive 24) · ×1
  • Extensions.Batch (cognitive 24) Common/Extensions.cs:546 — Extensions.Batch has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LeanDataPathComponents.Parse (cognitive 24) · ×1
  • LeanDataPathComponents.Parse (cognitive 24) Common/Util/LeanDataPathComponents.cs:103 — LeanDataPathComponents.Parse has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ContinuousFutureBackMonthRegressionAlgorithm.OnData (cognitive 24) · ×1
  • ContinuousFutureBackMonthRegressionAlgorithm.OnData (cognitive 24) Algorithm.CSharp/ContinuousFutureBackMonthRegressionAlgorithm.cs:70 — ContinuousFutureBackMonthRegressionAlgorithm.OnData has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HistoryAuxiliaryDataRegressionAlgorithm.Initialize (cognitive 24) · ×1
  • HistoryAuxiliaryDataRegressionAlgorithm.Initialize (cognitive 24) Algorithm.CSharp/HistoryAuxiliaryDataRegressionAlgorithm.cs:34 — HistoryAuxiliaryDataRegressionAlgorithm.Initialize has cognitive complexity 24 (threshold 15). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · FuturesChainFiltersRegressionAlgorithm.on_data (cognitive 24) · ×1
  • FuturesChainFiltersRegressionAlgorithm.on_data (cognitive 24) Algorithm.Python/FuturesChainFiltersRegressionAlgorithm.py:65 — FuturesChainFiltersRegressionAlgorithm.on_data has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 5 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CollectionSubscriptionDataSourceReader.Read (cognitive 23) · ×1
  • CollectionSubscriptionDataSourceReader.Read (cognitive 23) Engine/DataFeeds/CollectionSubscriptionDataSourceReader.cs:60 — CollectionSubscriptionDataSourceReader.Read has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DataManager.RemoveSubscriptionInternal (cognitive 23) · ×1
  • DataManager.RemoveSubscriptionInternal (cognitive 23) Engine/DataFeeds/DataManager.cs:382 — DataManager.RemoveSubscriptionInternal has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ZipDataCacheProvider.Fetch (cognitive 23) · ×1
  • ZipDataCacheProvider.Fetch (cognitive 23) Engine/DataFeeds/ZipDataCacheProvider.cs:62 — ZipDataCacheProvider.Fetch has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RenkoConsolidator.Update (cognitive 23) · ×1
  • RenkoConsolidator.Update (cognitive 23) Common/Data/Consolidators/RenkoConsolidator.cs:118 — RenkoConsolidator.Update has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DownloaderExtensions.GetDataDownloaderParameterForAllMappedSymbols (cognitive 23) · ×1
  • DownloaderExtensions.GetDataDownloaderParameterForAllMappedSymbols (cognitive 23) Common/Data/DownloaderExtensions.cs:41 — DownloaderExtensions.GetDataDownloaderParameterForAllMappedSymbols has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EquityFillModel.StopLimitFill (cognitive 23) · ×1
  • EquityFillModel.StopLimitFill (cognitive 23) Common/Orders/Fills/EquityFillModel.cs:280 — EquityFillModel.StopLimitFill has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EquityFillModel.MarketOnCloseFill (cognitive 23) · ×1
  • EquityFillModel.MarketOnCloseFill (cognitive 23) Common/Orders/Fills/EquityFillModel.cs:623 — EquityFillModel.MarketOnCloseFill has cognitive complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · FillModel.Fill (cognitive 23) · ×1
  • FillModel.Fill (cognitive 23) Common/Orders/Fills/FillModel.cs:59 — FillModel.Fill has cognitive complexity 23 (threshold 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · FillModel.StopLimitFill (cognitive 23) · ×1
  • FillModel.StopLimitFill (cognitive 23) Common/Orders/Fills/FillModel.cs:486 — FillModel.StopLimitFill has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CashBuyingPowerModel.GetMaximumOrderQuantityForTargetBuyingPower (cognitive 23) · ×1
  • CashBuyingPowerModel.GetMaximumOrderQuantityForTargetBuyingPower (cognitive 23) Common/Securities/CashBuyingPowerModel.cs:191 — CashBuyingPowerModel.GetMaximumOrderQuantityForTargetBuyingPower has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MarketHoursDatabaseEntryJson.Convert (cognitive 23) · ×1
  • MarketHoursDatabaseEntryJson.Convert (cognitive 23) Common/Util/MarketHoursDatabaseJsonConverter.cs:279 — MarketHoursDatabaseEntryJson.Convert has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WebSocketClientWrapper.HandleConnection (cognitive 23) · ×1
  • WebSocketClientWrapper.HandleConnection (cognitive 23) Brokerages/WebSocketClientWrapper.cs:219 — WebSocketClientWrapper.HandleConnection has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BubbleAlgorithm.OnData (cognitive 23) · ×1
  • BubbleAlgorithm.OnData (cognitive 23) Algorithm.CSharp/BubbleAlgorithm.cs:121 — BubbleAlgorithm.OnData has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConstituentsUniverseRegressionAlgorithm.OnData (cognitive 23) · ×1
  • ConstituentsUniverseRegressionAlgorithm.OnData (cognitive 23) Algorithm.CSharp/ConstituentsUniverseRegressionAlgorithm.cs:59 — ConstituentsUniverseRegressionAlgorithm.OnData has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IndicatorBasedOptionPricingModelRegressionAlgorithm.OnData (cognitive 23) · ×1
  • IndicatorBasedOptionPricingModelRegressionAlgorithm.OnData (cognitive 23) Algorithm.CSharp/IndicatorBasedOptionPricingModelRegressionAlgorithm.cs:62 — IndicatorBasedOptionPricingModelRegressionAlgorithm.OnData has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OptionSplitRegressionAlgorithm.OnData (cognitive 23) · ×1
  • OptionSplitRegressionAlgorithm.OnData (cognitive 23) Algorithm.CSharp/OptionSplitRegressionAlgorithm.cs:59 — OptionSplitRegressionAlgorithm.OnData has cognitive complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · LeanDataReader.Parse (cognitive 23) · ×1
  • LeanDataReader.Parse (cognitive 23) ToolBox/LeanDataReader.cs:109 — LeanDataReader.Parse has cognitive complexity 23 (threshold 15). Of this number, 21 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · AddFutureOptionSingleOptionChainSelectedInUniverseFilterRegressionAlgorithm.on_data (cognitive 23) · ×1
  • AddFutureOptionSingleOptionChainSelectedInUniverseFilterRegressionAlgorithm.on_data (cognitive 23) Algorithm.Python/AddFutureOptionSingleOptionChainSelectedInUniverseFilterRegressionAlgorithm.py:53 — AddFutureOptionSingleOptionChainSelectedInUniverseFilterRegressionAlgorithm.on_data has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HistoryAuxiliaryDataRegressionAlgorithm.initialize (cognitive 23) · ×1
  • HistoryAuxiliaryDataRegressionAlgorithm.initialize (cognitive 23) Algorithm.Python/HistoryAuxiliaryDataRegressionAlgorithm.py:21 — HistoryAuxiliaryDataRegressionAlgorithm.initialize has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (18 pts), loops 3, boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ReportCharts.GetMonthlyReturns (cognitive 23) · ×1
  • ReportCharts.GetMonthlyReturns (cognitive 23) Report/ReportCharts.py:348 — ReportCharts.GetMonthlyReturns has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 4 (8 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SubscriptionFilterEnumerator.MoveNext (cognitive 22) · ×1
  • SubscriptionFilterEnumerator.MoveNext (cognitive 22) Engine/DataFeeds/Enumerators/SubscriptionFilterEnumerator.cs:121 — SubscriptionFilterEnumerator.MoveNext has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OrderRequestProcessingPool.JoinWorkers (cognitive 22) · ×1
  • OrderRequestProcessingPool.JoinWorkers (cognitive 22) Engine/TransactionHandlers/OrderRequestProcessingPool.cs:316 — OrderRequestProcessingPool.JoinWorkers has cognitive complexity 22 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · QCAlgorithm.GetResolution (cognitive 22) · ×1
  • QCAlgorithm.GetResolution (cognitive 22) Algorithm/QCAlgorithm.History.cs:1426 — QCAlgorithm.GetResolution has cognitive complexity 22 (threshold 15). Of this number, 20 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DynamicData.SetProperty (cognitive 22) · ×1
  • DynamicData.SetProperty (cognitive 22) Common/Data/DynamicData.cs:52 — DynamicData.SetProperty has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Isolator.MonitorTask (cognitive 22) · ×1
  • Isolator.MonitorTask (cognitive 22) Common/Isolator.cs:82 — Isolator.MonitorTask has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FillModel.LimitIfTouchedFill (cognitive 22) · ×1
  • FillModel.LimitIfTouchedFill (cognitive 22) Common/Orders/Fills/FillModel.cs:603 — FillModel.LimitIfTouchedFill has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AdvanceBlock.ComputeNextValue (cognitive 22) · ×1
  • AdvanceBlock.ComputeNextValue (cognitive 22) Indicators/CandlestickPatterns/AdvanceBlock.cs:89 — AdvanceBlock.ComputeNextValue has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JobQueue.NextJob (cognitive 22) · ×1
  • JobQueue.NextJob (cognitive 22) Queues/JobQueue.cs:125 — JobQueue.NextJob has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BasicTemplateIndexOptionsAlgorithm.OnData (cognitive 22) · ×1
  • BasicTemplateIndexOptionsAlgorithm.OnData (cognitive 22) Algorithm.CSharp/BasicTemplateIndexOptionsAlgorithm.cs:59 — BasicTemplateIndexOptionsAlgorithm.OnData has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DuplicateOptionAssignmentRegressionAlgorithm.OnOrderEvent (cognitive 22) · ×1
  • DuplicateOptionAssignmentRegressionAlgorithm.OnOrderEvent (cognitive 22) Algorithm.CSharp/DuplicateOptionAssignmentRegressionAlgorithm.cs:69 — DuplicateOptionAssignmentRegressionAlgorithm.OnOrderEvent has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UnsettledCashWhenQuoteCurrencyIsNotAccountCurrencyAlgorithm.OnEndOfAlgorithm (cognitive 22) · ×1
  • UnsettledCashWhenQuoteCurrencyIsNotAccountCurrencyAlgorithm.OnEndOfAlgorithm (cognitive 22) Algorithm.CSharp/UnsettledCashWhenQuoteCurrencyIsNotAccountCurrencyAlgorithm.cs:104 — UnsettledCashWhenQuoteCurrencyIsNotAccountCurrencyAlgorithm.OnEndOfAlgorithm has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AlgoSeekFuturesConverter.Convert (cognitive 22) · ×1
  • AlgoSeekFuturesConverter.Convert (cognitive 22) ToolBox/AlgoSeekFuturesConverter/AlgoSeekFuturesConverter.cs:65 — AlgoSeekFuturesConverter.Convert has cognitive complexity 22 (threshold 15). None of this is in the body itself: all 22 points belong to 2 function literals inside it that branch (lines 86, 71). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · QuantBook.OptionHistory (cognitive 22) · ×1
  • QuantBook.OptionHistory (cognitive 22) Research/QuantBook.cs:397 — QuantBook.OptionHistory has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NullResultValueTypeJsonConverter.ReadJson (cognitive 22) · ×1
  • NullResultValueTypeJsonConverter.ReadJson (cognitive 22) Report/NullResultValueTypeJsonConverter.cs:60 — NullResultValueTypeJsonConverter.ReadJson has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BlackLittermanOptimizationPortfolioConstructionModel.get_views (cognitive 22) · ×1
  • BlackLittermanOptimizationPortfolioConstructionModel.get_views (cognitive 22) Algorithm.Framework/Portfolio/BlackLittermanOptimizationPortfolioConstructionModel.py:223 — BlackLittermanOptimizationPortfolioConstructionModel.get_views has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 4 (7 pts), ternaries 1 (2 pts), error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BracketOrderRegressionAlgorithm.on_data (cognitive 22) · ×1
  • BracketOrderRegressionAlgorithm.on_data (cognitive 22) Algorithm.Python/BracketOrderRegressionAlgorithm.py:31 — BracketOrderRegressionAlgorithm.on_data has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 7, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AlgorithmManager.HandleSplits (cognitive 21) · ×1
  • AlgorithmManager.HandleSplits (cognitive 21) Engine/AlgorithmManager.cs:779 — AlgorithmManager.HandleSplits has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BaseDataCollectionAggregatorEnumerator.MoveNext (cognitive 21) · ×1
  • BaseDataCollectionAggregatorEnumerator.MoveNext (cognitive 21) Engine/DataFeeds/Enumerators/BaseDataCollectionAggregatorEnumerator.cs:60 — BaseDataCollectionAggregatorEnumerator.MoveNext has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveTradingDataFeed.GetHistoryWarmupEnumerator (cognitive 21) · ×1
  • LiveTradingDataFeed.GetHistoryWarmupEnumerator (cognitive 21) Engine/DataFeeds/LiveTradingDataFeed.cs:499 — LiveTradingDataFeed.GetHistoryWarmupEnumerator has cognitive complexity 21 (threshold 15). Most of this is not in the body itself: 2 of the 21 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 511, 560, 536). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · Synchronizer.StreamData (cognitive 21) · ×1
  • Synchronizer.StreamData (cognitive 21) Engine/DataFeeds/Synchronizer.cs:86 — Synchronizer.StreamData has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HistoryProviderManager.GetHistory (cognitive 21) · ×1
  • HistoryProviderManager.GetHistory (cognitive 21) Engine/HistoricalData/HistoryProviderManager.cs:135 — HistoryProviderManager.GetHistory has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OptimizationBacktestJsonConverter.WriteJson (cognitive 21) · ×1
  • OptimizationBacktestJsonConverter.WriteJson (cognitive 21) Common/Api/OptimizationBacktestJsonConverter.cs:88 — OptimizationBacktestJsonConverter.WriteJson has cognitive complexity 21 (threshold 15). Of this number, 18 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Tick.Tick.ctor (cognitive 21) · ×1
  • Tick.Tick.ctor (cognitive 21) Common/Data/Market/Tick.cs:415 — Tick.Tick.ctor has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SecurityExchangeHours.GetNextMarketOpen (cognitive 21) · ×1
  • SecurityExchangeHours.GetNextMarketOpen (cognitive 21) Common/Securities/SecurityExchangeHours.cs:320 — SecurityExchangeHours.GetNextMarketOpen has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PortfolioStatistics.PortfolioStatistics.ctor (cognitive 21) · ×1
  • PortfolioStatistics.PortfolioStatistics.ctor (cognitive 21) Common/Statistics/PortfolioStatistics.cs:211 — PortfolioStatistics.PortfolioStatistics.ctor has cognitive complexity 21 (threshold 15). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · CoarseFineOptionUniverseChainRegressionAlgorithm.OnData (cognitive 21) · ×1
  • CoarseFineOptionUniverseChainRegressionAlgorithm.OnData (cognitive 21) Algorithm.CSharp/CoarseFineOptionUniverseChainRegressionAlgorithm.cs:78 — CoarseFineOptionUniverseChainRegressionAlgorithm.OnData has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ContinuousBackMonthRawFutureRegressionAlgorithm.OnData (cognitive 21) · ×1
  • ContinuousBackMonthRawFutureRegressionAlgorithm.OnData (cognitive 21) Algorithm.CSharp/ContinuousBackMonthRawFutureRegressionAlgorithm.cs:56 — ContinuousBackMonthRawFutureRegressionAlgorithm.OnData has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IndicatorSelectorsWorkWithDifferentOptions.OnData (cognitive 21) · ×1
  • IndicatorSelectorsWorkWithDifferentOptions.OnData (cognitive 21) Algorithm.CSharp/IndicatorSelectorsWorkWithDifferentOptions.cs:82 — IndicatorSelectorsWorkWithDifferentOptions.OnData has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OptionChainFiltersRegressionAlgorithm.Initialize (cognitive 21) · ×1
  • OptionChainFiltersRegressionAlgorithm.Initialize (cognitive 21) Algorithm.CSharp/OptionChainFiltersRegressionAlgorithm.cs:38 — OptionChainFiltersRegressionAlgorithm.Initialize has cognitive complexity 21 (threshold 15). Of this number, 17 points are the body's own statements and 4 belong to 6 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · BlackLittermanOptimizationPortfolioConstructionModel.determine_target_percent (cognitive 21) · ×1
  • BlackLittermanOptimizationPortfolioConstructionModel.determine_target_percent (cognitive 21) Algorithm.Framework/Portfolio/BlackLittermanOptimizationPortfolioConstructionModel.py:83 — BlackLittermanOptimizationPortfolioConstructionModel.determine_target_percent has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OptionPriceModelForOptionStylesBaseRegressionAlgorithm.check_greeks (cognitive 21) · ×1
  • OptionPriceModelForOptionStylesBaseRegressionAlgorithm.check_greeks (cognitive 21) Algorithm.Python/OptionPriceModelForOptionStylesBaseRegressionAlgorithm.py:51 — OptionPriceModelForOptionStylesBaseRegressionAlgorithm.check_greeks has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 8, if/else 4 (8 pts), error handling 1 (2 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveOptionChainProvider.GetOptionContractList (cognitive 20) · ×1
  • LiveOptionChainProvider.GetOptionContractList (cognitive 20) Engine/DataFeeds/LiveOptionChainProvider.cs:79 — LiveOptionChainProvider.GetOptionContractList has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WeightedWorkQueue.WorkerThread (cognitive 20) · ×1
  • WeightedWorkQueue.WorkerThread (cognitive 20) Engine/DataFeeds/WorkScheduling/WeightedWorkQueue.cs:55 — WeightedWorkQueue.WorkerThread has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BacktestingResultHandler.Update (cognitive 20) · ×1
  • BacktestingResultHandler.Update (cognitive 20) Engine/Results/BacktestingResultHandler.cs:160 — BacktestingResultHandler.Update has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QCAlgorithm.TryGetWarmupHistoryStartTime (cognitive 20) · ×1
  • QCAlgorithm.TryGetWarmupHistoryStartTime (cognitive 20) Algorithm/QCAlgorithm.History.cs:174 — QCAlgorithm.TryGetWarmupHistoryStartTime has cognitive complexity 20 (threshold 15). Of this number, 17 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QCAlgorithm.WarmUpIndicatorImpl (cognitive 20) · ×1
  • QCAlgorithm.WarmUpIndicatorImpl (cognitive 20) Algorithm/QCAlgorithm.Indicators.cs:3637 — QCAlgorithm.WarmUpIndicatorImpl has cognitive complexity 20 (threshold 15). Of this number, 13 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CapacityEstimate.UpdateMarketCapacity (cognitive 20) · ×1
  • CapacityEstimate.UpdateMarketCapacity (cognitive 20) Common/CapacityEstimate.cs:124 — CapacityEstimate.UpdateMarketCapacity has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LatestPriceFillModel.GetPrices (cognitive 20) · ×1
  • LatestPriceFillModel.GetPrices (cognitive 20) Common/Orders/Fills/LatestPriceFillModel.cs:35 — LatestPriceFillModel.GetPrices has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ScheduledEvent.Scan (cognitive 20) · ×1
  • ScheduledEvent.Scan (cognitive 20) Common/Scheduling/ScheduledEvent.cs:152 — ScheduledEvent.Scan has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FuturesExpiryUtilityFunctions.AddBusinessDays (cognitive 20) · ×1
  • FuturesExpiryUtilityFunctions.AddBusinessDays (cognitive 20) Common/Securities/Future/FuturesExpiryUtilityFunctions.cs:50 — FuturesExpiryUtilityFunctions.AddBusinessDays has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Composer.GetExportedValueByTypeName (cognitive 20) · ×1
  • Composer.GetExportedValueByTypeName (cognitive 20) Common/Util/Composer.cs:207 — Composer.GetExportedValueByTypeName has cognitive complexity 20 (threshold 15). Of this number, 14 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IndicatorBasedOptionPriceModel.Evaluate (cognitive 20) · ×1
  • IndicatorBasedOptionPriceModel.Evaluate (cognitive 20) Indicators/IndicatorBasedOptionPriceModel.cs:69 — IndicatorBasedOptionPriceModel.Evaluate has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EuropeanOptionsCannotBeExercisedBeforeExpiryRegressionAlgorithm.OnData (cognitive 20) · ×1
  • EuropeanOptionsCannotBeExercisedBeforeExpiryRegressionAlgorithm.OnData (cognitive 20) Algorithm.CSharp/EuropeanOptionsCannotBeExercisedBeforeExpiryRegressionAlgorithm.cs:56 — EuropeanOptionsCannotBeExercisedBeforeExpiryRegressionAlgorithm.OnData has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FuturesChainFiltersRegressionAlgorithm.OnData (cognitive 20) · ×1
  • FuturesChainFiltersRegressionAlgorithm.OnData (cognitive 20) Algorithm.CSharp/FuturesChainFiltersRegressionAlgorithm.cs:85 — FuturesChainFiltersRegressionAlgorithm.OnData has cognitive complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TickGenerator.GenerateTicks (cognitive 20) · ×1
  • TickGenerator.GenerateTicks (cognitive 20) ToolBox/RandomDataGenerator/TickGenerator.cs:60 — TickGenerator.GenerateTicks has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MaximumSectorExposureRiskManagementModel.ManageRisk (cognitive 20) · ×1
  • MaximumSectorExposureRiskManagementModel.ManageRisk (cognitive 20) Algorithm.Framework/Risk/MaximumSectorExposureRiskManagementModel.cs:56 — MaximumSectorExposureRiskManagementModel.ManageRisk has cognitive complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EulerSearchOptimizationStrategy.PushNewResults (cognitive 20) · ×1
  • EulerSearchOptimizationStrategy.PushNewResults (cognitive 20) Optimizer/Strategies/EulerSearchOptimizationStrategy.cs:63 — EulerSearchOptimizationStrategy.PushNewResults has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BracketOrderLimitEntryRegressionAlgorithm.on_data (cognitive 20) · ×1
  • BracketOrderLimitEntryRegressionAlgorithm.on_data (cognitive 20) Algorithm.Python/BracketOrderLimitEntryRegressionAlgorithm.py:33 — BracketOrderLimitEntryRegressionAlgorithm.on_data has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConstituentsUniverseRegressionAlgorithm.on_data (cognitive 20) · ×1
  • ConstituentsUniverseRegressionAlgorithm.on_data (cognitive 20) Algorithm.Python/ConstituentsUniverseRegressionAlgorithm.py:42 — ConstituentsUniverseRegressionAlgorithm.on_data has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OptionSplitRegressionAlgorithm.on_data (cognitive 20) · ×1
  • OptionSplitRegressionAlgorithm.on_data (cognitive 20) Algorithm.Python/OptionSplitRegressionAlgorithm.py:41 — OptionSplitRegressionAlgorithm.on_data has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 4, loops 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TimeSliceFactory.HandleOptionData (cognitive 19) · ×1
  • TimeSliceFactory.HandleOptionData (cognitive 19) Engine/DataFeeds/TimeSliceFactory.cs:422 — TimeSliceFactory.HandleOptionData has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ZipDataCacheProvider.CreateEntryStream (cognitive 19) · ×1
  • ZipDataCacheProvider.CreateEntryStream (cognitive 19) Engine/DataFeeds/ZipDataCacheProvider.cs:317 — ZipDataCacheProvider.CreateEntryStream has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BaseResultsHandler.ProcessAlgorithmLogsImpl (cognitive 19) · ×1
  • BaseResultsHandler.ProcessAlgorithmLogsImpl (cognitive 19) Engine/Results/BaseResultsHandler.cs:1371 — BaseResultsHandler.ProcessAlgorithmLogsImpl has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FTXBrokerageModel.CanSubmitOrder (cognitive 19) · ×1
  • FTXBrokerageModel.CanSubmitOrder (cognitive 19) Common/Brokerages/FTXBrokerageModel.cs:104 — FTXBrokerageModel.CanSubmitOrder has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InteractiveBrokersBrokerageModel.CanSubmitOrder (cognitive 19) · ×1
  • InteractiveBrokersBrokerageModel.CanSubmitOrder (cognitive 19) Common/Brokerages/InteractiveBrokersBrokerageModel.cs:164 — InteractiveBrokersBrokerageModel.CanSubmitOrder has cognitive complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · MappingContractFactorProvider.GetPriceFactor (cognitive 19) · ×1
  • MappingContractFactorProvider.GetPriceFactor (cognitive 19) Common/Data/Auxiliary/MappingContractFactorProvider.cs:39 — MappingContractFactorProvider.GetPriceFactor has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OrderContingency.Join (cognitive 19) · ×1
  • OrderContingency.Join (cognitive 19) Common/Orders/OrderContingency.cs:416 — OrderContingency.Join has cognitive complexity 19 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · ParameterAttribute.ApplyAttributes (cognitive 19) · ×1
  • ParameterAttribute.ApplyAttributes (cognitive 19) Common/Parameters/ParameterAttribute.cs:58 — ParameterAttribute.ApplyAttributes has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PandasData.AddMemberToSeries (cognitive 19) · ×1
  • PandasData.AddMemberToSeries (cognitive 19) Common/Python/PandasData.cs:220 — PandasData.AddMemberToSeries has cognitive complexity 19 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · BuyingPowerModel.GetMaximumOrderQuantityForTargetBuyingPower (cognitive 19) · ×1
  • BuyingPowerModel.GetMaximumOrderQuantityForTargetBuyingPower (cognitive 19) Common/Securities/BuyingPowerModel.cs:366 — BuyingPowerModel.GetMaximumOrderQuantityForTargetBuyingPower has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LocalMarketHours.GetMarketClose (cognitive 19) · ×1
  • LocalMarketHours.GetMarketClose (cognitive 19) Common/Securities/LocalMarketHours.cs:203 — LocalMarketHours.GetMarketClose has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SecurityCacheProvider.GetSecurityCache (cognitive 19) · ×1
  • SecurityCacheProvider.GetSecurityCache (cognitive 19) Common/Securities/SecurityCacheProvider.cs:58 — SecurityCacheProvider.GetSecurityCache has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Brokerage.PerformCashSync (cognitive 19) · ×1
  • Brokerage.PerformCashSync (cognitive 19) Brokerages/Brokerage.cs:598 — Brokerage.PerformCashSync has cognitive complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DefaultConnectionHandler.Initialize (cognitive 19) · ×1
  • DefaultConnectionHandler.Initialize (cognitive 19) Brokerages/DefaultConnectionHandler.cs:82 — DefaultConnectionHandler.Initialize has cognitive complexity 19 (threshold 15). None of this is in the body itself: all 19 points belong to one function literal inside it that branches (line 90). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · PairsAlphaModel.CorrelationPairsSelection (cognitive 19) · ×1
  • PairsAlphaModel.CorrelationPairsSelection (cognitive 19) Algorithm.CSharp/Alphas/GasAndCrudeOilEnergyCorrelationAlpha.cs:135 — PairsAlphaModel.CorrelationPairsSelection has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SetHoldingsFutureRegressionAlgorithm.OnData (cognitive 19) · ×1
  • SetHoldingsFutureRegressionAlgorithm.OnData (cognitive 19) Algorithm.CSharp/SetHoldingsFutureRegressionAlgorithm.cs:55 — SetHoldingsFutureRegressionAlgorithm.OnData has cognitive complexity 19 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · ShortableProviderOrdersRejectedRegressionAlgorithm.OnData (cognitive 19) · ×1
  • ShortableProviderOrdersRejectedRegressionAlgorithm.OnData (cognitive 19) Algorithm.CSharp/ShortableProviderOrdersRejectedRegressionAlgorithm.cs:54 — ShortableProviderOrdersRejectedRegressionAlgorithm.OnData has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CoarseUniverseGeneratorProgram.Run (cognitive 19) · ×1
  • CoarseUniverseGeneratorProgram.Run (cognitive 19) ToolBox/CoarseUniverseGenerator/CoarseUniverseGeneratorProgram.cs:110 — CoarseUniverseGeneratorProgram.Run has cognitive complexity 19 (threshold 15). Most of this is not in the body itself: 2 of the 19 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 139, 188, 219). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · AccumulativeInsightPortfolioConstructionModel.DetermineTargetPercent (cognitive 19) · ×1
  • AccumulativeInsightPortfolioConstructionModel.DetermineTargetPercent (cognitive 19) Algorithm.Framework/Portfolio/AccumulativeInsightPortfolioConstructionModel.cs:165 — AccumulativeInsightPortfolioConstructionModel.DetermineTargetPercent has cognitive complexity 19 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · PortfolioLooper.ProcessOrders (cognitive 19) · ×1
  • PortfolioLooper.ProcessOrders (cognitive 19) Report/PortfolioLooper/PortfolioLooper.cs:337 — PortfolioLooper.ProcessOrders has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AccumulativeInsightPortfolioConstructionModel.determine_target_percent (cognitive 19) · ×1
  • AccumulativeInsightPortfolioConstructionModel.determine_target_percent (cognitive 19) Algorithm.Framework/Portfolio/AccumulativeInsightPortfolioConstructionModel.py:44 — AccumulativeInsightPortfolioConstructionModel.determine_target_percent has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), ternaries 1 (5 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ComboOrderTicketDemoAlgorithm.on_data (cognitive 19) · ×1
  • ComboOrderTicketDemoAlgorithm.on_data (cognitive 19) Algorithm.Python/ComboOrderTicketDemoAlgorithm.py:39 — ComboOrderTicketDemoAlgorithm.on_data has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 1 (4 pts) (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ObjectStoreHelpersRegressionAlgorithm.on_end_of_algorithm (cognitive 19) · ×1
  • ObjectStoreHelpersRegressionAlgorithm.on_end_of_algorithm (cognitive 19) Algorithm.Python/ObjectStoreHelpersRegressionAlgorithm.py:33 — ObjectStoreHelpersRegressionAlgorithm.on_end_of_algorithm has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11, boolean chains 4, error handling 3, loops 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ShortableProviderOrdersRejectedRegressionAlgorithm.on_data (cognitive 19) · ×1
  • ShortableProviderOrdersRejectedRegressionAlgorithm.on_data (cognitive 19) Algorithm.Python/ShortableProviderOrdersRejectedRegressionAlgorithm.py:41 — ShortableProviderOrdersRejectedRegressionAlgorithm.on_data has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (19 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReportCharts.GetCumulativeReturns (cognitive 19) · ×1
  • ReportCharts.GetCumulativeReturns (cognitive 19) Report/ReportCharts.py:138 — ReportCharts.GetCumulativeReturns has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 4 (7 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InternalSubscriptionManager.AddedSubscriptionRequest (cognitive 18) · ×1
  • InternalSubscriptionManager.AddedSubscriptionRequest (cognitive 18) Engine/DataFeeds/InternalSubscriptionManager.cs:60 — InternalSubscriptionManager.AddedSubscriptionRequest has cognitive complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveTradingResultHandler.SampleRange (cognitive 18) · ×1
  • LiveTradingResultHandler.SampleRange (cognitive 18) Engine/Results/LiveTradingResultHandler.cs:734 — LiveTradingResultHandler.SampleRange has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BrokerageTransactionHandler.HandleUpdateOrderRequest (cognitive 18) · ×1
  • BrokerageTransactionHandler.HandleUpdateOrderRequest (cognitive 18) Engine/TransactionHandlers/BrokerageTransactionHandler.cs:1061 — BrokerageTransactionHandler.HandleUpdateOrderRequest has cognitive complexity 18 (threshold 15). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · QCAlgorithm.PostInitialize (cognitive 18) · ×1
  • QCAlgorithm.PostInitialize (cognitive 18) Algorithm/QCAlgorithm.cs:805 — QCAlgorithm.PostInitialize has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QCAlgorithm.AddSecurity (cognitive 18) · ×1
  • QCAlgorithm.AddSecurity (cognitive 18) Algorithm/QCAlgorithm.cs:2043 — QCAlgorithm.AddSecurity has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QCAlgorithm.InitializeInsights (cognitive 18) · ×1
  • QCAlgorithm.InitializeInsights (cognitive 18) Algorithm/QCAlgorithm.Framework.cs:437 — QCAlgorithm.InitializeInsights has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LargeHistoryRequestDiagnostics.WarnOnLargeHistoryRequests (cognitive 18) · ×1
  • LargeHistoryRequestDiagnostics.WarnOnLargeHistoryRequests (cognitive 18) Algorithm/QCAlgorithm.History.cs:1605 — LargeHistoryRequestDiagnostics.WarnOnLargeHistoryRequests has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QCAlgorithm.IndicatorHistory (cognitive 18) · ×1
  • QCAlgorithm.IndicatorHistory (cognitive 18) Algorithm/QCAlgorithm.Indicators.cs:4545 — QCAlgorithm.IndicatorHistory has cognitive complexity 18 (threshold 15). Of this number, 14 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · Extensions.ConvertToSymbolEnumerable (cognitive 18) · ×1
  • Extensions.ConvertToSymbolEnumerable (cognitive 18) Common/Extensions.cs:3203 — Extensions.ConvertToSymbolEnumerable has cognitive complexity 18 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · BasePythonWrapper.GetPropertyName (cognitive 18) · ×1
  • BasePythonWrapper.GetPropertyName (cognitive 18) Common/Python/BasePythonWrapper.cs:250 — BasePythonWrapper.GetPropertyName has cognitive complexity 18 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · FuturesExpiryUtilityFunctions.NthBusinessDay (cognitive 18) · ×1
  • FuturesExpiryUtilityFunctions.NthBusinessDay (cognitive 18) Common/Securities/Future/FuturesExpiryUtilityFunctions.cs:149 — FuturesExpiryUtilityFunctions.NthBusinessDay has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FuturesListings.MonthlyContractListings (cognitive 18) · ×1
  • FuturesListings.MonthlyContractListings (cognitive 18) Common/Securities/Future/FuturesListings.cs:160 — FuturesListings.MonthlyContractListings has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PositionGroupBuyingPowerModel.GetMaximumLotsForTargetBuyingPower (cognitive 18) · ×1
  • PositionGroupBuyingPowerModel.GetMaximumLotsForTargetBuyingPower (cognitive 18) Common/Securities/Positions/PositionGroupBuyingPowerModel.cs:238 — PositionGroupBuyingPowerModel.GetMaximumLotsForTargetBuyingPower has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LeanData.GenerateZipEntryName (cognitive 18) · ×1
  • LeanData.GenerateZipEntryName (cognitive 18) Common/Util/LeanData.cs:669 — LeanData.GenerateZipEntryName has cognitive complexity 18 (threshold 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · AddFutureOptionContractFromFutureChainRegressionAlgorithm.OnData (cognitive 18) · ×1
  • AddFutureOptionContractFromFutureChainRegressionAlgorithm.OnData (cognitive 18) Algorithm.CSharp/AddFutureOptionContractFromFutureChainRegressionAlgorithm.cs:43 — AddFutureOptionContractFromFutureChainRegressionAlgorithm.OnData has cognitive complexity 18 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · AddOptionContractTwiceRegressionAlgorithm.OnData (cognitive 18) · ×1
  • AddOptionContractTwiceRegressionAlgorithm.OnData (cognitive 18) Algorithm.CSharp/AddOptionContractTwiceRegressionAlgorithm.cs:53 — AddOptionContractTwiceRegressionAlgorithm.OnData has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BasicTemplateEurexFuturesAlgorithm.OnOrderEvent (cognitive 18) · ×1
  • BasicTemplateEurexFuturesAlgorithm.OnOrderEvent (cognitive 18) Algorithm.CSharp/BasicTemplateEurexFuturesAlgorithm.cs:114 — BasicTemplateEurexFuturesAlgorithm.OnOrderEvent has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BracketOrderLimitEntryRegressionAlgorithm.OnData (cognitive 18) · ×1
  • BracketOrderLimitEntryRegressionAlgorithm.OnData (cognitive 18) Algorithm.CSharp/BracketOrderLimitEntryRegressionAlgorithm.cs:53 — BracketOrderLimitEntryRegressionAlgorithm.OnData has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BracketOrderRegressionAlgorithm.OnData (cognitive 18) · ×1
  • BracketOrderRegressionAlgorithm.OnData (cognitive 18) Algorithm.CSharp/BracketOrderRegressionAlgorithm.cs:50 — BracketOrderRegressionAlgorithm.OnData has cognitive complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · InsufficientBuyingPowerForAutomaticExerciseRegressionAlgorithm.OnOrderEvent (cognitive 18) · ×1
  • InsufficientBuyingPowerForAutomaticExerciseRegressionAlgorithm.OnOrderEvent (cognitive 18) Algorithm.CSharp/InsufficientBuyingPowerForAutomaticExerciseRegressionAlgorithm.cs:99 — InsufficientBuyingPowerForAutomaticExerciseRegressionAlgorithm.OnOrderEvent has cognitive complexity 18 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · SplitPartialShareRegressionAlgorithm.OnData (cognitive 18) · ×1
  • SplitPartialShareRegressionAlgorithm.OnData (cognitive 18) Algorithm.CSharp/SplitPartialShareRegressionAlgorithm.cs:42 — SplitPartialShareRegressionAlgorithm.OnData has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WarmupLowerResolutionOptionRegressionAlgorithm.OnData (cognitive 18) · ×1
  • WarmupLowerResolutionOptionRegressionAlgorithm.OnData (cognitive 18) Algorithm.CSharp/WarmupLowerResolutionOptionRegressionAlgorithm.cs:51 — WarmupLowerResolutionOptionRegressionAlgorithm.OnData has cognitive complexity 18 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · AlgoSeekFuturesReader.Parse (cognitive 18) · ×1
  • AlgoSeekFuturesReader.Parse (cognitive 18) ToolBox/AlgoSeekFuturesConverter/AlgoSeekFuturesReader.cs:140 — AlgoSeekFuturesReader.Parse has cognitive complexity 18 (threshold 15). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ComboOrderTicketDemoAlgorithm.combo_leg_limit_orders (cognitive 18) · ×1
  • ComboOrderTicketDemoAlgorithm.combo_leg_limit_orders (cognitive 18) Algorithm.Python/ComboOrderTicketDemoAlgorithm.py:120 — ComboOrderTicketDemoAlgorithm.combo_leg_limit_orders has cognitive complexity 18 (threshold 15). Drivers by points: loops 4 (8 pts), ternaries 2 (6 pts), if/else 3 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ContingentOrderUpdateRegressionAlgorithm.on_data (cognitive 18) · ×1
  • ContingentOrderUpdateRegressionAlgorithm.on_data (cognitive 18) Algorithm.Python/ContingentOrderUpdateRegressionAlgorithm.py:31 — ContingentOrderUpdateRegressionAlgorithm.on_data has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ContinuousFutureRegressionAlgorithm.on_data (cognitive 18) · ×1
  • ContinuousFutureRegressionAlgorithm.on_data (cognitive 18) Algorithm.Python/ContinuousFutureRegressionAlgorithm.py:36 — ContinuousFutureRegressionAlgorithm.on_data has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CustomDataUniverseRegressionAlgorithm.on_data (cognitive 18) · ×1
  • CustomDataUniverseRegressionAlgorithm.on_data (cognitive 18) Algorithm.Python/CustomDataUniverseRegressionAlgorithm.py:49 — CustomDataUniverseRegressionAlgorithm.on_data has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 1 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ETFConstituentUniverseFilterFunctionRegressionAlgorithm.on_data (cognitive 18) · ×1
  • ETFConstituentUniverseFilterFunctionRegressionAlgorithm.on_data (cognitive 18) Algorithm.Python/ETFConstituentUniverseMappedCompositeRegressionAlgorithm.py:51 — ETFConstituentUniverseFilterFunctionRegressionAlgorithm.on_data has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FutureOptionChainFiltersRegressionAlgorithm.on_data (cognitive 18) · ×1
  • FutureOptionChainFiltersRegressionAlgorithm.on_data (cognitive 18) Algorithm.Python/FutureOptionChainFiltersRegressionAlgorithm.py:58 — FutureOptionChainFiltersRegressionAlgorithm.on_data has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 2 (4 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OneTriggersOtherOrderRegressionAlgorithm.on_data (cognitive 18) · ×1
  • OneTriggersOtherOrderRegressionAlgorithm.on_data (cognitive 18) Algorithm.Python/OneTriggersOtherOrderRegressionAlgorithm.py:34 — OneTriggersOtherOrderRegressionAlgorithm.on_data has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AlgorithmManager.ProcessSplitSymbols (cognitive 17) · ×1
  • AlgorithmManager.ProcessSplitSymbols (cognitive 17) Engine/AlgorithmManager.cs:920 — AlgorithmManager.ProcessSplitSymbols has cognitive complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveTradingResultHandler.ProcessSynchronousEvents (cognitive 17) · ×1
  • LiveTradingResultHandler.ProcessSynchronousEvents (cognitive 17) Engine/Results/LiveTradingResultHandler.cs:1117 — LiveTradingResultHandler.ProcessSynchronousEvents has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BrokerageTransactionHandler.ProcessSynchronousEvents (cognitive 17) · ×1
  • BrokerageTransactionHandler.ProcessSynchronousEvents (cognitive 17) Engine/TransactionHandlers/BrokerageTransactionHandler.cs:729 — BrokerageTransactionHandler.ProcessSynchronousEvents has cognitive complexity 17 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · QCAlgorithm.ConvertMarketOrderIfRequired (cognitive 17) · ×1
  • QCAlgorithm.ConvertMarketOrderIfRequired (cognitive 17) Algorithm/QCAlgorithm.Trading.ContingentOrders.cs:305 — QCAlgorithm.ConvertMarketOrderIfRequired has cognitive complexity 17 (threshold 15). Of this number, 11 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConsolidatorWrapper.AdvanceScanTime (cognitive 17) · ×1
  • ConsolidatorWrapper.AdvanceScanTime (cognitive 17) Common/Data/ConsolidatorWrapper.cs:98 — ConsolidatorWrapper.AdvanceScanTime has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DividendYieldProvider.GetDividendYieldImpl (cognitive 17) · ×1
  • DividendYieldProvider.GetDividendYieldImpl (cognitive 17) Common/Data/DividendYieldProvider.cs:193 — DividendYieldProvider.GetDividendYieldImpl has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EquityFillModel.GetPrices (cognitive 17) · ×1
  • EquityFillModel.GetPrices (cognitive 17) Common/Orders/Fills/EquityFillModel.cs:1061 — EquityFillModel.GetPrices has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FillModel.GetPrices (cognitive 17) · ×1
  • FillModel.GetPrices (cognitive 17) Common/Orders/Fills/FillModel.cs:1177 — FillModel.GetPrices has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OrderContingency.GetUnits (cognitive 17) · ×1
  • OrderContingency.GetUnits (cognitive 17) Common/Orders/OrderContingency.cs:365 — OrderContingency.GetUnits has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OrderJsonConverter.DeserializeContingency (cognitive 17) · ×1
  • OrderJsonConverter.DeserializeContingency (cognitive 17) Common/Orders/OrderJsonConverter.cs:396 — OrderJsonConverter.DeserializeContingency has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PythonWrapper.ValidateImplementationOf (cognitive 17) · ×1
  • PythonWrapper.ValidateImplementationOf (cognitive 17) Common/Python/PythonWrapper.cs:35 — PythonWrapper.ValidateImplementationOf has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StreamReaderExtensions.GetDecimal (cognitive 17) · ×1
  • StreamReaderExtensions.GetDecimal (cognitive 17) Common/Util/StreamReaderExtensions.cs:56 — StreamReaderExtensions.GetDecimal has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. Note what this body is, though: it carries an aggressive-inlining request, so its author has asked in the source for this body to be inlined into every caller. Each part pulled out of it becomes a call the runtime has to decide to inline again, against a size budget — so the split can quietly turn one inlined body into several real calls, on the path the marker exists to protect. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
D2 · Cognitive Complexity · Loader.TryCreateILAlgorithm (cognitive 17) · ×1
  • Loader.TryCreateILAlgorithm (cognitive 17) AlgorithmFactory/Loader.cs:207 — Loader.TryCreateILAlgorithm has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AddOptionContractFromUniverseRegressionAlgorithm.OnData (cognitive 17) · ×1
  • AddOptionContractFromUniverseRegressionAlgorithm.OnData (cognitive 17) Algorithm.CSharp/AddOptionContractFromUniverseRegressionAlgorithm.cs:53 — AddOptionContractFromUniverseRegressionAlgorithm.OnData has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AddRemoveOptionUniverseRegressionAlgorithm.OnSecuritiesChanged (cognitive 17) · ×1
  • AddRemoveOptionUniverseRegressionAlgorithm.OnSecuritiesChanged (cognitive 17) Algorithm.CSharp/AddRemoveOptionUniverseRegressionAlgorithm.cs:144 — AddRemoveOptionUniverseRegressionAlgorithm.OnSecuritiesChanged has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AutomaticSeedBaseRegressionAlgorithm.OnSecuritiesChanged (cognitive 17) · ×1
  • AutomaticSeedBaseRegressionAlgorithm.OnSecuritiesChanged (cognitive 17) Algorithm.CSharp/AutomaticSeedBaseRegressionAlgorithm.cs:36 — AutomaticSeedBaseRegressionAlgorithm.OnSecuritiesChanged has cognitive complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ContinuousFutureOpenPositionsLiquidationOnDelistingRegressionAlgorithm.OnData (cognitive 17) · ×1
  • ContinuousFutureOpenPositionsLiquidationOnDelistingRegressionAlgorithm.OnData (cognitive 17) Algorithm.CSharp/ContinuousFutureOpenPositionsLiquidationOnDelistingRegressionAlgorithm.cs:56 — ContinuousFutureOpenPositionsLiquidationOnDelistingRegressionAlgorithm.OnData has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DelistedIndexOptionDivestedRegression.OnData (cognitive 17) · ×1
  • DelistedIndexOptionDivestedRegression.OnData (cognitive 17) Algorithm.CSharp/DelistedIndexOptionDivestedRegression.cs:45 — DelistedIndexOptionDivestedRegression.OnData has cognitive complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FutureChainInternalSubscriptionsRegressionAlgorithm.OnData (cognitive 17) · ×1
  • FutureChainInternalSubscriptionsRegressionAlgorithm.OnData (cognitive 17) Algorithm.CSharp/FutureChainInternalSubscriptionsRegressionAlgorithm.cs:47 — FutureChainInternalSubscriptionsRegressionAlgorithm.OnData has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NonDynamicOptionsFilterRegressionAlgorithm.OnSecuritiesChanged (cognitive 17) · ×1
  • NonDynamicOptionsFilterRegressionAlgorithm.OnSecuritiesChanged (cognitive 17) Algorithm.CSharp/NonDynamicOptionsFilterRegressionAlgorithm.cs:52 — NonDynamicOptionsFilterRegressionAlgorithm.OnSecuritiesChanged has cognitive complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OptionEquityOverlappingBullCallSpreadsRegressionAlgorithm.OnData (cognitive 17) · ×1
  • OptionEquityOverlappingBullCallSpreadsRegressionAlgorithm.OnData (cognitive 17) Algorithm.CSharp/OptionEquityOverlappingBullCallSpreadsRegressionAlgorithm.cs:40 — OptionEquityOverlappingBullCallSpreadsRegressionAlgorithm.OnData has cognitive complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ETFConstituentUniverseMappedCompositeRegressionAlgorithm.OnData (cognitive 17) · ×1
  • ETFConstituentUniverseMappedCompositeRegressionAlgorithm.OnData (cognitive 17) Algorithm.CSharp/RegressionTests/Universes/ETFConstituentUniverseMappedCompositeRegressionAlgorithm.cs:75 — ETFConstituentUniverseMappedCompositeRegressionAlgorithm.OnData has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SetAccountCurrencyCashBuyingPowerModelRegressionAlgorithm.OnOrderEvent (cognitive 17) · ×1
  • SetAccountCurrencyCashBuyingPowerModelRegressionAlgorithm.OnOrderEvent (cognitive 17) Algorithm.CSharp/SetAccountCurrencyCashBuyingPowerModelRegressionAlgorithm.cs:161 — SetAccountCurrencyCashBuyingPowerModelRegressionAlgorithm.OnOrderEvent has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SetAccountCurrencySecurityMarginModelRegressionAlgorithm.OnOrderEvent (cognitive 17) · ×1
  • SetAccountCurrencySecurityMarginModelRegressionAlgorithm.OnOrderEvent (cognitive 17) Algorithm.CSharp/SetAccountCurrencySecurityMarginModelRegressionAlgorithm.cs:127 — SetAccountCurrencySecurityMarginModelRegressionAlgorithm.OnOrderEvent has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Program.Main (cognitive 17) · ×1
  • Program.Main (cognitive 17) ToolBox/Program.cs:31 — Program.Main has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QuantBook.PerformSelection (cognitive 17) · ×1
  • QuantBook.PerformSelection (cognitive 17) Research/QuantBook.cs:1128 — QuantBook.PerformSelection has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RebalancingLeveragedETFAlphaModel.update (cognitive 17) · ×1
  • RebalancingLeveragedETFAlphaModel.update (cognitive 17) Algorithm.Python/Alphas/RebalancingLeveragedETFAlpha.py:72 — RebalancingLeveragedETFAlphaModel.update has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 2 (4 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BasicTemplateEurexFuturesAlgorithm.on_order_event (cognitive 17) · ×1
  • BasicTemplateEurexFuturesAlgorithm.on_order_event (cognitive 17) Algorithm.Python/BasicTemplateEurexFuturesAlgorithm.py:87 — BasicTemplateEurexFuturesAlgorithm.on_order_event has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FuturesAndFutures_optionsExpiryTimeAndLiquidationRegressionAlgorithm.on_data (cognitive 17) · ×1
  • FuturesAndFutures_optionsExpiryTimeAndLiquidationRegressionAlgorithm.on_data (cognitive 17) Algorithm.Python/FuturesAndFuturesOptionsExpiryTimeAndLiquidationRegressionAlgorithm.py:52 — FuturesAndFutures_optionsExpiryTimeAndLiquidationRegressionAlgorithm.on_data has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 7, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IronCondorStrategyAlgorithm.assert_strategy_position_group (cognitive 17) · ×1
  • IronCondorStrategyAlgorithm.assert_strategy_position_group (cognitive 17) Algorithm.Python/IronCondorStrategyAlgorithm.py:51 — IronCondorStrategyAlgorithm.assert_strategy_position_group has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, boolean chains 8. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AlgorithmManager.Stream (cognitive 16) · ×1
  • AlgorithmManager.Stream (cognitive 16) Engine/AlgorithmManager.cs:697 — AlgorithmManager.Stream has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LiveOptionChainProvider.GetFutureOptionContractList (cognitive 16) · ×1
  • LiveOptionChainProvider.GetFutureOptionContractList (cognitive 16) Engine/DataFeeds/LiveOptionChainProvider.cs:137 — LiveOptionChainProvider.GetFutureOptionContractList has cognitive complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
D2 · Cognitive Complexity · PendingRemovalsManager.CheckPendingRemovals (cognitive 16) · ×1
  • PendingRemovalsManager.CheckPendingRemovals (cognitive 16) Engine/DataFeeds/PendingRemovalsManager.cs:179 — PendingRemovalsManager.CheckPendingRemovals has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BrokerageTransactionHandler.UpdateOrder (cognitive 16) · ×1
  • BrokerageTransactionHandler.UpdateOrder (cognitive 16) Engine/TransactionHandlers/BrokerageTransactionHandler.cs:426 — BrokerageTransactionHandler.UpdateOrder has cognitive complexity 16 (threshold 15). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · QCAlgorithm.AddOptionContract (cognitive 16) · ×1
  • QCAlgorithm.AddOptionContract (cognitive 16) Algorithm/QCAlgorithm.cs:2545 — QCAlgorithm.AddOptionContract has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QCAlgorithm.ProcessInsights (cognitive 16) · ×1
  • QCAlgorithm.ProcessInsights (cognitive 16) Algorithm/QCAlgorithm.Framework.cs:175 — QCAlgorithm.ProcessInsights has cognitive complexity 16 (threshold 15). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AlpacaBrokerageModel.CanSubmitContingentOrder (cognitive 16) · ×1
  • AlpacaBrokerageModel.CanSubmitContingentOrder (cognitive 16) Common/Brokerages/AlpacaBrokerageModel.cs:90 — AlpacaBrokerageModel.CanSubmitContingentOrder has cognitive complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · EtoroBrokerageModel.CanSubmitContingentOrder (cognitive 16) · ×1
  • EtoroBrokerageModel.CanSubmitContingentOrder (cognitive 16) Common/Brokerages/EtoroBrokerageModel.cs:183 — EtoroBrokerageModel.CanSubmitContingentOrder has cognitive complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · TradierBrokerageModel.CanSubmitOrder (cognitive 16) · ×1
  • TradierBrokerageModel.CanSubmitOrder (cognitive 16) Common/Brokerages/TradierBrokerageModel.cs:70 — TradierBrokerageModel.CanSubmitOrder has cognitive complexity 16 (threshold 15). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · TradingTechnologiesBrokerageModel.IsValidOrderPrices (cognitive 16) · ×1
  • TradingTechnologiesBrokerageModel.IsValidOrderPrices (cognitive 16) Common/Brokerages/TradingTechnologiesBrokerageModel.cs:187 — TradingTechnologiesBrokerageModel.IsValidOrderPrices has cognitive complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ContingentOrderExtensions.TryGetContingentOrders (cognitive 16) · ×1
  • ContingentOrderExtensions.TryGetContingentOrders (cognitive 16) Common/Orders/ContingentOrderExtensions.cs:117 — ContingentOrderExtensions.TryGetContingentOrders has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InteractiveBrokersFeeModel.GetOrderFee (cognitive 16) · ×1
  • InteractiveBrokersFeeModel.GetOrderFee (cognitive 16) Common/Orders/Fees/InteractiveBrokersFeeModel.cs:77 — InteractiveBrokersFeeModel.GetOrderFee has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EquityFillModel.LimitIfTouchedFill (cognitive 16) · ×1
  • EquityFillModel.LimitIfTouchedFill (cognitive 16) Common/Orders/Fills/EquityFillModel.cs:52 — EquityFillModel.LimitIfTouchedFill has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PythonInitializer.ActivatePythonVirtualEnvironment (cognitive 16) · ×1
  • PythonInitializer.ActivatePythonVirtualEnvironment (cognitive 16) Common/Python/PythonInitializer.cs:193 — PythonInitializer.ActivatePythonVirtualEnvironment has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DateRules.WeekIterator (cognitive 16) · ×1
  • DateRules.WeekIterator (cognitive 16) Common/Scheduling/DateRules.cs:682 — DateRules.WeekIterator has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BaseOptionFilterUniverse.Strikes (cognitive 16) · ×1
  • BaseOptionFilterUniverse.Strikes (cognitive 16) Common/Securities/Option/OptionFilterUniverse.cs:206 — BaseOptionFilterUniverse.Strikes has cognitive complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · BaseOptionFilterUniverse.IronCondor (cognitive 16) · ×1
  • BaseOptionFilterUniverse.IronCondor (cognitive 16) Common/Securities/Option/OptionFilterUniverse.cs:850 — BaseOptionFilterUniverse.IronCondor has cognitive complexity 16 (threshold 15). Of this number, 8 points are the body's own statements and 8 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · OptionPositionCollection.OptionPositionCollection.ctor (cognitive 16) · ×1
  • OptionPositionCollection.OptionPositionCollection.ctor (cognitive 16) Common/Securities/Option/StrategyMatcher/OptionPositionCollection.cs:113 — OptionPositionCollection.OptionPositionCollection.ctor has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SecurityExchangeHours.GetPreviousMarketOpen (cognitive 16) · ×1
  • SecurityExchangeHours.GetPreviousMarketOpen (cognitive 16) Common/Securities/SecurityExchangeHours.cs:269 — SecurityExchangeHours.GetPreviousMarketOpen has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Config.GetValue (cognitive 16) · ×1
  • Config.GetValue (cognitive 16) REDACTED:230 — Config.GetValue has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BasicTemplateEurexFuturesAlgorithm.OnData (cognitive 16) · ×1
  • BasicTemplateEurexFuturesAlgorithm.OnData (cognitive 16) Algorithm.CSharp/BasicTemplateEurexFuturesAlgorithm.cs:66 — BasicTemplateEurexFuturesAlgorithm.OnData has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConsolidateHourBarsIntoDailyBarsRegressionAlgorithm.OnData (cognitive 16) · ×1
  • ConsolidateHourBarsIntoDailyBarsRegressionAlgorithm.OnData (cognitive 16) Algorithm.CSharp/ConsolidateHourBarsIntoDailyBarsRegressionAlgorithm.cs:62 — ConsolidateHourBarsIntoDailyBarsRegressionAlgorithm.OnData has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ContinuousFutureImmediateUniverseSelectionRegressionAlgorithm.OnSecuritiesChanged (cognitive 16) · ×1
  • ContinuousFutureImmediateUniverseSelectionRegressionAlgorithm.OnSecuritiesChanged (cognitive 16) Algorithm.CSharp/ContinuousFutureImmediateUniverseSelectionRegressionAlgorithm.cs:116 — ContinuousFutureImmediateUniverseSelectionRegressionAlgorithm.OnSecuritiesChanged has cognitive complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FuturesFrameworkRegressionAlgorithm.OnSecuritiesChanged (cognitive 16) · ×1
  • FuturesFrameworkRegressionAlgorithm.OnSecuritiesChanged (cognitive 16) Algorithm.CSharp/FuturesFrameworkRegressionAlgorithm.cs:86 — FuturesFrameworkRegressionAlgorithm.OnSecuritiesChanged has cognitive complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpeningBreakoutAlgorithm.OnData (cognitive 16) · ×1
  • OpeningBreakoutAlgorithm.OnData (cognitive 16) Algorithm.CSharp/OpeningBreakoutAlgorithm.cs:216 — OpeningBreakoutAlgorithm.OnData has cognitive complexity 16 (threshold 15). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · OptionEquityBearPutLadderRegressionAlgorithm.OnData (cognitive 16) · ×1
  • OptionEquityBearPutLadderRegressionAlgorithm.OnData (cognitive 16) Algorithm.CSharp/OptionEquityBearPutLadderRegressionAlgorithm.cs:36 — OptionEquityBearPutLadderRegressionAlgorithm.OnData has cognitive complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WarmupFutureRegressionAlgorithm.OnData (cognitive 16) · ×1
  • WarmupFutureRegressionAlgorithm.OnData (cognitive 16) Algorithm.CSharp/WarmupFutureRegressionAlgorithm.cs:56 — WarmupFutureRegressionAlgorithm.OnData has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EmaCrossAlphaModel.Update (cognitive 16) · ×1
  • EmaCrossAlphaModel.Update (cognitive 16) Algorithm.Framework/Alphas/EmaCrossAlphaModel.cs:67 — EmaCrossAlphaModel.Update has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BlackLittermanOptimizationPortfolioConstructionModel.DetermineTargetPercent (cognitive 16) · ×1
  • BlackLittermanOptimizationPortfolioConstructionModel.DetermineTargetPercent (cognitive 16) Algorithm.Framework/Portfolio/BlackLittermanOptimizationPortfolioConstructionModel.cs:248 — BlackLittermanOptimizationPortfolioConstructionModel.DetermineTargetPercent has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PortfolioLooper.FromOrders (cognitive 16) · ×1
  • PortfolioLooper.FromOrders (cognitive 16) Report/PortfolioLooper/PortfolioLooper.cs:252 — PortfolioLooper.FromOrders has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OptimizationFailedBacktests.Build (cognitive 16) · ×1
  • OptimizationFailedBacktests.Build (cognitive 16) Optimizer/Analysis/OptimizationFailedBacktests.cs:31 — OptimizationFailedBacktests.Build has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PearsonCorrelationPairsTradingAlphaModel.on_securities_changed (cognitive 16) · ×1
  • PearsonCorrelationPairsTradingAlphaModel.on_securities_changed (cognitive 16) Algorithm.Framework/Alphas/PearsonCorrelationPairsTradingAlphaModel.py:39 — PearsonCorrelationPairsTradingAlphaModel.on_securities_changed has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 4 (7 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FundamentalUniverseSelectionModel.create_universes (cognitive 16) · ×1
  • FundamentalUniverseSelectionModel.create_universes (cognitive 16) Algorithm.Framework/Selection/FundamentalUniverseSelectionModel.py:35 — FundamentalUniverseSelectionModel.create_universes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BasicTemplateCryptoAlgorithm.on_data (cognitive 16) · ×1
  • BasicTemplateCryptoAlgorithm.on_data (cognitive 16) Algorithm.Python/BasicTemplateCryptoAlgorithm.py:63 — BasicTemplateCryptoAlgorithm.on_data has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 4 (8 pts) (nesting depth added 4). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · BasicTemplateEurexFuturesAlgorithm.on_data (cognitive 16) · ×1
  • BasicTemplateEurexFuturesAlgorithm.on_data (cognitive 16) Algorithm.Python/BasicTemplateEurexFuturesAlgorithm.py:56 — BasicTemplateEurexFuturesAlgorithm.on_data has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConsolidateHourBarsIntoDailyBarsRegressionAlgorithm.on_data (cognitive 16) · ×1
  • ConsolidateHourBarsIntoDailyBarsRegressionAlgorithm.on_data (cognitive 16) Algorithm.Python/ConsolidateHourBarsIntoDailyBarsRegressionAlgorithm.py:42 — ConsolidateHourBarsIntoDailyBarsRegressionAlgorithm.on_data has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConstituentWeightedRsiAlphaModel.update (cognitive 16) · ×1
  • ConstituentWeightedRsiAlphaModel.update (cognitive 16) Algorithm.Python/ETFConstituentUniverseRSIAlphaModelAlgorithm.py:59 — ConstituentWeightedRsiAlphaModel.update has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 2 (4 pts), loops 3, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IndexOptionCallITMGreeksExpiryRegressionAlgorithm.on_data (cognitive 16) · ×1
  • IndexOptionCallITMGreeksExpiryRegressionAlgorithm.on_data (cognitive 16) Algorithm.Python/IndexOptionCallITMGreeksExpiryRegressionAlgorithm.py:44 — IndexOptionCallITMGreeksExpiryRegressionAlgorithm.on_data has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, boolean chains 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member family (4 members, 30 shared lines) · ×1
  • Near-duplicate member family (4 members, 30 shared lines) Indicators/CandlestickPatterns/Hammer.cs:83 — Indicators/CandlestickPatterns/Hammer.cs:83-140 | Indicators/CandlestickPatterns/HangingMan.cs:83-140 | Indicators/CandlestickPatterns/InvertedHammer.cs:80-129 | Indicators/CandlestickPatterns/ShootingStar.cs:81-130 — These 4 members are variants of one another: a block of 30 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Near-duplicate member pair (35 shared lines) · ×1
  • Near-duplicate member pair (35 shared lines) Indicators/CandlestickPatterns/MatHold.cs:100 — Indicators/CandlestickPatterns/MatHold.cs:100-162 | Indicators/CandlestickPatterns/RiseFallThreeMethods.cs:82-146 — These two members are variants of one another: 35 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Members sharing a duplicated core (55 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (55 members, 50+ identical tokens) Common/Data/Fundamental/Generated/AvailableForSaleSecuritiesBalanceSheet.cs:83 — Common/Data/Fundamental/Generated/AvailableForSaleSecuritiesBalanceSheet.cs:83-93 | Common/Data/Fundamental/Generated/BankLoansCurrentBalanceSheet.cs:67-77 | Common/Data/Fundamental/Generated/BankLoansNonCurrentBalanceSheet.cs:67-77 | Common/Data/Fundamental/Generated/BasicAccountingChange.cs:83-93 | Common/Data/Fundamental/Generated/BasicEPSOtherGainsLosses.cs:83-93 | Common/Data/Fundamental/Generated/BasicExtraordinary.cs:99-109 | Common/Data/Fundamental/Generated/CashAndDueFromBanksBalanceSheet.cs:83-93 | Common/Data/Fundamental/Generated/CashReceiptsfromSecuritiesRelatedActivitiesCashFlowStatement.cs:91-101 | Common/Data/Fundamental/Generated/CashReceivedfromInsuranceActivitiesCashFlowStatement.cs:83-93 | Common/Data/Fundamental/Generated/ChangeInOtherWorkingCapitalCashFlowStatement.cs:99-109 | Common/Data/Fundamental/Generated/ChangeinAccruedIncomeCashFlowStatement.cs:83-93 | Common/Data/Fundamental/Generated/ChangeinInsuranceLiabilitiesNetofReinsuranceIncomeStatement.cs:83-93 | Common/Data/Fundamental/Generated/ChangeinInvestmentContractIncomeStatement.cs:83-93 | Common/Data/Fundamental/Generated/ChangeinReinsuranceReceivablesCashFlowStatement.cs:83-93 | Common/Data/Fundamental/Generated/ClaimsOutstandingBalanceSheet.cs:67-77 | Common/Data/Fundamental/Generated/ConvertibleLoansCurrentBalanceSheet.cs:59-69 | Common/Data/Fundamental/Generated/ConvertibleLoansNonCurrentBalanceSheet.cs:67-77 | Common/Data/Fundamental/Generated/DebtSecuritiesinIssueBalanceSheet.cs:67-77 | Common/Data/Fundamental/Generated/DepositsReceivedunderCededInsuranceContractBalanceSheet.cs:67-77 | Common/Data/Fundamental/Generated/DilutedAccountingChange.cs:83-93 | Common/Data/Fundamental/Generated/DilutedEPSOtherGainsLosses.cs:83-93 | Common/Data/Fundamental/Generated/DilutedExtraordinary.cs:99-109 | Common/Data/Fundamental/Generated/EquityInvestmentsBalanceSheet.cs:75-85 | Common/Data/Fundamental/Generated/EquitySharesInvestmentsBalanceSheet.cs:67-77 | Common/Data/Fundamental/Generated/FinanceLeaseReceivablesBalanceSheet.cs:67-77 | Common/Data/Fundamental/Generated/FinanceLeaseReceivablesCurrentBalanceSheet.cs:67-77 | Common/Data/Fundamental/Generated/FinanceLeaseReceivablesNonCurrentBalanceSheet.cs:67-77 | Common/Data/Fundamental/Generated/GainLossonDerecognitionofAvailableForSaleFinancialAssetsIncomeStatement.cs:83-93 | Common/Data/Fundamental/Generated/GainLossonFinancialInstrumentsDesignatedasCashFlowHedgesIncomeStatement.cs:83-93 | Common/Data/Fundamental/Generated/ImpairmentLossReversalRecognizedinProfitorLossCashFlowStatement.cs:83-93 | Common/Data/Fundamental/Generated/ImpairmentLossesReversalsFinancialInstrumentsNetIncomeStatement.cs:83-93 | Common/Data/Fundamental/Generated/LoansandAdvancestoCustomerBalanceSheet.cs:67-77 | Common/Data/Fundamental/Generated/MinorityInterestCashFlowStatement.cs:59-69 | Common/Data/Fundamental/Generated/NegativeGoodwillImmediatelyRecognizedIncomeStatement.cs:75-85 | Common/Data/Fundamental/Generated/NetIncomeFromTaxLossCarryforwardIncomeStatement.cs:83-93 | Common/Data/Fundamental/Generated/NetPolicyholderBenefitsAndClaimsIncomeStatement.cs:83-93 | Common/Data/Fundamental/Generated/NetTradingIncomeIncomeStatement.cs:59-69 | Common/Data/Fundamental/Generated/NormalizedDilutedEPSGrowth.cs:83-93 | Common/Data/Fundamental/Generated/OtherOperatingIncomeTotalIncomeStatement.cs:91-101 | Common/Data/Fundamental/Generated/PreTreShaNumBalanceSheet.cs:67-77 | Common/Data/Fundamental/Generated/ProfitOnDisposalsCashFlowStatement.cs:83-93 | Common/Data/Fundamental/Generated/PurchaseOfSubsidiariesCashFlowStatement.cs:83-93 | Common/Data/Fundamental/Generated/RegressionGrowthOperatingRevenue5Years.cs:59-69 | Common/Data/Fundamental/Generated/RegressionGrowthofDividends5Years.cs:59-69 | Common/Data/Fundamental/Generated/ReinsuranceRecoveriesClaimsandBenefitsIncomeStatement.cs:83-93 | Common/Data/Fundamental/Generated/ReinsuranceRecoveriesofInvestmentContractIncomeStatement.cs:83-93 | Common/Data/Fundamental/Generated/ReorganizationOtherCostsCashFlowStatement.cs:83-93 | Common/Data/Fundamental/Generated/RestructuringAndMergernAcquisitionIncomeStatement.cs:99-109 | Common/Data/Fundamental/Generated/SaleOfSubsidiariesCashFlowStatement.cs:67-77 | Common/Data/Fundamental/Generated/SecuritiesActivitiesIncomeStatement.cs:83-93 | Common/Data/Fundamental/Generated/ShareOfAssociatesCashFlowStatement.cs:83-93 | Common/Data/Fundamental/Generated/TaxAssetsTotalBalanceSheet.cs:67-77 | Common/Data/Fundamental/Generated/TaxLossCarryforwardBasicEPS.cs:83-93 | Common/Data/Fundamental/Generated/TaxLossCarryforwardDilutedEPS.cs:83-93 | Common/Data/Fundamental/Generated/TotalDebtInMaturityScheduleBalanceSheet.cs:67-77 — These 55 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 55 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 55 times.
D4 · Code Duplication · Members sharing a duplicated core (14 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (14 members, 50+ identical tokens) Algorithm.Python/FutureOptionCallOTMExpiryRegressionAlgorithm.py:67 — Algorithm.Python/FutureOptionCallOTMExpiryRegressionAlgorithm.py:67-74 | Algorithm.Python/FutureOptionPutOTMExpiryRegressionAlgorithm.py:66-73 | Algorithm.Python/FutureOptionShortCallITMExpiryRegressionAlgorithm.py:62-69 | Algorithm.Python/FutureOptionShortCallOTMExpiryRegressionAlgorithm.py:62-69 | Algorithm.Python/FutureOptionShortPutITMExpiryRegressionAlgorithm.py:62-69 | Algorithm.Python/FutureOptionShortPutOTMExpiryRegressionAlgorithm.py:63-70 | Algorithm.Python/IndexOptionCallITMExpiryRegressionAlgorithm.py:54-61 | Algorithm.Python/IndexOptionCallOTMExpiryRegressionAlgorithm.py:67-74 | Algorithm.Python/IndexOptionPutITMExpiryRegressionAlgorithm.py:49-55 | Algorithm.Python/IndexOptionPutOTMExpiryRegressionAlgorithm.py:67-74 | Algorithm.Python/IndexOptionShortCallITMExpiryRegressionAlgorithm.py:55-62 | Algorithm.Python/IndexOptionShortCallOTMExpiryRegressionAlgorithm.py:51-58 | Algorithm.Python/IndexOptionShortPutITMExpiryRegressionAlgorithm.py:55-62 | Algorithm.Python/IndexOptionShortPutOTMExpiryRegressionAlgorithm.py:51-58 — These 14 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 14 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 14 times.
D4 · Code Duplication · Members sharing a duplicated core (11 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (11 members, 50+ identical tokens) Report/ReportCharts.py:68 — Report/ReportCharts.py:68-136 | Report/ReportCharts.py:141-263 | Report/ReportCharts.py:268-346 | Report/ReportCharts.py:349-458 | Report/ReportCharts.py:462-529 | Report/ReportCharts.py:534-614 | Report/ReportCharts.py:660-746 | Report/ReportCharts.py:751-836 | Report/ReportCharts.py:840-904 | Report/ReportCharts.py:909-971 | Report/ReportCharts.py:976-1148 — These 11 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 11 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 11 times.
D4 · Code Duplication · Members sharing a duplicated core (10 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (10 members, 50+ identical tokens) Common/Brokerages/AxosClearingBrokerageModel.cs:103 — Common/Brokerages/AxosClearingBrokerageModel.cs:103-139 | Common/Brokerages/BitfinexBrokerageModel.cs:134-161 | Common/Brokerages/BloombergFixBrokerageModel.cs:65-86 | Common/Brokerages/CoinbaseBrokerageModel.cs:164-217 | Common/Brokerages/FxcmBrokerageModel.cs:78-136 | Common/Brokerages/KrakenBrokerageModel.cs:93-122 | Common/Brokerages/OandaBrokerageModel.cs:83-119 | Common/Brokerages/QuantBridgeBrokerageModel.cs:60-81 | Common/Brokerages/TradingTechnologiesBrokerageModel.cs:103-152 | Common/Brokerages/ZerodhaBrokerageModel.cs:100-138 — These 10 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 10 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 10 times.
D4 · Code Duplication · Edited copy of a member (75 corresponding lines) · ×1
  • Edited copy of a member (75 corresponding lines) Algorithm.Python/BasicTemplateCryptoFutureAlgorithm.py:58 — Algorithm.Python/BasicTemplateCryptoFutureAlgorithm.py:58-136 | Algorithm.Python/BybitCryptoFuturesRegressionAlgorithm.py:54-128 — These two members are one piece of code written twice and then edited apart: 75 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (60 corresponding lines) · ×1
  • Edited copy of a member (60 corresponding lines) Algorithm.CSharp/FutureOptionCallITMGreeksExpiryRegressionAlgorithm.cs:74 — Algorithm.CSharp/FutureOptionCallITMGreeksExpiryRegressionAlgorithm.cs:74-137 | Algorithm.CSharp/IndexOptionCallITMGreeksExpiryRegressionAlgorithm.cs:64-123 — These two members are one piece of code written twice and then edited apart: 60 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (68 corresponding lines) · ×1
  • Edited copy of a member (68 corresponding lines) Algorithm.CSharp/UpdateOrderLiveTestAlgorithm.cs:87 — Algorithm.CSharp/UpdateOrderLiveTestAlgorithm.cs:87-160 | Algorithm.CSharp/UpdateOrderRegressionAlgorithm.cs:78-145 — These two members are one piece of code written twice and then edited apart: 68 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (79 corresponding lines) · ×1
  • Edited copy of a member (79 corresponding lines) Common/Orders/Fills/EquityFillModel.cs:281 — Common/Orders/Fills/EquityFillModel.cs:281-363 | Common/Orders/Fills/FillModel.cs:487-565 — These two members are one piece of code written twice and then edited apart: 79 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 55+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 55+ corresponding lines) Common/Orders/Fills/EquityFillModel.cs:1062 — Common/Orders/Fills/EquityFillModel.cs:1062-1118 | Common/Orders/Fills/FillModel.cs:1178-1232 | Common/Orders/Fills/LatestPriceFillModel.cs:36-99 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 55 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (50 corresponding lines) · ×1
  • Edited copy of a member (50 corresponding lines) Common/Messages/Messages.Orders.cs:148 — Common/Messages/Messages.Orders.cs:148-199 | Common/Messages/Messages.Orders.cs:206-255 — These two members are one piece of code written twice and then edited apart: 50 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 27+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 27+ corresponding lines) Algorithm.Python/IronCondorStrategyAlgorithm.py:52 — Algorithm.Python/IronCondorStrategyAlgorithm.py:52-84 | Algorithm.Python/LongAndShortButterflyCallStrategiesAlgorithm.py:51-77 | Algorithm.Python/LongAndShortButterflyPutStrategiesAlgorithm.py:51-77 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 27 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (55 corresponding lines) · ×1
  • Edited copy of a member (55 corresponding lines) Common/Orders/Fills/FillModel.cs:283 — Common/Orders/Fills/FillModel.cs:283-338 | Common/Orders/Fills/FutureFillModel.cs:37-91 — These two members are one piece of code written twice and then edited apart: 55 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 45+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 45+ corresponding lines) Indicators/CandlestickPatterns/InNeck.cs:75 — Indicators/CandlestickPatterns/InNeck.cs:75-119 | Indicators/CandlestickPatterns/OnNeck.cs:75-119 | Indicators/CandlestickPatterns/Thrusting.cs:77-122 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 45 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 49+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 49+ corresponding lines) Algorithm.Python/OrderTicketDemoAlgorithm.py:94 — Algorithm.Python/OrderTicketDemoAlgorithm.py:94-142 | Algorithm.Python/OrderTicketDemoAlgorithm.py:146-194 | Algorithm.Python/OrderTicketDemoAlgorithm.py:198-261 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 49 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 28+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 28+ corresponding lines) Algorithm/QCAlgorithm.Python.cs:679 — Algorithm/QCAlgorithm.Python.cs:679-718 | Algorithm/QCAlgorithm.Python.cs:1776-1804 | Algorithm/QCAlgorithm.Python.cs:1833-1861 | Algorithm/QCAlgorithm.Python.cs:1871-1898 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 28 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 93+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 93+ corresponding lines) Algorithm.CSharp/BasicTemplateCryptoFutureAlgorithm.cs:83 — Algorithm.CSharp/BasicTemplateCryptoFutureAlgorithm.cs:83-200 | Algorithm.CSharp/BasicTemplateCryptoFutureHourlyAlgorithm.cs:78-170 | Algorithm.CSharp/BybitCryptoFuturesRegressionAlgorithm.cs:72-190 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 93 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 54+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 54+ corresponding lines) Algorithm.CSharp/ContinuousBackMonthRawFutureRegressionAlgorithm.cs:57 — Algorithm.CSharp/ContinuousBackMonthRawFutureRegressionAlgorithm.cs:57-110 | Algorithm.CSharp/ContinuousFutureBackMonthRegressionAlgorithm.cs:71-126 | Algorithm.CSharp/ContinuousFutureRegressionAlgorithm.cs:58-123 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 54 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (7 members, 33+ corresponding lines) · ×1
  • Edited copies of one member (7 members, 33+ corresponding lines) Algorithm.CSharp/OptionEquityBearCallSpreadRegressionAlgorithm.cs:36 — Algorithm.CSharp/OptionEquityBearCallSpreadRegressionAlgorithm.cs:36-77 | Algorithm.CSharp/OptionEquityBearCallSpreadSetHoldingsRegressionAlgorithm.cs:44-76 | Algorithm.CSharp/OptionEquityBearPutSpreadRegressionAlgorithm.cs:36-74 | Algorithm.CSharp/OptionEquityBullCallSpreadRegressionAlgorithm.cs:36-73 | Algorithm.CSharp/OptionEquityBullPutSpreadRegressionAlgorithm.cs:36-72 | Algorithm.CSharp/OptionEquityCallCalendarSpreadRegressionAlgorithm.cs:36-74 | Algorithm.CSharp/OptionEquityPutCalendarSpreadRegressionAlgorithm.cs:36-73 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 33 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (31 corresponding lines) · ×1
  • Edited copy of a member (31 corresponding lines) Common/Securities/Option/StrategyMatcher/OptionPositionCollection.cs:427 — Common/Securities/Option/StrategyMatcher/OptionPositionCollection.cs:427-457 | Common/Securities/Option/StrategyMatcher/OptionPositionCollection.cs:464-494 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 18+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 18+ corresponding lines) Algorithm.Python/IndexOptionBearCallSpreadAlgorithm.py:35 — Algorithm.Python/IndexOptionBearCallSpreadAlgorithm.py:35-56 | Algorithm.Python/IndexOptionBearPutSpreadAlgorithm.py:32-49 | Algorithm.Python/IndexOptionBullCallSpreadAlgorithm.py:35-56 | Algorithm.Python/IndexOptionBullPutSpreadAlgorithm.py:32-49 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 19+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 19+ corresponding lines) Algorithm.CSharp/IndexOptionBearCallSpreadAlgorithm.cs:44 — Algorithm.CSharp/IndexOptionBearCallSpreadAlgorithm.cs:44-67 | Algorithm.CSharp/IndexOptionBearPutSpreadAlgorithm.cs:43-61 | Algorithm.CSharp/IndexOptionBullCallSpreadAlgorithm.cs:44-67 | Algorithm.CSharp/IndexOptionBullPutSpreadAlgorithm.cs:43-61 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (40 corresponding lines) · ×1
  • Edited copy of a member (40 corresponding lines) Algorithm.Python/Collective2PortfolioSignalExportDemonstrationAlgorithm.py:26 — Algorithm.Python/Collective2PortfolioSignalExportDemonstrationAlgorithm.py:26-65 | Algorithm.Python/Collective2SignalExportDemonstrationAlgorithm.py:25-75 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (48 corresponding lines) · ×1
  • Edited copy of a member (48 corresponding lines) Indicators/ParabolicStopAndReverseExtended.cs:187 — Indicators/ParabolicStopAndReverseExtended.cs:187-234 | Indicators/ParabolicStopAndReverseExtended.cs:240-287 — These two members are one piece of code written twice and then edited apart: 48 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 17+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 17+ corresponding lines) Algorithm.CSharp/SpreadExecutionModelRegressionAlgorithm.cs:40 — Algorithm.CSharp/SpreadExecutionModelRegressionAlgorithm.cs:40-56 | Algorithm.CSharp/StandardDeviationExecutionModelRegressionAlgorithm.cs:35-53 | Algorithm.CSharp/VolumeWeightedAveragePriceExecutionModelRegressionAlgorithm.cs:36-56 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 29+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 29+ corresponding lines) Algorithm.CSharp/Alphas/GlobalEquityMeanReversionIBSAlpha.cs:45 — Algorithm.CSharp/Alphas/GlobalEquityMeanReversionIBSAlpha.cs:45-75 | Algorithm.CSharp/Alphas/ShareClassMeanReversionAlpha.cs:46-74 | Algorithm.CSharp/Alphas/TriangleExchangeRateArbitrageAlpha.cs:44-73 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 29 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 26+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 26+ corresponding lines) Algorithm.Python/Alphas/GlobalEquityMeanReversionIBSAlpha.py:34 — Algorithm.Python/Alphas/GlobalEquityMeanReversionIBSAlpha.py:34-63 | Algorithm.Python/Alphas/TriangleExchangeRateArbitrageAlpha.py:33-59 | Algorithm.Python/Alphas/TripleLeverageETFPairVolatilityDecayAlpha.py:32-57 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 26 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 22+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 22+ corresponding lines) Algorithm.CSharp/BasicTemplateOptionsAlgorithm.cs:65 — Algorithm.CSharp/BasicTemplateOptionsAlgorithm.cs:65-86 | Algorithm.CSharp/BasicTemplateOptionsHourlyAlgorithm.cs:66-87 | Algorithm.CSharp/OptionChainedUniverseSelectionModelRegressionAlgorithm.cs:49-71 | Algorithm.CSharp/OptionFilterReturnsNullRegressionAlgorithm.cs:60-83 | Algorithm.CSharp/SamcoBasicTemplateOptionsAlgorithm.cs:64-85 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 22+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 22+ corresponding lines) Algorithm.CSharp/Alphas/GreenblattMagicFormulaAlpha.cs:51 — Algorithm.CSharp/Alphas/GreenblattMagicFormulaAlpha.cs:51-72 | Algorithm.CSharp/Alphas/MeanReversionLunchBreakAlpha.cs:44-66 | Algorithm.CSharp/Alphas/SykesShortMicroCapAlpha.cs:38-60 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 18+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 18+ corresponding lines) Algorithm.CSharp/BasicTemplateOptionsDailyAlgorithm.cs:62 — Algorithm.CSharp/BasicTemplateOptionsDailyAlgorithm.cs:62-79 | Algorithm.CSharp/BasicTemplateSPXWeeklyIndexOptionsAlgorithm.cs:64-86 | Algorithm.CSharp/OptionResolutionRegressionAlgorithm.cs:56-76 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 6+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 6+ corresponding lines) Algorithm.Python/FutureOptionCallITMExpiryRegressionAlgorithm.py:110 — Algorithm.Python/FutureOptionCallITMExpiryRegressionAlgorithm.py:110-117 | Algorithm.Python/FutureOptionPutITMExpiryRegressionAlgorithm.py:109-116 | Algorithm.Python/IndexOptionCallITMExpiryRegressionAlgorithm.py:92-97 | Algorithm.Python/IndexOptionCallOTMExpiryRegressionAlgorithm.py:94-101 | Algorithm.Python/IndexOptionPutITMExpiryRegressionAlgorithm.py:89-94 | Algorithm.Python/IndexOptionPutOTMExpiryRegressionAlgorithm.py:94-101 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 23+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 23+ corresponding lines) Algorithm.CSharp/CoarseFineFundamentalComboAlgorithm.cs:86 — Algorithm.CSharp/CoarseFineFundamentalComboAlgorithm.cs:86-108 | Algorithm.CSharp/NoUniverseSelectorRegressionAlgorithm.cs:44-68 | Algorithm.CSharp/UniverseSelectionDefinitionsAlgorithm.cs:51-73 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (8 members, 11+ corresponding lines) · ×1
  • Edited copies of one member (8 members, 11+ corresponding lines) Algorithm/QCAlgorithm.Indicators.cs:1750 — Algorithm/QCAlgorithm.Indicators.cs:1750-1760 | Algorithm/QCAlgorithm.Indicators.cs:1772-1782 | Algorithm/QCAlgorithm.Indicators.cs:2884-2894 | Algorithm/QCAlgorithm.Indicators.cs:2905-2915 | Algorithm/QCAlgorithm.Indicators.cs:2926-2936 | Algorithm/QCAlgorithm.Indicators.cs:2947-2957 | Algorithm/QCAlgorithm.Indicators.cs:3002-3012 | Algorithm/QCAlgorithm.Indicators.cs:3040-3050 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 10+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 10+ corresponding lines) Algorithm.CSharp/BasicTemplateOptionsAlgorithm.cs:41 — Algorithm.CSharp/BasicTemplateOptionsAlgorithm.cs:41-58 | Algorithm.CSharp/NonDynamicOptionsFilterRegressionAlgorithm.cs:38-50 | Algorithm.CSharp/OptionFilterReturnsNullRegressionAlgorithm.cs:38-57 | Algorithm.CSharp/OptionNoTimeInUniverseRegressionAlgorithm.cs:35-49 | Algorithm.CSharp/WarmupLowerResolutionOptionRegressionAlgorithm.cs:36-45 | Algorithm.CSharp/WarmupOptionRegressionAlgorithm.cs:36-46 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 7+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 7+ corresponding lines) Algorithm/QCAlgorithm.Indicators.cs:722 — Algorithm/QCAlgorithm.Indicators.cs:722-728 | Algorithm/QCAlgorithm.Indicators.cs:990-996 | Algorithm/QCAlgorithm.Indicators.cs:1204-1210 | Algorithm/QCAlgorithm.Indicators.cs:2047-2053 | Algorithm/QCAlgorithm.Indicators.cs:2436-2442 | Algorithm/QCAlgorithm.Indicators.cs:2611-2617 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 2+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 2+ corresponding lines) Algorithm.Python/CoarseFineFundamentalRegressionAlgorithm.py:42 — Algorithm.Python/CoarseFineFundamentalRegressionAlgorithm.py:42-47 | Algorithm.Python/SectorExposureRiskFrameworkAlgorithm.py:48-49 | Algorithm.Python/SectorWeightingFrameworkAlgorithm.py:44-45 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 2 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (7 members, 8+ corresponding lines) · ×1
  • Edited copies of one member (7 members, 8+ corresponding lines) Common/Data/Fundamental/Generated/AuditorReportStatus.cs:83 — Common/Data/Fundamental/Generated/AuditorReportStatus.cs:83-90 | Common/Data/Fundamental/Generated/EarningReportsAccessionNumber.cs:83-90 | Common/Data/Fundamental/Generated/EarningReportsFormType.cs:83-90 | Common/Data/Fundamental/Generated/EarningReportsPeriodType.cs:83-90 | Common/Data/Fundamental/Generated/FinancialStatementsAccessionNumber.cs:83-90 | Common/Data/Fundamental/Generated/FinancialStatementsFormType.cs:83-90 | Common/Data/Fundamental/Generated/FinancialStatementsPeriodType.cs:83-90 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 8+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 8+ corresponding lines) Algorithm.CSharp/HourReverseSplitRegressionAlgorithm.cs:33 — Algorithm.CSharp/HourReverseSplitRegressionAlgorithm.cs:33-40 | Algorithm.CSharp/HourSplitRegressionAlgorithm.cs:38-45 | Algorithm.CSharp/ScaledRawHistoryAlgorithm.cs:37-44 | Algorithm.CSharp/SplitOnTradeBuilderRegressionAlgorithm.cs:36-43 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 5+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 5+ corresponding lines) Indicators/CandlestickPatterns/Hammer.cs:53 — Indicators/CandlestickPatterns/Hammer.cs:53-58 | Indicators/CandlestickPatterns/HangingMan.cs:53-58 | Indicators/CandlestickPatterns/InvertedHammer.cs:51-55 | Indicators/CandlestickPatterns/ShootingStar.cs:52-56 | Indicators/CandlestickPatterns/ThreeStarsInSouth.cs:55-60 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 4+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 4+ corresponding lines) Algorithm.Python/CustomIndicatorAlgorithm.py:71 — Algorithm.Python/CustomIndicatorAlgorithm.py:71-74 | Algorithm.Python/CustomIndicatorWithExtensionAlgorithm.py:83-87 | Algorithm.Python/CustomWarmUpPeriodIndicatorAlgorithm.py:107-110 | Algorithm.Python/SecurityDynamicPropertyPythonClassAlgorithm.py:57-60 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 3+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 3+ corresponding lines) Algorithm.Python/CoarseFineFundamentalComboAlgorithm.py:48 — Algorithm.Python/CoarseFineFundamentalComboAlgorithm.py:48-51 | Algorithm.Python/CoarseFundamentalTop3Algorithm.py:46-49 | Algorithm.Python/RawPricesCoarseUniverseAlgorithm.py:54-57 | Algorithm.Python/ScheduledQueuingAlgorithm.py:40-42 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 5+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 5+ corresponding lines) Algorithm.CSharp/DailyResolutionVsTimeSpanRegressionAlgorithm.cs:67 — Algorithm.CSharp/DailyResolutionVsTimeSpanRegressionAlgorithm.cs:67-71 | Algorithm.CSharp/DailyResolutionVsTimeSpanWithMinuteEquityAlgorithm.cs:23-27 | Algorithm.CSharp/DailyResolutionVsTimeSpanWithSecondEquityAlgorithm.cs:23-27 | Algorithm.CSharp/DailyResolutionVsTimeSpanWithTickResolutionEquityAlgorithm.cs:22-26 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (1 corresponding lines) · ×1
  • Edited copy of a member (1 corresponding lines) Algorithm.Python/SpreadExecutionModelRegressionAlgorithm.py:51 — Algorithm.Python/SpreadExecutionModelRegressionAlgorithm.py:51-51 | Algorithm.Python/VolumeWeightedAveragePriceExecutionModelRegressionAlgorithm.py:55-55 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (466 lines × 2) · ×1
  • Duplicated block (466 lines × 2) Common/Securities/Future/Futures.cs:345 — Common/Securities/Future/Futures.cs:345-810 | Common/Securities/Future/Futures.cs:818-1283 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Common/Securities/Future/Futures.cs:342` calls `Obsolete` and `Common/Securities/Future/Futures.cs:811` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (69 lines × 2) · ×1
  • Duplicated block (69 lines × 2) Common/Util/LeanData.cs:332 — Common/Util/LeanData.cs:332-400 | Common/Util/LeanData.cs:403-471 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (52 lines × 2) · ×1
  • Duplicated block (52 lines × 2) Common/Orders/Fills/EquityFillModel.cs:312 — Common/Orders/Fills/EquityFillModel.cs:312-363 | Common/Orders/Fills/FillModel.cs:514-565 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Common/Orders/Fills/EquityFillModel.cs:312` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (54 lines × 2) · ×1
  • Duplicated block (54 lines × 2) Indicators/CandlestickPatterns/Kicking.cs:76 — Indicators/CandlestickPatterns/Kicking.cs:76-129 | Indicators/CandlestickPatterns/KickingByLength.cs:77-130 — before extracting anything, compare `Indicators/CandlestickPatterns/Kicking.cs` and `Indicators/CandlestickPatterns/KickingByLength.cs` as WHOLE FILES: 87% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (44 lines × 2) · ×1
  • Duplicated block (44 lines × 2) Common/Orders/Fills/EquityFillModel.cs:821 — Common/Orders/Fills/EquityFillModel.cs:821-864 | Common/Orders/Fills/EquityFillModel.cs:930-973 — both copies are in the same file, so extract the 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:821` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (39 lines × 2) · ×1
  • Duplicated block (39 lines × 2) Common/Orders/Fills/FillModel.cs:360 — Common/Orders/Fills/FillModel.cs:360-398 | Common/Orders/Fills/FutureFillModel.cs:130-168 — before extracting anything, compare `Common/Orders/Fills/FillModel.cs` and `Common/Orders/Fills/FutureFillModel.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Common/Orders/Fills/FillModel.cs:360` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (34–39 lines × 2) · ×1
  • Duplicated block (34–39 lines × 2) Algorithm.CSharp/BasicTemplateCryptoFutureAlgorithm.cs:89 — Algorithm.CSharp/BasicTemplateCryptoFutureAlgorithm.cs:89-127 | Algorithm.CSharp/BybitCryptoFuturesRegressionAlgorithm.cs:87-120 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/BasicTemplateCryptoFutureAlgorithm.cs:89` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (38 lines × 2) · ×1
  • Duplicated block (38 lines × 2) Algorithm.CSharp/IndexOptionCallButterflyAlgorithm.cs:49 — Algorithm.CSharp/IndexOptionCallButterflyAlgorithm.cs:49-86 | Algorithm.CSharp/IndexOptionPutButterflyAlgorithm.cs:49-86 — before extracting anything, compare `Algorithm.CSharp/IndexOptionCallButterflyAlgorithm.cs` and `Algorithm.CSharp/IndexOptionPutButterflyAlgorithm.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (22–36 lines × 2) · ×1
  • Duplicated block (22–36 lines × 2) Algorithm.CSharp/OptionUniverseFilterOptionsDataLinqRegressionAlgorithm.cs:30 — Algorithm.CSharp/OptionUniverseFilterOptionsDataLinqRegressionAlgorithm.cs:30-65 | Algorithm.CSharp/OptionUniverseFilterOptionsDataRegressionAlgorithm.cs:43-64 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/OptionUniverseFilterOptionsDataLinqRegressionAlgorithm.cs:30` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Algorithm.CSharp/OptionUniverseFilterOptionsDataRegressionAlgorithm.cs:42` calls `Contracts` and `Algorithm.CSharp/OptionUniverseFilterOptionsDataLinqRegressionAlgorithm.cs:29` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (33–34 lines × 2) · ×1
  • Duplicated block (33–34 lines × 2) Algorithm/QCAlgorithm.Python.cs:759 — Algorithm/QCAlgorithm.Python.cs:759-792 | Algorithm/QCAlgorithm.Python.cs:831-863 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (31 lines × 2) · ×1
  • Duplicated block (31 lines × 2) Indicators/CandlestickPatterns/Hammer.cs:86 — Indicators/CandlestickPatterns/Hammer.cs:86-116 | Indicators/CandlestickPatterns/HangingMan.cs:86-116 — before extracting anything, compare `Indicators/CandlestickPatterns/Hammer.cs` and `Indicators/CandlestickPatterns/HangingMan.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 66 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/Hammer.cs:86` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (23–30 lines × 2) · ×1
  • Duplicated block (23–30 lines × 2) Common/Securities/Option/OptionFilterUniverse.cs:798 — Common/Securities/Option/OptionFilterUniverse.cs:798-820 | Common/Securities/Option/OptionFilterUniverse.cs:851-880 — both copies are in the same file, so extract the 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/Securities/Option/OptionFilterUniverse.cs:798` 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 (23 lines × 3) · ×1
  • Duplicated block (23 lines × 3) Algorithm.CSharp/OptionStrategyFilteringUniverseBoxSpreadRegressionAlgorithm.cs:52 — Algorithm.CSharp/OptionStrategyFilteringUniverseBoxSpreadRegressionAlgorithm.cs:52-74 | Algorithm.CSharp/OptionStrategyFilteringUniverseIronCondorRegressionAlgorithm.cs:54-76 | Algorithm.CSharp/OptionStrategyFilteringUniverseJellyRollRegressionAlgorithm.cs:52-74 — before extracting anything, compare `Algorithm.CSharp/OptionStrategyFilteringUniverseBoxSpreadRegressionAlgorithm.cs` and `Algorithm.CSharp/OptionStrategyFilteringUniverseIronCondorRegressionAlgorithm.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/OptionStrategyFilteringUniverseBoxSpreadRegressionAlgorithm.cs:52` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (25 lines × 3) · ×1
  • Duplicated block (25 lines × 3) Indicators/CandlestickPatterns/InNeck.cs:76 — Indicators/CandlestickPatterns/InNeck.cs:76-100 | Indicators/CandlestickPatterns/OnNeck.cs:76-100 | Indicators/CandlestickPatterns/Thrusting.cs:78-102 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/InNeck.cs:76` 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 (25–28 lines × 2) · ×1
  • Duplicated block (25–28 lines × 2) Algorithm.CSharp/CustomDataUniverseImmediateSelectionRegressionAlgorithm.cs:116 — Algorithm.CSharp/CustomDataUniverseImmediateSelectionRegressionAlgorithm.cs:116-143 | Algorithm.CSharp/DropboxBaseDataUniverseSelectionAlgorithm.cs:164-188 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (25 lines × 2) · ×1
  • Duplicated block (25 lines × 2) Algorithm.CSharp/OptionEquityJellyRollRegressionAlgorithm.cs:38 — Algorithm.CSharp/OptionEquityJellyRollRegressionAlgorithm.cs:38-62 | Algorithm.CSharp/OptionEquityShortJellyRollRegressionAlgorithm.cs:38-62 — before extracting anything, compare `Algorithm.CSharp/OptionEquityJellyRollRegressionAlgorithm.cs` and `Algorithm.CSharp/OptionEquityShortJellyRollRegressionAlgorithm.cs` as WHOLE FILES: 84% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `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.
D4 · Code Duplication · Duplicated block (21–26 lines × 2) · ×1
  • Duplicated block (21–26 lines × 2) Algorithm.CSharp/OptionRenameDailyRegressionAlgorithm.cs:106 — Algorithm.CSharp/OptionRenameDailyRegressionAlgorithm.cs:106-131 | Algorithm.CSharp/OptionRenameRegressionAlgorithm.cs:98-118 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/OptionRenameDailyRegressionAlgorithm.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.
D4 · Code Duplication · Duplicated block (24–26 lines × 2) · ×1
  • Duplicated block (24–26 lines × 2) Algorithm.Framework/Portfolio/MeanVarianceOptimizationPortfolioConstructionModel.cs:247 — Algorithm.Framework/Portfolio/MeanVarianceOptimizationPortfolioConstructionModel.cs:247-272 | Algorithm.Framework/Portfolio/RiskParityPortfolioConstructionModel.cs:189-212 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.Framework/Portfolio/MeanVarianceOptimizationPortfolioConstructionModel.cs:247` 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 (15–25 lines × 2) · ×1
  • Duplicated block (15–25 lines × 2) Report/ReportElements/AnnualReturnsReportElement.cs:50 — Report/ReportElements/AnnualReturnsReportElement.cs:50-74 | Report/ReportElements/CumulativeReturnsReportElement.cs:60-74 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Report/ReportElements/AnnualReturnsReportElement.cs:50` 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 (19–24 lines × 8) · ×1
  • Duplicated block (19–24 lines × 8) Algorithm.CSharp/OptionStrategyFilteringUniverseCallButterflyRegressionAlgorithm.cs:50 — Algorithm.CSharp/OptionStrategyFilteringUniverseCallButterflyRegressionAlgorithm.cs:50-73 | Algorithm.CSharp/OptionStrategyFilteringUniverseCallCalendarSpreadRegressionAlgorithm.cs:49-67 | Algorithm.CSharp/OptionStrategyFilteringUniverseCallLadderRegressionAlgorithm.cs:50-73 | Algorithm.CSharp/OptionStrategyFilteringUniverseCallSpreadRegressionAlgorithm.cs:49-67 | Algorithm.CSharp/OptionStrategyFilteringUniversePutButterflyRegressionAlgorithm.cs:50-73 | Algorithm.CSharp/OptionStrategyFilteringUniversePutCalendarSpreadRegressionAlgorithm.cs:49-67 | Algorithm.CSharp/OptionStrategyFilteringUniversePutLadderRegressionAlgorithm.cs:50-73 | Algorithm.CSharp/OptionStrategyFilteringUniversePutSpreadRegressionAlgorithm.cs:49-67 — before extracting anything, compare `Algorithm.CSharp/OptionStrategyFilteringUniverseCallButterflyRegressionAlgorithm.cs` and `Algorithm.CSharp/OptionStrategyFilteringUniversePutButterflyRegressionAlgorithm.cs` as WHOLE FILES: 83% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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 (22–24 lines × 2) · ×1
  • Duplicated block (22–24 lines × 2) Common/Brokerages/TradingTechnologiesBrokerageModel.cs:115 — Common/Brokerages/TradingTechnologiesBrokerageModel.cs:115-136 | Common/Brokerages/ZerodhaBrokerageModel.cs:112-135 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Common/Brokerages/TradingTechnologiesBrokerageModel.cs:115` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (21–23 lines × 2) · ×1
  • Duplicated block (21–23 lines × 2) Algorithm.CSharp/OptionEquityBearPutSpreadRegressionAlgorithm.cs:36 — Algorithm.CSharp/OptionEquityBearPutSpreadRegressionAlgorithm.cs:36-58 | Algorithm.CSharp/OptionEquityBullPutSpreadRegressionAlgorithm.cs:36-56 — before extracting anything, compare `Algorithm.CSharp/OptionEquityBearPutSpreadRegressionAlgorithm.cs` and `Algorithm.CSharp/OptionEquityBullPutSpreadRegressionAlgorithm.cs` as WHOLE FILES: 87% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `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.
D4 · Code Duplication · Duplicated block (12–22 lines × 5) · ×1
  • Duplicated block (12–22 lines × 5) REDACTED:126 — REDACTED:126-147 | Algorithm.CSharp/CustomDataBitcoinAlgorithm.cs:82-93 | Algorithm.CSharp/CustomDataPropertiesRegressionAlgorithm.cs:173-184 | REDACTED:173-194 | REDACTED:138-149 — before extracting anything, compare `REDACTED` and `Algorithm.CSharp/CustomDataBitcoinAlgorithm.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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 (19 lines × 5) · ×1
  • Duplicated block (19 lines × 5) REDACTED:195 — REDACTED:195-213 | Algorithm.CSharp/CustomDataBitcoinAlgorithm.cs:148-166 | Algorithm.CSharp/CustomDataPropertiesRegressionAlgorithm.cs:238-256 | REDACTED:242-260 | REDACTED:204-222 — before extracting anything, compare `REDACTED` and `Algorithm.CSharp/CustomDataBitcoinAlgorithm.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:195` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:216` calls `AddDays` and `REDACTED:225` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (19–21 lines × 3) · ×1
  • Duplicated block (19–21 lines × 3) Common/Orders/Fills/EquityFillModel.cs:1083 — Common/Orders/Fills/EquityFillModel.cs:1083-1101 | Common/Orders/Fills/FillModel.cs:1197-1215 | Common/Orders/Fills/LatestPriceFillModel.cs:58-78 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Common/Orders/Fills/EquityFillModel.cs:1101` calls `Contains` and `Common/Orders/Fills/LatestPriceFillModel.cs:78` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (16–21 lines × 2) · ×1
  • Duplicated block (16–21 lines × 2) Common/Securities/Option/OptionFilterUniverse.cs:465 — Common/Securities/Option/OptionFilterUniverse.cs:465-480 | Common/Securities/Option/OptionFilterUniverse.cs:751-771 — both copies are in the same file, so extract the 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/Securities/Option/OptionFilterUniverse.cs:465` 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 (20–21 lines × 2) · ×1
  • Duplicated block (20–21 lines × 2) Algorithm.CSharp/AddAlphaModelAlgorithm.cs:41 — Algorithm.CSharp/AddAlphaModelAlgorithm.cs:41-60 | Algorithm.CSharp/InsightTagAlphaRegressionAlgorithm.cs:39-59 — before extracting anything, compare `Algorithm.CSharp/AddAlphaModelAlgorithm.cs` and `Algorithm.CSharp/InsightTagAlphaRegressionAlgorithm.cs` as WHOLE FILES: 86% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (16–20 lines × 2) · ×1
  • Duplicated block (16–20 lines × 2) Algorithm/Selection/CustomUniverse.cs:52 — Algorithm/Selection/CustomUniverse.cs:52-67 | Algorithm/Selection/ManualUniverse.cs:64-83 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (15–20 lines × 2) · ×1
  • Duplicated block (15–20 lines × 2) Algorithm.CSharp/IsMarketOpenCheckAlgorithm.cs:51 — Algorithm.CSharp/IsMarketOpenCheckAlgorithm.cs:51-70 | Algorithm.CSharp/IsMarketOpenCheckWithExtendedMarketHoursAlgorithm.cs:28-42 — before extracting anything, compare `Algorithm.CSharp/IsMarketOpenCheckAlgorithm.cs` and `Algorithm.CSharp/IsMarketOpenCheckWithExtendedMarketHoursAlgorithm.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/IsMarketOpenCheckAlgorithm.cs:51` 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 (19–20 lines × 2) · ×1
  • Duplicated block (19–20 lines × 2) Algorithm.Framework/Portfolio/BlackLittermanOptimizationPortfolioConstructionModel.cs:278 — Algorithm.Framework/Portfolio/BlackLittermanOptimizationPortfolioConstructionModel.cs:278-296 | Algorithm.Framework/Portfolio/MeanVarianceOptimizationPortfolioConstructionModel.cs:269-288 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.Framework/Portfolio/BlackLittermanOptimizationPortfolioConstructionModel.cs:278` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16–19 lines × 4) · ×1
  • Duplicated block (16–19 lines × 4) Algorithm.CSharp/BasicTemplateFuturesDailyAlgorithm.cs:72 — Algorithm.CSharp/BasicTemplateFuturesDailyAlgorithm.cs:72-90 | Algorithm.CSharp/BasicTemplateMultiAssetAlgorithm.cs:92-108 | Algorithm.CSharp/FutureSharingTickerRegressionAlgorithm.cs:51-66 | Algorithm.CSharp/FuturesMomentumAlgorithm.cs:70-86 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/BasicTemplateFuturesDailyAlgorithm.cs:72` 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 (14–19 lines × 2) · ×1
  • Duplicated block (14–19 lines × 2) Common/Orders/Fills/EquityFillModel.cs:624 — Common/Orders/Fills/EquityFillModel.cs:624-637 | Common/Orders/Fills/FillModel.cs:828-846 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Common/Orders/Fills/EquityFillModel.cs:624` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (16–19 lines × 2) · ×1
  • Duplicated block (16–19 lines × 2) Algorithm.CSharp/CustomDataUniverseRegressionAlgorithm.cs:49 — Algorithm.CSharp/CustomDataUniverseRegressionAlgorithm.cs:49-64 | Algorithm.CSharp/CustomDataUniverseScheduledRegressionAlgorithm.cs:47-65 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/CustomDataUniverseRegressionAlgorithm.cs:49` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (18 lines × 3) · ×1
  • Duplicated block (18 lines × 3) Indicators/CandlestickPatterns/BeltHold.cs:73 — Indicators/CandlestickPatterns/BeltHold.cs:73-92 | Indicators/CandlestickPatterns/ClosingMarubozu.cs:73-92 | Indicators/CandlestickPatterns/Marubozu.cs:73-90 — before extracting anything, compare `Indicators/CandlestickPatterns/BeltHold.cs` and `Indicators/CandlestickPatterns/ClosingMarubozu.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/BeltHold.cs:73` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (14–18 lines × 2) · ×1
  • Duplicated block (14–18 lines × 2) Algorithm.CSharp/AddUniverseSelectionModelAlgorithm.cs:36 — Algorithm.CSharp/AddUniverseSelectionModelAlgorithm.cs:36-49 | Algorithm.CSharp/AddUniverseSelectionModelCoarseAlgorithm.cs:36-53 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (15–18 lines × 2) · ×1
  • Duplicated block (15–18 lines × 2) Algorithm.CSharp/OptionEquityBearCallSpreadRegressionAlgorithm.cs:43 — Algorithm.CSharp/OptionEquityBearCallSpreadRegressionAlgorithm.cs:43-60 | Algorithm.CSharp/OptionEquityBullCallSpreadRegressionAlgorithm.cs:43-57 — before extracting anything, compare `Algorithm.CSharp/OptionEquityBearCallSpreadRegressionAlgorithm.cs` and `Algorithm.CSharp/OptionEquityBullCallSpreadRegressionAlgorithm.cs` as WHOLE FILES: 85% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/OptionEquityBearCallSpreadRegressionAlgorithm.cs:43` 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 (13–17 lines × 10) · ×1
  • Duplicated block (13–17 lines × 10) Common/Brokerages/AxosClearingBrokerageModel.cs:112 — Common/Brokerages/AxosClearingBrokerageModel.cs:112-127 | Common/Brokerages/BitfinexBrokerageModel.cs:146-159 | Common/Brokerages/BloombergFixBrokerageModel.cs:71-83 | Common/Brokerages/CoinbaseBrokerageModel.cs:187-199 | Common/Brokerages/FxcmBrokerageModel.cs:87-102 | Common/Brokerages/KrakenBrokerageModel.cs:105-119 | Common/Brokerages/OandaBrokerageModel.cs:92-107 | Common/Brokerages/QuantBridgeBrokerageModel.cs:66-78 | Common/Brokerages/TradingTechnologiesBrokerageModel.cs:112-127 | Common/Brokerages/ZerodhaBrokerageModel.cs:109-125 — before extracting anything, compare `Common/Brokerages/FxcmBrokerageModel.cs` and `Common/Brokerages/OandaBrokerageModel.cs` as WHOLE FILES: 88% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (14–17 lines × 2) · ×1
  • Duplicated block (14–17 lines × 2) Algorithm.CSharp/PortfolioRebalanceOnCustomFuncRegressionAlgorithm.cs:42 — Algorithm.CSharp/PortfolioRebalanceOnCustomFuncRegressionAlgorithm.cs:42-58 | Algorithm.CSharp/PortfolioRebalanceOnDateRulesRegressionAlgorithm.cs:46-59 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/PortfolioRebalanceOnCustomFuncRegressionAlgorithm.cs:42` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (15–16 lines × 3) · ×1
  • Duplicated block (15–16 lines × 3) Common/Util/LeanData.cs:178 — Common/Util/LeanData.cs:178-192 | Common/Util/LeanData.cs:373-388 | Common/Util/LeanData.cs:444-459 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Common/Util/LeanData.cs:178` 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.
D4 · Code Duplication · Duplicated block (16 lines × 3) · ×1
  • Duplicated block (16 lines × 3) Indicators/CandlestickPatterns/InNeck.cs:104 — Indicators/CandlestickPatterns/InNeck.cs:104-119 | Indicators/CandlestickPatterns/OnNeck.cs:104-119 | Indicators/CandlestickPatterns/Thrusting.cs:107-122 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Indicators/CandlestickPatterns/InNeck.cs:104` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (13–15 lines × 6) · ×1
  • Duplicated block (13–15 lines × 6) Common/Brokerages/CharlesSchwabBrokerageModel.cs:98 — Common/Brokerages/CharlesSchwabBrokerageModel.cs:98-110 | Common/Brokerages/EzeBrokerageModel.cs:97-111 | Common/Brokerages/PublicBrokerageModel.cs:90-102 | Common/Brokerages/TDAmeritradeBrokerageModel.cs:73-87 | Common/Brokerages/TastytradeBrokerageModel.cs:98-110 | Common/Brokerages/TradeStationBrokerageModel.cs:140-152 — before extracting anything, compare `Common/Brokerages/CharlesSchwabBrokerageModel.cs` and `Common/Brokerages/PublicBrokerageModel.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (12 lines × 4) · ×1
  • Duplicated block (12 lines × 4) Common/Data/Market/QuoteBar.cs:319 — Common/Data/Market/QuoteBar.cs:319-330 | Common/Data/Market/QuoteBar.cs:368-379 | Common/Data/Market/TradeBar.cs:230-241 | Common/Data/Market/TradeBar.cs:294-305 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Common/Data/Market/QuoteBar.cs:319` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Common/Data/Market/TradeBar.cs:228` calls `ParseIndex` and `Common/Data/Market/QuoteBar.cs:317` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (9–15 lines × 2) · ×1
  • Duplicated block (9–15 lines × 2) Algorithm.CSharp/OptionChainSubscriptionRemovalRegressionAlgorithm.cs:74 — Algorithm.CSharp/OptionChainSubscriptionRemovalRegressionAlgorithm.cs:74-88 | Algorithm.CSharp/OptionChainUniverseRemovalRegressionAlgorithm.cs:184-192 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×1
  • Duplicated block (14–15 lines × 2) Algorithm.CSharp/SecurityInitializationOnReAdditionForEquityRegressionAlgorithm.cs:48 — Algorithm.CSharp/SecurityInitializationOnReAdditionForEquityRegressionAlgorithm.cs:48-61 | Algorithm.CSharp/SecurityInitializationOnReAdditionForUniverseSelectionRegressionAlgorithm.cs:48-62 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (12 lines × 9) · ×1
  • Duplicated block (12 lines × 9) Algorithm.CSharp/FutureOptionCallITMExpiryRegressionAlgorithm.cs:45 — Algorithm.CSharp/FutureOptionCallITMExpiryRegressionAlgorithm.cs:45-56 | Algorithm.CSharp/FutureOptionCallOTMExpiryRegressionAlgorithm.cs:51-62 | Algorithm.CSharp/FutureOptionPutITMExpiryRegressionAlgorithm.cs:46-57 | Algorithm.CSharp/FutureOptionPutOTMExpiryRegressionAlgorithm.cs:50-61 | Algorithm.CSharp/FutureOptionShortCallITMExpiryRegressionAlgorithm.cs:46-57 | Algorithm.CSharp/FutureOptionShortCallOTMExpiryRegressionAlgorithm.cs:47-58 | Algorithm.CSharp/FutureOptionShortPutITMExpiryRegressionAlgorithm.cs:46-57 | Algorithm.CSharp/FutureOptionShortPutOTMExpiryRegressionAlgorithm.cs:47-58 | Algorithm.CSharp/OptionOTMExpiryOrderHasZeroPriceRegressionAlgorithm.cs:52-63 — before extracting anything, compare `Algorithm.CSharp/FutureOptionCallITMExpiryRegressionAlgorithm.cs` and `Algorithm.CSharp/FutureOptionCallOTMExpiryRegressionAlgorithm.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/FutureOptionCallITMExpiryRegressionAlgorithm.cs:45` 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–14 lines × 5) · ×1
  • Duplicated block (13–14 lines × 5) Algorithm.CSharp/OptionEquityCallButterflyRegressionAlgorithm.cs:43 — Algorithm.CSharp/OptionEquityCallButterflyRegressionAlgorithm.cs:43-56 | Algorithm.CSharp/OptionEquityPutButterflyRegressionAlgorithm.cs:43-56 | Algorithm.CSharp/OptionEquityShortButterflyCallRegressionAlgorithm.cs:43-55 | Algorithm.CSharp/OptionEquityShortButterflyPutRegressionAlgorithm.cs:43-55 | Algorithm.CSharp/OptionEquityStrategyMatcherRegressionAlgorithm.cs:48-61 — before extracting anything, compare `Algorithm.CSharp/OptionEquityCallButterflyRegressionAlgorithm.cs` and `Algorithm.CSharp/OptionEquityShortButterflyCallRegressionAlgorithm.cs` as WHOLE FILES: 84% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/OptionEquityCallButterflyRegressionAlgorithm.cs:43` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (8–14 lines × 3) · ×1
  • Duplicated block (8–14 lines × 3) Common/Orders/Fills/EquityFillModel.cs:483 — Common/Orders/Fills/EquityFillModel.cs:483-496 | Common/Orders/Fills/EquityFillModel.cs:624-631 | Common/Orders/Fills/FillModel.cs:828-840 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Common/Orders/Fills/EquityFillModel.cs:483` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `order` to `MarketOnOpenOrder` in one and `MarketOnCloseOrder` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (11–14 lines × 3) · ×1
  • Duplicated block (11–14 lines × 3) Algorithm.CSharp/IsMarketOpenCheckAlgorithm.cs:52 — Algorithm.CSharp/IsMarketOpenCheckAlgorithm.cs:52-65 | Algorithm.CSharp/IsMarketOpenCheckAlgorithm.cs:70-80 | Algorithm.CSharp/IsMarketOpenCheckWithExtendedMarketHoursAlgorithm.cs:62-72 — before extracting anything, compare `Algorithm.CSharp/IsMarketOpenCheckAlgorithm.cs` and `Algorithm.CSharp/IsMarketOpenCheckWithExtendedMarketHoursAlgorithm.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/IsMarketOpenCheckAlgorithm.cs:70` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (12–14 lines × 2) · ×1
  • Duplicated block (12–14 lines × 2) Common/Util/LeanData.cs:97 — Common/Util/LeanData.cs:97-108 | Common/Util/LeanData.cs:260-273 — both copies are in the same file, so extract the 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:97` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (12–13 lines × 5) · ×1
  • Duplicated block (12–13 lines × 5) Common/Brokerages/CharlesSchwabBrokerageModel.cs:96 — Common/Brokerages/CharlesSchwabBrokerageModel.cs:96-108 | Common/Brokerages/PublicBrokerageModel.cs:88-99 | Common/Brokerages/RBIBrokerageModel.cs:70-81 | Common/Brokerages/TDAmeritradeBrokerageModel.cs:71-83 | Common/Brokerages/TastytradeBrokerageModel.cs:96-108 — before extracting anything, compare `Common/Brokerages/CharlesSchwabBrokerageModel.cs` and `Common/Brokerages/PublicBrokerageModel.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Common/Brokerages/CharlesSchwabBrokerageModel.cs:96` 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 (11–12 lines × 7) · ×1
  • Duplicated block (11–12 lines × 7) Common/Brokerages/CharlesSchwabBrokerageModel.cs:98 — Common/Brokerages/CharlesSchwabBrokerageModel.cs:98-108 | Common/Brokerages/EzeBrokerageModel.cs:97-108 | Common/Brokerages/PublicBrokerageModel.cs:90-100 | Common/Brokerages/RBIBrokerageModel.cs:71-82 | Common/Brokerages/TDAmeritradeBrokerageModel.cs:73-84 | Common/Brokerages/TastytradeBrokerageModel.cs:98-108 | Common/Brokerages/TradeStationBrokerageModel.cs:140-150 — before extracting anything, compare `Common/Brokerages/CharlesSchwabBrokerageModel.cs` and `Common/Brokerages/PublicBrokerageModel.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Common/Brokerages/CharlesSchwabBrokerageModel.cs:98` 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 (12 lines × 6) · ×1
  • Duplicated block (12 lines × 6) Common/Util/LeanData.cs:165 — Common/Util/LeanData.cs:165-176 | Common/Util/LeanData.cs:181-192 | Common/Util/LeanData.cs:353-365 | Common/Util/LeanData.cs:376-388 | Common/Util/LeanData.cs:424-436 | Common/Util/LeanData.cs:447-459 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Common/Util/LeanData.cs:165` 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. 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 × 6) · ×1
  • Duplicated block (9 lines × 6) Algorithm.CSharp/OptionEquityBoxSpreadRegressionAlgorithm.cs:37 — Algorithm.CSharp/OptionEquityBoxSpreadRegressionAlgorithm.cs:37-45 | Algorithm.CSharp/OptionEquityIronButterflyRegressionAlgorithm.cs:37-45 | Algorithm.CSharp/OptionEquityIronCondorRegressionAlgorithm.cs:37-45 | Algorithm.CSharp/OptionEquityShortBoxSpreadRegressionAlgorithm.cs:37-45 | Algorithm.CSharp/OptionEquityShortIronButterflyRegressionAlgorithm.cs:37-45 | Algorithm.CSharp/OptionEquityShortIronCondorRegressionAlgorithm.cs:37-45 — before extracting anything, compare `Algorithm.CSharp/OptionEquityBoxSpreadRegressionAlgorithm.cs` and `Algorithm.CSharp/OptionEquityShortBoxSpreadRegressionAlgorithm.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/OptionEquityBoxSpreadRegressionAlgorithm.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.
D4 · Code Duplication · Duplicated block (9 lines × 5) · ×1
  • Duplicated block (9 lines × 5) Algorithm.CSharp/OptionEquityConversionRegressionAlgorithm.cs:38 — Algorithm.CSharp/OptionEquityConversionRegressionAlgorithm.cs:38-46 | Algorithm.CSharp/OptionEquityProtectiveCollarRegressionAlgorithm.cs:39-47 | Algorithm.CSharp/OptionEquityReverseConversionRegressionAlgorithm.cs:38-46 | Algorithm.CSharp/OptionEquityStraddleRegressionAlgorithm.cs:38-46 | Algorithm.CSharp/OptionEquityStrangleRegressionAlgorithm.cs:38-46 — before extracting anything, compare `Algorithm.CSharp/OptionEquityConversionRegressionAlgorithm.cs` and `Algorithm.CSharp/OptionEquityProtectiveCollarRegressionAlgorithm.cs` as WHOLE FILES: 89% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/OptionEquityConversionRegressionAlgorithm.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.
D4 · Code Duplication · Duplicated block (7–12 lines × 4) · ×1
  • Duplicated block (7–12 lines × 4) Algorithm.CSharp/OptionRenameDailyRegressionAlgorithm.cs:70 — Algorithm.CSharp/OptionRenameDailyRegressionAlgorithm.cs:70-76 | Algorithm.CSharp/OptionRenameDailyRegressionAlgorithm.cs:112-123 | Algorithm.CSharp/OptionRenameRegressionAlgorithm.cs:70-76 | Algorithm.CSharp/OptionRenameRegressionAlgorithm.cs:104-110 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/OptionRenameDailyRegressionAlgorithm.cs:70` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Algorithm.CSharp/OptionRenameRegressionAlgorithm.cs:101` calls `Liquidate` and `Algorithm.CSharp/OptionRenameRegressionAlgorithm.cs:69` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (10–12 lines × 3) · ×1
  • Duplicated block (10–12 lines × 3) Algorithm.CSharp/BasicTemplateMultiAssetAlgorithm.cs:110 — Algorithm.CSharp/BasicTemplateMultiAssetAlgorithm.cs:110-121 | Algorithm.CSharp/BasicTemplateOptionStrategyAlgorithm.cs:68-77 | Algorithm.CSharp/BasicTemplateOptionTradesAlgorithm.cs:61-71 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/BasicTemplateMultiAssetAlgorithm.cs:110` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–12 lines × 3) · ×1
  • Duplicated block (11–12 lines × 3) Algorithm.CSharp/ComboOrderAlgorithm.cs:52 — Algorithm.CSharp/ComboOrderAlgorithm.cs:52-63 | Algorithm.CSharp/ComboOrderTicketDemoAlgorithm.cs:41-52 | Algorithm.CSharp/ContingentComboOrderRegressionAlgorithm.cs:45-55 — before extracting anything, compare `Algorithm.CSharp/ComboOrderAlgorithm.cs` and `Algorithm.CSharp/ComboOrderTicketDemoAlgorithm.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×1
  • Duplicated block (11–12 lines × 2) Algorithm.CSharp/OptionShortCallMarginCallEventsAlgorithm.cs:35 — Algorithm.CSharp/OptionShortCallMarginCallEventsAlgorithm.cs:35-46 | Algorithm.CSharp/SingleOptionPositionGroupBuyingPowerModelRegressionAlgorithm.cs:37-47 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `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 (10 lines × 55) · ×1
  • Duplicated block (10 lines × 55) Common/Data/Fundamental/Generated/AvailableForSaleSecuritiesBalanceSheet.cs:84 — Common/Data/Fundamental/Generated/AvailableForSaleSecuritiesBalanceSheet.cs:84-93 | Common/Data/Fundamental/Generated/BankLoansCurrentBalanceSheet.cs:68-77 | Common/Data/Fundamental/Generated/BankLoansNonCurrentBalanceSheet.cs:68-77 | Common/Data/Fundamental/Generated/BasicAccountingChange.cs:84-93 | Common/Data/Fundamental/Generated/BasicEPSOtherGainsLosses.cs:84-93 | Common/Data/Fundamental/Generated/BasicExtraordinary.cs:100-109 | Common/Data/Fundamental/Generated/CashAndDueFromBanksBalanceSheet.cs:84-93 | Common/Data/Fundamental/Generated/CashReceiptsfromSecuritiesRelatedActivitiesCashFlowStatement.cs:92-101 | Common/Data/Fundamental/Generated/CashReceivedfromInsuranceActivitiesCashFlowStatement.cs:84-93 | Common/Data/Fundamental/Generated/ChangeInOtherWorkingCapitalCashFlowStatement.cs:100-109 | Common/Data/Fundamental/Generated/ChangeinAccruedIncomeCashFlowStatement.cs:84-93 | Common/Data/Fundamental/Generated/ChangeinInsuranceLiabilitiesNetofReinsuranceIncomeStatement.cs:84-93 | Common/Data/Fundamental/Generated/ChangeinInvestmentContractIncomeStatement.cs:84-93 | Common/Data/Fundamental/Generated/ChangeinReinsuranceReceivablesCashFlowStatement.cs:84-93 | Common/Data/Fundamental/Generated/ClaimsOutstandingBalanceSheet.cs:68-77 | Common/Data/Fundamental/Generated/ConvertibleLoansCurrentBalanceSheet.cs:60-69 | Common/Data/Fundamental/Generated/ConvertibleLoansNonCurrentBalanceSheet.cs:68-77 | Common/Data/Fundamental/Generated/DebtSecuritiesinIssueBalanceSheet.cs:68-77 | Common/Data/Fundamental/Generated/DepositsReceivedunderCededInsuranceContractBalanceSheet.cs:68-77 | Common/Data/Fundamental/Generated/DilutedAccountingChange.cs:84-93 | Common/Data/Fundamental/Generated/DilutedEPSOtherGainsLosses.cs:84-93 | Common/Data/Fundamental/Generated/DilutedExtraordinary.cs:100-109 | Common/Data/Fundamental/Generated/EquityInvestmentsBalanceSheet.cs:76-85 | Common/Data/Fundamental/Generated/EquitySharesInvestmentsBalanceSheet.cs:68-77 | Common/Data/Fundamental/Generated/FinanceLeaseReceivablesBalanceSheet.cs:68-77 | Common/Data/Fundamental/Generated/FinanceLeaseReceivablesCurrentBalanceSheet.cs:68-77 | Common/Data/Fundamental/Generated/FinanceLeaseReceivablesNonCurrentBalanceSheet.cs:68-77 | Common/Data/Fundamental/Generated/GainLossonDerecognitionofAvailableForSaleFinancialAssetsIncomeStatement.cs:84-93 | Common/Data/Fundamental/Generated/GainLossonFinancialInstrumentsDesignatedasCashFlowHedgesIncomeStatement.cs:84-93 | Common/Data/Fundamental/Generated/ImpairmentLossReversalRecognizedinProfitorLossCashFlowStatement.cs:84-93 | Common/Data/Fundamental/Generated/ImpairmentLossesReversalsFinancialInstrumentsNetIncomeStatement.cs:84-93 | Common/Data/Fundamental/Generated/LoansandAdvancestoCustomerBalanceSheet.cs:68-77 | Common/Data/Fundamental/Generated/MinorityInterestCashFlowStatement.cs:60-69 | Common/Data/Fundamental/Generated/NegativeGoodwillImmediatelyRecognizedIncomeStatement.cs:76-85 | Common/Data/Fundamental/Generated/NetIncomeFromTaxLossCarryforwardIncomeStatement.cs:84-93 | Common/Data/Fundamental/Generated/NetPolicyholderBenefitsAndClaimsIncomeStatement.cs:84-93 | Common/Data/Fundamental/Generated/NetTradingIncomeIncomeStatement.cs:60-69 | Common/Data/Fundamental/Generated/NormalizedDilutedEPSGrowth.cs:84-93 | Common/Data/Fundamental/Generated/OtherOperatingIncomeTotalIncomeStatement.cs:92-101 | Common/Data/Fundamental/Generated/PreTreShaNumBalanceSheet.cs:68-77 | Common/Data/Fundamental/Generated/ProfitOnDisposalsCashFlowStatement.cs:84-93 | Common/Data/Fundamental/Generated/PurchaseOfSubsidiariesCashFlowStatement.cs:84-93 | Common/Data/Fundamental/Generated/RegressionGrowthOperatingRevenue5Years.cs:60-69 | Common/Data/Fundamental/Generated/RegressionGrowthofDividends5Years.cs:60-69 | Common/Data/Fundamental/Generated/ReinsuranceRecoveriesClaimsandBenefitsIncomeStatement.cs:84-93 | Common/Data/Fundamental/Generated/ReinsuranceRecoveriesofInvestmentContractIncomeStatement.cs:84-93 | Common/Data/Fundamental/Generated/ReorganizationOtherCostsCashFlowStatement.cs:84-93 | Common/Data/Fundamental/Generated/RestructuringAndMergernAcquisitionIncomeStatement.cs:100-109 | Common/Data/Fundamental/Generated/SaleOfSubsidiariesCashFlowStatement.cs:68-77 | Common/Data/Fundamental/Generated/SecuritiesActivitiesIncomeStatement.cs:84-93 | Common/Data/Fundamental/Generated/ShareOfAssociatesCashFlowStatement.cs:84-93 | Common/Data/Fundamental/Generated/TaxAssetsTotalBalanceSheet.cs:68-77 | Common/Data/Fundamental/Generated/TaxLossCarryforwardBasicEPS.cs:84-93 | Common/Data/Fundamental/Generated/TaxLossCarryforwardDilutedEPS.cs:84-93 | Common/Data/Fundamental/Generated/TotalDebtInMaturityScheduleBalanceSheet.cs:68-77 — before extracting anything, compare `Common/Data/Fundamental/Generated/AvailableForSaleSecuritiesBalanceSheet.cs` and `Common/Data/Fundamental/Generated/BankLoansCurrentBalanceSheet.cs` as WHOLE FILES: 82% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (11 lines × 7) · ×1
  • Duplicated block (11 lines × 7) Algorithm.CSharp/OptionStrategyFilteringUniverseBoxSpreadRegressionAlgorithm.cs:55 — Algorithm.CSharp/OptionStrategyFilteringUniverseBoxSpreadRegressionAlgorithm.cs:55-65 | Algorithm.CSharp/OptionStrategyFilteringUniverseConversionRegressionAlgorithm.cs:48-59 | Algorithm.CSharp/OptionStrategyFilteringUniverseIronCondorRegressionAlgorithm.cs:57-67 | Algorithm.CSharp/OptionStrategyFilteringUniverseJellyRollRegressionAlgorithm.cs:55-65 | Algorithm.CSharp/OptionStrategyFilteringUniverseProtectiveCollarRegressionAlgorithm.cs:49-60 | Algorithm.CSharp/OptionStrategyFilteringUniverseStraddleRegressionAlgorithm.cs:48-59 | Algorithm.CSharp/OptionStrategyFilteringUniverseStrangleRegressionAlgorithm.cs:49-60 — before extracting anything, compare `Algorithm.CSharp/OptionStrategyFilteringUniverseBoxSpreadRegressionAlgorithm.cs` and `Algorithm.CSharp/OptionStrategyFilteringUniverseIronCondorRegressionAlgorithm.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/OptionStrategyFilteringUniverseBoxSpreadRegressionAlgorithm.cs:55` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6–11 lines × 4) · ×1
  • Duplicated block (6–11 lines × 4) Report/ReportElements/CumulativeReturnsReportElement.cs:133 — Report/ReportElements/CumulativeReturnsReportElement.cs:133-143 | Report/ReportElements/LeverageUtilizationReportElement.cs:72-78 | Report/ReportElements/RollingPortfolioBetaReportElement.cs:79-84 | Report/ReportElements/RollingSharpeReportElement.cs:73-83 — before extracting anything, compare `Report/ReportElements/LeverageUtilizationReportElement.cs` and `Report/ReportElements/RollingSharpeReportElement.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×1
  • Duplicated block (10–11 lines × 2) Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs:511 — Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs:511-521 | Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs:529-538 — both copies are in the same file, so extract the 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/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs:511` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10 lines × 8) · ×1
  • Duplicated block (10 lines × 8) Algorithm.CSharp/OptionEquityBearCallLadderRegressionAlgorithm.cs:43 — Algorithm.CSharp/OptionEquityBearCallLadderRegressionAlgorithm.cs:43-52 | Algorithm.CSharp/OptionEquityBearPutLadderRegressionAlgorithm.cs:44-53 | Algorithm.CSharp/OptionEquityBullCallLadderRegressionAlgorithm.cs:44-53 | Algorithm.CSharp/OptionEquityBullPutLadderRegressionAlgorithm.cs:43-52 | Algorithm.CSharp/OptionEquityCallBackspreadRegressionAlgorithm.cs:44-53 | Algorithm.CSharp/OptionEquityPutBackspreadRegressionAlgorithm.cs:44-53 | Algorithm.CSharp/OptionEquityShortCallBackspreadRegressionAlgorithm.cs:45-54 | Algorithm.CSharp/OptionEquityShortPutBackspreadRegressionAlgorithm.cs:45-54 — before extracting anything, compare `Algorithm.CSharp/OptionEquityBearCallLadderRegressionAlgorithm.cs` and `Algorithm.CSharp/OptionEquityBullCallLadderRegressionAlgorithm.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/OptionEquityBearCallLadderRegressionAlgorithm.cs:43` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (7–10 lines × 3) · ×1
  • Duplicated block (7–10 lines × 3) Algorithm.CSharp/IndexOptionCallButterflyAlgorithm.cs:67 — Algorithm.CSharp/IndexOptionCallButterflyAlgorithm.cs:67-76 | Algorithm.CSharp/IndexOptionPutButterflyAlgorithm.cs:67-76 | Algorithm.CSharp/LongAndShortButterflyCallStrategiesAlgorithm.cs:51-57 — before extracting anything, compare `Algorithm.CSharp/IndexOptionCallButterflyAlgorithm.cs` and `Algorithm.CSharp/IndexOptionPutButterflyAlgorithm.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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 × 7) · ×1
  • Duplicated block (9 lines × 7) Algorithm.CSharp/AccumulativeInsightPortfolioRegressionAlgorithm.cs:36 — Algorithm.CSharp/AccumulativeInsightPortfolioRegressionAlgorithm.cs:36-46 | Algorithm.CSharp/AddRiskManagementAlgorithm.cs:36-44 | Algorithm.CSharp/BasicTemplateFrameworkAlgorithm.cs:40-55 | Algorithm.CSharp/CompositeRiskManagementModelFrameworkAlgorithm.cs:32-42 | Algorithm.CSharp/ConfidenceWeightedFrameworkAlgorithm.cs:36-50 | Algorithm.CSharp/ExecutionModelOrderEventsRegressionAlgorithm.cs:39-47 | Algorithm.CSharp/InsightWeightingFrameworkAlgorithm.cs:36-50 — before extracting anything, compare `Algorithm.CSharp/BasicTemplateFrameworkAlgorithm.cs` and `Algorithm.CSharp/ExecutionModelOrderEventsRegressionAlgorithm.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/AccumulativeInsightPortfolioRegressionAlgorithm.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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (8 lines × 5) · ×1
  • Duplicated block (8 lines × 5) Algorithm.CSharp/OptionEquityBearCallLadderRegressionAlgorithm.cs:37 — Algorithm.CSharp/OptionEquityBearCallLadderRegressionAlgorithm.cs:37-44 | Algorithm.CSharp/OptionEquityBullCallLadderRegressionAlgorithm.cs:38-45 | Algorithm.CSharp/OptionEquityCallBackspreadRegressionAlgorithm.cs:38-45 | Algorithm.CSharp/OptionEquityOverlappingBullCallSpreadsRegressionAlgorithm.cs:42-49 | Algorithm.CSharp/OptionEquityShortCallBackspreadRegressionAlgorithm.cs:39-46 — before extracting anything, compare `Algorithm.CSharp/OptionEquityBearCallLadderRegressionAlgorithm.cs` and `Algorithm.CSharp/OptionEquityBullCallLadderRegressionAlgorithm.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.CSharp/OptionEquityBearCallLadderRegressionAlgorithm.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.
D4 · Code Duplication · Duplicated block (6–8 lines × 2) · ×1
  • Duplicated block (6–8 lines × 2) DownloaderDataProvider/Program.cs:229 — DownloaderDataProvider/Program.cs:229-234 | ToolBox/Program.cs:49-56 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (10 lines × 882) · ×1
  • Duplicated block (10 lines × 882) Common/Data/Fundamental/Generated/AVG5YrsROIC.cs:69 — Common/Data/Fundamental/Generated/AVG5YrsROIC.cs:69-78 | Common/Data/Fundamental/Generated/AccountsPayableBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/AccountsReceivableBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/AccruedInterestReceivableBalanceSheet.cs:95-104 | Common/Data/Fundamental/Generated/AccruedInvestmentIncomeBalanceSheet.cs:81-90 | Common/Data/Fundamental/Generated/AccruedLiabilitiesTotalBalanceSheet.cs:83-92 | Common/Data/Fundamental/Generated/AccruedandDeferredIncomeBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/AccruedandDeferredIncomeCurrentBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/AccruedandDeferredIncomeNonCurrentBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/AccumulatedDepreciationBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/AccumulatedDepreciationValueBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/AdditionalPaidInCapitalBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/AdjustedBasicNetAssetValue.cs:93-102 | Common/Data/Fundamental/Generated/AdjustedBasicNetAssetValuePerShare.cs:93-102 | Common/Data/Fundamental/Generated/AdjustedDilutedNetAssetValue.cs:93-102 | Common/Data/Fundamental/Generated/AdjustedDilutedNetAssetValuePerShare.cs:93-102 | Common/Data/Fundamental/Generated/AdvanceFromFederalHomeLoanBanksBalanceSheet.cs:89-98 | Common/Data/Fundamental/Generated/AdvancesfromCentralBanksBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/AllTaxesPaidCashFlowStatement.cs:93-102 | Common/Data/Fundamental/Generated/AllowanceForDoubtfulAccountsReceivableBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/AllowanceForLoansAndLeaseLossesBalanceSheet.cs:89-98 | Common/Data/Fundamental/Generated/AllowanceForNotesReceivableBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/AmortizationCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/AmortizationIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/AmortizationOfFinancingCostsAndDiscountsCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/AmortizationOfIntangiblesCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/AmortizationOfIntangiblesIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/AmortizationOfSecuritiesCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/AmortizationSupplementalIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/AssetDisposalsAdjustmentIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/AssetDisposalsSupplementalIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/AssetImpairmentChargeCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/AssetsHeldForSaleBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/AssetsHeldForSaleCurrentBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/AssetsHeldForSaleNonCurrentBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/AssetsOfDiscontinuedOperationsBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/AssetsPledgedasCollateralSubjecttoSaleorRepledgingTotalBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/AssetsTurnover.cs:85-94 | Common/Data/Fundamental/Generated/AverageDilutionEarningsIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/BankIndebtednessBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/BankLoansTotalBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/BankOwnedLifeInsuranceBalanceSheet.cs:89-98 | Common/Data/Fundamental/Generated/BasicAverageShares.cs:99-108 | Common/Data/Fundamental/Generated/BasicContinuousOperations.cs:99-108 | Common/Data/Fundamental/Generated/BasicDiscontinuousOperations.cs:99-108 | Common/Data/Fundamental/Generated/BasicEPS.cs:99-108 | Common/Data/Fundamental/Generated/BeginningCashPositionCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/BiologicalAssetsBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/BookValuePerShareGrowth.cs:87-96 | Common/Data/Fundamental/Generated/BookValueToEBITDARatio.cs:69-78 | Common/Data/Fundamental/Generated/BookValueToEBITRatio.cs:69-78 | Common/Data/Fundamental/Generated/BookValueToNetIncomeRatio.cs:69-78 | Common/Data/Fundamental/Generated/BookValueToRevenueRatio.cs:69-78 | Common/Data/Fundamental/Generated/BuildingsAndImprovementsBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/CFOGrowth.cs:81-90 | Common/Data/Fundamental/Generated/CapExGrowth.cs:81-90 | Common/Data/Fundamental/Generated/CapExReportedCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/CapExSalesRatio.cs:69-78 | Common/Data/Fundamental/Generated/CapitalExpenditureAnnual5YrGrowth.cs:81-90 | Common/Data/Fundamental/Generated/CapitalExpenditureCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/CapitalExpenditurePerShare.cs:87-96 | Common/Data/Fundamental/Generated/CapitalExpendituretoEBITDA.cs:69-78 | Common/Data/Fundamental/Generated/CapitalLeaseObligationsBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/CapitalStockBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/CashAdvancesandLoansMadetoOtherPartiesCashFlowStatement.cs:69-78 | Common/Data/Fundamental/Generated/CashAndCashEquivalentsBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/CashBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/CashCashEquivalentsAndFederalFundsSoldBalanceSheet.cs:97-106 | Common/Data/Fundamental/Generated/CashCashEquivalentsAndMarketableSecuritiesBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/CashConversionCycle.cs:85-94 | Common/Data/Fundamental/Generated/CashDividendsAndInterestPaidCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/CashDividendsForMinoritiesCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/CashDividendsPaidCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/CashEquivalentsBalanceSheet.cs:89-98 | Common/Data/Fundamental/Generated/CashFlowFromContinuingFinancingActivitiesCashFlowStatement.cs:93-102 | Common/Data/Fundamental/Generated/CashFlowFromContinuingInvestingActivitiesCashFlowStatement.cs:93-102 | Common/Data/Fundamental/Generated/CashFlowFromContinuingOperatingActivitiesCashFlowStatement.cs:93-102 | Common/Data/Fundamental/Generated/CashFlowFromDiscontinuedOperationCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/CashFlowFromOperatingActivitiesPerFullTimeEmployee.cs:69-78 | Common/Data/Fundamental/Generated/CashFlowFromOperationsCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/CashFlowFromOperationsGrowth.cs:69-78 | Common/Data/Fundamental/Generated/CashFlowPerShareGrowth.cs:81-90 | Common/Data/Fundamental/Generated/CashFlowToDebtRatio.cs:69-78 | Common/Data/Fundamental/Generated/CashFlowfromFinancingGrowth.cs:81-90 | Common/Data/Fundamental/Generated/CashFlowfromInvestingGrowth.cs:81-90 | Common/Data/Fundamental/Generated/CashFlowsfromusedinOperatingActivitiesDirectCashFlowStatement.cs:93-102 | Common/Data/Fundamental/Generated/CashFromDiscontinuedFinancingActivitiesCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/CashFromDiscontinuedInvestingActivitiesCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/CashFromDiscontinuedOperatingActivitiesCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/CashGeneratedfromOperatingActivitiesCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/CashPaidforInsuranceActivitiesCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/CashPaidtoReinsurersCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/CashPaymentsforDepositsbyBanksandCustomersCashFlowStatement.cs:93-102 | Common/Data/Fundamental/Generated/CashPaymentsforLoansCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/CashRatio.cs:75-84 | Common/Data/Fundamental/Generated/CashRatioGrowth.cs:81-90 | Common/Data/Fundamental/Generated/CashReceiptsfromDepositsbyBanksandCustomersCashFlowStatement.cs:93-102 | Common/Data/Fundamental/Generated/CashReceiptsfromFeesandCommissionsCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/CashReceiptsfromLoansCashFlowStatement.cs:93-102 | Common/Data/Fundamental/Generated/CashReceiptsfromRepaymentofAdvancesandLoansMadetoOtherPartiesCashFlowStatement.cs:75-84 | Common/Data/Fundamental/Generated/CashReceiptsfromTaxRefundsCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/CashRestrictedOrPledgedBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/CashTurnoverRatio.cs:69-78 | Common/Data/Fundamental/Generated/CashtoTotalAssets.cs:75-84 | Common/Data/Fundamental/Generated/CededPremiumsIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/ChangeInAccountPayableCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/ChangeInAccruedExpenseCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/ChangeInAccruedInvestmentIncomeCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/ChangeInDeferredAcquisitionCostsCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/ChangeInDeferredChargesCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/ChangeInDividendPayableCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/ChangeInFederalFundsAndSecuritiesSoldForRepurchaseCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/ChangeInFundsWithheldCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/ChangeInIncomeTaxPayableCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/ChangeInInterestPayableCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/ChangeInInventoryCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/ChangeInLoansCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/ChangeInLossAndLossAdjustmentExpenseReservesCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/ChangeInOtherCurrentAssetsCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/ChangeInOtherCurrentLiabilitiesCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/ChangeInOtherOperatingCapitalCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/ChangeInPayableCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/ChangeInPayablesAndAccruedExpenseCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/ChangeInPrepaidAssetsCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/ChangeInReceivablesCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/ChangeInReinsuranceRecoverableOnPaidAndUnpaidLossesCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/ChangeInRestrictedCashCashFlowStatement.cs:75-84 | Common/Data/Fundamental/Generated/ChangeInTaxPayableCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/ChangeInTradingAccountSecuritiesCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/ChangeInUnearnedPremiumsCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/ChangeInWorkingCapitalCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/ChangeinAdvancesfromCentralBanksCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/ChangeinCashSupplementalAsReportedCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/ChangeinDeferredAcquisitionCostsNetCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/ChangeinDepositsbyBanksandCustomersCashFlowStatement.cs:69-78 | Common/Data/Fundamental/Generated/ChangeinFinancialAssetsCashFlowStatement.cs:69-78 | Common/Data/Fundamental/Generated/ChangeinFinancialLiabilitiesCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/ChangeinInsuranceContractAssetsCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/ChangeinInsuranceContractLiabilitiesCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/ChangeinInsuranceFundsCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/ChangeinInvestmentContractLiabilitiesCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/ChangeinTheGrossProvisionforUnearnedPremiumsIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/ChangeinTheGrossProvisionforUnearnedPremiumsReinsurersShareIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/ChangesInAccountReceivablesCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/ChangesInCashCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/ClaimsPaidCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/ClaimsandChangeinInsuranceLiabilitiesIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/ClaimsandPaidIncurredIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/ClassesofCashPaymentsCashFlowStatement.cs:93-102 | Common/Data/Fundamental/Generated/ClassesofCashReceiptsfromOperatingActivitiesCashFlowStatement.cs:93-102 | Common/Data/Fundamental/Generated/ComTreShaNumBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/CommercialLoanBalanceSheet.cs:89-98 | Common/Data/Fundamental/Generated/CommercialPaperBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/CommissionExpensesIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/CommissionPaidCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/CommonEquityTier1Capital.cs:93-102 | Common/Data/Fundamental/Generated/CommonEquityTier1CapitalRatio.cs:93-102 | Common/Data/Fundamental/Generated/CommonEquityToAssets.cs:105-114 | Common/Data/Fundamental/Generated/CommonStockBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/CommonStockDividendPaidCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/CommonStockEquityBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/CommonStockIssuanceCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/CommonStockPaymentsCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/CommonUtilityPlantBalanceSheet.cs:83-92 | Common/Data/Fundamental/Generated/ConstructionInProgressBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/ConsumerLoanBalanceSheet.cs:89-98 | Common/Data/Fundamental/Generated/ContinuingAndDiscontinuedBasicEPS.cs:99-108 | Common/Data/Fundamental/Generated/ContinuingAndDiscontinuedDilutedEPS.cs:99-108 | Common/Data/Fundamental/Generated/ConvertibleLoansTotalBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/CostOfRevenueIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/CreditCardIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/CreditLossesProvisionIncomeStatement.cs:93-102 | Common/Data/Fundamental/Generated/CreditRiskProvisionsIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/CurrentAccruedExpensesBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/CurrentAssetsBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/CurrentCapitalLeaseObligationBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/CurrentDebtAndCapitalLeaseObligationBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/CurrentDebtBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/CurrentDeferredAssetsBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/CurrentDeferredLiabilitiesBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/CurrentDeferredRevenueBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/CurrentDeferredTaxesAssetsBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/CurrentDeferredTaxesLiabilitiesBalanceSheet.cs:89-98 | Common/Data/Fundamental/Generated/CurrentLiabilitiesBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/CurrentNotesPayableBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/CurrentOtherFinancialLiabilitiesBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/CurrentPortionOfLongTermDebtAndCapitalLeaseBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/CurrentProvisionsBalanceSheet.cs:89-98 | Common/Data/Fundamental/Generated/CurrentRatio.cs:105-114 | Common/Data/Fundamental/Generated/CurrentRatioGrowth.cs:81-90 | Common/Data/Fundamental/Generated/CustomerAcceptancesBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/CustomerAccountsBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/DDACostofRevenueIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/DPSGrowth.cs:87-96 | Common/Data/Fundamental/Generated/DaysInInventory.cs:85-94 | Common/Data/Fundamental/Generated/DaysInPayment.cs:85-94 | Common/Data/Fundamental/Generated/DaysInSales.cs:85-94 | Common/Data/Fundamental/Generated/DebtDueBeyondBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/DebtDueInYear1BalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/DebtDueInYear2BalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/DebtDueInYear5BalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/DebtRestructuringAdjustmentIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/DebtRestructuringSupplementalIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/DebtSecuritiesBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/DebtTotalBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/DebttoAssets.cs:105-114 | Common/Data/Fundamental/Generated/DecreaseInInterestBearingDepositsInBankCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/DeferredAssetsBalanceSheet.cs:89-98 | Common/Data/Fundamental/Generated/DeferredCostsBalanceSheet.cs:103-112 | Common/Data/Fundamental/Generated/DeferredIncomeTaxCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/DeferredIncomeTotalBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/DeferredPolicyAcquisitionCostsBalanceSheet.cs:87-96 | Common/Data/Fundamental/Generated/DeferredTaxAssetsBalanceSheet.cs:89-98 | Common/Data/Fundamental/Generated/DeferredTaxCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/DeferredTaxLiabilitiesTotalBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/DefinedPensionBenefitBalanceSheet.cs:81-90 | Common/Data/Fundamental/Generated/DegreeOfOperatingLeverage.cs:69-78 | Common/Data/Fundamental/Generated/DepletionCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/DepletionIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/DepositCertificatesBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/DepositsMadeunderAssumedReinsuranceContractBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/DepositsbyBankBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/DepreciationAmortizationAndDepletionCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/DepreciationAmortizationDepletionCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/DepreciationAmortizationDepletionIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/DepreciationAndAmortizationCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/DepreciationAndAmortizationIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/DepreciationCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/DepreciationIncomeStatement.cs:93-102 | Common/Data/Fundamental/Generated/DepreciationSupplementalIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/DerivativeAssetsBalanceSheet.cs:81-90 | Common/Data/Fundamental/Generated/DerivativeProductLiabilitiesBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/DerivativesUnrealizedGainsLossesIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/DilutedAverageShares.cs:99-108 | Common/Data/Fundamental/Generated/DilutedContEPSGrowth.cs:87-96 | Common/Data/Fundamental/Generated/DilutedContinuousOperations.cs:99-108 | Common/Data/Fundamental/Generated/DilutedDiscontinuousOperations.cs:99-108 | Common/Data/Fundamental/Generated/DilutedEPS.cs:99-108 | Common/Data/Fundamental/Generated/DilutedEPSGrowth.cs:87-96 | Common/Data/Fundamental/Generated/DilutedNIAvailtoComStockholdersIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/DiscontinuedOperationsAdjustmentIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/DiscontinuedOperationsSupplementalIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/DisposalOfBusinessesAdjustmentIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/DisposalofBusinessesSupplementalIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/DividendCoverageRatio.cs:93-102 | Common/Data/Fundamental/Generated/DividendIncomeIncomeStatement.cs:101-110 | Common/Data/Fundamental/Generated/DividendPaidCFOCashFlowStatement.cs:69-78 | Common/Data/Fundamental/Generated/DividendPerShare.cs:103-112 | Common/Data/Fundamental/Generated/DividendReceivedCFOCashFlowStatement.cs:75-84 | Common/Data/Fundamental/Generated/DividendsPaidDirectCashFlowStatement.cs:69-78 | Common/Data/Fundamental/Generated/DividendsPayableBalanceSheet.cs:99-108 | Common/Data/Fundamental/Generated/DividendsReceivedCFICashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/DividendsReceivedDirectCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/DueFromRelatedPartiesBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/DuefromRelatedPartiesCurrentBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/DuefromRelatedPartiesNonCurrentBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/DuetoRelatedPartiesBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/DuetoRelatedPartiesCurrentBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/DuetoRelatedPartiesNonCurrentBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/EBITAIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/EBITAMargin.cs:87-96 | Common/Data/Fundamental/Generated/EBITDAGrowth.cs:81-90 | Common/Data/Fundamental/Generated/EBITDAIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/EBITDAInterestCoverage.cs:69-78 | Common/Data/Fundamental/Generated/EBITDAMargin.cs:99-108 | Common/Data/Fundamental/Generated/EBITDANetCapitalExpenditureToInterestExpensesRatio.cs:69-78 | Common/Data/Fundamental/Generated/EBITDAPerShare.cs:87-96 | Common/Data/Fundamental/Generated/EBITDARIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/EBITDARMargin.cs:87-96 | Common/Data/Fundamental/Generated/EBITDARPerShare.cs:87-96 | Common/Data/Fundamental/Generated/EBITGrowth.cs:69-78 | Common/Data/Fundamental/Generated/EBITIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/EBITMargin.cs:99-108 | Common/Data/Fundamental/Generated/EBITPerShare.cs:87-96 | Common/Data/Fundamental/Generated/EarningsFromEquityInterestIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/EarningsLossesFromEquityInvestmentsCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/EarningsPerShareGrowth.cs:93-102 | Common/Data/Fundamental/Generated/EarningsfromEquityInterestNetOfTaxIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/EffectOfExchangeRateChangesCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/EffectiveTaxRateAsReportedIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/ElectricUtilityPlantBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/EmployeeBenefitsBalanceSheet.cs:97-106 | Common/Data/Fundamental/Generated/EndCashPositionCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/EquipmentIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/EquityAttributableToOwnersOfParentBalanceSheet.cs:81-90 | Common/Data/Fundamental/Generated/EquityMultiplierRatio.cs:75-84 | Common/Data/Fundamental/Generated/EquityPerShareGrowth.cs:89-98 | Common/Data/Fundamental/Generated/EquityTurnoverRatio.cs:69-78 | Common/Data/Fundamental/Generated/ExcessCashMargin.cs:87-96 | Common/Data/Fundamental/Generated/ExcessTaxBenefitFromStockBasedCompensationCashFlowStatement.cs:93-102 | Common/Data/Fundamental/Generated/ExciseTaxesIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/ExpenseRatio.cs:75-84 | Common/Data/Fundamental/Generated/ExplorationDevelopmentAndMineralPropertyLeaseExpensesIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/FCFGrowth.cs:81-90 | Common/Data/Fundamental/Generated/FCFNetIncomeRatio.cs:69-78 | Common/Data/Fundamental/Generated/FCFPerShareGrowth.cs:81-90 | Common/Data/Fundamental/Generated/FCFSalesRatio.cs:69-78 | Common/Data/Fundamental/Generated/FCFtoCFO.cs:69-78 | Common/Data/Fundamental/Generated/FederalFundsPurchasedAndSecuritiesSoldUnderAgreementToRepurchaseBalanceSheet.cs:81-90 | Common/Data/Fundamental/Generated/FederalFundsPurchasedBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/FederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResellBalanceSheet.cs:89-98 | Common/Data/Fundamental/Generated/FederalFundsSoldBalanceSheet.cs:81-90 | Common/Data/Fundamental/Generated/FederalHomeLoanBankStockBalanceSheet.cs:89-98 | Common/Data/Fundamental/Generated/FeeRevenueAndOtherIncomeIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/FeesAndCommissionsIncomeStatement.cs:95-104 | Common/Data/Fundamental/Generated/FeesandCommissionExpenseIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/FeesandCommissionIncomeIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/FinancialAssetsBalanceSheet.cs:83-92 | Common/Data/Fundamental/Generated/FinancialAssetsDesignatedasFairValueThroughProfitorLossTotalBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/FinancialAssetsUnrealizedGainsLossesIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/FinancialInstrumentsAndInvestmentsGainsLossesIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/FinancialInstrumentsSoldUnderAgreementsToRepurchaseBalanceSheet.cs:81-90 | Common/Data/Fundamental/Generated/FinancialLeverage.cs:109-118 | Common/Data/Fundamental/Generated/FinancialLiabilitiesCurrentBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/FinancialLiabilitiesDesignatedasFairValueThroughProfitorLossTotalBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/FinancialLiabilitiesMeasuredatAmortizedCostTotalBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/FinancialLiabilitiesNonCurrentBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/FinancialOrDerivativeInvestmentCurrentLiabilitiesBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/FinancingCashFlowCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/FinishedGoodsBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/FixAssetsTuronver.cs:85-94 | Common/Data/Fundamental/Generated/FixedAssetsRevaluationReserveBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/FixedMaturityInvestmentsBalanceSheet.cs:87-96 | Common/Data/Fundamental/Generated/FlightFleetVehicleAndRelatedEquipmentsBalanceSheet.cs:81-90 | Common/Data/Fundamental/Generated/ForeclosedAssetsBalanceSheet.cs:83-92 | Common/Data/Fundamental/Generated/ForeignCurrencyExchangeUnrealizedGainsLossesIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/ForeignCurrencyTranslationAdjustmentsBalanceSheet.cs:97-106 | Common/Data/Fundamental/Generated/ForeignExchangeTradingGainsIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/FreeCashFlowCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/FreeCashFlowInterestCoverage.cs:69-78 | Common/Data/Fundamental/Generated/FreeCashFlowToAssetsRatio.cs:69-78 | Common/Data/Fundamental/Generated/FreeCashFlowToDebtRatio.cs:69-78 | Common/Data/Fundamental/Generated/FreeCashFlowToEquityHoldersCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/FreeCashFlowToEquityRatio.cs:69-78 | Common/Data/Fundamental/Generated/FuelAndPurchasePowerIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/FuelIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/FundFromOperationCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/FurnitureFixturesAndOfficeEquipmentBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/FuturePolicyBenefitsBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/GainLossOnDisposalsNonCashAdjustmentCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/GainLossOnExtinguishmentofDebtSupplementalIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/GainLossOnInvestmentSecuritiesCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/GainLossOnSaleOfBusinessCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/GainLossOnSaleOfPPECashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/GainLossonSaleofAssetsIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/GainOnSaleOfBusinessIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/GainOnSaleOfPPEIncomeStatement.cs:93-102 | Common/Data/Fundamental/Generated/GainOnSaleOfSecurityIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/GainonInvestmentPropertiesIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/GainonSaleofInvestmentPropertyIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/GainonSaleofLoansIncomeStatement.cs:93-102 | Common/Data/Fundamental/Generated/GainsLossesNotAffectingRetainedEarningsBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/GainsLossesonFinancialInstrumentsDuetoFairValueAdjustmentsinHedgeAccountingTotalIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/GeneralAndAdministrativeExpenseIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/GeneralPartnershipCapitalBalanceSheet.cs:83-92 | Common/Data/Fundamental/Generated/GoodwillAndOtherIntangibleAssetsBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/GoodwillBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/GoodwillImpairmentWriteOffAdjustmentIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/GoodwillImpairmentWriteOffSupplementalIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/GrossAccountsReceivableBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/GrossDividendPaymentIncomeStatement.cs:81-90 | Common/Data/Fundamental/Generated/GrossGoodwillAndOtherIntangibleAssetsBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/GrossLoanBalanceSheet.cs:89-98 | Common/Data/Fundamental/Generated/GrossMargin.cs:99-108 | Common/Data/Fundamental/Generated/GrossMargin5YrAvg.cs:69-78 | Common/Data/Fundamental/Generated/GrossNotesReceivableBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/GrossPPEBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/GrossPremiumsWrittenIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/GrossProfitAnnual5YrGrowth.cs:81-90 | Common/Data/Fundamental/Generated/GrossProfitIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/HedgingAssetsCurrentBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/HeldToMaturitySecuritiesBalanceSheet.cs:89-98 | Common/Data/Fundamental/Generated/ImpairmentOfCapitalAssetsIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/ImpairmentWriteOffWriteDownofCapitalAssetsSupplementalIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/ImpairmentWriteOffWriteDownofOtherAssetsSupplementalIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/IncomeAfterTaxesIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/IncomeLossBeforeNonCashAdjustmentCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/IncomeTaxPaidSupplementalDataCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/IncomeTaxPayableBalanceSheet.cs:95-104 | Common/Data/Fundamental/Generated/IncomefromAssociatesandOtherParticipatingInterestsIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/IncreaseDecreaseInDepositCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/IncreaseDecreaseInLeaseFinancingCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/IncreaseDecreaseInNetUnearnedPremiumReservesIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/IncreaseInInterestBearingDepositsInBankCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/IncreaseInLeaseFinancingCashFlowStatement.cs:75-84 | Common/Data/Fundamental/Generated/InsuranceAndClaimsIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/InsuranceContractAssetsBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/InsuranceContractLiabilitiesBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/InsuranceFundsNonCurrentBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/InterestAsAPercentOfInvestedCapitalRatio.cs:69-78 | Common/Data/Fundamental/Generated/InterestBearingBorrowingsNonCurrentBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/InterestBearingDepositsAssetsBalanceSheet.cs:89-98 | Common/Data/Fundamental/Generated/InterestBearingDepositsLiabilitiesBalanceSheet.cs:89-98 | Common/Data/Fundamental/Generated/InterestCoverage.cs:109-118 | Common/Data/Fundamental/Generated/InterestCreditedOnPolicyholderDepositsCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/InterestExpenseForDepositIncomeStatement.cs:95-104 | Common/Data/Fundamental/Generated/InterestExpenseForFederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResellIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/InterestExpenseForLongTermDebtAndCapitalSecuritiesIncomeStatement.cs:95-104 | Common/Data/Fundamental/Generated/InterestExpenseForShortTermDebtIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/InterestExpenseIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/InterestExpenseNonOperatingIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/InterestIncomeAfterProvisionForLoanLossIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/InterestIncomeFromDepositsIncomeStatement.cs:95-104 | Common/Data/Fundamental/Generated/InterestIncomeFromFederalFundsSoldAndSecuritiesPurchaseUnderAgreementsToResellIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/InterestIncomeFromLeasesIncomeStatement.cs:93-102 | Common/Data/Fundamental/Generated/InterestIncomeFromLoansAndLeaseIncomeStatement.cs:93-102 | Common/Data/Fundamental/Generated/InterestIncomeFromLoansIncomeStatement.cs:93-102 | Common/Data/Fundamental/Generated/InterestIncomeFromSecuritiesIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/InterestIncomeIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/InterestIncomeNonOperatingIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/InterestPaidCFFCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/InterestPaidCFOCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/InterestPaidDirectCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/InterestPaidSupplementalDataCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/InterestPayableBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/InterestRateIncomeStatement.cs:69-78 | Common/Data/Fundamental/Generated/InterestReceivedCFICashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/InterestReceivedCFOCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/InterestReceivedDirectCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/InterestandCommissionPaidCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/InventoriesAdjustmentsAllowancesBalanceSheet.cs:89-98 | Common/Data/Fundamental/Generated/InventoryBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/InventoryTurnover.cs:85-94 | Common/Data/Fundamental/Generated/InvestedCapitalBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/InvestingCashFlowCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/InvestmentBankingProfitIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/InvestmentContractLiabilitiesBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/InvestmentContractLiabilitiesIncurredIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/InvestmentPropertiesBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/InvestmentinFinancialAssetsBalanceSheet.cs:83-92 | Common/Data/Fundamental/Generated/InvestmentsAndAdvancesBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/InvestmentsInOtherVenturesUnderEquityMethodBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/InvestmentsinAssociatesatCostBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/InvestmentsinJointVenturesatCostBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/InvestmentsinSubsidiariesatCostBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/IrregularIncomeExpenseIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/IrregularIncomeLossNonCashAdjustmentCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/IssuanceOfCapitalStockCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/IssuanceOfCommonStockCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/IssuanceOfDebtCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/IssuanceOfLeaseFinancingCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/IssuanceOfLongTermDebtCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/IssuanceOfPreferredStockCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/IssuanceOfShortTermDebtCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/IssueExpensesCashFlowStatement.cs:93-102 | Common/Data/Fundamental/Generated/ItemsinTheCourseofTransmissiontoOtherBanksBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/LandAndImprovementsBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/LeasedPropertyPlantAndEquipmentBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/LeasesBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/LiabilitiesHeldforSaleCurrentBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/LiabilitiesHeldforSaleNonCurrentBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/LiabilitiesHeldforSaleTotalBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/LiabilitiesOfDiscontinuedOperationsBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/LimitedPartnershipCapitalBalanceSheet.cs:81-90 | Common/Data/Fundamental/Generated/LineOfCreditBalanceSheet.cs:91-100 | Common/Data/Fundamental/Generated/LiquidityCoverageRatio.cs:93-102 | Common/Data/Fundamental/Generated/LitigationIncomeExpenseAdjustmentIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/LitigationIncomeExpenseSupplementalIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/LoansHeldForSaleBalanceSheet.cs:89-98 | Common/Data/Fundamental/Generated/LoansReceivableBalanceSheet.cs:97-106 | Common/Data/Fundamental/Generated/LoansandAdvancestoBankBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/LongTermCapitalLeaseObligationBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/LongTermDebtAndCapitalLeaseObligationBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/LongTermDebtBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/LongTermDebtEquityRatio.cs:105-114 | Common/Data/Fundamental/Generated/LongTermDebtIssuanceCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/LongTermDebtPaymentsCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/LongTermDebtToAssetsRatio.cs:75-84 | Common/Data/Fundamental/Generated/LongTermDebtTotalCapitalRatio.cs:105-114 | Common/Data/Fundamental/Generated/LongTermInvestmentsBalanceSheet.cs:81-90 | Common/Data/Fundamental/Generated/LongTermProvisionsBalanceSheet.cs:89-98 | Common/Data/Fundamental/Generated/LossAdjustmentExpenseIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/LossRatio.cs:75-84 | Common/Data/Fundamental/Generated/LossonExtinguishmentofDebtIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/MachineryFurnitureEquipmentBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/MaintenanceAndRepairsIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/MaterialsAndSuppliesBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/MergerAndAcquisitionIncomeExpenseAdjustmentIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/MergerAndAcquisitionIncomeExpenseSupplementalIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/MineralPropertiesBalanceSheet.cs:89-98 | Common/Data/Fundamental/Generated/MinimumPensionLiabilitiesBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/MinorityInterestBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/MinorityInterestsIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/MoneyMarketInvestmentsBalanceSheet.cs:89-98 | Common/Data/Fundamental/Generated/MortgageAndConsumerloansBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/MortgageLoanBalanceSheet.cs:89-98 | Common/Data/Fundamental/Generated/NaturalGasFuelAndOtherBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/NetBusinessPurchaseAndSaleCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/NetCashFromDiscontinuedOperationsCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/NetCommonStockIssuanceCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/NetDebtBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/NetDebtToEBITDARatio.cs:69-78 | Common/Data/Fundamental/Generated/NetForeignCurrencyExchangeGainLossCashFlowStatement.cs:93-102 | Common/Data/Fundamental/Generated/NetForeignExchangeGainLossIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/NetIncomeAfterMinorityInterestGrowth.cs:99-108 | Common/Data/Fundamental/Generated/NetIncomeCommonStockholdersIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/NetIncomeContOpsGrowth.cs:87-96 | Common/Data/Fundamental/Generated/NetIncomeContinuousOperationsIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/NetIncomeContinuousOperationsNetMinorityInterestIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/NetIncomeDiscontinuousOperationsIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/NetIncomeExtraordinaryIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/NetIncomeFromContinuingAndDiscontinuedOperationIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/NetIncomeFromContinuingOperationNetMinorityInterestIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/NetIncomeFromContinuingOperationsCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/NetIncomeGrowth.cs:87-96 | Common/Data/Fundamental/Generated/NetIncomeIncludingNoncontrollingInterestsIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/NetIncomeIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/NetIncomePerEmployee.cs:77-86 | Common/Data/Fundamental/Generated/NetIncomeSelectionGrowth.cs:81-90 | Common/Data/Fundamental/Generated/NetIntangiblesPurchaseAndSaleCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/NetInterestIncomeExpenseIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/NetInterestIncomeIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/NetInterestMargin.cs:93-102 | Common/Data/Fundamental/Generated/NetInterestSpread.cs:93-102 | Common/Data/Fundamental/Generated/NetInvestmentIncomeIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/NetInvestmentIncomeLossNonCashAdjustmentCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/NetInvestmentIncomeValueIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/NetInvestmentPropertiesPurchaseAndSaleCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/NetInvestmentPurchaseAndSaleCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/NetIssuancePaymentsOfDebtCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/NetLoanBalanceSheet.cs:89-98 | Common/Data/Fundamental/Generated/NetLongTermDebtIssuanceCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/NetMargin.cs:99-108 | Common/Data/Fundamental/Generated/NetNonOperatingInterestIncomeExpenseIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/NetOccupancyExpenseIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/NetOperatingAssetsBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/NetOperatingAssetsTurnover.cs:69-78 | Common/Data/Fundamental/Generated/NetOperatingProfitAfterTaxIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/NetOtherFinancingChargesCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/NetOtherInvestingChangesCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/NetOutwardLoansCashFlowStatement.cs:69-78 | Common/Data/Fundamental/Generated/NetPPEBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/NetPPEPurchaseAndSaleCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/NetPreferredStockIssuanceCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/NetPremiumsWrittenIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/NetProceedsPaymentForLoanCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/NetRealizedGainLossOnInvestmentsIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/NetShortTermDebtIssuanceCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/NetTangibleAssetsBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/NetTangibleAssetsCalculatedBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/NetUtilityPlantBalanceSheet.cs:83-92 | Common/Data/Fundamental/Generated/NonCurrentAccountsReceivableBalanceSheet.cs:89-98 | Common/Data/Fundamental/Generated/NonCurrentAccruedExpensesBalanceSheet.cs:89-98 | Common/Data/Fundamental/Generated/NonCurrentDeferredAssetsBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/NonCurrentDeferredLiabilitiesBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/NonCurrentDeferredRevenueBalanceSheet.cs:103-112 | Common/Data/Fundamental/Generated/NonCurrentDeferredTaxesAssetsBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/NonCurrentDeferredTaxesLiabilitiesBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/NonCurrentNoteReceivablesBalanceSheet.cs:89-98 | Common/Data/Fundamental/Generated/NonCurrentOtherFinancialLiabilitiesBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/NonCurrentPensionAndOtherPostretirementBenefitPlansBalanceSheet.cs:97-106 | Common/Data/Fundamental/Generated/NonCurrentPrepaidAssetsBalanceSheet.cs:89-98 | Common/Data/Fundamental/Generated/NonInterestBearingBorrowingsCurrentBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/NonInterestBearingBorrowingsNonCurrentBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/NonInterestBearingBorrowingsTotalBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/NonInterestBearingDepositsBalanceSheet.cs:89-98 | Common/Data/Fundamental/Generated/NonInterestExpenseIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/NonInterestIncomeIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/NonOperatingIncomeExpensesTotalIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/NonPerformingAssetsLoans.cs:93-102 | Common/Data/Fundamental/Generated/NormalizedBasicEPS.cs:99-108 | Common/Data/Fundamental/Generated/NormalizedBasicEPSGrowth.cs:87-96 | Common/Data/Fundamental/Generated/NormalizedDilutedEPS.cs:99-108 | Common/Data/Fundamental/Generated/NormalizedEBITAsReportedIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/NormalizedEBITDAAsReportedIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/NormalizedEBITDAIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/NormalizedEBITDAMargin.cs:87-96 | Common/Data/Fundamental/Generated/NormalizedEBITDAPerShare.cs:87-96 | Common/Data/Fundamental/Generated/NormalizedEBITDARIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/NormalizedEBITDARMargin.cs:87-96 | Common/Data/Fundamental/Generated/NormalizedEBITDARPerShare.cs:87-96 | Common/Data/Fundamental/Generated/NormalizedEBITIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/NormalizedEBITMargin.cs:87-96 | Common/Data/Fundamental/Generated/NormalizedEBITPerShare.cs:87-96 | Common/Data/Fundamental/Generated/NormalizedEPS.cs:87-96 | Common/Data/Fundamental/Generated/NormalizedIncomeAsReportedIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/NormalizedIncomeGrowth.cs:81-90 | Common/Data/Fundamental/Generated/NormalizedIncomeIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/NormalizedIncomePerFullTimeEmployee.cs:69-78 | Common/Data/Fundamental/Generated/NormalizedNetProfitMargin.cs:99-108 | Common/Data/Fundamental/Generated/NormalizedOperatingProfitAsReportedIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/NormalizedPreTaxIncomeIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/NormalizedROIC.cs:85-94 | Common/Data/Fundamental/Generated/NormalizedReturnOnAsset.cs:69-78 | Common/Data/Fundamental/Generated/NormalizedReturnOnEquity.cs:69-78 | Common/Data/Fundamental/Generated/NotesReceivableBalanceSheet.cs:81-90 | Common/Data/Fundamental/Generated/OccupancyAndEquipmentIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/OperatingCashFlowCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/OperatingExpenseAsReportedIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/OperatingExpenseIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/OperatingGainsLossesCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/OperatingIncomeIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/OperatingLeaseAssetsBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/OperatingRevenueIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/OperationAndMaintenanceIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/OperationIncomeGrowth.cs:87-96 | Common/Data/Fundamental/Generated/OperationMargin.cs:99-108 | Common/Data/Fundamental/Generated/OperationRevenueGrowth3MonthAvg.cs:87-96 | Common/Data/Fundamental/Generated/OrdinarySharesNumberBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/OtherAssetsBalanceSheet.cs:95-104 | Common/Data/Fundamental/Generated/OtherBorrowedFundsBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/OtherCapitalStockBalanceSheet.cs:89-98 | Common/Data/Fundamental/Generated/OtherCashAdjustExcludeFromChangeinCashCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/OtherCashAdjustIncludedIntoChangeinCashCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/OtherCashPaymentsfromOperatingActivitiesCashFlowStatement.cs:95-104 | Common/Data/Fundamental/Generated/OtherCashReceiptsfromOperatingActivitiesCashFlowStatement.cs:95-104 | Common/Data/Fundamental/Generated/OtherCostofRevenueIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/OtherCurrentAssetsBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/OtherCurrentBorrowingsBalanceSheet.cs:89-98 | Common/Data/Fundamental/Generated/OtherCurrentLiabilitiesBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/OtherCustomerServicesIncomeStatement.cs:93-102 | Common/Data/Fundamental/Generated/OtherEquityAdjustmentsBalanceSheet.cs:89-98 | Common/Data/Fundamental/Generated/OtherEquityInterestBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/OtherFinancialLiabilitiesBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/OtherGAIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/OtherIncomeExpenseIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/OtherIncomeExpenseOperatingIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/OtherIntangibleAssetsBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/OtherIntangibleAssetsValueBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/OtherInterestExpenseIncomeStatement.cs:95-104 | Common/Data/Fundamental/Generated/OtherInterestIncomeIncomeStatement.cs:95-104 | Common/Data/Fundamental/Generated/OtherInventoriesBalanceSheet.cs:97-106 | Common/Data/Fundamental/Generated/OtherInvestedAssetsBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/OtherInvestmentsBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/OtherIrregularIncomeExpensesAdjustmentIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/OtherLiabilitiesBalanceSheet.cs:97-106 | Common/Data/Fundamental/Generated/OtherLoanAssetsBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/OtherLoansCurrentBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/OtherLoansNonCurrentBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/OtherLoansTotalBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/OtherNonCashItemsCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/OtherNonCurrentAssetsBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/OtherNonCurrentLiabilitiesBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/OtherNonInterestExpenseIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/OtherNonInterestIncomeIncomeStatement.cs:93-102 | Common/Data/Fundamental/Generated/OtherNonOperatingExpensesIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/OtherNonOperatingIncomeExpensesIncomeStatement.cs:93-102 | Common/Data/Fundamental/Generated/OtherNonOperatingIncomeIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/OtherOperatingExpensesIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/OtherOperatingInflowsOutflowsofCashCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/OtherPayableBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/OtherPropertiesBalanceSheet.cs:97-106 | Common/Data/Fundamental/Generated/OtherRealEstateOwnedBalanceSheet.cs:89-98 | Common/Data/Fundamental/Generated/OtherReceivablesBalanceSheet.cs:97-106 | Common/Data/Fundamental/Generated/OtherReceivablesCurrentBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/OtherReservesBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/OtherShortTermInvestmentsBalanceSheet.cs:97-106 | Common/Data/Fundamental/Generated/OtherSpecialChargesIncomeStatement.cs:93-102 | Common/Data/Fundamental/Generated/OtherStaffCostsIncomeStatement.cs:69-78 | Common/Data/Fundamental/Generated/OtherTaxesIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/OtherUnderwritingExpensesPaidCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/OtherunderPreferredStockDividendIncomeStatement.cs:93-102 | Common/Data/Fundamental/Generated/PaidInCapitalBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/PayablesAndAccruedExpensesBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/PayablesBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/PaymentForLoansCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/PaymentTurnover.cs:85-94 | Common/Data/Fundamental/Generated/PaymentsonBehalfofEmployeesCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/PaymentstoSuppliersforGoodsandServicesCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/PensionAndEmployeeBenefitExpenseCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/PensionAndOtherPostretirementBenefitPlansTotalBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/PensionCostsIncomeStatement.cs:69-78 | Common/Data/Fundamental/Generated/PensionandOtherPostRetirementBenefitPlansCurrentBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/PolicyAcquisitionExpenseIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/PolicyLoansBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/PolicyReservesBenefitsBalanceSheet.cs:87-96 | Common/Data/Fundamental/Generated/PolicyholderBenefitsCededIncomeStatement.cs:69-78 | Common/Data/Fundamental/Generated/PolicyholderBenefitsGrossIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/PolicyholderDepositInvestmentReceivedCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/PolicyholderDividendsIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/PolicyholderFundsBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/PolicyholderInterestIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/PostTaxMargin5YrAvg.cs:69-78 | Common/Data/Fundamental/Generated/PreTaxMargin5YrAvg.cs:69-78 | Common/Data/Fundamental/Generated/PreferredSecuritiesOutsideStockEquityBalanceSheet.cs:97-106 | Common/Data/Fundamental/Generated/PreferredSharesNumberBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/PreferredStockBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/PreferredStockDividendPaidCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/PreferredStockDividendsIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/PreferredStockEquityBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/PreferredStockIssuanceCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/PreferredStockPaymentsCashFlowStatement.cs:93-102 | Common/Data/Fundamental/Generated/PremiumReceivedCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/PrepaidAssetsBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/PretaxIncomeIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/PretaxMargin.cs:99-108 | Common/Data/Fundamental/Generated/ProceedsFromLoansCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/ProceedsFromStockOptionExercisedCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/ProceedsPaymentFederalFundsSoldAndSecuritiesPurchasedUnderAgreementToResellCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/ProceedsPaymentInInterestBearingDepositsInBankCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/ProfessionalExpenseAndContractServicesExpenseIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/ProfitMargin5YrAvg.cs:69-78 | Common/Data/Fundamental/Generated/PropertiesBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/ProvisionForDoubtfulAccountsIncomeStatement.cs:93-102 | Common/Data/Fundamental/Generated/ProvisionForLoanLeaseAndOtherLossesCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/ProvisionandWriteOffofAssetsCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/ProvisionsTotalBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/PurchaseOfBusinessCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/PurchaseOfIntangiblesCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/PurchaseOfInvestmentCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/PurchaseOfInvestmentPropertiesCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/PurchaseOfJointVentureAssociateCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/PurchaseOfPPECashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/QuickRatio.cs:105-114 | Common/Data/Fundamental/Generated/ROA.cs:85-94 | Common/Data/Fundamental/Generated/ROA5YrAvg.cs:69-78 | Common/Data/Fundamental/Generated/ROE.cs:85-94 | Common/Data/Fundamental/Generated/ROE5YrAvg.cs:69-78 | Common/Data/Fundamental/Generated/ROIC.cs:85-94 | Common/Data/Fundamental/Generated/RawMaterialsBalanceSheet.cs:97-106 | Common/Data/Fundamental/Generated/RealizedGainLossOnSaleOfLoansAndLeaseCashFlowStatement.cs:95-104 | Common/Data/Fundamental/Generated/RealizedInvestmentGainsIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/ReceiptsfromCustomersCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/ReceiptsfromGovernmentGrantsCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/ReceivableTurnover.cs:85-94 | Common/Data/Fundamental/Generated/ReceivablesAdjustmentsAllowancesBalanceSheet.cs:83-92 | Common/Data/Fundamental/Generated/ReceivablesBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/ReconciledCostOfRevenueIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/ReconciledDepreciationIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/RegulatoryAssetsBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/RegulatoryLiabilitiesBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/ReinsuranceAssetsBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/ReinsuranceBalancesPayableBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/ReinsuranceRecoverableBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/ReinsuranceRecoveriesofInsuranceLiabilitiesIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/ReinsuranceandOtherRecoveriesReceivedCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/RentAndLandingFeesIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/RentExpenseSupplementalIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/RentandLandingFeesCostofRevenueIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/RepaymentInLeaseFinancingCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/RepaymentOfDebtCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/RepaymentOfLeaseFinancingCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/RepaymentOfLongTermDebtCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/RepaymentOfShortTermDebtCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/ReportedBasicAdjustedFundFromOperations.cs:93-102 | Common/Data/Fundamental/Generated/ReportedBasicAdjustedFundFromOperationsPerShare.cs:93-102 | Common/Data/Fundamental/Generated/ReportedBasicFundFromOperationsPerShare.cs:93-102 | Common/Data/Fundamental/Generated/ReportedDilutedAdjustedFundFromOperations.cs:93-102 | Common/Data/Fundamental/Generated/ReportedDilutedAdjustedFundFromOperationsPerShare.cs:93-102 | Common/Data/Fundamental/Generated/ReportedDilutedFundFromOperations.cs:93-102 | Common/Data/Fundamental/Generated/ReportedDilutedFundFromOperationsPerShare.cs:93-102 | Common/Data/Fundamental/Generated/ReportedNormalizedBasicEPS.cs:87-96 | Common/Data/Fundamental/Generated/ReportedNormalizedDilutedEPS.cs:87-96 | Common/Data/Fundamental/Generated/RepurchaseOfCapitalStockCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/RepurchaseOfCommonStockCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/RepurchaseOfPreferredStockCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/ResearchAndDevelopmentExpensesSupplementalIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/ResearchAndDevelopmentIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/RestrictedCashAndCashEquivalentsBalanceSheet.cs:89-98 | Common/Data/Fundamental/Generated/RestrictedCashAndInvestmentsBalanceSheet.cs:89-98 | Common/Data/Fundamental/Generated/RestrictedCashBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/RestrictedCommonStockBalanceSheet.cs:81-90 | Common/Data/Fundamental/Generated/RestrictedInvestmentsBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/RestructuringAndReorganizationExpenseAdjustmentIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/RetainedEarningsBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/ReturnOnCapitalEmployed.cs:69-78 | Common/Data/Fundamental/Generated/ReturnOnNetOperatingAssets.cs:69-78 | Common/Data/Fundamental/Generated/RevenueGrowth.cs:87-96 | Common/Data/Fundamental/Generated/RiskWeightedAsset.cs:93-102 | Common/Data/Fundamental/Generated/SalariesAndWagesIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/SaleOfBusinessCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/SaleOfIntangiblesCashFlowStatement.cs:93-102 | Common/Data/Fundamental/Generated/SaleOfInvestmentCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/SaleOfInvestmentPropertiesCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/SaleOfJointVentureAssociateCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/SaleOfPPECashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/SalesPerEmployee.cs:109-118 | Common/Data/Fundamental/Generated/SalesPerShareGrowth.cs:93-102 | Common/Data/Fundamental/Generated/SecuritiesAmortizationIncomeStatement.cs:93-102 | Common/Data/Fundamental/Generated/SecuritiesAndInvestmentsBalanceSheet.cs:95-104 | Common/Data/Fundamental/Generated/SecuritiesLendingCollateralBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/SecuritiesLoanedBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/SecurityAgreeToBeResellBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/SecurityBorrowedBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/SecuritySoldNotYetRepurchasedBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/SellingAndMarketingExpenseIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/SellingGeneralAdministrativeExpenseMargin.cs:87-96 | Common/Data/Fundamental/Generated/SellingGeneralAndAdministrationIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/SeparateAccountAssetsBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/SeparateAccountBusinessBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/ServiceChargeOnDepositorAccountsIncomeStatement.cs:95-104 | Common/Data/Fundamental/Generated/ShareIssuedBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/ShortTermDebtIssuanceCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/ShortTermDebtPaymentsCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/ShortTermInvestmentsAvailableForSaleBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/ShortTermInvestmentsHeldToMaturityBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/ShortTermInvestmentsTradingBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/SocialSecurityCostsIncomeStatement.cs:69-78 | Common/Data/Fundamental/Generated/SolvencyRatio.cs:75-84 | Common/Data/Fundamental/Generated/SpecialIncomeChargesIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/StaffCostsIncomeStatement.cs:93-102 | Common/Data/Fundamental/Generated/StockBasedCompensationCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/StockBasedCompensationIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/StockholdersEquityBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/StockholdersEquityGrowth.cs:81-90 | Common/Data/Fundamental/Generated/SubordinatedLiabilitiesBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/TangibleBookValueBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/TaxEffectOfUnusualItemsIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/TaxProvisionIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/TaxRate.cs:99-108 | Common/Data/Fundamental/Generated/TaxRateForCalcsIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/TaxesAssetsCurrentBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/TaxesReceivableBalanceSheet.cs:97-106 | Common/Data/Fundamental/Generated/TaxesRefundPaidCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/TaxesRefundPaidDirectCashFlowStatement.cs:87-96 | Common/Data/Fundamental/Generated/Tier1Capital.cs:93-102 | Common/Data/Fundamental/Generated/Tier1CapitalRatio.cs:93-102 | Common/Data/Fundamental/Generated/Tier1LeverageRatio.cs:93-102 | Common/Data/Fundamental/Generated/Tier2Capital.cs:93-102 | Common/Data/Fundamental/Generated/Tier2CapitalRatio.cs:93-102 | Common/Data/Fundamental/Generated/TotalAdjustmentsforNonCashItemsCashFlowStatement.cs:93-102 | Common/Data/Fundamental/Generated/TotalAssetsBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/TotalAssetsGrowth.cs:81-90 | Common/Data/Fundamental/Generated/TotalCapital.cs:93-102 | Common/Data/Fundamental/Generated/TotalCapitalizationBalanceSheet.cs:107-116 | Common/Data/Fundamental/Generated/TotalDebtBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/TotalDebtEquityRatio.cs:105-114 | Common/Data/Fundamental/Generated/TotalDebtEquityRatioGrowth.cs:81-90 | Common/Data/Fundamental/Generated/TotalDebtToEBITDARatio.cs:69-78 | Common/Data/Fundamental/Generated/TotalDebtToInvestedCapitalRatio.cs:75-84 | Common/Data/Fundamental/Generated/TotalDeferredCreditsAndOtherNonCurrentLiabilitiesBalanceSheet.cs:89-98 | Common/Data/Fundamental/Generated/TotalDepositsBalanceSheet.cs:89-98 | Common/Data/Fundamental/Generated/TotalDividendPaymentofEquitySharesIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/TotalDividendPaymentofNonEquitySharesIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/TotalDividendPerShare.cs:103-112 | Common/Data/Fundamental/Generated/TotalEquityAsReportedBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/TotalEquityBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/TotalEquityGrossMinorityInterestBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/TotalExpensesIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/TotalFinancialLeaseObligationsBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/TotalInvestmentsBalanceSheet.cs:81-90 | Common/Data/Fundamental/Generated/TotalLiabilitiesAndEquityBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/TotalLiabilitiesAsReportedBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/TotalLiabilitiesGrowth.cs:81-90 | Common/Data/Fundamental/Generated/TotalLiabilitiesNetMinorityInterestBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/TotalMoneyMarketInvestmentsIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/TotalNetFinanceIncomeExpenseIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/TotalNonCurrentAssetsBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/TotalNonCurrentLiabilitiesNetMinorityInterestBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/TotalOperatingIncomeAsReportedIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/TotalOperatingProfitLossGrowth.cs:75-84 | Common/Data/Fundamental/Generated/TotalOtherFinanceCostIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/TotalPartnershipCapitalBalanceSheet.cs:81-90 | Common/Data/Fundamental/Generated/TotalPreferredBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/TotalPremiumsEarnedIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/TotalRevenueAsReportedIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/TotalRevenueIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/TotalRiskBasedCapital.cs:97-106 | Common/Data/Fundamental/Generated/TotalTaxPayableBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/TotalUnusualItemsAfterTaxIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/TotalUnusualItemsBeforeTaxIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/TotalUnusualItemsExcludingGoodwillIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/TotalUnusualItemsIncomeStatement.cs:99-108 | Common/Data/Fundamental/Generated/TotalUnusualItemsPerShare.cs:87-96 | Common/Data/Fundamental/Generated/TradeAndOtherReceivablesNonCurrentBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/TradeandOtherPayablesNonCurrentBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/TradingAndOtherReceivableBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/TradingAssetsBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/TradingGainLossIncomeStatement.cs:93-102 | Common/Data/Fundamental/Generated/TradingLiabilitiesBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/TradingSecuritiesBalanceSheet.cs:83-92 | Common/Data/Fundamental/Generated/TradingandFinancialLiabilitiesBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/TreasuryBillsandOtherEligibleBillsBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/TreasurySharesNumberBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/TreasuryStockBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/TrustFeesbyCommissionsIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/UnadjustedRevenueIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/UnallocatedSurplusBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/UnbilledReceivablesBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/UnderwritingExpensesIncomeStatement.cs:87-96 | Common/Data/Fundamental/Generated/UnearnedIncomeBalanceSheet.cs:89-98 | Common/Data/Fundamental/Generated/UnearnedPremiumsBalanceSheet.cs:87-96 | Common/Data/Fundamental/Generated/UnpaidLossAndLossReserveBalanceSheet.cs:89-98 | Common/Data/Fundamental/Generated/UnrealizedGainLossBalanceSheet.cs:81-90 | Common/Data/Fundamental/Generated/UnrealizedGainLossOnInvestmentSecuritiesCashFlowStatement.cs:99-108 | Common/Data/Fundamental/Generated/UnrealizedGainsLossesOnDerivativesCashFlowStatement.cs:75-84 | Common/Data/Fundamental/Generated/WagesandSalariesIncomeStatement.cs:75-84 | Common/Data/Fundamental/Generated/WaterProductionBalanceSheet.cs:75-84 | Common/Data/Fundamental/Generated/WorkInProcessBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/WorkingCapitalBalanceSheet.cs:105-114 | Common/Data/Fundamental/Generated/WorkingCapitalTurnoverRatio.cs:77-86 | Common/Data/Fundamental/Generated/WriteOffIncomeStatement.cs:87-96 — before extracting anything, compare `Common/Data/Fundamental/Generated/AVG5YrsROIC.cs` and `Common/Data/Fundamental/Generated/BookValuePerShareGrowth.cs` as WHOLE FILES: 84% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (10 lines × 7) · ×1
  • Duplicated block (10 lines × 7) Common/Data/Fundamental/Generated/AuditorReportStatus.cs:99 — Common/Data/Fundamental/Generated/AuditorReportStatus.cs:99-108 | Common/Data/Fundamental/Generated/EarningReportsAccessionNumber.cs:99-108 | Common/Data/Fundamental/Generated/EarningReportsFormType.cs:99-108 | Common/Data/Fundamental/Generated/EarningReportsPeriodType.cs:99-108 | Common/Data/Fundamental/Generated/FinancialStatementsAccessionNumber.cs:99-108 | Common/Data/Fundamental/Generated/FinancialStatementsFormType.cs:99-108 | Common/Data/Fundamental/Generated/FinancialStatementsPeriodType.cs:99-108 — before extracting anything, compare `Common/Data/Fundamental/Generated/AuditorReportStatus.cs` and `Common/Data/Fundamental/Generated/EarningReportsAccessionNumber.cs` as WHOLE FILES: 84% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (10 lines × 10) · ×1
  • Duplicated block (10 lines × 10) Common/Data/Fundamental/Generated/BalanceSheetFileDate.cs:83 — Common/Data/Fundamental/Generated/BalanceSheetFileDate.cs:83-92 | Common/Data/Fundamental/Generated/BalanceSheetPeriodEndingDate.cs:87-96 | Common/Data/Fundamental/Generated/CashFlowFileDate.cs:99-108 | Common/Data/Fundamental/Generated/CashFlowStatementPeriodEndingDate.cs:87-96 | Common/Data/Fundamental/Generated/EarningReportsFileDate.cs:99-108 | Common/Data/Fundamental/Generated/EarningReportsPeriodEndingDate.cs:99-108 | Common/Data/Fundamental/Generated/FinancialStatementsFileDate.cs:99-108 | Common/Data/Fundamental/Generated/FinancialStatementsPeriodEndingDate.cs:99-108 | Common/Data/Fundamental/Generated/IncomeStatementFileDate.cs:99-108 | Common/Data/Fundamental/Generated/IncomeStatementPeriodEndingDate.cs:87-96 — before extracting anything, compare `Common/Data/Fundamental/Generated/BalanceSheetFileDate.cs` and `Common/Data/Fundamental/Generated/CashFlowFileDate.cs` as WHOLE FILES: 82% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (7 lines × 7) · ×1
  • Duplicated block (7 lines × 7) Algorithm.CSharp/BracketOrderLimitEntryRegressionAlgorithm.cs:41 — Algorithm.CSharp/BracketOrderLimitEntryRegressionAlgorithm.cs:41-47 | Algorithm.CSharp/BracketOrderRegressionAlgorithm.cs:38-44 | Algorithm.CSharp/ContingentOrderCancelRegressionAlgorithm.cs:41-47 | Algorithm.CSharp/ContingentOrderUpdateRegressionAlgorithm.cs:42-48 | Algorithm.CSharp/ContingentTrailingStopOrderRegressionAlgorithm.cs:40-46 | Algorithm.CSharp/OneCancelsOtherOrderRegressionAlgorithm.cs:40-46 | Algorithm.CSharp/TimeInForceAlgorithm.cs:42-53 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 7 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (20 lines × 16) · ×1
  • Duplicated block (20 lines × 16) Algorithm.CSharp/FutureOptionCallITMExpiryRegressionAlgorithm.cs:76 — Algorithm.CSharp/FutureOptionCallITMExpiryRegressionAlgorithm.cs:76-95 | Algorithm.CSharp/FutureOptionCallOTMExpiryRegressionAlgorithm.cs:83-102 | Algorithm.CSharp/FutureOptionPutITMExpiryRegressionAlgorithm.cs:77-96 | Algorithm.CSharp/FutureOptionPutOTMExpiryRegressionAlgorithm.cs:81-100 | Algorithm.CSharp/FutureOptionShortCallITMExpiryRegressionAlgorithm.cs:77-96 | Algorithm.CSharp/FutureOptionShortCallOTMExpiryRegressionAlgorithm.cs:78-97 | Algorithm.CSharp/FutureOptionShortPutITMExpiryRegressionAlgorithm.cs:77-96 | Algorithm.CSharp/FutureOptionShortPutOTMExpiryRegressionAlgorithm.cs:78-97 | Algorithm.CSharp/IndexOptionCallITMExpiryRegressionAlgorithm.cs:74-93 | Algorithm.CSharp/IndexOptionCallOTMExpiryRegressionAlgorithm.cs:79-98 | Algorithm.CSharp/IndexOptionPutITMExpiryRegressionAlgorithm.cs:71-90 | Algorithm.CSharp/IndexOptionPutOTMExpiryRegressionAlgorithm.cs:76-95 | Algorithm.CSharp/IndexOptionShortCallITMExpiryRegressionAlgorithm.cs:83-102 | Algorithm.CSharp/IndexOptionShortCallOTMExpiryRegressionAlgorithm.cs:73-92 | Algorithm.CSharp/IndexOptionShortPutITMExpiryRegressionAlgorithm.cs:82-101 | Algorithm.CSharp/IndexOptionShortPutOTMExpiryRegressionAlgorithm.cs:73-92 — before extracting anything, compare `Algorithm.CSharp/FutureOptionCallITMExpiryRegressionAlgorithm.cs` and `Algorithm.CSharp/FutureOptionCallOTMExpiryRegressionAlgorithm.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (23–27 lines × 2) · ×1
  • Duplicated block (23–27 lines × 2) Algorithm.Python/Collective2PortfolioSignalExportDemonstrationAlgorithm.py:43 — Algorithm.Python/Collective2PortfolioSignalExportDemonstrationAlgorithm.py:43-65 | Algorithm.Python/Collective2SignalExportDemonstrationAlgorithm.py:49-75 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (24 lines × 12) · ×1
  • Duplicated block (24 lines × 12) Report/ReportCharts.py:69 — Report/ReportCharts.py:69-92 | Report/ReportCharts.py:154-177 | Report/ReportCharts.py:203-226 | Report/ReportCharts.py:269-292 | Report/ReportCharts.py:362-385 | Report/ReportCharts.py:471-494 | Report/ReportCharts.py:535-558 | Report/ReportCharts.py:661-684 | Report/ReportCharts.py:752-775 | Report/ReportCharts.py:841-864 | Report/ReportCharts.py:910-933 | Report/ReportCharts.py:977-1000 — all 12 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Report/ReportCharts.py:498` calls `list` and `Report/ReportCharts.py:180` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (10–18 lines × 2) · ×1
  • Duplicated block (10–18 lines × 2) Algorithm.Python/AddFutureOptionContractDataStreamingRegressionAlgorithm.py:28 — Algorithm.Python/AddFutureOptionContractDataStreamingRegressionAlgorithm.py:28-37 | Algorithm.Python/FutureOptionBuySellCallIntradayRegressionAlgorithm.py:33-50 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (4–17 lines × 6) · ×1
  • Duplicated block (4–17 lines × 6) Algorithm.Python/AccumulativeInsightPortfolioRegressionAlgorithm.py:22 — Algorithm.Python/AccumulativeInsightPortfolioRegressionAlgorithm.py:22-34 | Algorithm.Python/AddRiskManagementAlgorithm.py:23-33 | Algorithm.Python/BasicTemplateFrameworkAlgorithm.py:26-42 | Algorithm.Python/ConfidenceWeightedFrameworkAlgorithm.py:22-38 | Algorithm.Python/InsightScoringRegressionAlgorithm.py:27-30 | Algorithm.Python/InsightWeightingFrameworkAlgorithm.py:28-44 — before extracting anything, compare `Algorithm.Python/ConfidenceWeightedFrameworkAlgorithm.py` and `Algorithm.Python/InsightWeightingFrameworkAlgorithm.py` as WHOLE FILES: 82% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Algorithm.Python/InsightScoringRegressionAlgorithm.py:24` calls `set_start_date`, `set_end_date`, `create` and `Algorithm.Python/AccumulativeInsightPortfolioRegressionAlgorithm.py:22` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (2–16 lines × 5) · ×1
  • Duplicated block (2–16 lines × 5) Algorithm.Python/FutureOptionCallITMExpiryRegressionAlgorithm.py:69 — Algorithm.Python/FutureOptionCallITMExpiryRegressionAlgorithm.py:69-83 | Algorithm.Python/FutureOptionPutITMExpiryRegressionAlgorithm.py:68-82 | Algorithm.Python/FutureOptionShortCallITMExpiryRegressionAlgorithm.py:72-87 | Algorithm.Python/FutureOptionShortPutITMExpiryRegressionAlgorithm.py:72-87 | Algorithm.Python/IndexOptionCallITMExpiryRegressionAlgorithm.py:76-77 — before extracting anything, compare `Algorithm.Python/FutureOptionCallITMExpiryRegressionAlgorithm.py` and `Algorithm.Python/FutureOptionPutITMExpiryRegressionAlgorithm.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.Python/IndexOptionCallITMExpiryRegressionAlgorithm.py:76` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (14–15 lines × 8) · ×1
  • Duplicated block (14–15 lines × 8) Algorithm.Python/FutureOptionCallITMExpiryRegressionAlgorithm.py:30 — Algorithm.Python/FutureOptionCallITMExpiryRegressionAlgorithm.py:30-43 | Algorithm.Python/FutureOptionCallOTMExpiryRegressionAlgorithm.py:34-48 | Algorithm.Python/FutureOptionPutITMExpiryRegressionAlgorithm.py:29-42 | Algorithm.Python/FutureOptionPutOTMExpiryRegressionAlgorithm.py:34-47 | Algorithm.Python/FutureOptionShortCallITMExpiryRegressionAlgorithm.py:30-43 | Algorithm.Python/FutureOptionShortCallOTMExpiryRegressionAlgorithm.py:31-44 | Algorithm.Python/FutureOptionShortPutITMExpiryRegressionAlgorithm.py:30-43 | Algorithm.Python/FutureOptionShortPutOTMExpiryRegressionAlgorithm.py:31-44 — before extracting anything, compare `Algorithm.Python/FutureOptionCallITMExpiryRegressionAlgorithm.py` and `Algorithm.Python/FutureOptionPutITMExpiryRegressionAlgorithm.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Algorithm.Python/FutureOptionCallITMExpiryRegressionAlgorithm.py:30` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (8–11 lines × 2) · ×1
  • Duplicated block (8–11 lines × 2) Algorithm.Python/CustomDataNIFTYAlgorithm.py:85 — Algorithm.Python/CustomDataNIFTYAlgorithm.py:85-95 | Algorithm.Python/CustomDataNIFTYAlgorithm.py:118-125 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (6–8 lines × 4) · ×1
  • Duplicated block (6–8 lines × 4) Algorithm.Python/FutureOptionShortCallOTMExpiryRegressionAlgorithm.py:92 — Algorithm.Python/FutureOptionShortCallOTMExpiryRegressionAlgorithm.py:92-99 | Algorithm.Python/FutureOptionShortPutOTMExpiryRegressionAlgorithm.py:93-100 | Algorithm.Python/IndexOptionShortCallOTMExpiryRegressionAlgorithm.py:78-83 | Algorithm.Python/IndexOptionShortPutOTMExpiryRegressionAlgorithm.py:78-83 — before extracting anything, compare `Algorithm.Python/FutureOptionShortCallOTMExpiryRegressionAlgorithm.py` and `Algorithm.Python/FutureOptionShortPutOTMExpiryRegressionAlgorithm.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (7–8 lines × 3) · ×1
  • Duplicated block (7–8 lines × 3) Algorithm.Python/BasicTemplateOptionsAlgorithm.py:50 — Algorithm.Python/BasicTemplateOptionsAlgorithm.py:50-57 | Algorithm.Python/BasicTemplateOptionsHourlyAlgorithm.py:50-57 | Algorithm.Python/CustomOptionPriceModelRegressionAlgorithm.py:38-44 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×1
  • Duplicated block (7–8 lines × 2) Algorithm.Python/BasicTemplateOptionStrategyAlgorithm.py:48 — Algorithm.Python/BasicTemplateOptionStrategyAlgorithm.py:48-54 | Algorithm.Python/BasicTemplateOptionTradesAlgorithm.py:43-50 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (6–7 lines × 14) · ×1
  • Duplicated block (6–7 lines × 14) Algorithm.Python/FutureOptionCallOTMExpiryRegressionAlgorithm.py:67 — Algorithm.Python/FutureOptionCallOTMExpiryRegressionAlgorithm.py:67-73 | Algorithm.Python/FutureOptionPutOTMExpiryRegressionAlgorithm.py:66-72 | Algorithm.Python/FutureOptionShortCallITMExpiryRegressionAlgorithm.py:62-68 | Algorithm.Python/FutureOptionShortCallOTMExpiryRegressionAlgorithm.py:62-68 | Algorithm.Python/FutureOptionShortPutITMExpiryRegressionAlgorithm.py:62-68 | Algorithm.Python/FutureOptionShortPutOTMExpiryRegressionAlgorithm.py:63-69 | Algorithm.Python/IndexOptionCallITMExpiryRegressionAlgorithm.py:54-60 | Algorithm.Python/IndexOptionCallOTMExpiryRegressionAlgorithm.py:67-73 | Algorithm.Python/IndexOptionPutITMExpiryRegressionAlgorithm.py:49-54 | Algorithm.Python/IndexOptionPutOTMExpiryRegressionAlgorithm.py:67-73 | Algorithm.Python/IndexOptionShortCallITMExpiryRegressionAlgorithm.py:55-61 | Algorithm.Python/IndexOptionShortCallOTMExpiryRegressionAlgorithm.py:51-57 | Algorithm.Python/IndexOptionShortPutITMExpiryRegressionAlgorithm.py:55-61 | Algorithm.Python/IndexOptionShortPutOTMExpiryRegressionAlgorithm.py:51-57 — before extracting anything, compare `Algorithm.Python/FutureOptionCallOTMExpiryRegressionAlgorithm.py` and `Algorithm.Python/FutureOptionPutOTMExpiryRegressionAlgorithm.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (4–7 lines × 6) · ×1
  • Duplicated block (4–7 lines × 6) Algorithm.Python/IndexOptionCallITMExpiryRegressionAlgorithm.py:33 — Algorithm.Python/IndexOptionCallITMExpiryRegressionAlgorithm.py:33-36 | Algorithm.Python/IndexOptionCallOTMExpiryRegressionAlgorithm.py:35-41 | Algorithm.Python/IndexOptionPutITMExpiryRegressionAlgorithm.py:29-35 | Algorithm.Python/IndexOptionPutOTMExpiryRegressionAlgorithm.py:35-41 | Algorithm.Python/IndexOptionShortCallOTMExpiryRegressionAlgorithm.py:31-37 | Algorithm.Python/IndexOptionShortPutOTMExpiryRegressionAlgorithm.py:31-37 — before extracting anything, compare `Algorithm.Python/IndexOptionCallOTMExpiryRegressionAlgorithm.py` and `Algorithm.Python/IndexOptionPutOTMExpiryRegressionAlgorithm.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Algorithm.Python/IndexOptionCallITMExpiryRegressionAlgorithm.py:30` calls `set_end_date`, `set_cash`, `add_index` and `Algorithm.Python/IndexOptionCallOTMExpiryRegressionAlgorithm.py:35` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (5 lines × 7) · ×1
  • Duplicated block (5 lines × 7) Algorithm.Python/CustomDataBenchmarkRegressionAlgorithm.py:49 — Algorithm.Python/CustomDataBenchmarkRegressionAlgorithm.py:49-53 | Algorithm.Python/CustomDataMultiFileObjectStoreRegressionAlgorithm.py:97-101 | Algorithm.Python/CustomDataObjectStoreRegressionAlgorithm.py:88-92 | Algorithm.Python/CustomDataPropertiesRegressionAlgorithm.py:110-114 | Algorithm.Python/CustomDataRegressionAlgorithm.py:108-112 | Algorithm.Python/DescendingCustomDataObjectStoreRegressionAlgorithm.py:104-108 | Algorithm.Python/LiveFeaturesAlgorithm.py:135-139 — before extracting anything, compare `Algorithm.Python/CustomDataMultiFileObjectStoreRegressionAlgorithm.py` and `Algorithm.Python/CustomDataObjectStoreRegressionAlgorithm.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Algorithm.Python/CustomDataRegressionAlgorithm.py:107` calls `timedelta` and `Algorithm.Python/LiveFeaturesAlgorithm.py:134` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (5 lines × 5) · ×1
  • Duplicated block (5 lines × 5) Algorithm.Python/CustomDataBitcoinAlgorithm.py:78 — Algorithm.Python/CustomDataBitcoinAlgorithm.py:78-82 | Algorithm.Python/CustomDataBitcoinAlgorithm.py:106-110 | Algorithm.Python/CustomDataPropertiesRegressionAlgorithm.py:89-93 | Algorithm.Python/CustomDataRegressionAlgorithm.py:85-89 | Algorithm.Python/LiveFeaturesAlgorithm.py:113-117 — before extracting anything, compare `Algorithm.Python/CustomDataBitcoinAlgorithm.py` and `Algorithm.Python/LiveFeaturesAlgorithm.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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 · Edited copies of one member (5 members, 10+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 10+ corresponding lines) Algorithm.CSharp/CapacityTests/IntradayMinuteScalping.cs:36 — Algorithm.CSharp/CapacityTests/IntradayMinuteScalping.cs:36-45 | Algorithm.CSharp/CapacityTests/IntradayMinuteScalpingBTCETH.cs:39-51 | Algorithm.CSharp/CapacityTests/IntradayMinuteScalpingEURUSD.cs:36-45 | Algorithm.CSharp/CapacityTests/IntradayMinuteScalpingGBPJPY.cs:37-46 | Algorithm.CSharp/CapacityTests/IntradayMinuteScalpingTRYJPY.cs:37-46 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
IC1 · Incompleteness & stubs · Both branches open with the same statements · ×1
  • Both branches open with the same statements — the condition does not decide them Common/Statistics/TradeBuilder.cs:424 — The first 2 statements of the `if` and of the `else` are identical, so they run on both paths regardless of the condition. Lift them above the `if` — leaving them duplicated inside makes the branches read as though they handled this differently.
S1 · Cryptographic Hygiene · Obsolete TLS/SSL protocol version enabled · ×1
  • Obsolete TLS/SSL protocol version enabled Engine/DataFeeds/LiveOptionChainProvider.cs:62 — `SecurityProtocol` explicitly selects `SecurityProtocolType.Tls11`, a protocol version that is broken (SSL 2.0/3.0) or withdrawn (TLS 1.0/1.1, RFC 8996). Offering an obsolete version does not merely permit it — it is what a downgrade attack negotiates, so the weakest version on the list is the one that decides the connection's strength. Stop pinning versions here: leave the protocol unset (`SecurityProtocolType.SystemDefault`, or simply do not assign it) so the connection uses the OS policy and picks up TLS 1.3 and future versions without a code change. Where a version must be named explicitly, name `Tls12` and `Tls13` only.
S1 · Cryptographic Hygiene · Weak hash algorithm · ×1
  • Weak hash algorithm Common/Extensions.cs:2429 — 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.
SC1 · Supply-chain hygiene · NuGet dependencies are not locked · ×1
  • NuGet dependencies are not locked — No packages.lock.json and no central package management — restores aren't reproducible or pinned (SSDF PW.4.4). Enable <RestorePackagesWithLockFile>true</RestorePackagesWithLockFile> (commit the lockfile) or adopt Directory.Packages.props. Advisory — never scored.
X18 · Disposal-pattern correctness · Owned disposable field is never released · ×1
  • Owned disposable field is never released Engine/DataFeeds/Queues/FakeDataQueue.cs:42 — `FakeDataQueue` implements `IDisposable` — so it has told every caller it holds something worth releasing — and it constructs `_subscriptionManager` itself (line 42), which makes that instance its own. But `_subscriptionManager` is named in none of the methods the disposal search covered: `Dispose` (line 155) — that is `Dispose` plus every method `Dispose` calls BY NAME, so a release reached through an interface, a delegate or a base class is not followed and is worth checking before acting. On what was read, the type's disposal releases everything except the one thing it owns. A disposable the owner never disposes is held until finalization if its type has a finalizer, and forever if it does not — which for a synchronisation primitive, a timer, a stream or a handle means the resource accumulates once per instance for the life of the process. Release it in `Dispose` (`_subscriptionManager?.Dispose();`), or, if it truly does not need releasing, drop `IDisposable` from the type so the claim and the behaviour agree.
X18 · Disposal-pattern correctness · Finalizer on a type that owns no unmanaged resource · ×1
  • Finalizer on a type that owns no unmanaged resource Common/Util/StreamReaderEnumerable.cs:102 — `StreamReaderEnumerable` declares a finalizer (line 102), but nothing in the type is unmanaged: no `IntPtr`/`UIntPtr` or pointer field, no `SafeHandle`, no `HandleRef`, no `extern`/`DllImport` member and no `Marshal`/`GCHandle`/`NativeMemory` use. A finalizer can only release what the garbage collector cannot, so on a purely-managed type it releases nothing and costs something: every instance is put on the finalizer queue, survives at least one extra collection, and is then finalized on a thread that is NOT the disposing one — where the managed objects it touches may already have been finalized themselves. Delete the finalizer (and the `GC.SuppressFinalize` that exists to defuse it); if a handle is added later, wrap it in a `SafeHandle`, which brings its own correct finalization.
Minor — 1317 finding(s)
D34 · Knowledge Freshness · Orphaned file · ×741
  • Orphaned file Common/Util/LinqExtensions.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Algorithm.CSharp/HistoryAlgorithm.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Indicators/IndicatorBase.Operators.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Algorithm.Framework/Portfolio/MeanReversionPortfolioConstructionModel.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Indicators/Alpha.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file ToolBox/RandomDataGenerator/RandomDataGeneratorSettings.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Common/Securities/MarketHoursDatabase.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Common/Scheduling/FluentScheduledEventBuilder.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Report/ReportElements/CrisisReportElement.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Common/Data/Auxiliary/TradeConditionFlags.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Indicators/Delta.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Common/Data/SliceExtensions.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Indicators/Gamma.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Indicators/Theta.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Algorithm.CSharp/BacktestingBrokerageRegressionAlgorithm.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file ToolBox/FactorFileGenerator.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Indicators/PivotPointsHighLow.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Common/StringExtensions.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Indicators/Rho.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Indicators/TomDemarkSequential.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Common/Securities/Option/StrategyMatcher/OptionStrategyDefinition.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Indicators/Vega.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Algorithm.CSharp/CapacityTests/EmaPortfolioRebalance100.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Report/DrawdownCollection.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file ToolBox/AlgoSeekFuturesConverter/AlgoSeekFuturesConverter.cs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • + 716 more in this group — see findings.md.
D24 · Comment Value · redundant comment · ×446
  • redundant comment Algorithm.CSharp/AccumulativeInsightPortfolioRegressionAlgorithm.cs:40 — "Set Start Date" repeats the code it sits on: 3 of its 3 words (set, start, date) are already in `SetStartDate(2013, 10, 07); //Set Start Date`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Algorithm.CSharp/AddAlphaModelAlgorithm.cs:42 — "Set Start Date" repeats the code it sits on: 3 of its 3 words (set, start, date) are already in `SetStartDate(2013, 10, 07); //Set Start Date`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Algorithm.CSharp/AddRemoveOptionUniverseRegressionAlgorithm.cs:135 — "remove contracts from expected data" repeats the code it sits on: 4 of its 4 words (remove, contracts, expected, data) are already in `_expectedData.RemoveWhere(s => _expectedContracts.Contains(s));`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Algorithm.CSharp/AddRemoveOptionUniverseRegressionAlgorithm.cs:137 — "remove option chain universe from expected universes" repeats the code it sits on: 6 of its 6 words (remove, option, chain, universe, expected, universes) are already in `_expectedUniverses.Remove(OptionChainSymbol);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Algorithm.CSharp/AddRemoveSecurityCacheRegressionAlgorithm.cs:34 — "Set Start Date" repeats the code it sits on: 3 of its 3 words (set, start, date) are already in `SetStartDate(2013, 10, 07); //Set Start Date`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Algorithm.CSharp/AddRemoveSecurityRegressionAlgorithm.cs:45 — "Set Start Date" repeats the code it sits on: 3 of its 3 words (set, start, date) are already in `SetStartDate(2013, 10, 07); //Set Start Date`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Algorithm.CSharp/AddRiskManagementAlgorithm.cs:39 — "Set Start Date" repeats the code it sits on: 3 of its 3 words (set, start, date) are already in `SetStartDate(2013, 10, 07); //Set Start Date`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Algorithm.CSharp/AddUniverseSelectionModelAlgorithm.cs:40 — "Set Start Date" repeats the code it sits on: 3 of its 3 words (set, start, date) are already in `SetStartDate(2013, 10, 08); //Set Start Date`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Algorithm.CSharp/AdjustedVolumeRegressionAlgorithm.cs:43 — "Set Start Date" repeats the code it sits on: 3 of its 3 words (set, start, date) are already in `SetStartDate(2014, 6, 5); //Set Start Date`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Algorithm.CSharp/Alphas/GasAndCrudeOilEnergyCorrelationAlpha.cs:70 — "Set Custom Execution Model" repeats the code it sits on: 4 of its 4 words (set, custom, execution, model) are already in `SetExecution(new CustomExecutionModel());`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Algorithm.CSharp/Alphas/GasAndCrudeOilEnergyCorrelationAlpha.cs:73 — "Set Null Risk Management Model" repeats the code it sits on: 5 of its 5 words (set, null, risk, management, model) are already in `SetRiskManagement(new NullRiskManagementModel());`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Algorithm.CSharp/Alphas/GasAndCrudeOilEnergyCorrelationAlpha.cs:208 — "Update daily rate of change indicator" repeats the code it sits on: 4 of its 5 words (update, daily, rate, change) are already in `symbolData.UpdateDailyRateOfChange(bar);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Algorithm.CSharp/Alphas/GlobalEquityMeanReversionIBSAlpha.cs:70 — "Set Immediate Execution Model" repeats the code it sits on: 4 of its 4 words (set, immediate, execution, model) are already in `SetExecution(new ImmediateExecutionModel());`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Algorithm.CSharp/Alphas/GlobalEquityMeanReversionIBSAlpha.cs:73 — "Set Null Risk Management Model" repeats the code it sits on: 5 of its 5 words (set, null, risk, management, model) are already in `SetRiskManagement(new NullRiskManagementModel());`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Algorithm.CSharp/Alphas/GreenblattMagicFormulaAlpha.cs:67 — "Set Immediate Execution Model" repeats the code it sits on: 4 of its 4 words (set, immediate, execution, model) are already in `SetExecution(new ImmediateExecutionModel());`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Algorithm.CSharp/Alphas/GreenblattMagicFormulaAlpha.cs:70 — "Set Null Risk Management Model" repeats the code it sits on: 5 of its 5 words (set, null, risk, management, model) are already in `SetRiskManagement(new NullRiskManagementModel());`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Algorithm.CSharp/Alphas/IntradayReversalCurrencyMarketsAlpha.cs:67 — "Set Immediate Execution Model" repeats the code it sits on: 4 of its 4 words (set, immediate, execution, model) are already in `SetExecution(new ImmediateExecutionModel());`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Algorithm.CSharp/Alphas/IntradayReversalCurrencyMarketsAlpha.cs:70 — "Set Null Risk Management Model" repeats the code it sits on: 5 of its 5 words (set, null, risk, management, model) are already in `SetRiskManagement(new NullRiskManagementModel());`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Algorithm.CSharp/Alphas/MeanReversionLunchBreakAlpha.cs:61 — "Set Immediate Execution Model" repeats the code it sits on: 4 of its 4 words (set, immediate, execution, model) are already in `SetExecution(new ImmediateExecutionModel());`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Algorithm.CSharp/Alphas/MeanReversionLunchBreakAlpha.cs:64 — "Set Null Risk Management Model" repeats the code it sits on: 5 of its 5 words (set, null, risk, management, model) are already in `SetRiskManagement(new NullRiskManagementModel());`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Algorithm.CSharp/Alphas/RebalancingLeveragedETFAlpha.cs:68 — "Set Immediate Execution Model" repeats the code it sits on: 4 of its 4 words (set, immediate, execution, model) are already in `SetExecution(new ImmediateExecutionModel());`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Algorithm.CSharp/Alphas/RebalancingLeveragedETFAlpha.cs:71 — "Set Null Risk Management Model" repeats the code it sits on: 5 of its 5 words (set, null, risk, management, model) are already in `SetRiskManagement(new NullRiskManagementModel());`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Algorithm.CSharp/Alphas/ShareClassMeanReversionAlpha.cs:69 — "Set Immediate Execution Model" repeats the code it sits on: 4 of its 4 words (set, immediate, execution, model) are already in `SetExecution(new ImmediateExecutionModel());`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Algorithm.CSharp/Alphas/ShareClassMeanReversionAlpha.cs:72 — "Set Null Risk Management Model" repeats the code it sits on: 5 of its 5 words (set, null, risk, management, model) are already in `SetRiskManagement(new NullRiskManagementModel());`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment Algorithm.CSharp/Alphas/SykesShortMicroCapAlpha.cs:55 — "Set Immediate Execution Model" repeats the code it sits on: 4 of its 4 words (set, immediate, execution, model) are already in `SetExecution(new ImmediateExecutionModel());`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • + 421 more in this group — see findings.md.
IC1 · Incompleteness & stubs · Commented-out code · ×25
  • Commented-out code Algorithm.CSharp/AddUniverseSelectionModelCoarseAlgorithm.cs:42 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Algorithm.CSharp/AlgorithmModeAndDeploymentTargetAlgorithm.cs:51 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Algorithm.CSharp/AlgorithmModeAndDeploymentTargetAlgorithm.cs:52 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Algorithm.CSharp/AlgorithmModeAndDeploymentTargetAlgorithm.cs:55 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Algorithm.CSharp/BasicTemplateCryptoAlgorithm.cs:66 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Algorithm.CSharp/BasicTemplateFrameworkAlgorithm.cs:61 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Algorithm.CSharp/BasicTemplateFrameworkAlgorithm.cs:63 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Algorithm.CSharp/BasicTemplateFuturesConsolidationAlgorithm.cs:49 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Algorithm.CSharp/BasicTemplateIndiaAlgorithm.cs:49 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Algorithm.CSharp/BasicTemplateMultiAssetAlgorithm.cs:64 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Algorithm.CSharp/BasicTemplateMultiAssetAlgorithm.cs:71 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Algorithm.CSharp/BasicTemplateMultiAssetAlgorithm.cs:76 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Algorithm.CSharp/BasicTemplateOptionTradesAlgorithm.cs:47 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Algorithm.CSharp/BasicTemplateOptionsHistoryAlgorithm.cs:46 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Algorithm.CSharp/BlackLittermanPortfolioOptimizationFrameworkAlgorithm.cs:42 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Algorithm.CSharp/BrokerageModelAlgorithm.cs:45 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Algorithm.CSharp/BrokerageModelAlgorithm.cs:46 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Algorithm.CSharp/BrokerageModelAlgorithm.cs:47 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Algorithm.CSharp/BubbleAlgorithm.cs:61 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Algorithm.CSharp/BubbleAlgorithm.cs:62 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Algorithm.CSharp/BubbleAlgorithm.cs:66 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Algorithm.CSharp/BubbleAlgorithm.cs:67 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Algorithm.CSharp/BubbleAlgorithm.cs:71 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Algorithm.CSharp/BubbleAlgorithm.cs:72 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
  • Commented-out code Algorithm.CSharp/ComboOrdersFillModelAlgorithm.cs:211 — A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
X10 · Duplicated predicate · Duplicated predicate · ×25
  • Duplicated predicate Engine/DataFeeds/ApiDataProvider.cs:192 — `!File.Exists(filePath) || filePath.IsOutOfDate()` appears character-identically in 2 files — Engine/DataFeeds/ApiDataProvider.cs, Engine/DataFeeds/DownloaderDataProvider.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Algorithm.CSharp/CapacityTests/CheeseMilkHourlyRebalance.cs:77 — `!Portfolio.ContainsKey(contract) || (Portfolio[contract].Quantity <= 0 && _fast > _slow)` appears character-identically in 2 files — Algorithm.CSharp/CapacityTests/CheeseMilkHourlyRebalance.cs, Algorithm.CSharp/CapacityTests/IntradayMinuteScalpingFuturesES.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Algorithm.CSharp/BasicTemplateOptionsAlgorithm.cs:66 — `!Portfolio.Invested && IsMarketOpen(_optionSymbol)` appears character-identically in 7 files — Algorithm.CSharp/BasicTemplateOptionsAlgorithm.cs, Algorithm.CSharp/BasicTemplateOptionsHourlyAlgorithm.cs, Algorithm.CSharp/OptionExpiryDateOnHolidayCase.cs, Algorithm.CSharp/OptionFilterReturnsNullRegressionAlgorithm.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Algorithm.CSharp/HourReverseSplitRegressionAlgorithm.cs:47 — `!Portfolio.Invested && Time.Date == EndDate.Date` appears character-identically in 2 files — Algorithm.CSharp/HourReverseSplitRegressionAlgorithm.cs, Algorithm.CSharp/HourSplitRegressionAlgorithm.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Algorithm.CSharp/RegressionTests/CustomData/CustomDataLinkedIconicTypeAddDataCoarseSelectionRegressionAlgorithm.cs:72 — `!Portfolio.Invested && Transactions.GetOpenOrders().Count == 0` appears character-identically in 2 files — Algorithm.CSharp/RegressionTests/CustomData/CustomDataLinkedIconicTypeAddDataCoarseSelectionRegressionAlgorithm.cs, Algorithm.CSharp/RegressionTests/CustomData/CustomDataLinkedIconicTypeAddDataOnSecuritiesChangedRegressionAlgorithm.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Algorithm.CSharp/BasicTemplateCryptoFutureAlgorithm.cs:98 — `!Portfolio.Invested && Transactions.OrdersCount == 0` appears character-identically in 4 files — Algorithm.CSharp/BasicTemplateCryptoFutureAlgorithm.cs, Algorithm.CSharp/BasicTemplateCryptoFutureHourlyAlgorithm.cs, Algorithm.CSharp/BybitCryptoFuturesRegressionAlgorithm.cs, Algorithm.CSharp/CoveredCallComboLimitOrderAlgorithm.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Optimizer/Strategies/EulerSearchOptimizationStrategy.cs:72 — `!ReferenceEquals(result, OptimizationResult.Initial) && string.IsNullOrEmpty(result?.JsonBacktestResult)` appears character-identically in 2 files — Optimizer/Strategies/EulerSearchOptimizationStrategy.cs, Optimizer/Strategies/GridSearchOptimizationStrategy.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Engine/DataFeeds/CachingFutureChainProvider.cs:52 — `!_cache.TryGetValue(symbol, out entry) || date.Date != entry.Date` appears character-identically in 2 files — Engine/DataFeeds/CachingFutureChainProvider.cs, Engine/DataFeeds/CachingOptionChainProvider.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Algorithm.CSharp/IndicatorBasedOptionPricingModelRegressionAlgorithm.cs:64 — `!_checked && slice.OptionChains.TryGetValue(_option.Symbol, out var chain)` appears character-identically in 2 files — Algorithm.CSharp/IndicatorBasedOptionPricingModelRegressionAlgorithm.cs, Algorithm.CSharp/QLOptionPricingModelRegressionAlgorithm.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Algorithm.CSharp/FuturesChainFiltersRegressionAlgorithm.cs:134 — `!_esChainSeen || !_gcChainSeen || !_traded` appears character-identically in 2 files — Algorithm.CSharp/FutureUniverseFiltersRegressionAlgorithm.cs, Algorithm.CSharp/FuturesChainFiltersRegressionAlgorithm.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Algorithm.CSharp/SecurityInitializationOnReAdditionForSelectedOptionRegressionAlgorithm.cs:135 — `!_securityInializationCounts.TryGetValue(x, out var count) || count != 1` appears character-identically in 2 files — Algorithm.CSharp/SecurityInitializationOnReAdditionForSelectedOptionRegressionAlgorithm.cs, Algorithm.CSharp/SecurityInitializationOnReAdditionForUniverseSelectionRegressionAlgorithm.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Algorithm.CSharp/FutureContractsExtendedMarketHoursRegressionAlgorithm.cs:58 — `!esIsInRegularHours && _es.Exchange.Hours.IsOpen(Time, true)` appears character-identically in 2 files — Algorithm.CSharp/FutureContractsExtendedMarketHoursRegressionAlgorithm.cs, Algorithm.CSharp/FuturesExtendedMarketHoursRegressionAlgorithm.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Algorithm.CSharp/FutureContractsExtendedMarketHoursRegressionAlgorithm.cs:64 — `!gcIsInRegularHours && _gc.Exchange.Hours.IsOpen(Time, true)` appears character-identically in 2 files — Algorithm.CSharp/FutureContractsExtendedMarketHoursRegressionAlgorithm.cs, Algorithm.CSharp/FuturesExtendedMarketHoursRegressionAlgorithm.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Algorithm.CSharp/SecurityInitializationOnReAdditionForEquityRegressionAlgorithm.cs:170 — `!securityInializationCounts.TryGetValue(security, out var count) || count != 1` appears character-identically in 2 files — Algorithm.CSharp/SecurityInitializationOnReAdditionForEquityRegressionAlgorithm.cs, Algorithm.CSharp/SecurityInitializationOnReAdditionForManuallyAddedOptionRegressionAlgorithm.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Algorithm.CSharp/CoarseFineFundamentalRegressionAlgorithm.cs:100 — `!slice.Delistings.ContainsKey(sym) || slice.Delistings[sym].Type != DelistingType.Delisted` appears character-identically in 2 files — Algorithm.CSharp/CoarseFineFundamentalRegressionAlgorithm.cs, Algorithm.CSharp/UniverseSelectionRegressionAlgorithm.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Algorithm.CSharp/EuropeanOptionsCannotBeExercisedBeforeExpiryRegressionAlgorithm.cs:66 — `!slice.OptionChains.TryGetValue(_option.Symbol, out contracts) || !contracts.Any()` appears character-identically in 2 files — Algorithm.CSharp/EuropeanOptionsCannotBeExercisedBeforeExpiryRegressionAlgorithm.cs, Algorithm.CSharp/InteractiveBrokersBrokerageDisablesIndexOptionsExerciseRegressionAlgorithm.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Common/Securities/Future/FutureMarginModel.cs:277 — `!x.StartsWith("#") && !string.IsNullOrWhiteSpace(x)` appears character-identically in 2 files — Common/Securities/Future/FutureMarginModel.cs, Common/Securities/SymbolPropertiesDatabase.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Algorithm.CSharp/OptionEquityBaseStrategyRegressionAlgorithm.cs:55 — `((OptionStrategyPositionGroupBuyingPowerModel)@group.BuyingPowerModel).ToString() == name && (!quantity.HasValue || Math.Abs(group.Quantity)…` appears character-identically in 2 files — Algorithm.CSharp/OptionEquityBaseStrategyRegressionAlgorithm.cs, Algorithm.CSharp/OptionStrategyFilteringUniverseBaseAlgorithm.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Algorithm.CSharp/Collective2PortfolioSignalExportDemonstrationAlgorithm.cs:131 — `(_fast < _slow * 0.999m) && (_emaFastWasAbove)` appears character-identically in 2 files — Algorithm.CSharp/Collective2PortfolioSignalExportDemonstrationAlgorithm.cs, Algorithm.CSharp/Collective2SignalExportDemonstrationAlgorithm.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Algorithm.CSharp/Collective2PortfolioSignalExportDemonstrationAlgorithm.cs:126 — `(_fast > _slow * 1.001m) && (!_emaFastWasAbove)` appears character-identically in 2 files — Algorithm.CSharp/Collective2PortfolioSignalExportDemonstrationAlgorithm.cs, Algorithm.CSharp/Collective2SignalExportDemonstrationAlgorithm.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Engine/DataFeeds/BacktestingChainProvider.cs:79 — `(history == null || history.Count == 0) && periods <= 3` appears character-identically in 2 files — Algorithm/QCAlgorithm.cs, Engine/DataFeeds/BacktestingChainProvider.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Indicators/CandlestickPatterns/Kicking.cs:96 — `(int)GetCandleColor(window[1]) == -(int)GetCandleColor(input) && // 1st marubozu GetRealBody(window[1]) > GetCandleAverage(CandleSettingType…` appears character-identically in 2 files — Indicators/CandlestickPatterns/Kicking.cs, Indicators/CandlestickPatterns/KickingByLength.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Common/Brokerages/BinanceBrokerageModel.cs:73 — `AccountType == AccountType.Cash || security.IsInternalFeed() || security.Type == SecurityType.Base` appears character-identically in 6 files — Common/Brokerages/BinanceBrokerageModel.cs, Common/Brokerages/BitfinexBrokerageModel.cs, Common/Brokerages/BybitBrokerageModel.cs, Common/Brokerages/ExanteBrokerageModel.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Engine/DataFeeds/Enumerators/DividendEventProvider.cs:74 — `Config.Symbol == eventArgs.Symbol && FactorFile != null && _mapFile.HasData(eventArgs.Date)` appears character-identically in 2 files — Engine/DataFeeds/Enumerators/DividendEventProvider.cs, Engine/DataFeeds/Enumerators/SplitEventProvider.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Algorithm.CSharp/BasicTemplateOptionEquityStrategyAlgorithm.cs:61 — `IsMarketOpen(_optionSymbol) && slice.OptionChains.TryGetValue(_optionSymbol, out chain)` appears character-identically in 39 files — Algorithm.CSharp/BasicTemplateOptionEquityStrategyAlgorithm.cs, Algorithm.CSharp/ComboOrderAlgorithm.cs, Algorithm.CSharp/ComboOrderTicketDemoAlgorithm.cs, Algorithm.CSharp/CoveredCallComboLimitOrderAlgorithm.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
X7 · Silent fallback defaults · Silent fallback default in catch · ×16
  • Silent fallback default in catch Engine/DataFeeds/BaseSubscriptionDataSourceReader.cs:137 — `HandleRemoteSourceFile` swallows every exception into `return null;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
  • Silent fallback default in catch Common/BinaryComparison.cs:192 — `MakeBinaryComparisonLambdaOrNull` swallows every exception into `return null;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
  • Silent fallback default in catch Common/Data/Fundamental/FundamentalUniverse.cs:79 — `Reader` swallows every exception into `return null;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
  • Silent fallback default in catch Common/Data/UniverseSelection/CoarseFundamentalDataProvider.cs:151 — `Read` swallows every exception into `return null;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
  • Silent fallback default in catch Common/Data/UniverseSelection/ConstituentsUniverseData.cs:91 — `Reader` swallows every exception into `return null;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
  • Silent fallback default in catch Common/Extensions.cs:715 — `ToFunc` swallows `InvalidOperationException` into `return Time.EndOfTime;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
  • Silent fallback default in catch Common/Securities/Option/StrategyMatcher/OptionStrategyLegPredicate.cs:73 — `Matches` swallows `InvalidOperationException` into `return false;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
  • Silent fallback default in catch Common/Util/Composer.cs:189 — `GetExportedTypes` swallows every exception into `return false;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
  • Silent fallback default in catch Common/Util/DisposableExtensions.cs:58 — `DisposeSafely` swallows `ObjectDisposedException` into `return true;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
  • Silent fallback default in catch Common/Util/Validate.cs:58 — `EmailAddress` swallows every exception into `return false;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
  • Silent fallback default in catch Common/Util/Validate.cs:80 — `NormalizeEmailAddressDomainName` swallows every exception into `return null;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
  • Silent fallback default in catch Indicators/IndicatorBase.cs:322 — `Equals` swallows `InvalidCastException` into `return false;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
  • Silent fallback default in catch Algorithm.CSharp/CustomDataTypeHistoryAlgorithm.cs:94 — `Reader` swallows every exception into `return null;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
  • Silent fallback default in catch Algorithm.CSharp/CustomDataUniverseImmediateSelectionRegressionAlgorithm.cs:139 — `Reader` swallows every exception into `return null;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
  • Silent fallback default in catch Algorithm.CSharp/CustomDataZipFileRegressionAlgorithm.cs:89 — `Reader` swallows every exception into `return null;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
  • Silent fallback default in catch Algorithm.CSharp/DropboxBaseDataUniverseSelectionAlgorithm.cs:187 — `Reader` swallows every exception into `return null;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
X23 · Unguarded diagnostic materialisation · Diagnostic log message is built whether or not it is wanted · ×12
  • Diagnostic log message is built whether or not it is wanted Engine/DataFeeds/DataQueueHandlerManager.cs:253 — `Trace` at line 253 is called with an argument built by `string.Join(",", timeProviders.Select(x => x.GetType()))` (line 253), whose cost grows with the collection it walks. C# evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because Trace is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `IsEnabled` test, no debug flag, no conditional-compilation region.
  • Diagnostic log message is built whether or not it is wanted Engine/HistoricalData/HistoryProviderManager.cs:126 — `Trace` at line 126 is called with an argument built by `string.Join(",", _historyProviders.Select(x => x.GetType().Name))` (line 126), whose cost grows with the collection it walks. C# evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because Trace is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `IsEnabled` test, no debug flag, no conditional-compilation region.
  • Diagnostic log message is built whether or not it is wanted Engine/HistoricalData/HistoryProviderManager.cs:165 — `Trace` at line 165 is called with an argument built by `string.Join(",", _historyProviders.Skip(1).Select(x => x.GetType().Name))` (line 166), whose cost grows with the collection it walks. C# evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because Trace is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `IsEnabled` test, no debug flag, no conditional-compilation region.
  • Diagnostic log message is built whether or not it is wanted Engine/Results/RegressionResultHandler.cs:400 — `Trace` at line 400 is called with an argument built by `string.Join(Environment.NewLine, holdings)` (line 400), whose cost grows with the collection it walks. C# evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because Trace is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `IsEnabled` test, no debug flag, no conditional-compilation region.
  • Diagnostic log message is built whether or not it is wanted Common/Data/EventBasedDataQueueHandlerSubscriptionManager.cs:66 — `Trace` at line 66 is called with an argument built by `string.Join(",", symbols.Select(x => x.Value))` (line 66), whose cost grows with the collection it walks. C# evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because Trace is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `IsEnabled` test, no debug flag, no conditional-compilation region.
  • Diagnostic log message is built whether or not it is wanted Common/Data/EventBasedDataQueueHandlerSubscriptionManager.cs:78 — `Trace` at line 78 is called with an argument built by `string.Join(",", symbols.Select(x => x.Value))` (line 78), whose cost grows with the collection it walks. C# evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because Trace is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `IsEnabled` test, no debug flag, no conditional-compilation region.
  • Diagnostic log message is built whether or not it is wanted AlgorithmFactory/Loader.cs:251 — `Debug` at line 251 is called with an argument built by `string.Join(",", types)` (line 251), whose cost grows with the collection it walks. C# evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because Debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `IsEnabled` test, no debug flag, no conditional-compilation region.
  • Diagnostic log message is built whether or not it is wanted Brokerages/BrokerageMultiWebSocketSubscriptionManager.cs:138 — `Trace` at line 138 is called with an argument built by `string.Join(",", symbols.Select(x => x.Value))` (line 138), whose cost grows with the collection it walks. C# evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because Trace is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `IsEnabled` test, no debug flag, no conditional-compilation region.
  • Diagnostic log message is built whether or not it is wanted Brokerages/BrokerageMultiWebSocketSubscriptionManager.cs:159 — `Trace` at line 159 is called with an argument built by `string.Join(",", symbols.Select(x => x.Value))` (line 159), whose cost grows with the collection it walks. C# evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because Trace is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `IsEnabled` test, no debug flag, no conditional-compilation region.
  • Diagnostic log message is built whether or not it is wanted Api/Api.cs:1008 — `Trace` at line 1008 is called with an argument built by `string.Join(',', dataLink.Errors)` (line 1009), whose cost grows with the collection it walks. C# evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because Trace is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `IsEnabled` test, no debug flag, no conditional-compilation region.
  • Diagnostic log message is built whether or not it is wanted ToolBox/AlgoSeekFuturesConverter/AlgoSeekFuturesProgram.cs:75 — `Trace` at line 75 is called with an argument built by `string.Join(";", resolutionList.Select(x => x.ToString()).ToArray())` (line 75), whose cost grows with the collection it walks. C# evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because Trace is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `IsEnabled` test, no debug flag, no conditional-compilation region.
  • Diagnostic log message is built whether or not it is wanted ToolBox/CoarseUniverseGenerator/CoarseUniverseGeneratorProgram.cs:144 — `Debug` at line 144 is called with an argument built by `string.Join(",", sidContext.Tickers)` (line 144), whose cost grows with the collection it walks. C# evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because Debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `IsEnabled` test, no debug flag, no conditional-compilation region.
AX6 · Interface segregation · Fat interface · ×7
  • Fat interface: IResultHandler (24 members) Engine/Results/IResultHandler.cs:35 — `IResultHandler` declares 24 members: `Messages`, `IsActive`, `OnSecuritiesChanged`, `OnWarmupFinished`, `Initialize`, `DebugMessage`, `SystemDebugMessage`, `SecurityType`, `LogMessage`, `ErrorMessage`, `RuntimeError`, `BrokerageMessage`, `Sample`, `SetAlgorithm`, `SendStatusUpdate`, `RuntimeStatistic`, `AddDeploymentDetail`, `DeploymentDetails`, `OrderEvent`, `Exit`, `ProcessSynchronousEvents`, `SaveResults`, `AlgorithmNameUpdated`, `AlgorithmTagsUpdated`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: IBrokerageModel (18 members) Common/Brokerages/IBrokerageModel.cs:34 — `IBrokerageModel` declares 18 members: `AccountType`, `RequiredFreeBuyingPowerPercent`, `DefaultMarkets`, `CanSubmitOrder`, `CanUpdateOrder`, `CanExecuteOrder`, `ApplySplit`, `GetLeverage`, `GetBenchmark`, `GetFillModel`, `GetFeeModel`, `GetSlippageModel`, `GetSettlementModel`, `GetMarginInterestRateModel`, `GetSettlementModel`, `GetBuyingPowerModel`, `GetBuyingPowerModel`, `GetShortableProvider`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. Those 18 declarations carry 16 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 16 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: IAlgorithm (126 members) Common/Interfaces/IAlgorithm.cs:52 — `IAlgorithm` declares 126 members: `InsightsGenerated`, `TimeKeeper`, `SubscriptionManager`, `ProjectId`, `Securities`, `UniverseManager`, `Portfolio`, `Transactions`, `BrokerageModel`, `BrokerageName`, `RiskFreeInterestRateModel`, `BrokerageMessageHandler`, `Notify`, `Schedule`, `HistoryProvider`, `Status`, `IsWarmingUp`, `Name`, `Tags`, `NameUpdated`, `TagsUpdated`, `Time`, `TimeZone`, `UtcTime`, `StartDate`, `EndDate`, `AlgorithmId`, `LiveMode`, `AlgorithmMode`, `DeploymentTarget`, `UniverseSettings`, `DebugMessages`, `ErrorMessages`, `LogMessages`, `RunTimeError`, `RuntimeStatistics`, `Statistics`, `Benchmark`, `TradeBuilder`, `Settings`, and 86 more. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. Those 126 declarations carry 119 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 119 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: IAlgorithmSettings (19 members) Common/Interfaces/IAlgorithmSettings.cs:24 — `IAlgorithmSettings` declares 19 members: `AutomaticIndicatorWarmUp`, `RebalancePortfolioOnSecurityChanges`, `RebalancePortfolioOnInsightChanges`, `MaxAbsolutePortfolioTargetPercentage`, `MinAbsolutePortfolioTargetPercentage`, `MinimumOrderMarginPortfolioPercentage`, `FreePortfolioValue`, `FreePortfolioValuePercentage`, `LiquidateEnabled`, `DailyPreciseEndTime`, `DailyConsolidationUseExtendedMarketHours`, `DataSubscriptionLimit`, `StalePriceTimeSpan`, `WarmupResolution`, `TradingDaysPerYear`, `DatabasesRefreshPeriod`, `IgnoreUnknownAssetHoldings`, `PerformanceSamplePeriod`, `SeedInitialPrices`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: IApi (65 members) Common/Interfaces/IApi.cs:32 — `IApi` declares 65 members: `Initialize`, `CreateProject`, `ReadProject`, `UpdateProject`, `AddProjectFile`, `UpdateProjectFileName`, `UpdateProjectFileContent`, `ReadProjectFile`, `ReadProjectFiles`, `ReadProjectNodes`, `UpdateProjectNodes`, `DeleteProjectFile`, `DeleteProject`, `ListProjects`, `CreateCompile`, `ReadCompile`, `CreateBacktest`, `ReadBacktest`, `UpdateBacktest`, `UpdateBacktestTags`, `DeleteBacktest`, `ListBacktests`, `ReadBacktestInsights`, `ReadBacktestOrders`, `ReadBacktestLog`, `EstimateOptimization`, `CreateOptimization`, `ListOptimizations`, `ReadOptimization`, `AbortOptimization`, `UpdateOptimization`, `DeleteOptimization`, `ReadLiveLogs`, `ReadLiveChart`, `ReadLivePortfolio`, `ReadLiveInsights`, `ReadLiveInsights`, `ReadLiveOrders`, `ReadDataLink`, `ReadDataDirectory`, and 25 more. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. Those 65 declarations carry 64 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 64 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: IBrokerage (23 members) Common/Interfaces/IBrokerage.cs:29 — `IBrokerage` declares 23 members: `OrderIdChanged`, `OrdersStatusChanged`, `OrderUpdated`, `OptionPositionAssigned`, `OptionNotification`, `NewBrokerageOrderNotification`, `DelistingNotification`, `AccountChanged`, `Message`, `Name`, `IsConnected`, `GetOpenOrders`, `GetAccountHoldings`, `GetCashBalance`, `PlaceOrder`, `UpdateOrder`, `CancelOrder`, `Connect`, `Disconnect`, `AccountInstantlyUpdated`, `AccountBaseCurrency`, `GetHistory`, `ConcurrencyEnabled`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: IOptionContractFilters<TSelf> (42 members) Common/Securities/Option/IOptionContractFilters.cs:27 — `IOptionContractFilters<TSelf>` declares 42 members: `Strikes`, `Strikes`, `StrikesAbove`, `StrikesBelow`, `OutOfTheMoney`, `OTM`, `InTheMoney`, `ITM`, `AtTheMoney`, `ATM`, `CallsOnly`, `PutsOnly`, `Delta`, `D`, `Gamma`, `G`, `Theta`, `T`, `Vega`, `V`, `Rho`, `R`, `ImpliedVolatility`, `IV`, `NakedCall`, `NakedPut`, `CallSpread`, `PutSpread`, `CallCalendarSpread`, `PutCalendarSpread`, `Strangle`, `Straddle`, `ProtectiveCollar`, `Conversion`, `CallButterfly`, `PutButterfly`, `IronButterfly`, `IronCondor`, `BoxSpread`, `JellyRoll`, and 2 more. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. Those 42 declarations carry 41 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 41 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
D16 · Bus Factor · Off-boarding risk · ×6
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 46 significant file(s) lose their only recent owner: Common/Securities/Option/OptionFilterUniverse.cs, Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs, Common/Python/PandasData.cs, Common/Data/Market/OptionChain.Filters.cs, Common/Securities/Option/StrategyMatcher/OptionPositionCollection.cs, Common/Statistics/TradeBuilder.cs, Engine/DataFeeds/TimeSliceFactory.cs, Common/Securities/ContractSecurityFilterUniverse.cs (+38 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 28 significant file(s) lose their only recent owner: REDACTED, Brokerages/Backtesting/BacktestingBrokerage.cs, Report/PortfolioLooper/PortfolioLooper.cs, Common/Data/UniverseSelection/Universe.cs, ToolBox/CoarseUniverseGenerator/CoarseUniverseGeneratorProgram.cs, Engine/DataFeeds/SubscriptionSynchronizer.cs, Engine/LeanEngineAlgorithmHandlers.cs, Engine/DataFeeds/SubscriptionUtils.cs (+20 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 14 significant file(s) lose their only recent owner: Indicators/AutoRegressiveIntegratedMovingAverage.cs, Common/Securities/Future/FutureMarginModel.cs, Indicators/PythonIndicator.cs, Indicators/CandlestickPatterns/AbandonedBaby.cs, Indicators/CandlestickPatterns/MatHold.cs, Indicators/CandlestickPatterns/RiseFallThreeMethods.cs, Indicators/ConnorsRelativeStrengthIndex.cs, Indicators/AdvanceDeclineIndicator.cs (+6 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #4 — If anonymized user #4 becomes unavailable, 9 significant file(s) lose their only recent owner: Brokerages/SymbolPropertiesDatabaseSymbolMapper.cs, Algorithm.CSharp/ScheduledUniverseSelectionModelRegressionAlgorithm.cs, Common/Statistics/PerformanceMetrics.cs, Algorithm.CSharp/CustomOptionPriceModelRegressionAlgorithm.cs, Algorithm.CSharp/MarketHourAwareIntradayConsolidationRegressionAlgorithm.cs, Common/Data/Consolidators/ConsolidatorBase.cs, Common/Data/Market/Greeks.cs, Common/Data/Consolidators/SequentialConsolidator.cs (+1 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #5 — If anonymized user #5 becomes unavailable, 7 significant file(s) lose their only recent owner: Common/Exchange.cs, Common/Brokerages/BrokerageExtensions.cs, Brokerages/LevelOneOrderBook/LevelOneMarketData.cs, Brokerages/Authentication/LeanTokenHandler.cs, Common/Brokerages/BloombergFixBrokerageModel.cs, Engine/HistoricalData/MappedSynchronizingHistoryProvider.cs, Common/Orders/EzeOrderProperties.cs. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #6 — If anonymized user #6 becomes unavailable, 4 significant file(s) lose their only recent owner: Indicators/KnowSureThing.cs, Algorithm.Framework/Selection/QC500UniverseSelectionModel.cs, Common/Data/Auxiliary/LocalZipMapFileProvider.cs, Engine/DataFeeds/Enumerators/Factories/BaseDataCollectionSubscriptionEnumeratorFactory.cs. Pair on, review, or document these before any departure.
D12 · Dependency Hygiene · Outdated · ×5
  • Outdated: System.ComponentModel.Composition Logging/QuantConnect.Logging.csproj:37 — System.ComponentModel.Composition 6.0.0 → 11.0.0 available (referenced by QuantConnect.Logging).
  • Outdated: Deedle Report/QuantConnect.Report.csproj:43 — Deedle 2.1.0 → 8.1.0 available (referenced by QuantConnect.Tests).
  • Outdated: CsvHelper Brokerages/QuantConnect.Brokerages.csproj:32 — CsvHelper 19.0.0 → 34.0.0 available (referenced by QuantConnect.Brokerages).
  • Outdated: RestSharp Api/QuantConnect.Api.csproj:37 — RestSharp 106.12.0 → 114.1.0 available (referenced by QuantConnect.Brokerages).
  • Outdated: McMaster.Extensions.CommandLineUtils Configuration/QuantConnect.Configuration.csproj:33 — McMaster.Extensions.CommandLineUtils 2.6.0 → 5.1.0 available (referenced by QuantConnect.Configuration).
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×4
  • Projects may be oversized for their cohesion Common/QuantConnect.csproj:1 — `QuantConnect` overshoots its size bounds (271850 LoC, 2357 public types across 64 namespaces). 4 of 23 project(s) overshoot their size bounds, lowering Project Cohesion to 6.5/10. Size alone is no reason to split a project: where its type references show a separable part, a Split row names it.
  • Projects may be oversized for their cohesion Algorithm.CSharp/QuantConnect.Algorithm.CSharp.csproj:1 — `QuantConnect.Algorithm.CSharp` overshoots its size bounds (121724 LoC, 951 public types across 6 namespaces). 4 of 23 project(s) overshoot their size bounds, lowering Project Cohesion to 6.5/10. Size alone is no reason to split a project: where its type references show a separable part, a Split row names it.
  • Projects may be oversized for their cohesion Engine/QuantConnect.Lean.Engine.csproj:1 — `QuantConnect.Lean.Engine` overshoots its size bounds (35519 LoC, 231 public types across 27 namespaces). 4 of 23 project(s) overshoot their size bounds, lowering Project Cohesion to 6.5/10. Size alone is no reason to split a project: where its type references show a separable part, a Split row names it.
  • Projects may be oversized for their cohesion Indicators/QuantConnect.Indicators.csproj:1 — `QuantConnect.Indicators` overshoots its size bounds (28136 LoC, 241 public types across 2 namespaces). 4 of 23 project(s) overshoot their size bounds, lowering Project Cohesion to 6.5/10. Size alone is no reason to split a project: where its type references show a separable part, a Split row names it.
D31 · IaC & Container Security · Low IaC · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
X7 · Silent fallback defaults · Silent fallback default on lookup miss · ×2
  • Silent fallback default on lookup miss Algorithm/QCAlgorithm.cs:3575 — `OptionChain` answers a miss of `OptionChains(new[] { symbol }, flatten).Values.SingleOrDefault()` with `new OptionChain(GetCanonicalOptionSymbol(symbol), Time.Date, flatten)` — an entity fabricated around `flatten`, which the caller cannot tell from a stored one. Return null or a not-found result, or throw.
  • Silent fallback default on lookup miss Common/Data/SubscriptionManager.cs:300 — `RemoveConsolidator` answers a miss of `FindPythonConsolidator(symbol, pyConsolidator)` with `new DataConsolidatorPythonWrapper(pyConsolidator)` — an entity fabricated around `pyConsolidator`, which the caller cannot tell from a stored one. Return null or a not-found result, or throw.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 12 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (135 single-owned of 1880 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 1880 of the 2749 production source files in this repository met that bar). They are anonymized user #7 (2 file(s)), anonymized user #8 (2 file(s)), anonymized user #9 (2 file(s)), anonymized user #10 (2 file(s)), anonymized user #11 (2 file(s)), anonymized user #12 (2 file(s)) (+6 more) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: Common/Orders/Slippage/MarketImpactSlippageModel.cs, Common/Orders/Slippage/VolumeShareSlippageModel.cs, Indicators/SwissArmyKnife.cs, Indicators/LeastSquaresMovingAverageWithReference.cs, Common/SymbolCache.cs, Algorithm.CSharp/EquityDottedTickerAdditionOrderRegressionAlgorithm.cs, Algorithm.CSharp/TrainingInitializeRegressionAlgorithm.cs, Common/Interfaces/IRegressionAlgorithmDefinition.cs (+11 more).
D19 · Documentation Quality · Documentation · ×1
  • Documentation: no build, run or usage example ToolBox/README.md:1 — `ToolBox` is an executable (`OutputType Exe`) and neither `ToolBox/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`.
D21 · Naming Consistency · `ConvertToCSVFormat` spells `CSV` where 22 names in the project spell it `Csv` · ×1
  • `ConvertToCSVFormat` spells `CSV` where 22 names in the project spell it `Csv` Common/Algorithm/Framework/Portfolio/SignalExports/CrunchDAOSignalExport.cs:141 — 22 of 24 names in project QuantConnect spell the token `Csv` (22 of 24; unit: names in project QuantConnect containing `Csv`). Peers: VBaseSignalExport.BuildCsv (Common/Algorithm/Framework/Portfolio/SignalExports/VBaseSignalExport.cs:126); MapFile.ToCsvLines (Common/Data/Auxiliary/MapFile.cs:146); MapFile.WriteToCsv (Common/Data/Auxiliary/MapFile.cs:156); MapFileRow.ToCsv (Common/Data/Auxiliary/MapFileRow.cs:183); InterestRateProvider.FromCsvFile (Common/Data/InterestRateProvider.cs:112). Rename to `ConvertToCsvFormat`. [rule N6]
D21 · Naming Consistency · `GetCurrentRoundID` spells `ID` where 256 names in the project spell it `Id` · ×1
  • `GetCurrentRoundID` spells `ID` where 256 names in the project spell it `Id` Common/Algorithm/Framework/Portfolio/SignalExports/CrunchDAOSignalExport.cs:216 — 256 of 263 names in project QuantConnect spell the token `Id` (256 of 263; unit: names in project QuantConnect containing `Id`). Peers: Insight.GroupId (Common/Algorithm/Framework/Alphas/Insight.cs:44); SerializedInsight.GroupId (Common/Algorithm/Framework/Alphas/Serialization/SerializedInsight.cs:39); SerializedInsight.OldGroupId (Common/Algorithm/Framework/Alphas/Serialization/SerializedInsight.cs:189); Collective2SignalExport._systemId (Common/Algorithm/Framework/Portfolio/SignalExports/Collective2SignalExport.cs:54); CrunchDAOSignalExport.GetCurrentRoundID(currentRoundId) (Common/Algorithm/Framework/Portfolio/SignalExports/CrunchDAOSignalExport.cs:216). Rename to `GetCurrentRoundId`. [rule N6]
D21 · Naming Consistency · `GetFxcmIDFromSymbol` spells `ID` where 256 names in the project spell it `Id` · ×1
  • `GetFxcmIDFromSymbol` spells `ID` where 256 names in the project spell it `Id` Common/Data/Custom/FxcmVolume.cs:198 — 256 of 263 names in project QuantConnect spell the token `Id` (256 of 263; unit: names in project QuantConnect containing `Id`). Peers: Insight.GroupId (Common/Algorithm/Framework/Alphas/Insight.cs:44); SerializedInsight.GroupId (Common/Algorithm/Framework/Alphas/Serialization/SerializedInsight.cs:39); SerializedInsight.OldGroupId (Common/Algorithm/Framework/Alphas/Serialization/SerializedInsight.cs:189); Collective2SignalExport._systemId (Common/Algorithm/Framework/Portfolio/SignalExports/Collective2SignalExport.cs:54); CrunchDAOSignalExport.GetCurrentRoundID(currentRoundId) (Common/Algorithm/Framework/Portfolio/SignalExports/CrunchDAOSignalExport.cs:216). Rename to `GetFxcmIdFromSymbol`. [rule N6]
D21 · Naming Consistency · `OrganizationID` spells `ID` where 256 names in the project spell it `Id` · ×1
  • `OrganizationID` spells `ID` where 256 names in the project spell it `Id` Common/Globals.cs:56 — 256 of 263 names in project QuantConnect spell the token `Id` (256 of 263; unit: names in project QuantConnect containing `Id`). Peers: Insight.GroupId (Common/Algorithm/Framework/Alphas/Insight.cs:44); SerializedInsight.GroupId (Common/Algorithm/Framework/Alphas/Serialization/SerializedInsight.cs:39); SerializedInsight.OldGroupId (Common/Algorithm/Framework/Alphas/Serialization/SerializedInsight.cs:189); Collective2SignalExport._systemId (Common/Algorithm/Framework/Portfolio/SignalExports/Collective2SignalExport.cs:54); CrunchDAOSignalExport.GetCurrentRoundID(currentRoundId) (Common/Algorithm/Framework/Portfolio/SignalExports/CrunchDAOSignalExport.cs:216). Rename to `OrganizationId`. [rule N6]
D21 · Naming Consistency · `TypesCSV` spells `CSV` where 22 names in the project spell it `Csv` · ×1
  • `TypesCSV` spells `CSV` where 22 names in the project spell it `Csv` Common/Packets/SecurityTypesPacket.cs:35 — 22 of 24 names in project QuantConnect spell the token `Csv` (22 of 24; unit: names in project QuantConnect containing `Csv`). Peers: VBaseSignalExport.BuildCsv (Common/Algorithm/Framework/Portfolio/SignalExports/VBaseSignalExport.cs:126); MapFile.ToCsvLines (Common/Data/Auxiliary/MapFile.cs:146); MapFile.WriteToCsv (Common/Data/Auxiliary/MapFile.cs:156); MapFileRow.ToCsv (Common/Data/Auxiliary/MapFileRow.cs:183); InterestRateProvider.FromCsvFile (Common/Data/InterestRateProvider.cs:112). Rename to `TypesCsv`. [rule N6]
D27 · Navigability · Pass-through layer · ×1
  • Pass-through layer Compression/ZipStreamWriter.cs:25 — ZipStreamWriter: all 3 public methods forward their arguments unchanged to _writer and add no behaviour — an extra hop (and usually an extra interface) to trace through. Call _writer directly, or give the layer a job.
D28 · Secrets (history) · Rotate the exposed credentials · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D34 · Knowledge Freshness · Further orphaned files (smaller) · ×1
  • Further orphaned files (smaller) — 741 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: Common/Util/LinqExtensions.cs, Algorithm.CSharp/HistoryAlgorithm.cs, Indicators/IndicatorBase.Operators.cs, Algorithm.Framework/Portfolio/MeanReversionPortfolioConstructionModel.cs, Indicators/Alpha.cs, ToolBox/RandomDataGenerator/RandomDataGeneratorSettings.cs, Common/Securities/MarketHoursDatabase.cs, Common/Scheduling/FluentScheduledEventBuilder.cs (and 733 more) (752 orphaned of 2121 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 2121 of the 2749 production source files in this repository met that bar). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
IC1 · Incompleteness & stubs · Empty method body · ×1
  • Empty method body Algorithm.CSharp/Benchmarks/ScheduledEventsBenchmark.cs:38 — `Rebalance` has an empty body — confirm it's an intentional no-op and not an unfinished method.
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
M3 · Folder & project structure · No src/ separation · ×1
  • No src/ separation — Most of the production code is in directories of its own, but 4 application file(s) sit at the repository root beside the build and tooling files (`compare_benchmarks.py`, `REDACTED`, `run_benchmarks.py`, `run_syntax_check.py`).
P12 · CI test-gate honesty · Sleep-based test synchronization · ×1
  • Sleep-based test synchronization — 85 Task.Delay/Thread.Sleep call(s) in test code synchronize with background work by sleeping — a known flakiness precursor on slow runners. Prefer polling with a deadline or completion signals.
P3 · Security & performance tooling · No dependency-update automation · ×1
  • No dependency-update automation Algorithm.CSharp/QuantConnect.Algorithm.CSharp.csproj:35 — `Algorithm.CSharp/QuantConnect.Algorithm.CSharp.csproj` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`.
P6 · Release Hygiene · No changelog · ×1
  • No changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
X2 · Cancellation propagation · Not all async methods take a CancellationToken · ×1
  • Not all async methods take a CancellationToken — 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.
X7 · Silent fallback defaults · Silent fallback default on unknown code · ×1
  • Silent fallback default on unknown code Common/Global.cs:1172 — `GetPrimaryExchange` maps every unrecognised code to `Exchange.UNKNOWN`, one of the real values, with no log or throw — a malformed or new code silently reads as a known one. Throw on the unknown code, or log it. If that member is the correct answer for any other code, say so in a comment on the member and the row stops firing.
Minor — 72 finding(s)
D10 · Test Quality · Skipped (documented) · ×32
  • Skipped (documented): ApiConnectionWillAuthenticate_ValidCredentials_Successfully Tests/Api/ApiTests.cs:34 — Skipped with a documented reason — a deferral, not lazy debt: Requires configured api access
  • Skipped (documented): ApiWillAuthenticate_ValidCredentials_Successfully Tests/Api/ApiTests.cs:44 — Skipped with a documented reason — a deferral, not lazy debt: Requires configured api access
  • Skipped (documented): Link Tests/Api/AuthenticationTests.cs:27 — Skipped with a documented reason — a deferral, not lazy debt: Requires api creds
  • Skipped (documented): PartialFills Tests/Brokerages/BrokerageTests.cs:727 — Skipped with a documented reason — a deferral, not lazy debt: This test requires reading the output and selection of a low volume security for the Brokerage
  • Skipped (documented): FindsFactorFilesWithErrors Tests/Common/Data/Auxiliary/LocalDiskFactorFileProviderTests.cs:60 — Skipped with a documented reason — a deferral, not lazy debt: This test is meant to be run manually
  • Skipped (documented): PythonSlice_performance Tests/Common/Data/SliceTests.cs:996 — Skipped with a documented reason — a deferral, not lazy debt: Performance test
  • Skipped (documented): SpeedTest Tests/Common/ProtobufSerializationTests.cs:340 — Skipped with a documented reason — a deferral, not lazy debt: Performance test
  • Skipped (documented): ValidateAAPLOptionChainSecurityIdentifiers Tests/Common/Securities/SecurityIdentifierTests.cs:591 — Skipped with a documented reason — a deferral, not lazy debt: Requires complete option data to validate chain
  • Skipped (documented): ConvertMarketHoursDatabaseCsvToJson Tests/Common/Util/MarketHoursDatabaseJsonConverterTests.cs:250 — Skipped with a documented reason — a deferral, not lazy debt: This is provided to make it easier to convert your own market-hours-database.csv to the new format
  • Skipped (documented): HandlesRestApi Tests/Engine/DataFeeds/LiveTradingDataFeedTests.cs:1866 — Skipped with a documented reason — a deferral, not lazy debt: These tests depend on a remote server
  • Skipped (documented): CacheMissPerformance Tests/Engine/DataFeeds/TextSubscriptionDataSourceReaderTests.cs:244 — Skipped with a documented reason — a deferral, not lazy debt: Performance test
  • Skipped (documented): CacheHappyPerformance Tests/Engine/DataFeeds/TextSubscriptionDataSourceReaderTests.cs:310 — Skipped with a documented reason — a deferral, not lazy debt: Performance test
  • Skipped (documented): PyCaret Tests/Python/PythonPackagesTests.cs:603 — Skipped with a documented reason — a deferral, not lazy debt: Requires older pandas
  • Skipped (documented): XTransformers Tests/Python/PythonPackagesTests.cs:695 — Skipped with a documented reason — a deferral, not lazy debt: Needs to be run by itself to avoid hanging
  • Skipped (documented): Functime Tests/Python/PythonPackagesTests.cs:725 — Skipped with a documented reason — a deferral, not lazy debt: Requires old polars
  • Skipped (documented): Transformers Tests/Python/PythonPackagesTests.cs:884 — Skipped with a documented reason — a deferral, not lazy debt: Needs to be run by itself to avoid hanging
  • Skipped (documented): TensorflowProbabilityTest Tests/Python/PythonPackagesTests.cs:1229 — Skipped with a documented reason — a deferral, not lazy debt: Hangs if run along side the rest
  • Skipped (documented): IgniteTest Tests/Python/PythonPackagesTests.cs:1407 — Skipped with a documented reason — a deferral, not lazy debt: Hangs if run along side the rest
  • Skipped (documented): StellargraphTest Tests/Python/PythonPackagesTests.cs:1419 — Skipped with a documented reason — a deferral, not lazy debt: Hangs if run along side the rest
  • Skipped (documented): TensorlyTest Tests/Python/PythonPackagesTests.cs:1431 — Skipped with a documented reason — a deferral, not lazy debt: Sometimes hangs when run along side the other tests
  • Skipped (documented): KerasTest Tests/Python/PythonPackagesTests.cs:1714 — Skipped with a documented reason — a deferral, not lazy debt: Hangs if run along side the rest
  • Skipped (documented): TensorflowTest Tests/Python/PythonPackagesTests.cs:1738 — Skipped with a documented reason — a deferral, not lazy debt: Hangs if run along side the rest
  • Skipped (documented): TensorflowAddons Tests/Python/PythonPackagesTests.cs:2029 — Skipped with a documented reason — a deferral, not lazy debt: Requires old version of TF, addons are winding down
  • Skipped (documented): ScikerasTest Tests/Python/PythonPackagesTests.cs:2227 — Skipped with a documented reason — a deferral, not lazy debt: Requires keras < 3
  • Skipped (documented): StableBaselinesTest Tests/Python/PythonPackagesTests.cs:2441 — Skipped with a documented reason — a deferral, not lazy debt: Sometimes hangs when run along side the other tests
  • + 7 more in this group — see findings.md.
D24 · Comment Value · doc comments repeat the names · ×21
  • doc comments repeat the names Common/Algorithm/Framework/Alphas/InsightScore.cs:108 — 576 of 8072 documented parameters and 1770 of 24256 summaries in `QuantConnect` only repeat the member or parameter name (e.g. "Gets the specified score" for `GetScore`). 101 documentation tag(s) are empty. This build requires documentation, so say what the name does not: units, ranges, null handling, side effects.
  • doc comments repeat the names Algorithm/Alphas/AlphaModel.cs:46 — 281 of 2620 documented parameters and 16 of 1074 summaries in `QuantConnect.Algorithm` only repeat the member or parameter name (e.g. "The algorithm instance" for `algorithm`). 8 documentation tag(s) are empty. This build requires documentation, so say what the name does not: units, ranges, null handling, side effects.
  • doc comments repeat the names Algorithm.CSharp/Alphas/GasAndCrudeOilEnergyCorrelationAlpha.cs:286 — 21 of 408 documented parameters and 11 of 5735 summaries in `QuantConnect.Algorithm.CSharp` only repeat the member or parameter name (e.g. "The algorithm instance" for `algorithm`). 10 documentation tag(s) are empty. Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names Algorithm.Framework/Alphas/BasePairsTradingAlphaModel.cs:72 — 39 of 550 documented parameters and 12 of 330 summaries in `QuantConnect.Algorithm.Framework` only repeat the member or parameter name (e.g. "The algorithm instance" for `algorithm`). 3 documentation tag(s) are empty. This build requires documentation, so say what the name does not: units, ranges, null handling, side effects.
  • doc comments repeat the names AlgorithmFactory/Loader.cs:147 — 10 of 123 documented parameters and 9 of 157 summaries in `QuantConnect.AlgorithmFactory` only repeat the member or parameter name (e.g. "Create a new instance of a python algorithm" for `TryCreatePythonAlgorithm`). 8 documentation tag(s) are empty. This build requires documentation, so say what the name does not: units, ranges, null handling, side effects.
  • doc comments repeat the names Api/Api.cs:127 — 10 of 207 documented parameters and 19 of 97 summaries in `QuantConnect.Api` only repeat the member or parameter name (e.g. "Id of the project" for `projectId`). 5 documentation tag(s) are empty. This build requires documentation, so say what the name does not: units, ranges, null handling, side effects.
  • doc comments repeat the names Brokerages/Authentication/LeanTokenCredentials.cs:39 — 44 of 256 documented parameters and 33 of 372 summaries in `QuantConnect.Brokerages` only repeat the member or parameter name (e.g. "The type of the token." for `tokenType`). 8 documentation tag(s) are empty. This build requires documentation, so say what the name does not: units, ranges, null handling, side effects.
  • doc comments repeat the names REDACTED:298 — 4 of 94 documented parameters and 0 of 49 summaries in `QuantConnect.Compression` only repeat the member or parameter name (e.g. "The zip entry name" for `zipEntryName`). 3 documentation tag(s) are empty. This build requires documentation, so say what the name does not: units, ranges, null handling, side effects.
  • doc comments repeat the names Configuration/ApplicationParser.cs:19 — 1 of 28 documented parameters and 1 of 36 summaries in `QuantConnect.Configuration` only repeat the member or parameter name (e.g. "The application help text" for `applicationHelpText`). 3 documentation tag(s) are empty. This build requires documentation, so say what the name does not: units, ranges, null handling, side effects.
  • doc comments repeat the names DownloaderDataProvider/Models/BaseDataDownloadConfig.cs:140 — 2 of 36 documented parameters and 0 of 39 summaries in `QuantConnect.DownloaderDataProvider.Launcher` only repeat the member or parameter name (e.g. "The security type." for `securityType`). 1 documentation tag(s) are empty. Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names Indicators/AccelerationBands.cs:28 — 133 of 1728 documented parameters and 115 of 1921 summaries in `QuantConnect.Indicators` only repeat the member or parameter name (e.g. "Gets the type of moving average" for `MovingAverageType`). 30 documentation tag(s) are empty. This build requires documentation, so say what the name does not: units, ranges, null handling, side effects.
  • doc comments repeat the names Engine/AlgorithmManager.cs:113 — 74 of 976 documented parameters and 77 of 1803 summaries in `QuantConnect.Lean.Engine` only repeat the member or parameter name (e.g. "Algorithm instance" for `algorithm`). 12 documentation tag(s) are empty. This build requires documentation, so say what the name does not: units, ranges, null handling, side effects.
  • doc comments repeat the names Logging/CompositeLogHandler.cs:35 — 0 of 63 documented parameters and 1 of 95 summaries in `QuantConnect.Logging` only repeat the member or parameter name (e.g. "Initializes a new instance of the class from the specified handlers" for `CompositeLogHandler`). 9 documentation tag(s) are empty. This build requires documentation, so say what the name does not: units, ranges, null handling, side effects.
  • doc comments repeat the names Messaging/EventMessagingHandler.cs:65 — 0 of 8 documented parameters and 0 of 33 summaries in `QuantConnect.Messaging` only repeat the member or parameter name (e.g. "" for `job`). 2 documentation tag(s) are empty. This build requires documentation, so say what the name does not: units, ranges, null handling, side effects.
  • doc comments repeat the names Optimizer/LeanOptimizer.cs:63 — 5 of 32 documented parameters and 5 of 99 summaries in `QuantConnect.Optimizer` only repeat the member or parameter name (e.g. "The optimization target" for `OptimizationTarget`). 1 documentation tag(s) are empty. Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names REDACTED:146 — 1 of 6 documented parameters and 0 of 6 summaries in `QuantConnect.Optimizer.Launcher` only repeat the member or parameter name (e.g. "Specified backtest id" for `backtestId`). Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names Queues/JobQueue.cs:102 — 0 of 2 documented parameters and 0 of 8 summaries in `QuantConnect.Queues` only repeat the member or parameter name (e.g. "" for `dataQueueHandler`). 2 documentation tag(s) are empty. This build requires documentation, so say what the name does not: units, ranges, null handling, side effects.
  • doc comments repeat the names Report/Crisis.cs:81 — 11 of 210 documented parameters and 12 of 185 summaries in `QuantConnect.Report` only repeat the member or parameter name (e.g. "Crisis Event" for `crisisEvent`). 2 documentation tag(s) are empty. This build requires documentation, so say what the name does not: units, ranges, null handling, side effects.
  • doc comments repeat the names Research/QuantBook.cs:596 — 6 of 127 documented parameters and 2 of 43 summaries in `QuantConnect.Research` only repeat the member or parameter name (e.g. "Indicator" for `indicator`). 2 documentation tag(s) are empty. Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names Tests/Api/ApiTestBase.cs:151 — 14 of 251 documented parameters and 4 of 488 summaries in `QuantConnect.Tests` only repeat the member or parameter name (e.g. "Id of the project" for `projectId`). 25 documentation tag(s) are empty. Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names ToolBox/AlgoSeekFuturesConverter/AlgoSeekFuturesConverter.cs:180 — 35 of 188 documented parameters and 24 of 238 summaries in `QuantConnect.ToolBox` only repeat the member or parameter name (e.g. "Gets the files in raw folder." for `GetFilesInRawFolder`). 4 documentation tag(s) are empty. Delete the restating tags, or add what the name does not say.
D12 · Dependency Hygiene · Outdated · ×18
  • Outdated: Newtonsoft.Json — Newtonsoft.Json 13.0.2 → 13.0.4 available (referenced by QuantConnect.Lean.Engine).
  • Outdated: NodaTime — NodaTime 3.0.5 → 3.3.7 available (referenced by QuantConnect.Lean.Engine).
  • Outdated: CloneExtensions — CloneExtensions 1.3.0 → 1.4.2 available (referenced by QuantConnect).
  • Outdated: Microsoft.IO.RecyclableMemoryStream — Microsoft.IO.RecyclableMemoryStream 3.0.1 → 4.0.1 available (referenced by QuantConnect).
  • Outdated: protobuf-net — protobuf-net 3.1.33 → 3.4.40 available (referenced by QuantConnect).
  • Outdated: QLNet — QLNet 1.13.1 → 1.13.2 available (referenced by QuantConnect).
  • Outdated: Accord — Accord 3.6.0 → 3.8.0 available (referenced by QuantConnect.Tests).
  • Outdated: Accord.Math — Accord.Math 3.6.0 → 3.8.0 available (referenced by QuantConnect.Tests).
  • Outdated: Microsoft.NET.Test.Sdk — Microsoft.NET.Test.Sdk 16.9.4 → 18.12.0 available (referenced by QuantConnect.Tests).
  • Outdated: Microsoft.TestPlatform.ObjectModel — Microsoft.TestPlatform.ObjectModel 16.9.4 → 18.12.0 available (referenced by QuantConnect.Tests).
  • Outdated: Moq — Moq 4.16.1 → 4.21.0 available (referenced by QuantConnect.Tests).
  • Outdated: NetMQ — NetMQ 4.0.1.6 → 4.0.4.5 available (referenced by QuantConnect.Tests).
  • Outdated: NUnit — NUnit 4.2.2 → 5.0.0 available (referenced by QuantConnect.Tests).
  • Outdated: NUnit3TestAdapter — NUnit3TestAdapter 4.6.0 → 6.3.1 available (referenced by QuantConnect.Tests).
  • Outdated: SharpZipLib — SharpZipLib 1.3.3 → 1.4.2 available (referenced by QuantConnect.Compression).
  • Outdated: Accord.Fuzzy — Accord.Fuzzy 3.6.0 → 3.8.0 available (referenced by QuantConnect.Algorithm.CSharp).
  • Outdated: Accord.MachineLearning — Accord.MachineLearning 3.6.0 → 3.8.0 available (referenced by QuantConnect.Algorithm.CSharp).
  • Outdated: Accord.Statistics — Accord.Statistics 3.6.0 → 3.8.0 available (referenced by QuantConnect.Algorithm.CSharp).
D10 · Test Quality · Mock framework · ×1
  • Mock framework: Moq — QuantConnect.Tests references Moq.

Appendix B — Reproduction & audit trail

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

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-e9f37615ad294ed3a8f350a76e81a304/history.json --exit-code 0 --source .9artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-e9f37615ad294ed3a8f350a76e81a304/tree.json --exit-code 0 --source .2artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt .47artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesdotnet—dotnet list QuantConnect.Lean.sln package --vulnerable --include-transitive --format json5artifacts/raw/dotnet-vulnerable.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .9artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 53 file(s) — `Common/Analysis.cs`, `Common/Data/UniverseSelection/BackupUniverseFileDataProvider.cs`, `Engine/Results/Analysis/Analyses/CrisisEventsAnalysis.cs`, `Engine/Results/Analysis/Analyses/InsightsEmittedForDelistedSecuritiesAnalysis.cs`, `Engine/Results/Analysis/Analyses/MarginCallsAnalysis.cs`, … (+48 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.0—
D37 · Vulnerability-disclosure Policydisclosure—disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm . /tmp/codehealth-osv-sbom-5f9061ec94f045ffa1f3191f4eb1ffac0artifacts/raw/osv-scanner.json

Run 01a1cd43-399d-78d2-b9b9-22f438ee3f04 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

Appendix C — Personal-data map

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

Phone — 3 field(s)
  • CompanyProfile.HeadquarterPhone Common/Data/Fundamental/Generated/CompanyProfile.cs:119
  • CompanyProfile.RegisteredPhone Common/Data/Fundamental/Generated/CompanyProfile.cs:247
  • NotificationSms.PhoneNumber Common/Notifications/Notification.cs:85
Address — 2 field(s)
  • CompanyProfile.HeadquarterPostalCode Common/Data/Fundamental/Generated/CompanyProfile.cs:110
  • CompanyProfile.RegisteredPostalCode Common/Data/Fundamental/Generated/CompanyProfile.cs:238
Email — 2 field(s)
  • Collaborator.Email Common/Api/Project.cs:61
  • CompanyProfile.ContactEmail Common/Data/Fundamental/Generated/CompanyProfile.cs:157
Financial (card / IBAN) — 2 field(s)
  • IncomeStatement.CreditCard Common/Data/Fundamental/Generated/IncomeStatement.cs:560
  • IncomeStatement._creditCard Common/Data/Fundamental/Generated/IncomeStatement.cs:561
Government ID (SSN / passport / tax) — 2 field(s)
  • IncomeStatement.SocialSecurityCosts Common/Data/Fundamental/Generated/IncomeStatement.cs:1296
  • IncomeStatement._socialSecurityCosts Common/Data/Fundamental/Generated/IncomeStatement.cs:1297

Downloadable artifacts

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

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