FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix based on Coverity and Sonar audits (part 7) by stelfrag · Pull Request #22335 · netdata/netdata · GitHub

Fix based on Coverity and Sonar audits (part 7) - #22335

Merged
stelfrag merged 2 commits into
netdata:masterfrom
stelfrag:cov_fix_202604_part7
May 7, 2026
Merged

Fix based on Coverity and Sonar audits (part 7)#22335
stelfrag merged 2 commits into
netdata:masterfrom
stelfrag:cov_fix_202604_part7

Conversation

Copy link
Copy Markdown
Collaborator

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.
github-actions Bot added area/collectors Everything related to data collection collectors/go.d area/go labels Apr 30, 2026

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

cubic-dev-ai Bot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@stelfrag I have started the AI code review. It will take a few minutes to complete.

stelfrag marked this pull request as ready for review May 1, 2026 07:24
Copilot AI review requested due to automatic review settings May 1, 2026 07:24
stelfrag requested a review from ilyam8 as a code owner May 1, 2026 07:24
stelfrag marked this pull request as draft May 1, 2026 07:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Pull request overview

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:

  • Simplified sortRethinkRows() by removing a degenerate switch and always sorting by DurationMs.
  • Updated the function signature to avoid an unused parameter warning.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

stelfrag marked this pull request as ready for review May 1, 2026 11:45
…es the order. Remove the now-unused parameter rather than leaving a stub that suggests sorting is configurable.
stelfrag requested a review from Copilot May 7, 2026 12:01

sonarqubecloud Bot commented May 7, 2026

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

stelfrag requested review from Copilot and thiagoftsm May 7, 2026 14:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

thiagoftsm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This PR is also working as expected. LGTM!

stelfrag merged commit 7a8ac3a into netdata:master May 7, 2026
163 of 164 checks passed
stelfrag deleted the cov_fix_202604_part7 branch May 7, 2026 16:51
stelfrag mentioned this pull request Jun 22, 2026
Ferroin pushed a commit that referenced this pull request Jul 15, 2026
* 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)
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

Labels

area/collectors Everything related to data collection area/go collectors/go.d

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL