analyzers

package
v2.21.1 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildDefaultAnalyzers

func BuildDefaultAnalyzers() []*analysis.Analyzer

BuildDefaultAnalyzers returns the default list of analyzers

Types

type AnalyzerBuilder added in v2.21.0

type AnalyzerBuilder func(id string, description string) *analysis.Analyzer

AnalyzerBuilder is used to register an analyzer definition with the analyzer

type AnalyzerDefinition added in v2.21.0

type AnalyzerDefinition struct {
	ID          string
	Description string
	Create      AnalyzerBuilder
}

AnalyzerDefinition contains the description of an analyzer and a mechanism to create it.

type AnalyzerFilter added in v2.21.0

type AnalyzerFilter func(string) bool

AnalyzerFilter can be used to include or exclude an analyzer depending on the return value of the function

func NewAnalyzerFilter added in v2.21.0

func NewAnalyzerFilter(action bool, analyzerIDs ...string) AnalyzerFilter

NewAnalyzerFilter is a closure that will include/exclude the analyzer ID's based on the supplied boolean value.

type AnalyzerList added in v2.21.0

type AnalyzerList struct {
	Analyzers          map[string]AnalyzerDefinition
	AnalyzerSuppressed map[string]bool
}

AnalyzerList contains a mapping of analyzer ID's to analyzer definitions and a mapping of analyzer ID's to whether analyzers are suppressed.

func Generate added in v2.21.0

func Generate(trackSuppressions bool, filters ...AnalyzerFilter) *AnalyzerList

Generate the list of analyzers to use

func (*AnalyzerList) AnalyzersInfo added in v2.21.0

func (al *AnalyzerList) AnalyzersInfo() (map[string]AnalyzerDefinition, map[string]bool)

AnalyzersInfo returns all the create methods and the analyzer suppressed map for a given list

type AnalyzerSet added in v2.21.0

type AnalyzerSet struct {
	Analyzers             []*analysis.Analyzer
	AnalyzerSuppressedMap map[string]bool
}

func NewAnalyzerSet added in v2.21.0

func NewAnalyzerSet() *AnalyzerSet

NewAnalyzerSet constructs a new AnalyzerSet

func (*AnalyzerSet) IsSuppressed added in v2.21.0

func (a *AnalyzerSet) IsSuppressed(ruleID string) bool

IsSuppressed will return whether the Analyzer is suppressed.

func (*AnalyzerSet) Register added in v2.21.0

func (a *AnalyzerSet) Register(analyzer *analysis.Analyzer, isSuppressed bool)

Register adds a trigger for the supplied analyzer

type SSAAnalyzerResult

type SSAAnalyzerResult struct {
	Config map[string]interface{}
	Logger *log.Logger
	SSA    *buildssa.SSA
}

SSAAnalyzerResult contains various information returned by the SSA analysis along with some configuration

Jump to

Keyboard shortcuts

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