mirror of
https://github.com/github/codeql.git
synced 2026-04-29 02:35:15 +02:00
JavaScript: Alert suppression through single-line /* */ style comments.
This commit is contained in:
@@ -16,9 +16,11 @@ class SuppressionComment extends Locatable {
|
||||
|
||||
SuppressionComment() {
|
||||
(
|
||||
text = this.(LineComment).getText() or
|
||||
text = this.(Comment).getText() or
|
||||
text = this.(HTML::CommentNode).getText()
|
||||
) and
|
||||
// suppression comments must be single-line
|
||||
not text.matches("%\n%") and
|
||||
(
|
||||
// match `lgtm[...]` anywhere in the comment
|
||||
annotation = text.regexpFind("(?i)\\blgtm\\s*\\[[^\\]]*\\]", _, _)
|
||||
|
||||
Reference in New Issue
Block a user