Skip to content

refactor: resolve 31 SonarQube HIGH severity issues#563

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

refactor: resolve 31 SonarQube HIGH severity issues#563
rygel merged 2 commits intodevelopfrom
fix/sonarqube-high-severity

Conversation

@rygel
Copy link
Copy Markdown
Owner

@rygel rygel commented Apr 16, 2026

Summary

Resolves all 31 HIGH severity SonarQube issues through method extraction and minor web fixes.

S3776 - Cognitive Complexity (27 issues):
Extracted helper methods from 27 complex methods to reduce cognitive complexity from 15-57 down to below 15. Key refactors:

File Helpers Extracted Original Complexity
AntigravityProvider.cs 10 46, 41, 19, 18
ZaiProvider.cs 3 56
OpenRouterProvider.cs 3 40
CodexProvider.cs 3 27
KimiProvider.cs 3 57
MinimaxProvider.cs 1 23
Monitor/Program.cs 4 33
ImportService.cs 2 36
UsageDatabase.cs 1 21
CLI/Program.cs 4 26, 23
MainWindow.xaml.cs 5 Complex constructor
ProviderCardRenderer.cs 3 Complex rendering
ChangelogMarkdownRenderer.cs 1 Complex parsing
SettingsWindow.xaml.cs 1 Complex persistence
ConfigService.cs 1 16
JsonConfigLoader.cs 2 16
GitHubUpdateChecker.cs 1 16
Seeder/Program.cs 1 21, 21

JavaScript S7761 (3 issues): Use dataset property instead of setAttribute in theme.js

Web S7927 (1 issue): Fix accessible name to match visible button label

Test plan

  • dotnet build - 0 errors
  • All 1,491 tests pass across 3 test projects
  • SonarQube scan to verify HIGH issues resolved

…complexity)

- S3776 (27): Extract helper methods to reduce cognitive complexity below 15
  - AntigravityProvider: 10 helpers extracted from 4 complex methods
  - ZaiProvider: 3 helpers (ProcessTokenLimit, IsFutureTimestamp, ResolveResetTimeInfo)
  - OpenRouterProvider: 3 helpers (FetchKeyInfoAsync, TryParseLimitResetTime, BuildUsageCards)
  - CodexProvider: 3 helpers (ParseAdditionalRateLimits, ParseRateLimitProperties, TryParseSparkWindow)
  - KimiProvider: 3 helpers (BuildUsageCards, TryBuildWeeklyCard, AddLimitCards)
  - Monitor/Program.cs: 4 helpers (TryAcquireStartupMutexAsync, LogDebugStartupBanner, etc.)
  - ImportService: 2 helpers (ImportJsonAsync, ImportCsvAsync)
  - UsageDatabase: 1 helper (ClassifyHistoryEntries)
  - CLI/Program.cs: 4 helpers (ParseDays, HandleSetKeyAsync, HandleConfigCommandAsync, etc.)
  - ProviderCardRenderer: 3 helpers (BuildDualProgressBar, BuildSingleProgressBar, RenderResetSlot)
  - MainWindow.xaml.cs: 5 helpers (WireUpEventHandlers, OnWindowClosed, etc.)
  - MainWindow.Polling.cs: 3 helpers (OnPollingTimerTick, HandlePollingEmptyResultAsync, etc.)
  - ChangelogMarkdownRenderer, SettingsWindow, ConfigService, JsonConfigLoader, GitHubUpdateChecker, MinimaxProvider, OpenCodeZenProvider, GitHubCopilotProvider, Seeder
- S7761 (3): Use dataset property instead of setAttribute in theme.js
- S7927 (1): Fix accessible name to match visible label in Index.cshtml
@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Large PR Detected

This PR contains 3421 lines changed across 34 files.

Details:

  • 📁 Files changed: 34
  • ➕ Insertions: 1759
  • ➖ Deletions: 1662
  • 📊 Total: 3421 lines

Recommendation:
Consider splitting this PR into smaller, focused changes to make review easier and faster. PRs under 500 lines are ideal for thorough code review.


This is an automated message. Feel free to ignore if this PR is intentionally large.

@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Large PR Detected

This PR contains 3425 lines changed across 35 files.

Details:

  • 📁 Files changed: 35
  • ➕ Insertions: 1761
  • ➖ Deletions: 1664
  • 📊 Total: 3425 lines

Recommendation:
Consider splitting this PR into smaller, focused changes to make review easier and faster. PRs under 500 lines are ideal for thorough code review.


This is an automated message. Feel free to ignore if this PR is intentionally large.

@rygel rygel merged commit b63dfdb into develop Apr 16, 2026
20 checks passed
@rygel rygel deleted the fix/sonarqube-high-severity branch April 16, 2026 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants