JS: rename UselessRangeCheck -> UselessComparisonTest

This commit is contained in:
Asger F
2018-11-15 17:08:34 +00:00
parent 2e65f6b660
commit 477be260f3
9 changed files with 6 additions and 5 deletions

View File

@@ -27,14 +27,14 @@ If the check is needed to guard against <code>NaN</code> values, insert a commen
The following example finds the index of an element in a given slice of the array:
</p>
<sample src="examples/UselessRangeCheck.js" />
<sample src="examples/UselessComparisonTest.js" />
<p>
The condition <code>i &lt; end</code> at the end is always false, however. The code can be clarified if the
redundant condition is removed:
</p>
<sample src="examples/UselessRangeCheckGood.js" />
<sample src="examples/UselessComparisonTestGood.js" />
</example>
<references>

View File

@@ -1,6 +1,7 @@
/**
* @name Useless range check
* @description If a range check always fails or always succeeds, it is indicative of a bug.
* @name Useless comparison test
* @description A comparison that always evaluates to true or always evaluates to false may
* indicate faulty logic and dead code.
* @kind problem
* @problem.severity warning
* @id js/useless-range-check