gendarme icon indicating copy to clipboard operation
gendarme copied to clipboard

False Positive - AvoidRepetitiveCallsToPropertiesRule

Open ghost opened this issue 12 years ago • 0 comments

The code down below triggers the AvoidRepetitiveCallsToPropertiesRule, however there is no reason to cache the property sins we always return before a second call to the property is made.

public bool MethodAccessException() 
{
    if (aError) {
        Debug (this.GetType().Name, "Some Message");
        return false;
    }

    ....

    if (bError) {
        Debug (this.GetType().Name, "A other Message");
        return false;
    }

    ....
}

ghost avatar Nov 17 '12 16:11 ghost