mirror of
https://github.com/github/codeql.git
synced 2026-02-14 22:21:06 +01:00
Excluded for now: unnecassary-delete; since the pattern is often intentional to break reference cycles, which the query doesn't account for; so uncertain about its claim of high precision
22 lines
652 B
Plaintext
22 lines
652 B
Plaintext
/**
|
|
* @name Comparison of identical values
|
|
* @description Comparison of identical values, the intent of which is unclear.
|
|
* @kind problem
|
|
* @tags quality
|
|
* maintainability
|
|
* readability
|
|
* external/cwe/cwe-570
|
|
* external/cwe/cwe-571
|
|
* @problem.severity warning
|
|
* @sub-severity high
|
|
* @precision very-high
|
|
* @id py/comparison-of-identical-expressions
|
|
*/
|
|
|
|
import python
|
|
import Expressions.RedundantComparison
|
|
|
|
from RedundantComparison comparison
|
|
where not comparison.isConstant() and not comparison.maybeMissingSelf()
|
|
select comparison, "Comparison of identical values; use cmath.isnan() if testing for not-a-number."
|