We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9f688eb commit a51b984Copy full SHA for a51b984
1 file changed
cpp/ql/src/Power of 10/Rule 6/VariableScopeTooLarge.ql
@@ -10,5 +10,7 @@ import cpp
10
11
from GlobalVariable v, Function f
12
where v.getAnAccess().getEnclosingFunction() = f and
13
- strictcount(v.getAnAccess().getEnclosingFunction()) = 1
+ strictcount(v.getAnAccess().getEnclosingFunction()) = 1 and
14
+ forall(VariableAccess a | a = v.getAnAccess() | exists(a.getEnclosingFunction())) and
15
+ not v.getADeclarationEntry().getFile() instanceof HeaderFile // intended to be accessed elsewhere
16
select v, "The variable " + v.getName() + " is only accessed in $@ and should be scoped accordingly.", f, f.getName()
0 commit comments