Details
-
Type:
New Feature
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: JAVASCRIPT-1.3
-
Component/s: JavaScript
-
Labels:None
-
Number of attachments :
Description
- Title
Avoid unused variables
- Description
<p>
When a variable is declared but never used this definitely decreases the readability of the source code and such dead declarations can even be misleading.
</p>
<p>
The following code snippet illustrates this rule :
<p>
<pre>
function fun(a, b) {
var c = 2; //Non-Compliant
return a + b;
}
test(1, 2);
</pre>
- Violation message
Remove the declaration of the unused 'xxxx' variable
- Default severity
Major
Part of the Sonar way quality profile
Origin : JSHint
Issue Links
- is related to
-
SONARPLUGINS-2743
Update the SQALE mapping for new rules
-
Integration tests were updated.