I hope this thread is not yet archived…
I noticed something as to why some of these issues frequently showed up as “new” despite not being new.
It is, unfortunately, even more creepy: There is a particular type of finding - possible NullPointer dereferencations - in code that was
auto-generated long ago (by some Oracle tool to wrap some stored procedures in Java classes).
Each possible NullPointer-dereferencing is itself a true positive, but by random chance, a new scan will sometimes
not find some of them, and at some further scan re-find them–and present them as new then.
So, all the analysis about versions, VCS and where the scanner is running seem to be moot -
the real question is: why are scans not “stable” - why can they suddenly lose spots of possible
Null-deref’ing, and later suddenly re-find it, without the source even changing at all?
Hi,
Andreas L.:
I’m using SonarQube on a local directory, which casually gets completely overwritten by the latest sources (and .class-files). A tar-file gets unpacked, so technically all files receive a new “ctime”-stamp, but almost all of them have still same “mtime” and content. (This is necessary, because the actual build system cannot run sonarqube scanner.)
What I think you’re saying is not that SonarQube itself gets overwritten, but that you’re performing analysis in a directory where the project gets overwritten because it’s obtained by unpacking an archive.
If that’s correct, then I’m not surprised you’re getting specious “new” issues: analysis relies on SCM data to understand what code is new. You should be running analysis in the checkout directory, after compile but before the tar file is created.
Andreas L.:
This is necessary, because the actual build system cannot run sonarqube scanner.
The actual build system can’t run Java? Really?
As a side note, you should consider upgrading regardless of this question. Non-LTS versions are EOL as soon as each subsequent version is released. There will be no patches or fixes for 10.0. You should upgrade to 10.2 at your earliest convenience and plan to keep up with the ~2mo release cycle.
HTH,
Ann