Documentation
¶
Index ¶
- func Async(workers int, input chan *callgraph.Graph, output chan []*Report, ...)
- func CalcNextWithColor(graph *callgraph.Graph)
- func EraseNodesWithRemoverColor(graph *callgraph.Graph)
- func FindRootNodes(graph *callgraph.Graph) callgraph.Nodes
- func FunctionsToNodes(funcs *symbols.Functions) callgraph.Nodes
- func NodesToGraphs(nodes callgraph.Nodes) []*callgraph.Graph
- func WriteGraphsAsync(graphs []*callgraph.Graph, graphsCh chan *callgraph.Graph)
- type CheckerFunctionsColors
- type Report
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalcNextWithColor ¶
Here we calculate node.NextWithColors for every function. We'll use it for perform dfs only for colored nodes of a call graph.
Note: this precalculation is needed, because dfs for a whole call graph is too heavy on a large code base.
func EraseNodesWithRemoverColor ¶
To perform calculating NextWithColors and checking color rules from the palette, we need to drop '@color remover' functions from a call graph completely, like they don't exist at all, this special color is for manual cutting connectivity rules, allowing to explicitly separate recursively-joint components
func FindRootNodes ¶
FindRootNodes finds the nodes with the minimum number of input edges and has NextWithColors.
func NodesToGraphs ¶
NodesToGraphs splits the graph into connectivity components.
Graphs from one node are skipped.
Types ¶
type CheckerFunctionsColors ¶
type CheckerFunctionsColors struct {
// contains filtered or unexported fields
}
func NewCheckerFunctionsColors ¶
func NewCheckerFunctionsColors(callGraph *callgraph.Graph, palette *palette.Palette) *CheckerFunctionsColors
func (*CheckerFunctionsColors) CheckFuncDFS ¶
func (c *CheckerFunctionsColors) CheckFuncDFS(callstack *callgraph.CallstackOfColoredFunctions, graph *callgraph.Graph, node *callgraph.Node) (reports []*Report)
type Report ¶
func CheckColorsInGraph ¶
CheckColorsInGraph check all palette rules like "api has-curl" or "messages-module messages-internals".
Start from the root, make dfs expanding NextWithColors and check all rules for each dfs chain.
These chains are left-to-right, e.g. colored f1 -> f2 -> f3, we find and check f1, then f1 -> f2, then f1 -> f2 -> f3.