pipes

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Async

func Async(workers int, input chan *callgraph.Graph, output chan []*Report, cb func(*callgraph.Graph) []*Report)

func CalcNextWithColor

func CalcNextWithColor(graph *callgraph.Graph)

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

func EraseNodesWithRemoverColor(graph *callgraph.Graph)

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

func FindRootNodes(graph *callgraph.Graph) callgraph.Nodes

FindRootNodes finds the nodes with the minimum number of input edges and has NextWithColors.

func FunctionsToNodes

func FunctionsToNodes(funcs *symbols.Functions) callgraph.Nodes

func NodesToGraphs

func NodesToGraphs(nodes callgraph.Nodes) []*callgraph.Graph

NodesToGraphs splits the graph into connectivity components.

Graphs from one node are skipped.

func WriteGraphsAsync

func WriteGraphsAsync(graphs []*callgraph.Graph, graphsCh chan *callgraph.Graph)

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

type Report struct {
	Rule      *palette.Rule
	CallChain callgraph.Nodes
	Message   string
}

func CheckColorsInGraph

func CheckColorsInGraph(graph *callgraph.Graph, palette *palette.Palette) []*Report

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.

func ReadReportsSync

func ReadReportsSync(output chan []*Report) []*Report

func (*Report) String

func (r *Report) String() string

Jump to

Keyboard shortcuts

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