[[Property:title|CA071 - Self-comparison]]
[[Property:link_title|CA071]]
[[Property:weight|0]]
[[Property:uuid|02a649b3-0e4e-6fdf-388d-c411a06fc787]]
__NOTOC__
=Description=
An expression comparing a variable to itself always evaluates to the same boolean value. The comparison is thus redundant. In an Until expression it may lead to non-termination. Usually it is a typing error.
:{| class="doctable"
|-
| '''Scope'''
| Instruction
|-
| '''Status'''
| Enabled
|-
| '''Severity'''
| Warning
|-
| '''Applicability'''
| All
|-
| '''Score'''
|  70
|}


=Example of violation=
<e>if a >= a then
	...
end</e>

=Recommendation=
Replace left or right side of comparison with something else than the other element.

In the example, replace '''<e>a</e>''' by something else.

{{SeeAlso| [[CA001 - Self Assignment]]}}

