Keywords break, continue and return cc4m_logo_inline

IDSTAT-15
TitleCarefully use break, continue and return.
PriorityMandatory
Severity level10
DescriptionCarefully use the keywords break, continue and return .
RationaleUsing break, continue or return decreases readability because the end of the function is not always reached. By avoiding these keywords, the flow of the code remains clear. However, these keywords can be useful to reduce complexity and improve performance.

Avoid:

if isempty(x)
    return
end

<rest of the code>

Instead use:

if isempty(x)
    % No further actions.
else
    <rest of the code>
end