From f8ab1ee2e5a459e37da0f2f811b4cd920f124b23 Mon Sep 17 00:00:00 2001 From: Godin Date: Mon, 29 Nov 2010 15:49:47 +0000 Subject: [PATCH] SONAR-1817: Squid rule to create violation on each NOSONAR tag occurence --- .../main/java/org/sonar/java/squid/check/NoSonarCheck.java | 7 ++++--- 1 file 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 = "

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.

" + + "

This rule allows to track and/or forbid use of this marker

") 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); -- 2.39.5