sonarqube中new issue的标准

https://docs.sonarqube.org/latest/user-guide/issues/#header-4

Understanding which Issues are "New"

To determine the creation date of an issue, an algorithm is executed during each analysis to determine whether an issue is new or existed previously.

This algorithm relies on content hashes (excluding whitespace) for the line the issue is reported on.

For multi-line issues, the hash of the first line is used.

For each file (after detection of file renaming), the algorithm takes the base list of issues from the previous analysis, and tries to match those issues with the raw issue list reported by the new analysis.

The algorithm tries to first match using the strongest evidence, and then falls back to weaker heuristics启发式的.

  • if the issue is on the same rule, with the same line number and with the same line hash (but not necessarily with the same message) > MATCH
  • detect block move inside file, then if the issue is on the same (moved) line and on the same rule (but not necessarily with the same message) > MATCH
  • on the same rule, with the same message and with the same line hash (but not necessarily with the same line) > MATCH
  • on the same rule, with the same message and with the same line number (but not necessarily with the same line hash) > MATCH
  • on the same rule and with the same line hash (but not the same message and not the same line) > MATCH
  • is there a matching CLOSED issue > MATCH and Reopen

Unmatched "base" issues are closed as fixed.

Unmatched "raw" issues are new.

原文地址:https://www.cnblogs.com/chucklu/p/10678639.html