gocyclo

command module
v0.0.0-...-4ed32f3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 17, 2016 License: BSD-3-Clause Imports: 8 Imported by: 0

README

Command gocyclo calculates cyclomatic complexities of functions in Go source code.

For more information on the metric refer to https://en.wikipedia.org/wiki/Cyclomatic_complexity.

To install, run

$ go get github.com/nodirt/gocyclo

Usage:

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

Examples:

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

The output fields for each line are:

<complexity> <full function name> <file:row:column>

Documentation

Overview

Command gocyclo calculates the cyclomatic complexities of functions in Go source code.

Usage:

gocyclo [<flag> ...] <Go file or packages> ...

Flags:

-over N   show functions with complexity > N only and
          return exit code 1 if the output is non-empty
-top N    show the top N most complex functions only
-avg      show the average complexity

The output fields for each line are: <complexity> <full function name> <file:row:column>

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL