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

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

Fix based on Coverity and Sonar audits (part 10) - #22338

Merged
stelfrag merged 1 commit into
netdata:masterfrom
stelfrag:cov_fix_202604_part10
May 1, 2026
Merged

Fix based on Coverity and Sonar audits (part 10)#22338
stelfrag merged 1 commit into
netdata:masterfrom
stelfrag:cov_fix_202604_part10

Conversation

Copy link
Copy Markdown
Collaborator

Sonar c:S3923: mcp_query_interrupt_callback() had a null guard
(`if (!int_data || !int_data->mcpc) return false;`) followed by an
unconditional `return false`. Both branches returned the same value
and no field of int_data was ever dereferenced, so the guard was dead
code.

Remove the conditional, mark `data` unused with `(void)data;`, and
keep the callback as an explicit "no interrupt" stub. The trailing
comment about future client-disconnect/timeout detection is preserved.

Copy link
Copy Markdown

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:25
Copilot AI review requested due to automatic review settings May 1, 2026 07:25
stelfrag marked this pull request as draft May 1, 2026 07:25

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

Continues the audit-driven cleanup series by addressing a static-analysis finding in the MCP metrics query tool, simplifying an unused interrupt callback parameter handling.

Changes:

  • Simplify mcp_query_interrupt_callback() by removing an unused/ineffective null-guard path and explicitly marking the argument unused.

💡 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 07:53
stelfrag merged commit 5b05083 into netdata:master May 1, 2026
162 checks passed
stelfrag deleted the cov_fix_202604_part10 branch May 1, 2026 08:16
stelfrag mentioned this pull request Jun 22, 2026
Ferroin pushed a commit that referenced this pull request Jul 15, 2026
mcp: drop redundant null guard from interrupt-callback stub

Sonar c:S3923: mcp_query_interrupt_callback() had a null guard
(`if (!int_data || !int_data->mcpc) return false;`) followed by an
unconditional `return false`. Both branches returned the same value
and no field of int_data was ever dereferenced, so the guard was dead
code.

Remove the conditional, mark `data` unused with `(void)data;`, and
keep the callback as an explicit "no interrupt" stub. The trailing
comment about future client-disconnect/timeout detection is preserved.

Co-authored-by: Costa Tsaousis <costa@netdata.cloud>
(cherry picked from commit 5b05083)
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL