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