Java sonarQube 中的“泄漏期”是什么意思?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/41550260/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 23:28:43  来源:igfitidea点击:

What does the "leak period" mean in sonarQube?

javasonarqubesonar-runner

提问by e2rabi

I'm new in SonarQube I started reading documentation but a lot of time a found "The leak period"but I didn't found anything about it can someone explain me what it means.

我是 SonarQube 的新手,我开始阅读文档,但很多时候发现了“泄漏期”,但我没有找到任何关于它的信息,有人可以向我解释这意味着什么。

采纳答案by Tibor Blenessy

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

“泄漏”概念在此处的文档中进行了解释https://docs.sonarqube.org/display/SONAR/Fixing+the+Water+Leak



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

更新SonarSource 充实并更新了术语/理念:https://sonarqube.org/features/clean-as-you-code 。

回答by JJS

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

虽然SonarQube 的文档很好地解释了理论,但 code.scan(用于 salesforce 代码的 sonarqube)在解释场景方面做得很好。

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_versionsetting, the Leak Period will be tracked from the previous version set with the sonar.projectVersionparameter.

For example, a scan is run on a project with the sonar.projectVersionset to 1.0. After time, the project's sonar.projectVersionis 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.projectVersionset to BASELINE. The project's sonar.projectVersionis then set to DEVELOPMENTand all necessary scans are run over time. The Leak Period set to BASELINEwould 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.

泄漏期的设置方式决定了哪些问题显示为“新”问题。对此有多种选择。

日期

通过以 yyyy-MM-dd 格式输入日期,SonarQube 将显示自该日期以来出现的问题。

天数

通过输入一个数字,SonarQube 将显示自该天数前出现的问题。请记住,过去 5 天内发现的问题在一周后将不再相同。

上一版本

通过使用该previous_version设置,将从使用该sonar.projectVersion参数设置的先前版本开始跟踪泄漏周期 。

例如,对sonar.projectVersion设置为的项目运行扫描1.0。一段时间后,项目的sonar.projectVersion设置为1.1。设置为 previous_version 的泄漏期将显示自 sonar.projectVersion 1.0 以来出现的所有问题。

具体版本

通过输入您需要的项目 sonar.projectVersion,泄漏期将显示自该特定版本以来出现的所有问题。

例如,在sonar.projectVersion设置为 的项目上运行扫描BASELINEsonar.projectVersion然后将项目设置为 DEVELOPMENT并且随着时间的推移运行所有必要的扫描。泄漏期设置为BASELINE将显示自原始扫描以来出现的所有问题。

需要注意的是,所有违规行为、引入时间和引入版本都将被跟踪。泄漏期仅在项目的概览仪表板和问题屏幕上过滤此信息。