mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Filter our sources in test folders
This commit is contained in:
@@ -116,10 +116,15 @@ module ImproperArrayIndexValidationConfig implements DataFlow::ConfigSig {
|
||||
|
||||
module ImproperArrayIndexValidation = TaintTracking::Global<ImproperArrayIndexValidationConfig>;
|
||||
|
||||
predicate isInTestFile(ImproperArrayIndexValidation::PathNode node){
|
||||
node.getNode().asExpr().getFile().getRelativePath().regexpMatch("/tests?/")
|
||||
}
|
||||
|
||||
from
|
||||
ImproperArrayIndexValidation::PathNode source, ImproperArrayIndexValidation::PathNode sink,
|
||||
string sourceType
|
||||
where
|
||||
not isInTestFile(source) and
|
||||
ImproperArrayIndexValidation::flowPath(source, sink) and
|
||||
isFlowSource(source.getNode(), sourceType)
|
||||
select sink.getNode(), source, sink,
|
||||
|
||||
Reference in New Issue
Block a user