No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2018-05-28 17:44:36 +03:00
cmd/gocyclo make API: separate analysis from running wrapper 2018-05-28 16:43:21 +03:00
pkg/gocyclo make API: separate analysis from running wrapper 2018-05-28 16:43:21 +03:00
CONTRIBUTORS Add CONTRIBUTORS file 2015-06-27 07:29:59 +02:00
LICENSE initial commit 2014-01-21 18:03:23 +01:00
README.md fix README 2018-05-28 17:44:36 +03:00

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 '||'

To install, run

$ go get github.com/fzipp/gocyclo/cmd/gocyclo

and put the resulting binary in one of your PATH directories if $GOPATH/bin isn't already in your PATH.

Usage:

$ gocyclo [<flag> ...] <Go file or directory> ...

Examples:

$ gocyclo .
$ gocyclo main.go
$ gocyclo -top 10 src/
$ gocyclo -over 25 docker
$ gocyclo -avg .

The output fields for each line are:

<complexity> <package> <function> <file:row:column>