What does the "leak period" mean in sonarQube?

Shortly, leak period is time frame (usually since last release), where specified criteria are measured on newly added code. This allows to focus on quality of fresh code and stop the accumulation of technical debt.

The "leak" concept is explained in documentation here https://docs.sonarqube.org/display/SONAR/Fixing+the+Water+Leak


Update SonarSource has fleshed-out and updated the terminology / philosophy: https://sonarqube.org/features/clean-as-you-code.


While SonarQube's documentation does an adequate job explaining the theory, code.scan (sonarqube for salesforce code) does a great job explaining the scenarios.

How the Leak Period is set determines what issues are displayed as ‘new’ issues. There are several options for this.

Date

By entering a date in the format yyyy-MM-dd, SonarQube will show the issues that have arisen since that date.

Number of days

By entering a single number, SonarQube will show the issues that have arisen since that number of days ago. Keep in mind that the issues found in the last 5 days will not be the same a week from now.

Previous version

By using the previous_version setting, the Leak Period will be tracked from the previous version set with the sonar.projectVersion parameter.

For example, a scan is run on a project with the sonar.projectVersion set to 1.0 . After time, the project's sonar.projectVersion is set to 1.1. The Leak Period set to previous_version would display all issues that have arisen since sonar.projectVersion 1.0 .

Specific version

By entering your projects required sonar.projectVersion, the Leak Period will display all issues that have arisen since that specific version.

For example, a scan is run on a project with the sonar.projectVersion set to BASELINE. The project’s sonar.projectVersion is then set to DEVELOPMENT and all necessary scans are run over time. The Leak Period set to BASELINE would display all issues that have arisen since the original scan.

It is important to note that all violations, when they were introduced and the version they are introduced in are tracked. The Leak Period only filters this information on the project’s Overview dashboard and the Issues screen.