metrics

package
v0.0.0-...-faa6e34 Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GO_SRC_EXTENSION = ".go"
	CUR_DIR_NAME     = "."
	PARENT_DIR_NAME  = ".."
	NEW_LINE_CHAR    = '\n'
)

Variables

This section is empty.

Functions

func GetSourceFileExtensions

func GetSourceFileExtensions() []string

func IsEmptyLine

func IsEmptyLine(line string) bool

func IsHiddenDirectory

func IsHiddenDirectory(dirName string) bool

func IsSourceFile

func IsSourceFile(path string) bool

Types

type FileLogicalMetrics

type FileLogicalMetrics struct {
	CountSelectStmt  int
	CountIterStmt    int
	CountJumpStmt    int
	CountExprStmt    int
	CountGeneralStmt int
	CountBlockStmt   int
	CountDataDecl    int
	CountIfElse      int
	CountCases       int
}

func (*FileLogicalMetrics) CalculateCyclomaticComplexity

func (m *FileLogicalMetrics) CalculateCyclomaticComplexity() int

func (*FileLogicalMetrics) CalculateLogicalLOC

func (m *FileLogicalMetrics) CalculateLogicalLOC() int

type ModuleMetrics

type ModuleMetrics struct {
	Path                   string
	CountSourceFiles       int
	CountDirectories       int
	LinesOfCode            int
	BlankLines             int
	PhysicalLOC            int
	LogicalLOC             int
	CommentsLOC            int
	CommentSaturationLevel float64
	CyclomaticComplexity   int
}

func (*ModuleMetrics) CalculateCommentSaturationLevel

func (m *ModuleMetrics) CalculateCommentSaturationLevel()

func (*ModuleMetrics) CountAllMetrics

func (m *ModuleMetrics) CountAllMetrics() error

func (*ModuleMetrics) String

func (m *ModuleMetrics) String() string

type SourceFileInfo

type SourceFileInfo struct {
	TokensPos *token.FileSet
	AST       *ast.File
}

Jump to

Keyboard shortcuts

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