warning fixes

This commit is contained in:
Brett Hewitson 2022-12-23 18:31:21 +10:00
parent eb66b63ed4
commit 89f60420cd
6 changed files with 15 additions and 0 deletions

View file

@ -2468,6 +2468,7 @@ namespace ServerManagerTool.Lib
return appMods;
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Security", "SCS0006:Weak hashing function.", Justification = "<Pending>")]
public static string GetMutexName(string directory)
{
using (var hashAlgo = MD5.Create())

View file

@ -1295,25 +1295,33 @@ namespace ServerManagerTool.Lib
public bool SaveTributeCharacterExpirationSeconds
{
get { return !string.IsNullOrWhiteSpace(this.CrossArkClusterId) && OverrideTributeCharacterExpirationSeconds; }
#pragma warning disable CS1717 // Assignment made to same variable
set { value = value; }
#pragma warning restore CS1717 // Assignment made to same variable
}
public bool SaveTributeItemExpirationSeconds
{
get { return !string.IsNullOrWhiteSpace(this.CrossArkClusterId) && OverrideTributeItemExpirationSeconds; }
#pragma warning disable CS1717 // Assignment made to same variable
set { value = value; }
#pragma warning restore CS1717 // Assignment made to same variable
}
public bool SaveTributeDinoExpirationSeconds
{
get { return !string.IsNullOrWhiteSpace(this.CrossArkClusterId) && OverrideTributeDinoExpirationSeconds; }
#pragma warning disable CS1717 // Assignment made to same variable
set { value = value; }
#pragma warning restore CS1717 // Assignment made to same variable
}
public bool SaveMinimumDinoReuploadInterval
{
get { return !string.IsNullOrWhiteSpace(this.CrossArkClusterId) && OverrideMinimumDinoReuploadInterval; }
#pragma warning disable CS1717 // Assignment made to same variable
set { value = value; }
#pragma warning restore CS1717 // Assignment made to same variable
}
public static readonly DependencyProperty TributeCharacterExpirationSecondsProperty = DependencyProperty.Register(nameof(TributeCharacterExpirationSeconds), typeof(int), typeof(ServerProfile), new PropertyMetadata(86400));
@ -5220,6 +5228,7 @@ namespace ServerManagerTool.Lib
list.UpdateTotals();
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Security", "SCS0005:Weak random number generator.", Justification = "<Pending>")]
public void RandomizePGMSettings()
{
var random = new Random(DateTime.Now.Millisecond);

View file

@ -2342,6 +2342,7 @@ namespace ServerManagerTool.Lib
return appMods;
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Security", "SCS0006:Weak hashing function.", Justification = "<Pending>")]
public static string GetMutexName(string directory)
{
using (var hashAlgo = MD5.Create())

View file

@ -228,6 +228,7 @@ namespace Plugin.Discord.UnitTests
});
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Security", "SCS0005:Weak random number generator.", Justification = "<Pending>")]
private void SendMultipleMessages(DiscordPlugin plugin, string profileName)
{
// Arrange
@ -254,6 +255,7 @@ namespace Plugin.Discord.UnitTests
Assert.IsTrue(true);
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Security", "SCS0005:Weak random number generator.", Justification = "<Pending>")]
private void SendMultipleErrors(DiscordPlugin plugin, string profileName)
{
// Arrange

View file

@ -20,6 +20,7 @@ namespace ServerManagerTool.Common.Utils
private static int callCount = 0;
[System.Diagnostics.CodeAnalysis.SuppressMessage("Security", "SCS0005:Weak random number generator.", Justification = "<Pending>")]
public static string GeneratePassword(int count)
{
StringBuilder newPassword = new StringBuilder(count);

View file

@ -46,6 +46,7 @@ namespace ServerManagerTool.Common.Utils
set;
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Security", "SCS0006:Weak hashing function.", Justification = "<Pending>")]
public static string ComputeKey(string folder)
{
try