analyzers

package
v2.21.4-beta1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

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

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

AnalyzerBuilder is used to register an analyzer definition with the analyzer

type AnalyzerDefinition

type AnalyzerDefinition struct {
	ID          string
	Description string
	Create      AnalyzerBuilder
}

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

type AnalyzerFilter

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

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 (false means don't remove, true means exclude).

type AnalyzerList

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

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

Generate the list of analyzers to use

func (*AnalyzerList) AnalyzersInfo

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

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

func NewAnalyzerSet

func NewAnalyzerSet() *AnalyzerSet

NewAnalyzerSet constructs a new AnalyzerSet

func (*AnalyzerSet) IsSuppressed

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

IsSuppressed will return whether the Analyzer is suppressed.

func (*AnalyzerSet) Register

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