From 8605c71f815929c57c16d519fda1dcc885837103 Mon Sep 17 00:00:00 2001 From: JustArchi Date: Fri, 7 May 2021 23:12:58 +0200 Subject: [PATCH] Resolve CA5394 --- .editorconfig | 3 --- ArchiSteamFarm/Utilities.cs | 6 ++++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.editorconfig b/.editorconfig index 93c947d51..dfb5ccd62 100644 --- a/.editorconfig +++ b/.editorconfig @@ -114,9 +114,6 @@ dotnet_code_quality_unused_parameters = all:warning dotnet_diagnostic.ca1028.severity = silent dotnet_diagnostic.ca1031.severity = silent -# TODO - one at a time -dotnet_diagnostic.ca5394.severity = silent - # Rule - almost everything dotnet_naming_rule.almost_everything_must_be_pascal_case.severity = warning dotnet_naming_rule.almost_everything_must_be_pascal_case.style = pascal_case diff --git a/ArchiSteamFarm/Utilities.cs b/ArchiSteamFarm/Utilities.cs index 06f3fd35a..61e4c0ae0 100644 --- a/ArchiSteamFarm/Utilities.cs +++ b/ArchiSteamFarm/Utilities.cs @@ -198,7 +198,9 @@ namespace ArchiSteamFarm { [PublicAPI] public static int RandomNext() { lock (Random) { +#pragma warning disable CA5394 // This call isn't used in a security-sensitive manner return Random.Next(); +#pragma warning restore CA5394 // This call isn't used in a security-sensitive manner } } @@ -211,7 +213,9 @@ namespace ArchiSteamFarm { return 0; default: lock (Random) { +#pragma warning disable CA5394 // This call isn't used in a security-sensitive manner return Random.Next(maxValue); +#pragma warning restore CA5394 // This call isn't used in a security-sensitive manner } } } @@ -227,7 +231,9 @@ namespace ArchiSteamFarm { } lock (Random) { +#pragma warning disable CA5394 // This call isn't used in a security-sensitive manner return Random.Next(minValue, maxValue); +#pragma warning restore CA5394 // This call isn't used in a security-sensitive manner } }