Versions in this module Expand all Collapse all v1 v1.2.1 Mar 21, 2017 v1.2.0 Mar 21, 2017 Changes in this version + func GetCallInfo(n ast.Node, ctx *Context) (string, string, error) + func GetCallObject(n ast.Node, ctx *Context) (*ast.CallExpr, types.Object) + func GetChar(n ast.Node) (byte, error) + func GetFloat(n ast.Node) (float64, error) + func GetImportPath(name string, ctx *Context) (string, bool) + func GetImportedName(path string, ctx *Context) (string, bool) + func GetInt(n ast.Node) (int64, error) + func GetLocation(n ast.Node, ctx *Context) (string, int) + func GetString(n ast.Node) (string, error) + func MatchCall(n ast.Node, r *regexp.Regexp) *ast.CallExpr + func MatchCallByPackage(n ast.Node, c *Context, pkg string, names ...string) (*ast.CallExpr, bool) + func MatchCallByType(n ast.Node, ctx *Context, requiredType string, calls ...string) (*ast.CallExpr, bool) + func MatchCompLit(n ast.Node, r *regexp.Regexp) *ast.CompositeLit + func Select(s Selector, n ast.Node, bits ...reflect.Type) + func SimpleSelect(n ast.Node, bits ...reflect.Type) ast.Node + func TryResolve(n ast.Node, c *Context) bool + type Analyzer struct + Issues []*Issue + Stats *Metrics + func NewAnalyzer(conf map[string]interface{}, logger *log.Logger) Analyzer + func (gas *Analyzer) AddRule(r Rule, nodes []ast.Node) + func (gas *Analyzer) Process(filename string) error + func (gas *Analyzer) ProcessSource(filename string, source string) error + func (gas *Analyzer) Visit(n ast.Node) ast.Visitor + type CallList map[string]set + func NewCallList() CallList + func (c CallList) Add(selector, ident string) + func (c CallList) AddAll(selector string, idents ...string) + func (c CallList) Contains(selector, ident string) bool + func (c CallList) ContainsCallExpr(n ast.Node, ctx *Context) bool + type Context struct + Comments ast.CommentMap + Config map[string]interface{} + FileSet *token.FileSet + Imports *ImportInfo + Info *types.Info + Pkg *types.Package + Root *ast.File + type ImportInfo struct + Aliased map[string]string + Imported map[string]string + InitOnly map[string]bool + func NewImportInfo() *ImportInfo + type Issue struct + Code string + Confidence Score + File string + Line int + Severity Score + What string + func NewIssue(ctx *Context, node ast.Node, desc string, severity Score, confidence Score) *Issue + type MetaData struct + Confidence Score + Severity Score + What string + type Metrics struct + NumFiles int + NumFound int + NumLines int + NumNosec int + type Rule interface + Match func(ast.Node, *Context) (*Issue, error) + type RuleSet map[reflect.Type][]Rule + type Score int + const High + const Low + const Medium + func (c Score) MarshalJSON() ([]byte, error) + func (c Score) String() string + type SelectFunc func(ast.Node, int) bool + type Selector interface + Final func(ast.Node) + Partial func(ast.Node) bool