codestruct

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package with metric which checks general code structure.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metric

type Metric struct {
	// Config with weights
	Config Weights
	// contains filtered or unexported fields
}

Intermidiate state for code structure metric

func (*Metric) Finish

func (m *Metric) Finish() float64

Returns final result of metric

func (*Metric) ParseNode

func (m *Metric) ParseNode(n ast.Node)

Parses ast node and collects result of metric

type Weights

type Weights struct {
	// Function declaration weight
	Func float64 `xml:"func"`
	// Structure declaration weight
	Struct float64 `xml:"struct"`
	// Interface declaration weight
	Interface float64 `xml:"interface"`
}

Weights for metric

Jump to

Keyboard shortcuts

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