Documentation
¶
Overview ¶
Package complexity provides the repository's versioned complexity analysis. Its counting rules deliberately match plans/go-complexity-reduction.md: one plus a nesting-weighted increment for every branch, loop, switch and select, one for each else or else-if, one for each sequence of logical operators, and one for each labeled branch. A switch or select costs the same whether it has two cases or twenty, because flat dispatch is read one case at a time. Each function literal is measured as its own unit named <enclosing>.funcN, so callback-shaped code is attributed where it is actually read.
Index ¶
Constants ¶
const CountingRules = "" /* 341-byte string literal not displayed */
CountingRules describes the measure emitted in every report.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type File ¶
type File struct {
Module string `json:"module"`
Package string `json:"package"`
Path string `json:"path"`
Lines int `json:"lines"`
Test bool `json:"test,omitempty"`
}
File records every analyzed source file, including files without functions.
type Function ¶
type Function struct {
Module string `json:"module"`
Package string `json:"package"`
Path string `json:"path"`
Receiver string `json:"receiver,omitempty"`
Name string `json:"name"`
Complexity int `json:"complexity"`
Lines int `json:"lines"`
FileLines int `json:"file_lines"`
Test bool `json:"test,omitempty"`
}
Function identifies and measures a function or method.