File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1313import python
1414import Variables.Definition
1515
16- predicate global_name_used ( Module m , Variable name ) {
16+ predicate global_name_used ( Module m , string name ) {
1717 exists ( Name u , GlobalVariable v |
1818 u .uses ( v ) and
19- v .getId ( ) = name . getId ( ) and
19+ v .getId ( ) = name and
2020 u .getEnclosingModule ( ) = m
2121 )
2222 or
2323 // A use of an undefined class local variable, will use the global variable
2424 exists ( Name u , LocalVariable v |
2525 u .uses ( v ) and
26- v .getId ( ) = name . getId ( ) and
26+ v .getId ( ) = name and
2727 u .getEnclosingModule ( ) = m and
2828 not v .getScope ( ) .getEnclosingScope * ( ) instanceof Function
2929 )
@@ -101,7 +101,7 @@ predicate unused_import(Import imp, Variable name) {
101101 not imp .getAnImportedModuleName ( ) = "__future__" and
102102 not imp .getEnclosingModule ( ) .declaredInAll ( name .getId ( ) ) and
103103 imp .getScope ( ) = imp .getEnclosingModule ( ) and
104- not global_name_used ( imp .getScope ( ) , name ) and
104+ not global_name_used ( imp .getScope ( ) , name . getId ( ) ) and
105105 // Imports in `__init__.py` are used to force module loading
106106 not imp .getEnclosingModule ( ) .isPackageInit ( ) and
107107 // Name may be imported for use in epytext documentation
You can’t perform that action at this time.
0 commit comments