Merging into logical pattern. if (foo = 1 || foo = 2) into if (foo is 1 or 2) (11)
Class validation checks become inefficient when compared over logical OR due to Logical AND's high priority. (3)
(CA1860) ActivePhases is List. Lists(like all other collections) have it's size stored. So ActivePhases.Count == 0 could be used instead (23)
(CA1847) Single quotation marks in characterName.Contains() forsing search for char instead substring (8)
Switch statement used in switch expression way so it may be converted into expression (11)
return challenge.ChallengeType switch {
ChallengeType.DamageOut => foo,
ChallengeType.DamageIn => bar }
.gitkeepfile in directoryDataStructures\ChallengeInfo\SWTORCombatParser/SWTORCombatParser.csproj
Line 3405 in d87d20a
Outdated namespace?
Timersseems missed (3)Possible NullReferenceException / null assignment to non-nullable entity (13)
Typo (32)
Merging into logical pattern.
if (foo = 1 || foo = 2)intoif (foo is 1 or 2)(11)if (encounter is { BossInfos: not null })) https://github.com/dubada01/SWTORCombatParser/blob/master/Model/CombatParsing/CombatIdentifier.cs#L53CA1854: Prefer TryGetValue over ContainsKey ( https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1854 ) (22)
Class validation checks become inefficient when compared over logical OR due to Logical AND's high priority. (3)
Some small sudgestions:
Where(foo).Count() may be replaced with Count(foo)
(CA1860) ActivePhases is List. Lists(like all other collections) have it's size stored. So
ActivePhases.Count == 0could be used instead (23)(CA1847) Single quotation marks in characterName.Contains() forsing search for char instead substring (8)
Object initialization may increase readability
new foo() {bar = 1, baz = 2}Switch statement used in switch expression way so it may be converted into expression (11)