mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
change the alert message of unused-local-variable
This commit is contained in:
@@ -58,4 +58,4 @@ where
|
||||
not exists(AsmStmt s | f = s.getEnclosingFunction()) and
|
||||
not v.getAnAttribute().getName() = "unused" and
|
||||
not any(ErrorExpr e).getEnclosingFunction() = f // unextracted expr may use `v`
|
||||
select v, "The value assigned to local variable '" + v.getName() + "' is never used."
|
||||
select v, "Variable " + v.getName() + " is not used"
|
||||
|
||||
@@ -43,4 +43,4 @@ 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."
|
||||
select v, "Variable " + v.getId() + " is not used"
|
||||
|
||||
Reference in New Issue
Block a user