diff --git a/cpp/ql/src/Best Practices/SloppyGlobal.ql b/cpp/ql/src/Best Practices/SloppyGlobal.ql index 4c1935627d5..b20e0271db8 100644 --- a/cpp/ql/src/Best Practices/SloppyGlobal.ql +++ b/cpp/ql/src/Best Practices/SloppyGlobal.ql @@ -14,6 +14,9 @@ import semmle.code.cpp.ConfigurationTestFile from GlobalVariable gv where gv.getName().length() <= 3 and + // We will give an alert for the TemplateVariable, so we don't + // need to also give one for each instantiation + not gv instanceof VariableTemplateInstantiation and not gv.isStatic() and not gv.getFile() instanceof ConfigurationTestFile // variables in files generated during configuration are likely false positives select gv,