Files
codeql/javascript/ql/src/Expressions/ComparisonWithNaN.ql
Anders Schack-Mulligen e58094c732 Javascript: Autoformat.
2019-01-11 11:02:42 +01:00

20 lines
583 B
Plaintext

/**
* @name Comparison with NaN
* @description Arithmetic comparisons with NaN are useless: nothing is considered to be equal to NaN, not even NaN itself,
* and similarly nothing is considered greater or less than NaN.
* @kind problem
* @problem.severity error
* @id js/comparison-with-nan
* @tags reliability
* correctness
* external/cwe/cwe-570
* external/cwe/cwe-571
* @precision very-high
*/
import javascript
from Comparison cmp
where cmp.getAnOperand().(GlobalVarAccess).getName() = "NaN"
select cmp, "Useless comparison with NaN."