Open L34T opened 7 months ago
.gitkeep
DataStructures\ChallengeInfo\
Outdated namespace? Timers seems missed (3)
Timers
Possible NullReferenceException / null assignment to non-nullable entity (13)
Typo (32)
Merging into logical pattern. if (foo = 1 || foo = 2) into if (foo is 1 or 2) (11)
if (foo = 1 || foo = 2)
if (foo is 1 or 2)
if (encounter is { BossInfos: not null })
CA1854: 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 == 0 could be used instead (23)
ActivePhases.Count == 0
(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}
new foo() {bar = 1, baz = 2}
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 }
Thanks for your suggestions! I've marked the ones that I've implemented, and I'll be keeping this open and evaluating further enhancements. It'll be implemented with #14
[ ] Possible missed
.gitkeep
file in directoryDataStructures\ChallengeInfo\
https://github.com/dubada01/SWTORCombatParser/blob/d87d20a5bb371648bbc1811be1855a904533c3db/SWTORCombatParser.csproj#L3405Outdated namespace?
Timers
seems missed (3)[x] https://github.com/dubada01/SWTORCombatParser/blob/master/DataStructures/Timers/HOT%20Timers/HotTimerLoader.cs#L7
Possible NullReferenceException / null assignment to non-nullable entity (13)
[ ] https://github.com/dubada01/SWTORCombatParser/blob/master/Model/Timers/StarParseTimerImport.cs#L90
Typo (32)
[ ] https://github.com/dubada01/SWTORCombatParser/blob/master/Model/ParticipantSelectionHandler.cs#L8
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#L53[ ] https://github.com/dubada01/SWTORCombatParser/blob/master/Model/Timers/TriggerDetection.cs#L339
CA1854: Prefer TryGetValue over ContainsKey ( https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1854 ) (22)
[ ] https://github.com/dubada01/SWTORCombatParser/blob/master/Model/Timers/VariableManager.cs#L49
Class validation checks become inefficient when compared over logical OR due to Logical AND's high priority. (3)
[ ] https://github.com/dubada01/SWTORCombatParser/blob/master/Model/Timers/DefaultTimersManager.cs#L279
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 == 0
could 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)