This commit is contained in:
JustArchi 2020-05-21 22:47:23 +02:00
parent 771d8b3391
commit 01482e8dd0
7 changed files with 10 additions and 22 deletions

View file

@ -92,7 +92,7 @@
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=EnforceWhileStatementBraces/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ForeachCanBeConvertedToQueryUsingAnotherGetEnumerator/@EntryIndexedValue">SUGGESTION</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ForeachCanBePartlyConvertedToQueryUsingAnotherGetEnumerator/@EntryIndexedValue">SUGGESTION</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=FunctionComplexityOverflow/@EntryIndexedValue">SUGGESTION</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=FunctionComplexityOverflow/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=IdentifierTypo/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ImplicitlyCapturedClosure/@EntryIndexedValue">SUGGESTION</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=IncorrectBlankLinesNearBraces/@EntryIndexedValue">WARNING</s:String>

View file

@ -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<Steam.Asset, bool> filterFunction = null) {
if ((appID == 0) || (contextID == 0)) {
Bot.ArchiLogger.LogNullError(nameof(appID) + " || " + nameof(contextID));

View file

@ -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<string>(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<Steam.Asset> 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]

View file

@ -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;

View file

@ -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<uint> 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));
}

View file

@ -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<uint, string> CachedGamesOwned = new Dictionary<uint, string>();
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<string, string> 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<string> ResponseRedeem(ulong steamID, string keysText, ERedeemFlags redeemFlags = ERedeemFlags.None) {
if ((steamID == 0) || string.IsNullOrEmpty(keysText)) {
Bot.ArchiLogger.LogNullError(nameof(steamID) + " || " + nameof(keysText));

View file

@ -352,7 +352,6 @@ namespace ArchiSteamFarm {
}
}
[SuppressMessage("ReSharper", "FunctionComplexityOverflow")]
private async Task<bool> MatchActivelyRound(IReadOnlyCollection<Steam.Asset.EType> acceptedMatchableTypes, IDictionary<ulong, (byte Tries, ISet<ulong> GivenAssetIDs, ISet<ulong> ReceivedAssetIDs)> triedSteamIDs) {
if ((acceptedMatchableTypes == null) || (acceptedMatchableTypes.Count == 0) || (triedSteamIDs == null)) {
Bot.ArchiLogger.LogNullError(nameof(acceptedMatchableTypes) + " || " + nameof(triedSteamIDs));