Documentation ¶
Index ¶
Constants ¶
const ( // SeverityInfo represents informational severity SeverityInfo int = iota // SeverityLow represents low severity SeverityLow // SeverityMed represents medium severity SeverityMed // SeverityHigh represents high severity SeverityHigh )
const ( // CallGraphCallInternal represents an internal function call. CallGraphCallInternal = iota )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CallGraph ¶
type CallGraph struct { SubGraphs []*CallGraphSubGraph SubGraphsMap map[string]*CallGraphSubGraph Edges []*CallGraphEdge EdgesMap map[string]*CallGraphEdge DotAttrs *DotAttrs NodeDotAttrs *DotAttrs EdgeDotAttrs *DotAttrs }
CallGraph is the root of a call graph that only has subgraphs and edges.
func NewCallGraph ¶
func NewCallGraph() *CallGraph
NewCallGraph returns a new instance of CallGraph.
func (*CallGraph) AddEdge ¶
func (cg *CallGraph) AddEdge(from *CallGraphNode, to *CallGraphNode, subType int)
AddEdge adds a new edge to the graph.
func (*CallGraph) SubGraph ¶
func (cg *CallGraph) SubGraph(id string) *CallGraphSubGraph
SubGraph creates a new graph or returns an existing one.
type CallGraphAnalyzer ¶
type CallGraphAnalyzer struct{}
CallGraphAnalyzer is an analyzer that reports issues related to function calls.
func (*CallGraphAnalyzer) Execute ¶
func (cga *CallGraphAnalyzer) Execute(source *sources.Source) ([]*Issue, error)
Execute runs the analyzer on a given source.
func (*CallGraphAnalyzer) ID ¶
func (cga *CallGraphAnalyzer) ID() string
ID returns the unique ID of the analyzer.
func (*CallGraphAnalyzer) Name ¶
func (cga *CallGraphAnalyzer) Name() string
Name returns the name of the analyzer.
type CallGraphEdge ¶
type CallGraphEdge struct { From *CallGraphNode To *CallGraphNode SubType int DotAttrs *DotAttrs }
CallGraphEdge is a call graph edge.
func NewCallGraphEdge ¶
func NewCallGraphEdge(from *CallGraphNode, to *CallGraphNode, subType int) *CallGraphEdge
NewCallGraphEdge returns a new instance of CallGraphEdge.
type CallGraphNode ¶
CallGraphNode is a call graph node.
func NewCallGraphNode ¶
func NewCallGraphNode(id string, fn *sources.Function) *CallGraphNode
NewCallGraphNode returns a new instance of CallGraphNode.
type CallGraphSubGraph ¶
type CallGraphSubGraph struct { ID string Nodes []*CallGraphNode NodesMap map[string]*CallGraphNode Edges []*CallGraphEdge EdgesMap map[string]*CallGraphEdge DotAttrs *DotAttrs }
CallGraphSubGraph is a subgraph of a call graph.
func NewCallGraphSubGraph ¶
func NewCallGraphSubGraph(id string) *CallGraphSubGraph
NewCallGraphSubGraph returns a new instance of CallGraphSubGraph.
func (*CallGraphSubGraph) AddEdge ¶
func (sg *CallGraphSubGraph) AddEdge(from *CallGraphNode, to *CallGraphNode, subType int)
AddEdge adds a new edge to a subgraph.
func (*CallGraphSubGraph) Node ¶
func (sg *CallGraphSubGraph) Node(fn *sources.Function) *CallGraphNode
Node creates a new node or returns an existing one.
type CompilerBug ¶
type CompilerBug struct { Name string `json:"name"` Summary string `json:"summary"` Description string `json:"description"` Introduced string `json:"introduced"` Fixed string `json:"fixed"` Severity string `json:"severity"` URL string `json:"url"` }
CompilerBug represents a known bug affecting a version of the Solidity compiler.
type CompilerVersionAnalyzer ¶
type CompilerVersionAnalyzer struct { LatestVersion string KnownBugs []*CompilerBug KnownBugVersions map[string]*KnownBugVersion AffectedBugs map[string]bool }
CompilerVersionAnalyzer is an analyzer that reports issues related to the version of the Solidity compiler declared in a source's solidity pragma.
func NewCompilerVersionAnalyzer ¶
func NewCompilerVersionAnalyzer() (*CompilerVersionAnalyzer, error)
NewCompilerVersionAnalyzer returns a new instance of the analyzer.
func (*CompilerVersionAnalyzer) Execute ¶
func (cva *CompilerVersionAnalyzer) Execute(source *sources.Source) ([]*Issue, error)
Execute runs the analyzer on a given source.
func (*CompilerVersionAnalyzer) ID ¶
func (cva *CompilerVersionAnalyzer) ID() string
ID returns the unique ID of the analyzer.
func (*CompilerVersionAnalyzer) Name ¶
func (cva *CompilerVersionAnalyzer) Name() string
Name returns the name of the analyzer.
type DotAttrs ¶
DotAttrs is a map of attributes for dot templates.
type FunctionVisibilityAnalyzer ¶
type FunctionVisibilityAnalyzer struct{}
FunctionVisibilityAnalyzer is an analyzer that reports issues related to function visibility.
func (*FunctionVisibilityAnalyzer) Execute ¶
func (fva *FunctionVisibilityAnalyzer) Execute(source *sources.Source) ([]*Issue, error)
Execute runs the analyzer on a given source.
func (*FunctionVisibilityAnalyzer) ID ¶
func (fva *FunctionVisibilityAnalyzer) ID() string
ID returns the unique ID of the analyzer.
func (*FunctionVisibilityAnalyzer) Name ¶
func (fva *FunctionVisibilityAnalyzer) Name() string
Name returns the name of the analyzer.
type Issue ¶
type Issue struct { Severity int Title string Format string Message string // contains filtered or unexported fields }
Issue contains output generated by an analyzer.
func (*Issue) AnalyzerID ¶
AnalyzerID returns the ID of an analyzer associated with an issue.
type KnownBugVersion ¶
type KnownBugVersion struct {
Bugs []string `json:"bugs"`
}
KnownBugVersion represents a version of the Solidity compiler with one or more known bugs.