cyclop

command module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2021 License: MIT Imports: 0 Imported by: 0

README

cyclop

Coverage Status

Cyclop calculates cyclomatic complexities of functions in Go source code.

Usage

go get github.com/bkielbasa/cyclop

Options

cyclop: calculates cyclomatic complexity

Usage: cyclop [-flag] [package]


Flags:
  -V    print version and exit
  -all
        no effect (deprecated)
  -c int
        display offending line with this many lines of context (default -1)
  -cpuprofile string
        write CPU profile to this file
  -debug string
        debug flags, any subset of "fpstv"
  -fix
        apply all suggested fixes
  -flags
        print analyzer flags in JSON
  -json
        emit JSON output
  -maxComplexity int
        max complexity the function can have (default 10)
  -memprofile string
        write memory profile to this file
  -packageAverage float
        max avarage complexity in package
  -skipTests
        should the linter execute on test files as well
  -source
        no effect (deprecated)
  -tags string
        no effect (deprecated)
  -trace string
        write trace log to this file
  -v    no effect (deprecated)

Important parameters are:

  • -maxComplexity int - the max complexity calculated for a single function. 10 by default
  • -packageAvarage float64 - the average cyclomatic complexity for a package. If the value is higher than 0 it will reaise an error if the average will be higher. 0 default.
  • -skipTests bool - should checks be executed in tests files. false by default

Documentation

Overview

Cyclop calculates cyclomatic complexities of functions in Go source code. Simple usage:

cyclop .

Read more about usage in https://github.com/bkielbasa/cyclop/blob/master/README.md

Directories

Path Synopsis
cmd
cyclop command
pkg

Jump to

Keyboard shortcuts

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