We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cb3a0fb commit 2ea2bd8Copy full SHA for 2ea2bd8
ql/ql/src/queries/style/RepeatedWord.ql
@@ -14,9 +14,12 @@ string getWord(Comment node) { result = node.getContents().regexpFind("\\b[A-Za-
14
15
Comment hasRepeatedWord(string word) {
16
word = getWord(result) and
17
- result.getContents().regexpMatch(".*\\b" + word + "\\s+" + word + "\\b.*")
+ result.getContents().regexpMatch(".*[\\s]" + word + "\\s+" + word + "[\\s.,].*")
18
}
19
20
from Comment comment, string word
21
-where comment = hasRepeatedWord(word)
+where
22
+ comment = hasRepeatedWord(word) and
23
+ // lots of these, and I can't just change old dbschemes.
24
+ not (word = "type" and comment.getLocation().getFile().getExtension() = "dbscheme")
25
select comment, "The comment repeats " + word + "."
0 commit comments