mirror of
https://github.com/github/codeql.git
synced 2026-05-02 12:15:17 +02:00
Python: Apply autoformat.
This commit is contained in:
@@ -15,8 +15,7 @@ import python
|
||||
import Definition
|
||||
|
||||
predicate unused_local(Name unused, LocalVariable v) {
|
||||
forex(Definition def |
|
||||
def.getNode() = unused |
|
||||
forex(Definition def | def.getNode() = unused |
|
||||
def.getVariable() = v and
|
||||
def.isUnused() and
|
||||
not exists(def.getARedef()) and
|
||||
@@ -27,9 +26,9 @@ predicate unused_local(Name unused, LocalVariable v) {
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
from Name unused, LocalVariable v
|
||||
where unused_local(unused, v) and
|
||||
// If unused is part of a tuple, count it as unused if all elements of that tuple are unused.
|
||||
forall(Name el | el = unused.getParentNode().(Tuple).getAnElt() | unused_local(el, _))
|
||||
where
|
||||
unused_local(unused, v) and
|
||||
// If unused is part of a tuple, count it as unused if all elements of that tuple are unused.
|
||||
forall(Name el | el = unused.getParentNode().(Tuple).getAnElt() | unused_local(el, _))
|
||||
select unused, "The value assigned to local variable '" + v.getId() + "' is never used."
|
||||
|
||||
Reference in New Issue
Block a user