metrics

package
v0.0.0-...-7db53b1 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2019 License: BSD-3-Clause, MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AstVisitor

type AstVisitor interface {
	Visit(ast.Node)
}

type FlowControlVisitor

type FlowControlVisitor struct {
	// contains filtered or unexported fields
}

FlowControlVisitor visits ifs, cases etc.

func (*FlowControlVisitor) Visit

func (v *FlowControlVisitor) Visit(node ast.Node)

type FuncVisitor

type FuncVisitor struct {
	// contains filtered or unexported fields
}

FuncVisitor visits functions to count functions, methods tests etc.

func (*FuncVisitor) Visit

func (v *FuncVisitor) Visit(node ast.Node)

type ImportVisitor

type ImportVisitor struct {
	// contains filtered or unexported fields
}

ImportVisitor visits import statements

func (*ImportVisitor) Visit

func (v *ImportVisitor) Visit(node ast.Node)

type Parser

type Parser struct{}

Parser - Code parser struct

func (*Parser) CountLOC

func (p *Parser) CountLOC(filePath string) (int, int, int)

CountLOC - count lines of code, pull LOC, Comments, assertions

func (*Parser) ParsePackages

func (p *Parser) ParsePackages(packageSpec []string) *Result

ParseDir - Parse all files within directory

type Result

type Result struct {
	LOC   int // line of code
	CLOC  int // comment line of code
	NCLOC int //

	Package int

	Struct    int
	Interface int

	Method           int
	ExportedMethod   int
	MethodLOC        int
	Function         int
	ExportedFunction int
	FunctionLOC      int

	Import int

	IfStatement     int
	SwitchStatement int
	GoStatement     int

	Test      int
	Benchmark int
	Assertion int
}

Result - container for analysis results

type TypeVisitor

type TypeVisitor struct {
	// contains filtered or unexported fields
}

TypeVisitor visits types to count structs, interfaces

func (*TypeVisitor) Visit

func (v *TypeVisitor) Visit(node ast.Node)

Jump to

Keyboard shortcuts

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