woodpecker/vendor/github.com/yagipy/maintidx
6543 56a854fe14
Update deps (#789)
* update github.com/docker/cli

* update github.com/docker/distribution

* update github.com/docker/docker

* update github.com/gin-gonic/gin

* update github.com/golang-jwt/jwt/v4

* update github.com/golangci/golangci-lint

* update github.com/gorilla/securecookie

* update github.com/mattn/go-sqlite3

* update github.com/moby/moby

* update github.com/prometheus/client_golang

* update github.com/xanzy/go-gitlab
2022-02-24 17:33:24 +01:00
..
pkg Update deps (#789) 2022-02-24 17:33:24 +01:00
.gitignore Update deps (#789) 2022-02-24 17:33:24 +01:00
go.mod Update deps (#789) 2022-02-24 17:33:24 +01:00
go.sum Update deps (#789) 2022-02-24 17:33:24 +01:00
LICENSE Update deps (#789) 2022-02-24 17:33:24 +01:00
maintidx.go Update deps (#789) 2022-02-24 17:33:24 +01:00
Makefile Update deps (#789) 2022-02-24 17:33:24 +01:00
README.md Update deps (#789) 2022-02-24 17:33:24 +01:00
visitor.go Update deps (#789) 2022-02-24 17:33:24 +01:00

maintidx

maintidx measures the maintainability index of each function.
https://docs.microsoft.com/en-us/visualstudio/code-quality/code-metrics-maintainability-index-range-and-meaning

Installation

Go version < 1.16

go get -u github.com/yagipy/maintidx/cmd/maintidx

Go version 1.16+

go install github.com/yagipy/maintidx/cmd/maintidx

Usage

standalone

maintidx ./...

with go run

No installation required

go run github.com/yagipy/maintidx/cmd/maintidx ./...

with go vet

go vet -vettool=`which maintidx` ./...

Flag

Flags:
  -under int
    	show functions with maintainability index < N only. (default 20)

TODO

  • Setup execute env on container
  • Impl cyc.Cyc.Calc()
  • Move maintidx.Visitor.PrintHalstVol to halstval package
  • Consider the necessity of halstvol.incrIfAllTrue
  • Test under pkg file