Permalink
Fetching contributors…
Cannot retrieve contributors at this time
47 lines (36 sloc) 837 Bytes

RCS1179: Use return instead of assignment

Property Value
Id RCS1179
Category Simplification
Default Severity Info
Enabled by Default
Supports Fade-Out -
Supports Fade-Out Analyzer -

Example

Code with Diagnostic

if (condition) // RCS1179
{
    x = 1;
}
else
{
    x = 2;
}

return x;

Code with Fix

if (condition)
{
    return 1;
}
else
{
    return 2;
}

See Also

(Generated with DotMarkdown)