which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
Enterprise Edition Version 7.9.4
sonar-scanner-cli-4.3.0.2102-linux
what are you trying to achieve
I would like to have only completely new bugs in “New Code” section.
what have you tried so far to achieve this
I have a very large code base (mainly c/c++), some of the files are quite big and old. I run analysis daily, and it looks like bugs from code that wasn’t touched for 5+ years shows in “New Code” section, I found out only that those file were modified in last 30 days but in different place e.g. modified printed string, so It’s not like modified code affected some other code that now is a bug. My question is why those errors weren’t detected on the first scan, but now after half year, does it mean I have even more bugs in my code, but they aren’t detected only because I didn’t edit a file?
cast to ‘void *’ from smaller integer type ‘uint32’ (aka ‘unsigned int’)
I understand that this is a bug, but this code was present in repository for a long time, file wasn’t edited for at least half a year, why then it shows up in “New Code” section?
But okay. Is it possible that the function_a signature changed recently? That’s generally the cause with this kind of complaint; a code change elsewhere caused a new issue to be raised (quite properly) on old code.
I found a better example of this scenario where old code gets into “New Code section”:
I have a line of code that wasn’t edited since at least 5 years, and file itself wasn’t edited at least since 3 years.
function_foo1(int var_a){
// initialization of local variables
function_foo2(var_a);
...
}
Error says:
“code will never be executed” which applies to line with function_foo2(var_a);
My only concern is why this is showed on “new code” while it’s very old, and no changes around it were performed.
Without actual code it’s impossible for me to tell. Is it possible that the code called during “initialization of local variables” has changed in the meantime to now throw an exception?