Resolve SonarQube findings in WebApi, Db, and Service code - #595
Merged
Conversation
Rewords a prose comment in AppMetrics that tripped the S125 commented-code heuristic by ending a line in a semicolon. Suppresses the S5122 and S5332 findings on WebHosting's CORS policy and Development-only HTTP binding with documented justifications, since the API has no authentication and the binding never runs in production. Also simplifies the ChampionshipEntity.IsFinished setter, removes an unnecessary null-forgiving operator in PacketProcessor, drops an unused dependency from HealthController, and passes the cancellation token through WebHosting.StopWebHosting.
|
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.


Pull Request
📖 Description
Addresses several SonarQube findings that had accumulated across the backend.
AppMetricshad a prose comment that tripped the S125 "commented-out code" heuristic because a line happened to end in a semicolon; it is reworded without changing its meaning.WebHosting's CORS policy (S5122) and Development-only plain-HTTP binding (S5332) are documented and suppressed viaGlobalSuppressions.cs, following the project's existing suppression convention, because the API has no authentication (so origin restriction adds no real access control) and the HTTP binding never runs in production. Also included: a simplifiedChampionshipEntity.IsFinishedsetter, an unnecessary null-forgiving operator removed fromPacketProcessor, an unused constructor dependency removed fromHealthController, andWebHosting.StopWebHostingnow passes its cancellation token through toStopAsync.This is a maintenance/chore change; no behavior changes are intended.
🎫 Issues
No related issue.
👩💻 Reviewer Notes
The two suppressions in
GlobalSuppressions.csare the parts most worth a close look — the justifications explain why the underlying Sonar concern doesn't apply to this project's deployment model (unauthenticated API, two independently addressable Docker images, Development-only HTTP binding). Everything else is a small, self-contained cleanup.📑 Test Plan
No behavior changes, so no new tests were added. Existing coverage already exercises
ChampionshipEntity.IsFinished,PacketProcessor's packet handling, andWebHosting's host lifecycle.✅ Checklist
General
Backend-specific (.NET)
F1Server.*.F1Server.Testsfor the change.F1Server.Db.MsSqlMigrations,F1Server.Db.MySqlMigrationsandF1Server.Db.PostgreSqlMigrations.⏭ Next Steps
None.