bump AnalysisModePerformance to Recommended

fixes CA1841

silence CA1805 and CA1822 because of sheer amount of violations

reduce severity of CA1838 because I don't wanna fix it lol
This commit is contained in:
Morilli 2023-06-08 19:48:57 +02:00 committed by Moritz Bender
parent 18a742195b
commit 71e08e27b9
6 changed files with 11 additions and 3 deletions

View File

@ -17,3 +17,10 @@ dotnet_code_quality.CA1305.excluded_symbol_names = T:System.Byte|T:System.SByte|
dotnet_diagnostic.CA1305.severity = error
dotnet_diagnostic.CA2101.severity = suggestion
# Performance rules
dotnet_code_quality.CA1826.exclude_ordefault_methods = true
dotnet_diagnostic.CA1805.severity = silent
dotnet_diagnostic.CA1822.severity = silent
dotnet_diagnostic.CA1838.severity = suggestion

View File

@ -4,6 +4,7 @@
<AnalysisModeGlobalization>Recommended</AnalysisModeGlobalization>
<AnalysisModeMaintainability>Recommended</AnalysisModeMaintainability>
<AnalysisModeReliability>Recommended</AnalysisModeReliability>
<AnalysisModePerformance>Recommended</AnalysisModePerformance>
<CodeAnalysisRuleSet>$(MSBuildProjectDirectory)/../../Common.ruleset</CodeAnalysisRuleSet>
<ContinuousIntegrationBuild Condition=" '$(GITLAB_CI)' != '' Or '$(APPVEYOR)' != '' ">true</ContinuousIntegrationBuild>
<EnableNETAnalyzers>true</EnableNETAnalyzers>

View File

@ -77,7 +77,7 @@ namespace {nSpace}
{{
private const string EMBED_PREFIX = ""{nSpace}."";
private static Type[]? _types = null;
private static Type[]? _types;
private static readonly Assembly Asm = typeof({nSpace}.ReflectionCache).Assembly;

View File

@ -114,7 +114,7 @@ namespace BizHawk.Client.EmuHawk
// check to make sure that the settings object has all of the appropriate bool buttons
foreach (var button in controllerButtons)
{
if (!settings.Keys.Contains(button))
if (!settings.ContainsKey(button))
{
settings[button] = defaultValue;
}

View File

@ -72,7 +72,7 @@ namespace BizHawk.Emulation.Common
foreach (var k in Definition.Axes.Keys)
{
if (_buttons.Keys.Contains(k))
if (_buttons.ContainsKey(k))
{
throw new Exception("name collision between bool and float lists!");
}