Skip to content

fix: resolve 423 SonarQube MEDIUM severity issues#561

Merged
rygel merged 2 commits intodevelopfrom
fix/sonarqube-medium-severity-v2
Apr 16, 2026
Merged

fix: resolve 423 SonarQube MEDIUM severity issues#561
rygel merged 2 commits intodevelopfrom
fix/sonarqube-medium-severity-v2

Conversation

@rygel
Copy link
Copy Markdown
Owner

@rygel rygel commented Apr 16, 2026

Summary

Fixes 423 MEDIUM severity SonarQube issues across 51 files:

String comparison (73 issues):

  • MA0006: Replace == with string.Equals(a, b, StringComparison.Ordinal) in test assertions

Async patterns (53 issues):

  • VSTHRD111: Add .ConfigureAwait(false) to 19 Web project await expressions
  • xUnit1030: Remove .ConfigureAwait(false) from 30 test methods (conflicts with xUnit parallelization)
  • MA0004: Add .ConfigureAwait(false) to 4 production test awaits

Exception handling (34 issues):

  • CA1031: Use specific exception types or pragma suppressions in 6 locations (28 test files suppressed)
  • S108: Fill empty catch/event accessor blocks in notification services

Code quality (46 issues):

  • S3358: Extract nested ternaries to helper methods in Razor pages
  • S127: Refactor for loop variable updates to while loops
  • S6580: Add CultureInfo.InvariantCulture to date/time parsing
  • S6677: Make log template placeholders unique
  • S2139: Pass exceptions to logger with context

Roslyn analyzer fixes (63 issues):

  • MA0002: Add StringComparer.Ordinal to Distinct/Dictionary calls
  • MA0011: Add IFormatProvider to TryParse calls
  • MA0074: Add StringComparison to StartsWith calls
  • SA1116/SA1137/SA1407: Style/Formatting fixes
  • SA1203/SA1210: Field and using ordering
  • SA1502: Single-line element expansion

Nullability (3): CS8601/CS8602/CS8620 fixes
Other: VSTHRD003 (4), SYSLIB0050 (2), IDE0055 (12), S7772 (1)

Test plan

  • dotnet build - 0 errors, 0 warnings
  • All 1,491 tests pass across 3 test projects
  • SonarQube scan to verify issue reduction

- 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
@rygel rygel merged commit a299e4e into develop Apr 16, 2026
20 checks passed
@rygel rygel deleted the fix/sonarqube-medium-severity-v2 branch April 16, 2026 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants