We are using SonarQube 6.7.3 and sonar java plugin 5.3
We have changed sonar configuration to make byte code available to Sonar and enabled some new rules to quality profile
Changed “clean sonar:sonar” to “clean package sonar:sonar”
Since then it is showing issues in old code as new errors.
We have enabled sonar with svn plugin and provided credentials as well, so we expect it to show new errors on new code only.
Please let me know why it is showing new errors in old code…
You don’t give any examples, so it’s down to educated guessing on my side, but it’s entirely possible for legitimately new issues to be raised in old code. For instance, let’s say you update methodA so that it might now return null. Old calls to methodA must now null-check return values before dereferencing. If they don’t, new null pointer issues will legitimately be raised on those old calls.
Not providing bytecode was actually a misconfiguration, so from there on it’s expected that fixing it might raise new issues. @ganncamp described the legit use-cases where SonarQube performs issue backdating, and there is no plan to have SonarQube backdate issues in the cases of past misconfigurations that have been addressed.
Not to mention that this should remain a rare situation, so ultimately it’s under your control to (punctually) perform these changes in between two versions of your products, so that you can then pursue clean code on a clean Leak Period.