From 01482e8dd03a8357daf2b714d0cd19e23fcc1e60 Mon Sep 17 00:00:00 2001 From: JustArchi Date: Thu, 21 May 2020 22:47:23 +0200 Subject: [PATCH] Misc --- ArchiSteamFarm.sln.DotSettings | 2 +- ArchiSteamFarm/Actions.cs | 4 +--- ArchiSteamFarm/ArchiWebHandler.cs | 8 +++----- ArchiSteamFarm/Bot.cs | 6 ++---- ArchiSteamFarm/CardsFarmer.cs | 6 ++---- ArchiSteamFarm/Commands.cs | 5 +---- ArchiSteamFarm/Statistics.cs | 1 - 7 files changed, 10 insertions(+), 22 deletions(-) diff --git a/ArchiSteamFarm.sln.DotSettings b/ArchiSteamFarm.sln.DotSettings index 478ee935c..810eda7b1 100644 --- a/ArchiSteamFarm.sln.DotSettings +++ b/ArchiSteamFarm.sln.DotSettings @@ -92,7 +92,7 @@ WARNING SUGGESTION SUGGESTION - SUGGESTION + HINT HINT SUGGESTION WARNING diff --git a/ArchiSteamFarm/Actions.cs b/ArchiSteamFarm/Actions.cs index accc322bd..a7f85ce09 100644 --- a/ArchiSteamFarm/Actions.cs +++ b/ArchiSteamFarm/Actions.cs @@ -21,7 +21,6 @@ using System; using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Net.Http; using System.Threading; @@ -45,7 +44,7 @@ namespace ArchiSteamFarm { private bool ProcessingGiftsScheduled; private bool TradingScheduled; - internal Actions([JetBrains.Annotations.NotNull] Bot bot) => Bot = bot ?? throw new ArgumentNullException(nameof(bot)); + internal Actions([NotNull] Bot bot) => Bot = bot ?? throw new ArgumentNullException(nameof(bot)); public async ValueTask DisposeAsync() { // Those are objects that are always being created if constructor doesn't throw exception @@ -235,7 +234,6 @@ namespace ArchiSteamFarm { } [PublicAPI] - [SuppressMessage("ReSharper", "FunctionComplexityOverflow")] public async Task<(bool Success, string Message)> SendInventory(uint appID = Steam.Asset.SteamAppID, ulong contextID = Steam.Asset.SteamCommunityContextID, ulong targetSteamID = 0, string tradeToken = null, Func filterFunction = null) { if ((appID == 0) || (contextID == 0)) { Bot.ArchiLogger.LogNullError(nameof(appID) + " || " + nameof(contextID)); diff --git a/ArchiSteamFarm/ArchiWebHandler.cs b/ArchiSteamFarm/ArchiWebHandler.cs index 04cccf34b..040600579 100644 --- a/ArchiSteamFarm/ArchiWebHandler.cs +++ b/ArchiSteamFarm/ArchiWebHandler.cs @@ -22,7 +22,6 @@ using System; using System.Collections.Generic; using System.Collections.Immutable; -using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Net; using System.Net.Http; @@ -78,7 +77,7 @@ namespace ArchiSteamFarm { private bool MarkingInventoryScheduled; private string VanityURL; - internal ArchiWebHandler([JetBrains.Annotations.NotNull] Bot bot) { + internal ArchiWebHandler([NotNull] Bot bot) { Bot = bot ?? throw new ArgumentNullException(nameof(bot)); CachedApiKey = new ArchiCacheable(ResolveApiKey); @@ -111,9 +110,8 @@ namespace ArchiSteamFarm { return string.IsNullOrEmpty(VanityURL) ? "/profiles/" + Bot.SteamID : "/id/" + VanityURL; } - [JetBrains.Annotations.NotNull] + [NotNull] [PublicAPI] - [SuppressMessage("ReSharper", "FunctionComplexityOverflow")] public async IAsyncEnumerable GetInventoryAsync(ulong steamID = 0, uint appID = Steam.Asset.SteamAppID, ulong contextID = Steam.Asset.SteamCommunityContextID) { if ((appID == 0) || (contextID == 0)) { throw new ArgumentException(string.Format(Strings.ErrorObjectIsNull, nameof(appID) + " || " + nameof(contextID))); @@ -1381,7 +1379,7 @@ namespace ArchiSteamFarm { return true; } - [JetBrains.Annotations.NotNull] + [NotNull] internal HttpClient GenerateDisposableHttpClient() => WebBrowser.GenerateDisposableHttpClient(); [ItemCanBeNull] diff --git a/ArchiSteamFarm/Bot.cs b/ArchiSteamFarm/Bot.cs index 85a30778f..f6ff0d117 100755 --- a/ArchiSteamFarm/Bot.cs +++ b/ArchiSteamFarm/Bot.cs @@ -24,7 +24,6 @@ using System.Collections; using System.Collections.Concurrent; using System.Collections.Generic; using System.Collections.Specialized; -using System.Diagnostics.CodeAnalysis; using System.IO; using System.Linq; using System.Security.Cryptography; @@ -149,7 +148,7 @@ namespace ArchiSteamFarm { #pragma warning disable IDE0051 [JsonProperty(PropertyName = SharedInfo.UlongCompatibilityStringPrefix + nameof(SteamID))] - [JetBrains.Annotations.NotNull] + [NotNull] private string SSteamID => SteamID.ToString(); #pragma warning restore IDE0051 @@ -201,7 +200,7 @@ namespace ArchiSteamFarm { private string TwoFactorCode; private byte TwoFactorCodeFailures; - private Bot([JetBrains.Annotations.NotNull] string botName, [JetBrains.Annotations.NotNull] BotConfig botConfig, [JetBrains.Annotations.NotNull] BotDatabase botDatabase) { + private Bot([NotNull] string botName, [NotNull] BotConfig botConfig, [NotNull] BotDatabase botDatabase) { if (string.IsNullOrEmpty(botName) || (botConfig == null) || (botDatabase == null)) { throw new ArgumentNullException(nameof(botName) + " || " + nameof(botConfig) + " || " + nameof(botDatabase)); } @@ -2830,7 +2829,6 @@ namespace ArchiSteamFarm { WalletCurrency = callback.Currency; } - [SuppressMessage("ReSharper", "FunctionComplexityOverflow")] private async Task RedeemGamesInBackground() { if (!await GamesRedeemerInBackgroundSemaphore.WaitAsync(0).ConfigureAwait(false)) { return; diff --git a/ArchiSteamFarm/CardsFarmer.cs b/ArchiSteamFarm/CardsFarmer.cs index 6823ac320..1ee892f59 100755 --- a/ArchiSteamFarm/CardsFarmer.cs +++ b/ArchiSteamFarm/CardsFarmer.cs @@ -23,7 +23,6 @@ using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Collections.Immutable; -using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Linq; using System.Net; @@ -98,7 +97,7 @@ namespace ArchiSteamFarm { private bool PermanentlyPaused; private bool ShouldResumeFarming = true; - internal CardsFarmer([JetBrains.Annotations.NotNull] Bot bot) { + internal CardsFarmer([NotNull] Bot bot) { Bot = bot ?? throw new ArgumentNullException(nameof(bot)); if (ASF.GlobalConfig.IdleFarmingPeriod > 0) { @@ -373,7 +372,6 @@ namespace ArchiSteamFarm { await StartFarming().ConfigureAwait(false); } - [SuppressMessage("ReSharper", "FunctionComplexityOverflow")] private async Task CheckPage(IDocument htmlDocument, ISet parsedAppIDs) { if ((htmlDocument == null) || (parsedAppIDs == null)) { Bot.ArchiLogger.LogNullError(nameof(htmlDocument) + " || " + nameof(parsedAppIDs)); @@ -1243,7 +1241,7 @@ namespace ArchiSteamFarm { internal uint PlayableAppID { get; set; } - internal Game(uint appID, [JetBrains.Annotations.NotNull] string gameName, float hoursPlayed, ushort cardsRemaining, byte badgeLevel) { + internal Game(uint appID, [NotNull] string gameName, float hoursPlayed, ushort cardsRemaining, byte badgeLevel) { if ((appID == 0) || string.IsNullOrEmpty(gameName) || (hoursPlayed < 0) || (cardsRemaining == 0)) { throw new ArgumentOutOfRangeException(nameof(appID) + " || " + nameof(gameName) + " || " + nameof(hoursPlayed) + " || " + nameof(cardsRemaining)); } diff --git a/ArchiSteamFarm/Commands.cs b/ArchiSteamFarm/Commands.cs index 93598b7cf..445c659fe 100644 --- a/ArchiSteamFarm/Commands.cs +++ b/ArchiSteamFarm/Commands.cs @@ -21,7 +21,6 @@ using System; using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Net.Http; using System.Text; @@ -40,7 +39,7 @@ namespace ArchiSteamFarm { private readonly Bot Bot; private readonly Dictionary CachedGamesOwned = new Dictionary(); - internal Commands([JetBrains.Annotations.NotNull] Bot bot) => Bot = bot ?? throw new ArgumentNullException(nameof(bot)); + internal Commands([NotNull] Bot bot) => Bot = bot ?? throw new ArgumentNullException(nameof(bot)); [PublicAPI] public static string FormatBotResponse(string response, string botName) { @@ -1635,7 +1634,6 @@ namespace ArchiSteamFarm { return responses.Count > 0 ? string.Join(Environment.NewLine, responses) : null; } - [SuppressMessage("ReSharper", "FunctionComplexityOverflow")] private async Task<(string Response, Dictionary OwnedGames)> ResponseOwns(ulong steamID, string query) { if ((steamID == 0) || string.IsNullOrEmpty(query)) { Bot.ArchiLogger.LogNullError(nameof(steamID) + " || " + nameof(query)); @@ -2154,7 +2152,6 @@ namespace ArchiSteamFarm { return responses.Count > 0 ? string.Join(Environment.NewLine, responses) : null; } - [SuppressMessage("ReSharper", "FunctionComplexityOverflow")] private async Task ResponseRedeem(ulong steamID, string keysText, ERedeemFlags redeemFlags = ERedeemFlags.None) { if ((steamID == 0) || string.IsNullOrEmpty(keysText)) { Bot.ArchiLogger.LogNullError(nameof(steamID) + " || " + nameof(keysText)); diff --git a/ArchiSteamFarm/Statistics.cs b/ArchiSteamFarm/Statistics.cs index 81721a89b..d65fa499e 100644 --- a/ArchiSteamFarm/Statistics.cs +++ b/ArchiSteamFarm/Statistics.cs @@ -352,7 +352,6 @@ namespace ArchiSteamFarm { } } - [SuppressMessage("ReSharper", "FunctionComplexityOverflow")] private async Task MatchActivelyRound(IReadOnlyCollection acceptedMatchableTypes, IDictionary GivenAssetIDs, ISet ReceivedAssetIDs)> triedSteamIDs) { if ((acceptedMatchableTypes == null) || (acceptedMatchableTypes.Count == 0) || (triedSteamIDs == null)) { Bot.ArchiLogger.LogNullError(nameof(acceptedMatchableTypes) + " || " + nameof(triedSteamIDs));