We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e253ab5 commit 1cba1d0Copy full SHA for 1cba1d0
1 file changed
cpp/ql/src/Power of 10/Rule 6/GlobalCouldBeStatic.ql
@@ -12,5 +12,6 @@ from GlobalVariable v
12
where forex(VariableAccess va | va.getTarget() = v | va.getFile() = v.getDefinitionLocation().getFile())
13
and not v.hasSpecifier("static")
14
and strictcount(v.getAnAccess().getEnclosingFunction()) > 1 // If = 1, variable should be function-scope.
15
+ and not v.getADeclarationEntry().getFile() instanceof HeaderFile // intended to be accessed elsewhere
16
select v, "The global variable " + v.getName() + " is not accessed outside of " + v.getFile().getBaseName() +
17
" and could be made static."
0 commit comments