aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-squid/src
diff options
context:
space:
mode:
authorGodin <mandrikov@gmail.com>2010-11-26 15:02:43 +0000
committerGodin <mandrikov@gmail.com>2010-11-26 15:02:43 +0000
commit6d6a15f11a58b03d3942cd9e237460cdc2393ed2 (patch)
tree791b034e4b70a5f46facdb387cc4bff9c1b432b8 /sonar-squid/src
parent9aa8946e233c9f2fb46ed80f27a2d912516876ef (diff)
downloadsonarqube-6d6a15f11a58b03d3942cd9e237460cdc2393ed2.tar.gz
sonarqube-6d6a15f11a58b03d3942cd9e237460cdc2393ed2.zip
SONAR-1817: Squid rule to create violation on each NOSONAR tag occurence
Diffstat (limited to 'sonar-squid/src')
-rw-r--r--sonar-squid/src/main/java/org/sonar/squid/api/CheckMessage.java10
-rw-r--r--sonar-squid/src/main/java/org/sonar/squid/api/SourceCode.java2
2 files changed, 11 insertions, 1 deletions
diff --git a/sonar-squid/src/main/java/org/sonar/squid/api/CheckMessage.java b/sonar-squid/src/main/java/org/sonar/squid/api/CheckMessage.java
index e9caeb3e2af..1c56f8a4fb9 100644
--- a/sonar-squid/src/main/java/org/sonar/squid/api/CheckMessage.java
+++ b/sonar-squid/src/main/java/org/sonar/squid/api/CheckMessage.java
@@ -33,6 +33,7 @@ public class CheckMessage implements Message {
private CodeCheck codeCheck;
private String defaultMessage;
private Object[] messageArguments;
+ private Boolean forced;
public CheckMessage(CodeCheck rule, String message, Object... messageArguments) {
this.codeCheck = rule;
@@ -64,6 +65,14 @@ public class CheckMessage implements Message {
return cost;
}
+ public void setForced(boolean forced) {
+ this.forced = forced;
+ }
+
+ public boolean isForced() {
+ return forced == null ? false : forced;
+ }
+
public CodeCheck getChecker() {
return codeCheck;
}
@@ -93,4 +102,5 @@ public class CheckMessage implements Message {
return MessageFormat.format(defaultMessage, messageArguments);
}
}
+
}
diff --git a/sonar-squid/src/main/java/org/sonar/squid/api/SourceCode.java b/sonar-squid/src/main/java/org/sonar/squid/api/SourceCode.java
index 0cedaf8bc03..03d3ce8fc8a 100644
--- a/sonar-squid/src/main/java/org/sonar/squid/api/SourceCode.java
+++ b/sonar-squid/src/main/java/org/sonar/squid/api/SourceCode.java
@@ -262,7 +262,7 @@ public abstract class SourceCode implements Measurable, Comparable<SourceCode> {
return false;
}
- protected boolean hasChildren() {
+ public boolean hasChildren() {
return children != null && children.size() != 0;
}