diff options
author | Godin <mandrikov@gmail.com> | 2010-11-29 15:49:47 +0000 |
---|---|---|
committer | Godin <mandrikov@gmail.com> | 2010-11-29 15:49:47 +0000 |
commit | f8ab1ee2e5a459e37da0f2f811b4cd920f124b23 (patch) | |
tree | 9bc6b2b42b91c1d81c6bde89c24c7771a521eace | |
parent | 6e611257a0ce85043e9d22f4297cbfb03cae508a (diff) | |
download | sonarqube-f8ab1ee2e5a459e37da0f2f811b4cd920f124b23.tar.gz sonarqube-f8ab1ee2e5a459e37da0f2f811b4cd920f124b23.zip |
SONAR-1817: Squid rule to create violation on each NOSONAR tag occurence
-rw-r--r-- | plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/squid/check/NoSonarCheck.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/squid/check/NoSonarCheck.java b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/squid/check/NoSonarCheck.java index add1a0cd6eb..e17c348d012 100644 --- a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/squid/check/NoSonarCheck.java +++ b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/squid/check/NoSonarCheck.java @@ -26,14 +26,15 @@ import org.sonar.check.Rule; import org.sonar.squid.api.CheckMessage; import org.sonar.squid.api.SourceFile; -@Rule(key = "NoSonarCheck", name = "NOSONAR occurence", isoCategory = IsoCategory.Maintainability, priority = Priority.INFO, - description = "") +@Rule(key = "NoSonar", name = "Avoid use of //NOSONAR marker", isoCategory = IsoCategory.Reliability, priority = Priority.INFO, + description = "<p>Any violation to quality rule can be deactivated with the //NOSONAR marker. This marker is pretty useful to exclude false-positive results but sometimes it can abusively be used to hide real quality flaws.</p>" + + "<p>This rule allows to track and/or forbid use of this marker</p>") public class NoSonarCheck extends SquidCheck { @Override public void visitFile(SourceFile sourceFile) { for (Integer line : sourceFile.getNoSonarTagLines()) { - CheckMessage message = new CheckMessage(this, "NOSONAR occurence"); + CheckMessage message = new CheckMessage(this, "Is //NOSONAR used to exclude false-positive or to hide real quality flaw ?"); message.setForced(true); message.setLine(line); sourceFile.log(message); |