Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It seems the "method too long" restriction isn't counting the statements correctly #30

Open
SuperJMN opened this issue Apr 13, 2017 · 1 comment

Comments

@SuperJMN
Copy link
Contributor

The advice is triggered in some methods that are smaller than specified number of lines.

@nhamlin-mw
Copy link

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";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants