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
{{ message }}
Repository navigation
It seems the "method too long" restriction isn't counting the statements correctly #30
I noticed that a single-line if statement counts as 2, but if I put that inside braces, the same statement counts as 3. It's bad practice to use single-line if statements, so should the braces be counted as a statement?
Also, the following code evaluates to 5 statements. Is it the declaration, the if, the comparison, and the two return statements?
int i = 1;
if (i == 1) return "hey";
return "uhoh";
Activity
nhamlin-mw commentedon Jun 5, 2018
I noticed that a single-line if statement counts as 2, but if I put that inside braces, the same statement counts as 3. It's bad practice to use single-line if statements, so should the braces be counted as a statement?
Also, the following code evaluates to 5 statements. Is it the declaration, the if, the comparison, and the two return statements?