inline

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: 2 Imported by: 0

Documentation

Overview

Metric for inline data complexity measurement

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metric

type Metric struct {
	// Config with all metric's weights
	Config Weights
	// contains filtered or unexported fields
}

Intermidiate state of metric

func (Metric) Finish

func (m Metric) Finish() float64

Returns final metric's result

func (*Metric) ParseNode

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

Parses ast node and collects all info about inlined constants in code

type Weights

type Weights struct {
	// Integer constants complexity
	Int float64 `xml:"int"`
	// Float constants complexity
	Float float64 `xml:"float"`
	// Imaginary numbers constants complexity
	Imag float64 `xml:"imag"`
	// Characters constants complexity
	Char float64 `xml:"char"`
	// Strings constants complexity
	String float64 `xml:"string"`
	// Composite literals (like structure initialization) constants complexity
	CompositeLit float64 `xml:"composite"`
}

Weight of different data complexity

Jump to

Keyboard shortcuts

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