-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Expand file tree
/
Copy pathAlertSuppression.ql
More file actions
32 lines (27 loc) · 959 Bytes
/
AlertSuppression.ql
File metadata and controls
32 lines (27 loc) · 959 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/**
* @name Alert suppression
* @description Generates information about alert suppressions.
* @kind alert-suppression
* @id cs/alert-suppression
*/
private import codeql.util.suppression.AlertSuppression as AS
private import semmle.code.csharp.Comments
class AstNode extends Element {
predicate hasLocationInfo(
string filepath, int startline, int startcolumn, int endline, int endcolumn
) {
this.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
}
}
class SingleLineComment extends CommentLine {
SingleLineComment() {
// Must be either `// ...` or `/* ... */` on a single line.
this.getRawText().regexpMatch("//.*|/\\*.*\\*/")
}
predicate hasLocationInfo(
string filepath, int startline, int startcolumn, int endline, int endcolumn
) {
this.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
}
}
import AS::Make<AstNode, SingleLineComment>