navigator

package
v0.0.0-...-2c9b28d Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: MPL-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func File

func File(pass *analysis.Pass, pos token.Pos) *ast.File

func GetEnclosingFuncWithSSA

func GetEnclosingFuncWithSSA(pass *analysis.Pass, ce *ast.CallExpr, ssaPkg *ssa.Package) *ssa.Function

func GetObjFromCe

func GetObjFromCe(ce *ast.CallExpr, info *types.Info) types.Object

func LoadPackages

func LoadPackages(paths []string) []*packages.Package

Types

type Exclusions

type Exclusions struct {
	Packages    []string
	PosSuffixes []string
}
type Navigator struct {
	Logger          *slog.Logger
	SSA             *SSA
	RouteIndicators []indicator.Indicator
	RouteMatches    []match.RouteMatch
	RunSSA          bool
	Packages        []*packages.Package
	CallgraphAlg    string
	Exclusions      Exclusions
}

func NewNavigator

func NewNavigator(logLevel int, indicators []indicator.Indicator) *Navigator
func (n *Navigator) GetCallInstructionFromSSAFunc(enclosingFunc *ssa.Function, expr *ast.CallExpr) ssa.CallInstruction
func (n *Navigator) GetCalledFunctionUsingEnclosing(enclosingFunc *ssa.Function, ce *ast.CallExpr) *ssa.Function
func (n *Navigator) GetModuleName(typesPkg *types.Package) string
func (n *Navigator) MapRoutes(paths []string)
func (n *Navigator) PassesExclusions(pos token.Position, pkg string) bool
func (n *Navigator) PrintResults(format string, fileName string)
func (n *Navigator) RecordGlobals(gen *ast.GenDecl, pass *analysis.Pass)
func (n *Navigator) RecordLocals(gen *ast.AssignStmt, pass *analysis.Pass)
func (n *Navigator) Run(pass *analysis.Pass) (interface{}, error)
func (n *Navigator) SSAPkgFromTypesPackage(pkg *types.Package) *ssa.Package
func (n *Navigator) SolveCallPaths(options callmapper.Options)
func (n *Navigator) SolvePathsSlow()

TODO: very slow function as it checks every node, one by one, and whether it has a path to any of the matches. At the moment, not used and only prints results for testing

type SSA

type SSA struct {
	Packages  []*ssa.Package
	Callgraph *callgraph.Graph
	Program   *ssa.Program
}

Jump to

Keyboard shortcuts

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