refactor: resolve 31 SonarQube HIGH severity issues#563
Merged
Conversation
…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
Contributor
|
This PR contains 3421 lines changed across 34 files. Details:
Recommendation: This is an automated message. Feel free to ignore if this PR is intentionally large. |
Contributor
|
This PR contains 3425 lines changed across 35 files. Details:
Recommendation: This is an automated message. Feel free to ignore if this PR is intentionally large. |
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
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:
JavaScript S7761 (3 issues): Use
datasetproperty instead ofsetAttributein theme.jsWeb S7927 (1 issue): Fix accessible name to match visible button label
Test plan
dotnet build- 0 errors