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

Improve gocyclo score #20

Open
fredmaggiowski opened this issue Jan 29, 2018 · 0 comments
Open

Improve gocyclo score #20

fredmaggiowski opened this issue Jan 29, 2018 · 0 comments

Comments

@fredmaggiowski
Copy link
Owner

fredmaggiowski commented Jan 29, 2018

The gocyclo tool used by goreport card reported the following:

Gocyclo calculates cyclomatic complexities of functions in Go source code. The cyclomatic complexity of a function is calculated according to the following rules: 1 is the base complexity of a function +1 for each 'if', 'for', 'case', '&&' or '||' Go Report Card warns on functions with cyclomatic complexity > 15.

gonyan/bufferedstream_test.go
Line 51: warning: cyclomatic complexity 21 of function TestSetStartingSize() is high (> 15) (gocyclo)
Line 241: warning: cyclomatic complexity 19 of function TestAutonomousTransmissionRoutine() is high (> 15) (gocyclo)
Line 162: warning: cyclomatic complexity 16 of function TestSetSchedulingInterval() is high (> 15) (gocyclo)

To keep the whole code easy and clean let's simplify these tests.

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

No branches or pull requests

1 participant