Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 698ccd8

Browse files
committed
update {cpp/java}/unused-local to match python
1 parent 5a312cd commit 698ccd8

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

cpp/ql/src/Best Practices/Unused Entities/UnusedLocals.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ where
5858
not exists(AsmStmt s | f = s.getEnclosingFunction()) and
5959
not v.getAnAttribute().getName() = "unused" and
6060
not any(ErrorExpr e).getEnclosingFunction() = f // unextracted expr may use `v`
61-
select v, "Variable " + v.getName() + " is not used"
61+
select v, "The value assigned to local variable '" + v.getName() + "' is never used."

java/ql/src/Violations of Best Practice/Dead Code/UnusedLocal.ql

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,4 @@ where
2929
// Rules about catch clauses belong in an exception handling query
3030
not exceptionVariable(ve) and
3131
not enhancedForVariable(ve)
32-
select v,
33-
"Unused local variable " + v.getName() +
34-
". The variable is never read or written to and should be removed."
32+
select v, "The value assigned to local variable '" + v.getName() + "' is never used."

0 commit comments

Comments
 (0)