Resolve CA5394

This commit is contained in:
JustArchi 2021-05-07 23:12:58 +02:00
parent bc74c69ac5
commit 8605c71f81
2 changed files with 6 additions and 3 deletions

View file

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

View file

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