godepth

command module
v0.0.0-...-f5fe467 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

README

This work was mainly inspired by github.com/fzipp/gocyclo

godepth

Count the maxdepth of go functions

examples:

$ godepth .
$ godepth -over 3
$ godepth -avg

history

One of my use case was to test the deepness of go functions for code reviews. I didn't find any tools that fulfill the requirement.

Documentation

Overview

godepth calculates maximum depth of go methods in Go source code.

This work was mainly inspired by github.com/fzipp/gocyclo

Usage:

godepth [<flag> ...] <Go file or directory> ...

Flags:

-over N   show functions with depth > 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 depth

The output fields for each line are: <depth> <package> <function> <file:row:column>

Jump to

Keyboard shortcuts

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