CPP: Exclude variables that are part of an interface.

This commit is contained in:
Geoffrey White
2018-11-16 21:24:18 +00:00
parent b70c572e34
commit 2d07410f97
3 changed files with 3 additions and 3 deletions

View File

@@ -10,5 +10,6 @@ import cpp
from GlobalVariable v, Function f
where v.getAnAccess().getEnclosingFunction() = f and
strictcount(v.getAnAccess().getEnclosingFunction()) = 1
strictcount(v.getAnAccess().getEnclosingFunction()) = 1 and
not v.getADeclarationEntry().getFile() instanceof HeaderFile // intended to be accessed elsewhere
select v, "The variable " + v.getName() + " is only accessed in $@ and should be scoped accordingly.", f, f.getName()