mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
C++: SloppyGlobal: Don't alert on template instantiations, only the template
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user