You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When large IF statement is extracted, during refactoring, to separate method it's important to transform it the way that it will exit method immediately using inverted condition to decrease nesting level in that method.
If transformation wasn't made by developer and method has method-wide IF statement, then this must be reported as an error.
Before:
...
if ( $condition ) {
// some stuff
}
...
After:
...
function someStuff()
{
if ( !$condition ) {
return;
}
// some stuff
}
...
The text was updated successfully, but these errors were encountered:
When large IF statement is extracted, during refactoring, to separate method it's important to transform it the way that it will exit method immediately using inverted condition to decrease nesting level in that method.
If transformation wasn't made by developer and method has method-wide IF statement, then this must be reported as an error.
Before:
After:
The text was updated successfully, but these errors were encountered: