Filter out tests directories

This commit is contained in:
Josh Brown
2024-04-17 11:47:23 -07:00
parent 720285f724
commit db49d95e77

View File

@@ -68,7 +68,7 @@ predicate predictableInstruction(Instruction instr) {
module ImproperArrayIndexValidationConfig implements DataFlow::ConfigSig { module ImproperArrayIndexValidationConfig implements DataFlow::ConfigSig {
predicate isSource(DataFlow::Node source) { predicate isSource(DataFlow::Node source) {
isFlowSource(source, _) and isFlowSource(source, _) and
not source.asExpr().getFile().getRelativePath().regexpMatch("/tests?/") not source.getLocation().getFile().getRelativePath().regexpMatch("(.*/)?tests?/.*")
} }
predicate isBarrier(DataFlow::Node node) { predicate isBarrier(DataFlow::Node node) {