[[Property:title|CA001 - Self Assignment]]
[[Property:link_title|CA001]]
[[Property:weight|0]]
[[Property:uuid|d98b7fb8-37a1-05b3-a58f-baacefd5dce6]]
__NOTOC__
=Description=
Assigning a variable to itself is a meaningless instruction due to a typing error. Most probably, one of the two variable names was misspelled. One example among many others: the programmer wanted to assign a local variable to a class attribute and used one of the variable names twice.
:{| class="doctable"
|-
| '''Scope'''
| Instruction
|-
| '''Status'''
| Enabled
|-
| '''Severity'''
| Warning
|-
| '''Applicability'''
| All
|-
| '''Score'''
|  70
|}


=Example of violation=
<e>a := a
</e>

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

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

{{SeeAlso| [[CA071 - Self-comparison]]}}

