| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sonar go:S3923: sortRethinkRows() switched on sortColumn but the "durationMs" case and the default branch performed the same descending sort by DurationMs. RethinkDB only exposes durationMs as a server-side sort option (the only column with sortOpt: true in rethinkRunningColumns), so the switch was always going to take one of two identical paths. Drop the switch and sort directly. The unused parameter is renamed to `_` (Go idiom). Behaviour and call shape are unchanged.
|
@cubic-dev-ai review this PR |
Sorry, something went wrong.
@stelfrag I have started the AI code review. It will take a few minutes to complete. |
Sorry, something went wrong.
There was a problem hiding this comment.
Simplifies the RethinkDB running-queries function’s row-sorting logic as part of the ongoing Coverity/Sonar audit cleanups, removing a redundant switch that always sorted by the same column.
Changes:
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
…es the order. Remove the now-unused parameter rather than leaving a stub that suggests sorting is configurable.
|
Sorry, something went wrong.
There was a problem hiding this comment.
This PR is also working as expected. LGTM!
Sorry, something went wrong.
* go.d/rethinkdb: drop degenerate switch in sortRethinkRows Sonar go:S3923: sortRethinkRows() switched on sortColumn but the "durationMs" case and the default branch performed the same descending sort by DurationMs. RethinkDB only exposes durationMs as a server-side sort option (the only column with sortOpt: true in rethinkRunningColumns), so the switch was always going to take one of two identical paths. Drop the switch and sort directly. The unused parameter is renamed to `_` (Go idiom). Behaviour and call shape are unchanged. * Only durationMs is exposed as a sort option, so the function hard-codes the order. Remove the now-unused parameter rather than leaving a stub that suggests sorting is configurable. --------- Co-authored-by: Costa Tsaousis <costa@netdata.cloud> (cherry picked from commit 7a8ac3a)
| Back | FazBrowse Home | New Git URL |
Summary