From 171e4335936eb4655639a71199440c598af85fbb Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Wed, 11 Nov 2020 15:36:17 +0000 Subject: [PATCH] Exclude test files --- ql/src/semmle/go/security/ExternalAPIs.qll | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ql/src/semmle/go/security/ExternalAPIs.qll b/ql/src/semmle/go/security/ExternalAPIs.qll index 357f9290aed..4a2e096a430 100644 --- a/ql/src/semmle/go/security/ExternalAPIs.qll +++ b/ql/src/semmle/go/security/ExternalAPIs.qll @@ -71,6 +71,8 @@ class ExternalAPIDataNode extends DataFlow::Node { ) and // Not defined in the code that is being analysed not exists(call.getACallee().getBody()) and + // Not defined in a test file + not call.getFile() instanceof TestFile and // Not already modeled as a taint step not exists(DataFlow::Node next | TaintTracking::localTaintStep(this, next)) and // Not a sink for a commonly-used query