Skip to content

Commit f34f7cc

Browse files
committed
exclude test folders from ql/path-problem-query
1 parent 3feee23 commit f34f7cc

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

ql/ql/src/queries/bugs/PathProblemQuery.ql

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,15 @@ import codeql_ql.bugs.PathProblemQueryQuery
1414

1515
from Query query, string msg, AstNode pred
1616
where
17-
query.isPathProblem() and
18-
not query.hasEdgesRelation(_) and
19-
pred = any(TopLevel top | top.getLocation().getFile() = query) and // <- dummy value
20-
msg = "A path-problem query should have a edges relation."
21-
or
22-
query.isProblem() and
23-
query.hasEdgesRelation(pred) and
24-
msg = "A problem query should not have a $@."
17+
(
18+
query.isPathProblem() and
19+
not query.hasEdgesRelation(_) and
20+
pred = any(TopLevel top | top.getLocation().getFile() = query) and // <- dummy value
21+
msg = "A path-problem query should have a edges relation."
22+
or
23+
query.isProblem() and
24+
query.hasEdgesRelation(pred) and
25+
msg = "A problem query should not have a $@."
26+
) and
27+
not query.getAbsolutePath().matches("%/test/%")
2528
select query, msg, pred, "edges relation"

0 commit comments

Comments
 (0)