gitee.com/wgliang/goreporter@v0.0.0-20180902115603-df1b20f7c5d0/linters/cyclo/README.md (about) 1 Gocyclo calculates cyclomatic complexities of functions in Go source code. 2 3 The cyclomatic complexity of a function is calculated according to the 4 following rules: 5 6 1 is the base complexity of a function 7 +1 for each 'if', 'for', 'case', '&&' or '||' 8 9 To install, run 10 11 $ go get github.com/fzipp/gocyclo 12 13 and put the resulting binary in one of your PATH directories if 14 `$GOPATH/bin` isn't already in your PATH. 15 16 Usage: 17 18 $ gocyclo [<flag> ...] <Go file or directory> ... 19 20 Examples: 21 22 $ gocyclo . 23 $ gocyclo main.go 24 $ gocyclo -top 10 src/ 25 $ gocyclo -over 25 docker 26 $ gocyclo -avg . 27 28 The output fields for each line are: 29 30 <complexity> <package> <function> <file:row:column> 31