mirror of
https://github.com/JustArchiNET/ArchiSteamFarm
synced 2024-11-10 07:04:27 +00:00
Resolve CA1508
This commit is contained in:
parent
377df12924
commit
90ff43dc98
9 changed files with 15 additions and 2 deletions
|
@ -111,7 +111,6 @@ dotnet_diagnostic.ca1028.severity = silent
|
|||
dotnet_diagnostic.ca1031.severity = silent
|
||||
|
||||
# TODO - one at a time
|
||||
dotnet_diagnostic.ca1508.severity = silent
|
||||
dotnet_diagnostic.ca1819.severity = silent
|
||||
dotnet_diagnostic.ca1812.severity = silent
|
||||
dotnet_diagnostic.ca1823.severity = silent
|
||||
|
|
|
@ -351,7 +351,9 @@ namespace ArchiSteamFarm {
|
|||
|
||||
try {
|
||||
#if NETFRAMEWORK
|
||||
#pragma warning disable CA1508 // False positive
|
||||
using (memoryStream) {
|
||||
#pragma warning restore CA1508 // False positive
|
||||
#else
|
||||
await using (memoryStream.ConfigureAwait(false)) {
|
||||
#endif
|
||||
|
|
|
@ -720,7 +720,9 @@ namespace ArchiSteamFarm {
|
|||
throw new ArgumentNullException(nameof(appIDs));
|
||||
}
|
||||
|
||||
#pragma warning disable CA1508 // False positive
|
||||
ISet<uint> uniqueAppIDs = appIDs as ISet<uint> ?? appIDs.ToHashSet();
|
||||
#pragma warning restore CA1508 // False positive
|
||||
|
||||
switch (ASF.GlobalConfig?.OptimizationMode) {
|
||||
case GlobalConfig.EOptimizationMode.MinMemoryUsage:
|
||||
|
|
|
@ -179,7 +179,9 @@ namespace ArchiSteamFarm.Helpers {
|
|||
}
|
||||
|
||||
try {
|
||||
#pragma warning disable CA1508 // False positive
|
||||
using (new FileStream(FilePath, FileMode.CreateNew)) { }
|
||||
#pragma warning restore CA1508 // False positive
|
||||
|
||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) {
|
||||
FileInfo fileInfo = new(FilePath);
|
||||
|
|
|
@ -152,7 +152,9 @@ namespace ArchiSteamFarm.IPC.Controllers.Api {
|
|||
}
|
||||
|
||||
try {
|
||||
#pragma warning disable CA1508 // False positive
|
||||
if (cancellationToken.IsCancellationRequested || (webSocket.State != WebSocketState.Open)) {
|
||||
#pragma warning restore CA1508 // False positive
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -111,7 +111,7 @@ namespace ArchiSteamFarm {
|
|||
|
||||
Mutex? singleInstance = null;
|
||||
|
||||
for (byte i = 0; (i < WebBrowser.MaxTries) && (singleInstance == null); i++) {
|
||||
for (byte i = 0; i < WebBrowser.MaxTries; i++) {
|
||||
if (i > 0) {
|
||||
await Task.Delay(1000).ConfigureAwait(false);
|
||||
}
|
||||
|
|
|
@ -96,7 +96,9 @@ namespace ArchiSteamFarm {
|
|||
|
||||
LastChangeNumber = picsChanges.CurrentChangeNumber;
|
||||
|
||||
#pragma warning disable CA1508 // False positive
|
||||
if (picsChanges.RequiresFullAppUpdate || picsChanges.RequiresFullPackageUpdate || ((picsChanges.AppChanges.Count == 0) && (picsChanges.PackageChanges.Count == 0))) {
|
||||
#pragma warning restore CA1508 // False positive
|
||||
if (ASF.GlobalDatabase != null) {
|
||||
await ASF.GlobalDatabase.OnPICSChangesRestart(picsChanges.CurrentChangeNumber).ConfigureAwait(false);
|
||||
}
|
||||
|
|
|
@ -312,7 +312,9 @@ namespace ArchiSteamFarm {
|
|||
throw new ArgumentNullException(nameof(directory));
|
||||
}
|
||||
|
||||
#pragma warning disable CA1508 // False positive
|
||||
if ((prefixes == null) || (prefixes.Length == 0)) {
|
||||
#pragma warning restore CA1508 // False positive
|
||||
throw new ArgumentNullException(nameof(prefixes));
|
||||
}
|
||||
|
||||
|
|
|
@ -143,7 +143,9 @@ namespace ArchiSteamFarm.Web {
|
|||
MemoryStream ms = new((int) response.Length);
|
||||
|
||||
#if NETFRAMEWORK
|
||||
#pragma warning disable CA1508 // False positive
|
||||
using (ms) {
|
||||
#pragma warning restore CA1508 // False positive
|
||||
#else
|
||||
await using (ms.ConfigureAwait(false)) {
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue