Search code examples
javasonarqubesonar-runner

Sonar runner, seeonly newly introduced issues


is there a manner, using sonar runner, to see only the delta of the issues? For delta I mean only the issues introduced by recent changes? If yes how? Thanks and best regards


Solution

  • You have to change the Leak Period of your project.

    Default value is previous_version, which means you get the delta between last analysis and last version (defined in sonar-project.properties for example).

    Based on your example, you want the delta between each analysis, so you need to set up the parameter to previous_analysis.

    Solution 1 : Setting using web interface

    The easiest way to change the parameter is to use the sonar web interface as described in the documentation : change the Leak Period

    Solution 2 : Setting using configuration file

    If you can't or don't want to use web interface to set this parameter, use the configuration file sonar-project.properties.

    1. Create or edit sonar-project.properties into the root folder of your project
    2. Add the following line : sonar.timemachine.period1=previous_analysis

    Solution 3 : Set as a parameter of command line

    The last solution is to add an argument of the command line to take into account the parameter. You have to add the argument -Dsonar.timemachine.period1=previous_analysis to your command line.

    SonnarQube scanner options are defined in the manual page