From 5a7a162d34f468240cdefd89f306e1e9c355bc79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Andr=C3=A9s=20Marino=20Rojas?= <47573394+Marinovsky@users.noreply.github.com> Date: Tue, 9 Jul 2024 15:52:07 -0500 Subject: [PATCH] Fix warnings CA1574 (#8186) --- Algorithm/QCAlgorithm.History.cs | 2 +- Algorithm/QCAlgorithm.Trading.cs | 14 +++++++------- AlgorithmFactory/Loader.cs | 3 ++- Api/Api.cs | 4 ++-- .../Portfolio/SignalExports/SignalExportManager.cs | 2 +- Common/CapacityEstimate.cs | 2 ++ Common/Data/Auxiliary/FactorFile.cs | 2 +- .../Data/Auxiliary/LocalDiskFactorFileProvider.cs | 2 +- .../Data/Auxiliary/LocalZipFactorFileProvider.cs | 2 +- Common/Extensions.cs | 4 ++-- Common/Interfaces/IApi.cs | 4 ++++ Common/Interfaces/IFactorFileProvider.cs | 4 ++-- Common/Interfaces/IRegressionResearchDefinition.cs | 2 ++ ...Messages.Algorithm.Framework.Alphas.Analysis.cs | 2 +- Common/Messages/Messages.QuantConnect.cs | 2 +- Common/Messages/Messages.Securities.cs | 2 +- .../OptimizationParameterJsonConverter.cs | 2 +- .../Parameters/OptimizationStepParameter.cs | 2 ++ .../OptionStrategyPositionGroupBuyingPowerModel.cs | 2 +- .../Volatility/IndicatorVolatilityModel.cs | 1 - Common/Util/PythonUtil.cs | 2 +- ...eOptionChainUniverseDataCollectionEnumerator.cs | 2 +- .../Enumerators/SynchronizingEnumerator.cs | 4 ++-- .../ZipEntryNameSubscriptionDataSourceReader.cs | 2 +- 24 files changed, 40 insertions(+), 30 deletions(-) diff --git a/Algorithm/QCAlgorithm.History.cs b/Algorithm/QCAlgorithm.History.cs index c95096028160..0642488e4417 100644 --- a/Algorithm/QCAlgorithm.History.cs +++ b/Algorithm/QCAlgorithm.History.cs @@ -1249,7 +1249,7 @@ private void CheckPeriodBasedHistoryRequestResolution(IEnumerable symbol /// /// This method is only used for Python algorithms, specially for those requesting custom data type history. /// The reason for using this method is that custom data type Python history calls to - /// will always use (the custom data base class) + /// will always use (the custom data base class) /// as the T argument, because the custom data class is a Python type, which will cause the history data in the slices to not be matched /// to the actual requested type, resulting in an empty list of slices. /// diff --git a/Algorithm/QCAlgorithm.Trading.cs b/Algorithm/QCAlgorithm.Trading.cs index 77186efec228..493aad200d6a 100644 --- a/Algorithm/QCAlgorithm.Trading.cs +++ b/Algorithm/QCAlgorithm.Trading.cs @@ -188,7 +188,7 @@ public OrderTicket Order(Symbol symbol, decimal quantity) /// Place a custom order property or tag (e.g. indicator data). /// The order properties to use. Defaults to /// The order ticket instance. - /// + /// [DocumentationAttribute(TradingAndOrders)] public OrderTicket Order(Symbol symbol, decimal quantity, bool asynchronous = false, string tag = "", IOrderProperties orderProperties = null) { @@ -1203,7 +1203,7 @@ private OrderResponse PreOrderChecksImpl(SubmitOrderRequest request) /// Symbols we wish to liquidate /// Custom tag to know who is calling this. /// Array of order ids for liquidated symbols - /// + /// [DocumentationAttribute(TradingAndOrders)] public List Liquidate(Symbol symbolToLiquidate = null, string tag = "Liquidated") { @@ -1295,7 +1295,7 @@ public void SetMaximumOrders(int max) /// True will liquidate existing holdings /// Tag the order with a short string. /// The order properties to use. Defaults to - /// + /// [DocumentationAttribute(TradingAndOrders)] public void SetHoldings(List targets, bool liquidateExistingHoldings = false, string tag = "", IOrderProperties orderProperties = null) { @@ -1322,7 +1322,7 @@ public void SetHoldings(List targets, bool liquidateExistingHol /// liquidate existing holdings if necessary to hold this stock /// Tag the order with a short string. /// The order properties to use. Defaults to - /// + /// [DocumentationAttribute(TradingAndOrders)] public void SetHoldings(Symbol symbol, double percentage, bool liquidateExistingHoldings = false, string tag = "", IOrderProperties orderProperties = null) { @@ -1337,7 +1337,7 @@ public void SetHoldings(Symbol symbol, double percentage, bool liquidateExisting /// bool liquidate existing holdings if necessary to hold this stock /// Tag the order with a short string. /// The order properties to use. Defaults to - /// + /// [DocumentationAttribute(TradingAndOrders)] public void SetHoldings(Symbol symbol, float percentage, bool liquidateExistingHoldings = false, string tag = "", IOrderProperties orderProperties = null) { @@ -1352,7 +1352,7 @@ public void SetHoldings(Symbol symbol, float percentage, bool liquidateExistingH /// bool liquidate existing holdings if necessary to hold this stock /// Tag the order with a short string. /// The order properties to use. Defaults to - /// + /// [DocumentationAttribute(TradingAndOrders)] public void SetHoldings(Symbol symbol, int percentage, bool liquidateExistingHoldings = false, string tag = "", IOrderProperties orderProperties = null) { @@ -1370,7 +1370,7 @@ public void SetHoldings(Symbol symbol, int percentage, bool liquidateExistingHol /// bool flag to clean all existing holdings before setting new faction. /// Tag the order with a short string. /// The order properties to use. Defaults to - /// + /// [DocumentationAttribute(TradingAndOrders)] public void SetHoldings(Symbol symbol, decimal percentage, bool liquidateExistingHoldings = false, string tag = "", IOrderProperties orderProperties = null) { diff --git a/AlgorithmFactory/Loader.cs b/AlgorithmFactory/Loader.cs index f251d493f5d7..0a06706797d1 100644 --- a/AlgorithmFactory/Loader.cs +++ b/AlgorithmFactory/Loader.cs @@ -382,12 +382,13 @@ public bool TryCreateAlgorithmInstanceWithIsolator(string assemblyPath, int ramL return complete && success && algorithmInstance != null; } - + #pragma warning disable CS1574 /// /// Unload this factory's appDomain. /// /// Not used in lean engine. Running the library in an app domain is 10x slower. /// + #pragma warning restore CS1574 public void Unload() { if (appDomain != null) { diff --git a/Api/Api.cs b/Api/Api.cs index 2321d6206569..4b7eed02bae6 100644 --- a/Api/Api.cs +++ b/Api/Api.cs @@ -1517,7 +1517,7 @@ public Organization ReadOrganization(string organizationId = null) /// Target of the optimization, see examples in /// Target extremum of the optimization, for example "max" or "min" /// Optimization target value - /// Optimization strategy, + /// Optimization strategy, /// Optimization compile ID /// Optimization parameters /// Optimization constraints @@ -1563,7 +1563,7 @@ public Estimate EstimateOptimization( /// Target of the optimization, see examples in /// Target extremum of the optimization, for example "max" or "min" /// Optimization target value - /// Optimization strategy, + /// Optimization strategy, /// Optimization compile ID /// Optimization parameters /// Optimization constraints diff --git a/Common/Algorithm/Framework/Portfolio/SignalExports/SignalExportManager.cs b/Common/Algorithm/Framework/Portfolio/SignalExports/SignalExportManager.cs index 21ce786588e6..4d29ed57a9d3 100644 --- a/Common/Algorithm/Framework/Portfolio/SignalExports/SignalExportManager.cs +++ b/Common/Algorithm/Framework/Portfolio/SignalExports/SignalExportManager.cs @@ -80,7 +80,7 @@ public bool SetTargetPortfolioFromPortfolio() /// /// Obtains an array of portfolio targets from algorithm's Portfolio and returns them. - /// See for more + /// See for more /// information about how each symbol quantity was calculated /// /// An array of portfolio targets from the algorithm's Portfolio diff --git a/Common/CapacityEstimate.cs b/Common/CapacityEstimate.cs index a58f66116f8c..548df7e26912 100644 --- a/Common/CapacityEstimate.cs +++ b/Common/CapacityEstimate.cs @@ -112,6 +112,7 @@ public void OnOrderEvent(OrderEvent orderEvent) _monitoredSymbolCapacitySet.Add(symbolCapacity); } + #pragma warning disable CS1574 /// /// Updates the market capacity for any Symbols that require a market update. /// Sometimes, after the specified , we @@ -119,6 +120,7 @@ public void OnOrderEvent(OrderEvent orderEvent) /// /// This result will be written into the Algorithm Statistics via the /// + #pragma warning restore CS1574 public void UpdateMarketCapacity(bool forceProcess) { for (var i = _monitoredSymbolCapacity.Count - 1; i >= 0; --i) diff --git a/Common/Data/Auxiliary/FactorFile.cs b/Common/Data/Auxiliary/FactorFile.cs index 6ed4ba7d7db6..097161e5008c 100644 --- a/Common/Data/Auxiliary/FactorFile.cs +++ b/Common/Data/Auxiliary/FactorFile.cs @@ -63,7 +63,7 @@ public abstract class FactorFile : IFactorProvider public string Permtick { get; } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// protected FactorFile(string permtick, IEnumerable data, DateTime? factorFileMinimumDate = null) { diff --git a/Common/Data/Auxiliary/LocalDiskFactorFileProvider.cs b/Common/Data/Auxiliary/LocalDiskFactorFileProvider.cs index cf2e65884478..1cbf00e44bcd 100644 --- a/Common/Data/Auxiliary/LocalDiskFactorFileProvider.cs +++ b/Common/Data/Auxiliary/LocalDiskFactorFileProvider.cs @@ -51,7 +51,7 @@ public void Initialize(IMapFileProvider mapFileProvider, IDataProvider dataProvi } /// - /// Gets a instance for the specified symbol, or null if not found + /// Gets a instance for the specified symbol, or null if not found /// /// The security's symbol whose factor file we seek /// The resolved factor file, or null if not found diff --git a/Common/Data/Auxiliary/LocalZipFactorFileProvider.cs b/Common/Data/Auxiliary/LocalZipFactorFileProvider.cs index 25f577952fcd..96194f28acfa 100644 --- a/Common/Data/Auxiliary/LocalZipFactorFileProvider.cs +++ b/Common/Data/Auxiliary/LocalZipFactorFileProvider.cs @@ -80,7 +80,7 @@ public void Initialize(IMapFileProvider mapFileProvider, IDataProvider dataProvi } /// - /// Gets a instance for the specified symbol, or null if not found + /// Gets a instance for the specified symbol, or null if not found /// /// The security's symbol whose factor file we seek /// The resolved factor file, or null if not found diff --git a/Common/Extensions.cs b/Common/Extensions.cs index 5df58a710b38..245476c73f13 100644 --- a/Common/Extensions.cs +++ b/Common/Extensions.cs @@ -593,8 +593,8 @@ public static bool IsEmpty(this BaseSeries series) } /// - /// Returns if the specified instance holds no - /// or they are all empty + /// Returns if the specified instance holds no + /// or they are all empty /// public static bool IsEmpty(this Chart chart) { diff --git a/Common/Interfaces/IApi.cs b/Common/Interfaces/IApi.cs index 685a8e834685..efd669024153 100644 --- a/Common/Interfaces/IApi.cs +++ b/Common/Interfaces/IApi.cs @@ -201,6 +201,7 @@ public interface IApi : IDisposable /// public InsightResponse ReadBacktestInsights(int projectId, string backtestId, int start = 0, int end = 0); + #pragma warning disable CS1574 /// /// Estimate optimization with the specified parameters via QuantConnect.com API /// @@ -214,6 +215,7 @@ public interface IApi : IDisposable /// Optimization parameters /// Optimization constraints /// Estimate object from the API. + #pragma warning restore CS1574 public Estimate EstimateOptimization( int projectId, string name, @@ -225,6 +227,7 @@ public Estimate EstimateOptimization( HashSet parameters, IReadOnlyList constraints); + #pragma warning disable CS1574 /// /// Create an optimization with the specified parameters via QuantConnect.com API /// @@ -241,6 +244,7 @@ public Estimate EstimateOptimization( /// Optimization node type /// Number of parallel nodes for optimization /// BaseOptimization object from the API. + #pragma warning restore CS1574 public OptimizationSummary CreateOptimization( int projectId, string name, diff --git a/Common/Interfaces/IFactorFileProvider.cs b/Common/Interfaces/IFactorFileProvider.cs index 3f05e2086376..2ac756c04ad1 100644 --- a/Common/Interfaces/IFactorFileProvider.cs +++ b/Common/Interfaces/IFactorFileProvider.cs @@ -20,7 +20,7 @@ namespace QuantConnect.Interfaces { /// - /// Provides instances of at run time + /// Provides instances of at run time /// [InheritedExport(typeof(IFactorFileProvider))] public interface IFactorFileProvider @@ -34,7 +34,7 @@ public interface IFactorFileProvider void Initialize(IMapFileProvider mapFileProvider, IDataProvider dataProvider); /// - /// Gets a instance for the specified symbol, or null if not found + /// Gets a instance for the specified symbol, or null if not found /// /// The security's symbol whose factor file we seek /// The resolved factor file, or null if not found diff --git a/Common/Interfaces/IRegressionResearchDefinition.cs b/Common/Interfaces/IRegressionResearchDefinition.cs index 89882876120e..a0a19db2d76f 100644 --- a/Common/Interfaces/IRegressionResearchDefinition.cs +++ b/Common/Interfaces/IRegressionResearchDefinition.cs @@ -20,11 +20,13 @@ namespace QuantConnect.Interfaces /// public interface IRegressionResearchDefinition { + #pragma warning disable CS1574 /// /// This is used by the research regression test system to validate the output /// /// Requires to be implemented last in the file /// get should start from next line + #pragma warning restore CS1574 string ExpectedOutput { get; } } } diff --git a/Common/Messages/Messages.Algorithm.Framework.Alphas.Analysis.cs b/Common/Messages/Messages.Algorithm.Framework.Alphas.Analysis.cs index 1fd087b5b137..a91b60f74dbe 100644 --- a/Common/Messages/Messages.Algorithm.Framework.Alphas.Analysis.cs +++ b/Common/Messages/Messages.Algorithm.Framework.Alphas.Analysis.cs @@ -46,7 +46,7 @@ public static string ZeroInitialPriceValue(DateTime frontierTimeUtc, Algorithm.F } /// - /// Provides user-facing messages for the class and its consumers or related classes + /// Provides user-facing messages for the class and its consumers or related classes /// public static class ReadOnlySecurityValuesCollection { diff --git a/Common/Messages/Messages.QuantConnect.cs b/Common/Messages/Messages.QuantConnect.cs index abb6c0b86b13..6cf7c0b95518 100644 --- a/Common/Messages/Messages.QuantConnect.cs +++ b/Common/Messages/Messages.QuantConnect.cs @@ -31,7 +31,7 @@ namespace QuantConnect public static partial class Messages { /// - /// Provides user-facing messages for the class and its consumers or related classes + /// Provides user-facing messages for the class and its consumers or related classes /// public static class AlphaRuntimeStatistics { diff --git a/Common/Messages/Messages.Securities.cs b/Common/Messages/Messages.Securities.cs index d1cf37836e4b..e2fe35e287a9 100644 --- a/Common/Messages/Messages.Securities.cs +++ b/Common/Messages/Messages.Securities.cs @@ -178,7 +178,7 @@ public static string MarginBeingAdjustedInTheWrongDirectionUnderlyingSecurityInf } /// - /// Provides user-facing messages for the class and its consumers or related classes + /// Provides user-facing messages for the class and its consumers or related classes /// public static class PositionGroupBuyingPowerModel { diff --git a/Common/Optimizer/Parameters/OptimizationParameterJsonConverter.cs b/Common/Optimizer/Parameters/OptimizationParameterJsonConverter.cs index 6cfe14288aca..b64816586705 100644 --- a/Common/Optimizer/Parameters/OptimizationParameterJsonConverter.cs +++ b/Common/Optimizer/Parameters/OptimizationParameterJsonConverter.cs @@ -22,7 +22,7 @@ namespace QuantConnect.Optimizer.Parameters { /// /// Override deserialization method. - /// Can handle and instances + /// Can handle instances /// public class OptimizationParameterJsonConverter : JsonConverter { diff --git a/Common/Optimizer/Parameters/OptimizationStepParameter.cs b/Common/Optimizer/Parameters/OptimizationStepParameter.cs index def0d45a5c2f..dea63d014c23 100644 --- a/Common/Optimizer/Parameters/OptimizationStepParameter.cs +++ b/Common/Optimizer/Parameters/OptimizationStepParameter.cs @@ -41,11 +41,13 @@ public class OptimizationStepParameter : OptimizationParameter [JsonProperty("step")] public decimal? Step { get; set; } + #pragma warning disable CS1574 /// /// Minimal possible movement for current parameter, should be positive /// /// Used by to determine when this parameter can no longer be optimized [JsonProperty("minStep")] + #pragma warning restore CS1574 public decimal? MinStep { get; set; } /// diff --git a/Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs b/Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs index 8d18f7aaed5e..ed82b3e4fafa 100644 --- a/Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs +++ b/Common/Securities/Option/OptionStrategyPositionGroupBuyingPowerModel.cs @@ -445,7 +445,7 @@ public override InitialMargin GetInitialMarginRequiredForOrder(PositionGroupInit /// /// Gets the initial margin required for the specified contemplated position group. - /// Used by to get the contemplated groups margin. + /// Used by to get the contemplated groups margin. /// protected override decimal GetContemplatedGroupsInitialMargin(SecurityPortfolioManager portfolio, PositionGroupCollection contemplatedGroups, List ordersPositions) diff --git a/Common/Securities/Volatility/IndicatorVolatilityModel.cs b/Common/Securities/Volatility/IndicatorVolatilityModel.cs index 16301220d915..f51b945a0c8b 100644 --- a/Common/Securities/Volatility/IndicatorVolatilityModel.cs +++ b/Common/Securities/Volatility/IndicatorVolatilityModel.cs @@ -24,7 +24,6 @@ namespace QuantConnect.Securities /// Provides an implementation of that uses an indicator /// to compute its value /// - /// The indicator's input type public class IndicatorVolatilityModel : BaseVolatilityModel { private readonly IIndicator _indicator; diff --git a/Common/Util/PythonUtil.cs b/Common/Util/PythonUtil.cs index 0e29a8f3a9c2..1239d173401c 100644 --- a/Common/Util/PythonUtil.cs +++ b/Common/Util/PythonUtil.cs @@ -171,7 +171,7 @@ public static string PythonExceptionParser(PythonException pythonException) } /// - /// Parsers into a readable message + /// Parsers into a readable message /// /// The python exception message /// String with relevant part of the stacktrace diff --git a/Engine/DataFeeds/Enumerators/DataQueueOptionChainUniverseDataCollectionEnumerator.cs b/Engine/DataFeeds/Enumerators/DataQueueOptionChainUniverseDataCollectionEnumerator.cs index 749b617e333e..31b940e13858 100644 --- a/Engine/DataFeeds/Enumerators/DataQueueOptionChainUniverseDataCollectionEnumerator.cs +++ b/Engine/DataFeeds/Enumerators/DataQueueOptionChainUniverseDataCollectionEnumerator.cs @@ -27,7 +27,7 @@ namespace QuantConnect.Lean.Engine.DataFeeds.Enumerators { /// - /// Enumerates live options symbol universe data into instances + /// Enumerates live options symbol universe data into instances /// public class DataQueueOptionChainUniverseDataCollectionEnumerator : IEnumerator { diff --git a/Engine/DataFeeds/Enumerators/SynchronizingEnumerator.cs b/Engine/DataFeeds/Enumerators/SynchronizingEnumerator.cs index 017b85c70103..c9266c8da7d5 100644 --- a/Engine/DataFeeds/Enumerators/SynchronizingEnumerator.cs +++ b/Engine/DataFeeds/Enumerators/SynchronizingEnumerator.cs @@ -62,7 +62,7 @@ object IEnumerator.Current /// Initializes a new instance of the class /// /// The enumerators to be synchronized. NOTE: Assumes the same time zone for all data - /// The type of data we want, for example, or , ect... + /// The type of data we want, for example, or , ect... protected SynchronizingEnumerator(params IEnumerator[] enumerators) : this ((IEnumerable>)enumerators) { @@ -72,7 +72,7 @@ protected SynchronizingEnumerator(params IEnumerator[] enumerators) /// Initializes a new instance of the class /// /// The enumerators to be synchronized. NOTE: Assumes the same time zone for all data - /// The type of data we want, for example, or , ect... + /// The type of data we want, for example, or , ect... protected SynchronizingEnumerator(IEnumerable> enumerators) { _enumerators = enumerators.ToArray(); diff --git a/Engine/DataFeeds/ZipEntryNameSubscriptionDataSourceReader.cs b/Engine/DataFeeds/ZipEntryNameSubscriptionDataSourceReader.cs index 7add15bc9fc0..61e28ca48238 100644 --- a/Engine/DataFeeds/ZipEntryNameSubscriptionDataSourceReader.cs +++ b/Engine/DataFeeds/ZipEntryNameSubscriptionDataSourceReader.cs @@ -89,7 +89,7 @@ public override IEnumerable Read(SubscriptionDataSource source) } /// - /// Event invocator for the event + /// Event invocator for the event /// /// The that was invalid /// The exception if one was raised, otherwise null