Permalink
Fetching contributors…
Cannot retrieve contributors at this time
59 lines (44 sloc) 958 Bytes

RCS1073: Replace if statement with return statement

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

Examples

Code with Diagnostic

if (x) // RCS1073
{
    return true;
}
else
{
    return false;
}

Code with Fix

return x;

Code with Diagnostic

if (x != null) // RCS1073
{
    return x;
}
else
{
    return null;
}

Code with Fix

return x;

See Also

(Generated with DotMarkdown)