diff options
author | Evgeny Mandrikov <mandrikov@gmail.com> | 2011-12-13 18:10:57 +0400 |
---|---|---|
committer | Evgeny Mandrikov <mandrikov@gmail.com> | 2011-12-13 19:54:07 +0400 |
commit | 81cffc0f9e4ba50a873f72de195345216c66559b (patch) | |
tree | bb46fd9f3c73731f09c5e5df7bf4484c4cc0662f /sonar-squid/src | |
parent | 65cb425e561a1789beee8baa12e6b1aace140c15 (diff) | |
download | sonarqube-81cffc0f9e4ba50a873f72de195345216c66559b.tar.gz sonarqube-81cffc0f9e4ba50a873f72de195345216c66559b.zip |
SONAR-2018 Improve rule for detection of commented-out code
* Only one violation in one block of comment.
* Proper recognition of Javadocs.
Diffstat (limited to 'sonar-squid/src')
-rw-r--r-- | sonar-squid/src/main/java/org/sonar/squid/api/SourceFile.java | 14 | ||||
-rw-r--r-- | sonar-squid/src/main/java/org/sonar/squid/text/Source.java | 9 |
2 files changed, 0 insertions, 23 deletions
diff --git a/sonar-squid/src/main/java/org/sonar/squid/api/SourceFile.java b/sonar-squid/src/main/java/org/sonar/squid/api/SourceFile.java index 922c5ca26b1..27d06e6f652 100644 --- a/sonar-squid/src/main/java/org/sonar/squid/api/SourceFile.java +++ b/sonar-squid/src/main/java/org/sonar/squid/api/SourceFile.java @@ -26,7 +26,6 @@ import java.util.Set; public class SourceFile extends SourceCode { private Set<Integer> noSonarTagLines = new HashSet<Integer>(); - private Set<Integer> commentedOutCodeLines = new HashSet<Integer>(); public SourceFile(String key) { super(key); @@ -54,17 +53,4 @@ public class SourceFile extends SourceCode { noSonarTagLines.add(line); } - /** - * @since 2.13 - */ - public Set<Integer> getCommentedOutCodeLines() { - return commentedOutCodeLines; - } - - /** - * @since 2.13 - */ - public void addCommentedOutCodeLines(Set<Integer> commentedOutCodeLines) { - this.commentedOutCodeLines.addAll(commentedOutCodeLines); - } } diff --git a/sonar-squid/src/main/java/org/sonar/squid/text/Source.java b/sonar-squid/src/main/java/org/sonar/squid/text/Source.java index 7d4510f8db1..8e6b51b4714 100644 --- a/sonar-squid/src/main/java/org/sonar/squid/text/Source.java +++ b/sonar-squid/src/main/java/org/sonar/squid/text/Source.java @@ -33,7 +33,6 @@ public class Source { private List<Line> lines = new ArrayList<Line>(); private CodeRecognizer codeRecognizer; private Set<Integer> noSonarTagLines = new HashSet<Integer>(); - private Set<Integer> commentedOutCodeLines = new HashSet<Integer>(); public Source(Reader reader, CodeRecognizer codeRecognizer, String... additionalSingleLineCommentFlag) { this.codeRecognizer = codeRecognizer; @@ -88,7 +87,6 @@ public class Source { line.setMeasure(Metric.COMMENT_LINES, 1); } else { line.setMeasure(Metric.COMMENTED_OUT_CODE_LINES, 1); - commentedOutCodeLines.add(line.getLineIndex()); } } } @@ -127,11 +125,4 @@ public class Source { public Set<Integer> getNoSonarTagLines() { return noSonarTagLines; } - - /** - * @since 2.13 - */ - public Set<Integer> getCommentedOutCodeLines() { - return commentedOutCodeLines; - } } |