mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
JavaScript: Generalize description of js/unused-local-variable.
The query also flags unused imports, functions and classes (which, of course, are just unused variables at the end of the day). This is now made more explicit in the description.
This commit is contained in:
@@ -7,11 +7,15 @@
|
||||
Unused local variables make code hard to read and understand. Any computation used to initialize
|
||||
an unused variable is wasted, which may lead to performance problems.
|
||||
</p>
|
||||
<p>
|
||||
Similarly, unused imports and unused functions or classes can be confusing. They may even be
|
||||
a symptom of a bug caused, for example, by an incomplete refactoring.
|
||||
</p>
|
||||
|
||||
</overview>
|
||||
<recommendation>
|
||||
|
||||
<p>Remove the unused variable.</p>
|
||||
<p>Remove the unused program element.</p>
|
||||
|
||||
</recommendation>
|
||||
<example>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/**
|
||||
* @name Unused variable
|
||||
* @description Unused variables may be a symptom of a bug and should be examined carefully.
|
||||
* @name Unused variable, import, function or class
|
||||
* @description Unused variables, imports, functions or classes may be a symptom of a bug
|
||||
* and should be examined carefully.
|
||||
* @kind problem
|
||||
* @problem.severity recommendation
|
||||
* @id js/unused-local-variable
|
||||
|
||||
Reference in New Issue
Block a user