maintidx

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2021 License: MIT Imports: 9 Imported by: 9

README

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Name: "maintidx",
	Doc:  doc,
	Run:  run,
	Requires: []*analysis.Analyzer{
		inspect.Analyzer,
	},
}

Functions

This section is empty.

Types

type Coef

type Coef struct {
	Cyc      cyc.Cyc
	HalstVol halstvol.HalstVol
}

type Visitor

type Visitor struct {
	MaintIdx int
	Coef     Coef
}

func NewVisitor

func NewVisitor() *Visitor

func (*Visitor) Visit

func (v *Visitor) Visit(n ast.Node) ast.Visitor

Directories

Path Synopsis
cmd
pkg
cyc
https://golangci-lint.run/contributing/new-linters/#how-to-add-a-private-linter-to-golangci-lint
https://golangci-lint.run/contributing/new-linters/#how-to-add-a-private-linter-to-golangci-lint

Jump to

Keyboard shortcuts

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