CA005 - Useless object test local

Description

For local variables and feature arguments it is unnecessary to use an object test to check their attachment status.

Scope feature
Status Enabled
Severity Suggestion
Applicability All
Score 40

Example of violation

if attached a_local as another_local then another_local.do_something end

Recommendation

Remove the object test local, or replace the object test and use a comparison to Void.

In the example, it can simply be: if attached a_local then a_local.do_something end

or

if a_local /= Void then a_local.do_something end

56a54ef0-48e8-b58f-ac2c-09074782b9f7