fix: resolve 423 SonarQube MEDIUM severity issues#561
Merged
Conversation
- MA0006 (73): Use string.Equals with StringComparison.Ordinal in test assertions - VSTHRD111 (19): Add ConfigureAwait(false) to Web project await expressions - xUnit1030 (30): Remove ConfigureAwait(false) from test methods - CA1031 (6): Use specific exception types or pragma suppressions - S3358 (4): Extract nested ternaries to helper methods in Razor pages - S2139 (7): Pass exceptions to logger with context (already fixed) - S108 (4): Fill empty catch/event accessor blocks - S127 (3): Refactor for loop variable updates to while loops - S6580 (2): Add CultureInfo.InvariantCulture to date/time parsing - S6677 (1): Make log template placeholders unique - MA0002 (7): Add StringComparer.Ordinal to Distinct/Dictionary calls - MA0004 (4): Add ConfigureAwait(false) to production await expressions - MA0011 (6): Add IFormatProvider to TryParse calls - MA0074 (6): Add StringComparison to StartsWith calls - SA1116 (4): Fix parameter placement on multi-line calls - SA1137 (3): Fix element indentation - SA1407 (9): Add parentheses for arithmetic precedence clarity - SA1502 (1): Expand single-line constructor - SA1203 (1): Move const fields before non-const fields - SA1210 (1): Reorder using directives alphabetically - CS8601/CS8602/CS8620 (3): Fix nullable reference warnings - VSTHRD003 (4): Store foreign tasks in local variables before awaiting - SYSLIB0050 (2): Suppress obsolete FormatterServices in tests - S7772 (1): Use node:fs instead of fs in JavaScript file - IDE0055 (12): Fix code formatting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes 423 MEDIUM severity SonarQube issues across 51 files:
String comparison (73 issues):
==withstring.Equals(a, b, StringComparison.Ordinal)in test assertionsAsync patterns (53 issues):
.ConfigureAwait(false)to 19 Web project await expressions.ConfigureAwait(false)from 30 test methods (conflicts with xUnit parallelization).ConfigureAwait(false)to 4 production test awaitsException handling (34 issues):
Code quality (46 issues):
Roslyn analyzer fixes (63 issues):
Nullability (3): CS8601/CS8602/CS8620 fixes
Other: VSTHRD003 (4), SYSLIB0050 (2), IDE0055 (12), S7772 (1)
Test plan
dotnet build- 0 errors, 0 warnings