I have this code:
public int GetNumber()
{
if (Foo() > 8)
{
return 10;
}
if (Foo() == 4)
{
return 0;
}
if (Foo() == 3)
{
return 1;
}
return 10;
}
And I would like to use patterns with ReSharper to verify if my method has multuple "return" statements and display a suggestion, and if I have this method:
public int GetNumber2()
{
var result = 0;
if (Foo() > 8)
{
result = 10;
}
if (Foo() == 4)
{
result = 0;
}
if (Foo() == 3)
{
result = 1;
}
return result;
}
The suggestion won't be displayed.