Files
codeql/python/ql/src/Variables/GlobalAtModuleLevel.ql
2019-12-20 15:08:20 +01:00

18 lines
440 B
Plaintext

/**
* @name Use of 'global' at module level
* @description Use of the 'global' statement at module level
* @kind problem
* @tags maintainability
* useless-code
* @problem.severity warning
* @sub-severity low
* @precision very-high
* @id py/redundant-global-declaration
*/
import python
from Global g
where g.getScope() instanceof Module
select g, "Declaring '" + g.getAName() + "' as global at module-level is redundant."