alexoren
(Alex)
February 3, 2026, 11:06pm
1
Make sure to read this post before raising a thread here:
Hey SonarSource Community!
False-positives happen , as do false-negatives, and we’re eager to fix them. We are thrilled when our users report problems, so we can make our products better.
What is a false-positive (FP)?
A false-positive is when an issue is raised unexpectedly on code that should not trigger an issue, or where the suggested action doesn’t make any sense for the code.
What is a false-negative (FN)?
A false-negative is when an issue should be raised on a piece of code, but isn’t.
…
Then tell us:
What language is this for?
C++
Which rule?
Header files should not contain unnamed namespaces (cpp:S1000)
Why do you believe it’s a false-positive/false-negative?
The rule is triggered on implementation source files.
It should be only be evaluated in header files.
I am using
SonarQube Cloud
SonarQube for IDE 4.42.0 in VSCode 1.108.2
in connected mode with SonarQube Cloud
How can we reproduce the problem?
In a .cpp file:
namespace
{
void f() {}
}
Screenshot as proof:
alexoren
(Alex)
February 3, 2026, 11:11pm
2
Forgot to add, this is new behaviour.
Didn’t happen last week.
Thanks for your report!
I tried to reproduce this issue, but was not able to.
Can you share a reproducer? If you want to share it privately, please let me know, then I’ll sent you a DM.
alexoren
(Alex)
February 4, 2026, 3:22pm
5
That would probably be best.
Please remind me how to create one.