Documentation ¶
Index ¶
- Constants
- func Extract(targetFile string, config *ExtractConfig) ([]*extractor.FileResult, error)
- func ExtractClazz(targetFile string, config *ExtractConfig) ([]*extractor.ClazzFileResult, error)
- func ExtractFromBytes(content []byte, config *ExtractConfig) (*extractor.FileResult, error)
- func ExtractFromString(content string, config *ExtractConfig) (*extractor.FileResult, error)
- func ExtractFunction(targetFile string, config *ExtractConfig) ([]*extractor.FunctionFileResult, error)
- func ExtractSymbol(targetFile string, config *ExtractConfig) ([]*extractor.SymbolFileResult, error)
- func QueryUnitsByIndexNames[T extractor.DataType](result *extractor.BaseFileResult[T], indexNames ...string) []T
- func QueryUnitsByIndexNamesInFiles[T extractor.DataType](result []*extractor.BaseFileResult[T], indexNames ...string) []T
- func QueryUnitsByLines[T extractor.DataType](result *extractor.BaseFileResult[T], lines ...int) []T
- type AdjacencyMapType
- type ExtractConfig
- type FuncGraph
- type FuncGraphType
- type FunctionContext
Constants ¶
View Source
const HomePage = "https://github.com/opensibyl/sibyl2"
View Source
const Version = "v0.16.0"
Version strictly sync with tag
Variables ¶
This section is empty.
Functions ¶
func Extract ¶
func Extract(targetFile string, config *ExtractConfig) ([]*extractor.FileResult, error)
func ExtractClazz ¶ added in v0.10.0
func ExtractClazz(targetFile string, config *ExtractConfig) ([]*extractor.ClazzFileResult, error)
func ExtractFromBytes ¶
func ExtractFromBytes(content []byte, config *ExtractConfig) (*extractor.FileResult, error)
func ExtractFromString ¶
func ExtractFromString(content string, config *ExtractConfig) (*extractor.FileResult, error)
func ExtractFunction ¶
func ExtractFunction(targetFile string, config *ExtractConfig) ([]*extractor.FunctionFileResult, error)
func ExtractSymbol ¶
func ExtractSymbol(targetFile string, config *ExtractConfig) ([]*extractor.SymbolFileResult, error)
func QueryUnitsByIndexNames ¶
func QueryUnitsByIndexNames[T extractor.DataType](result *extractor.BaseFileResult[T], indexNames ...string) []T
func QueryUnitsByIndexNamesInFiles ¶
func QueryUnitsByIndexNamesInFiles[T extractor.DataType](result []*extractor.BaseFileResult[T], indexNames ...string) []T
func QueryUnitsByLines ¶
func QueryUnitsByLines[T extractor.DataType](result *extractor.BaseFileResult[T], lines ...int) []T
Types ¶
type ExtractConfig ¶
type ExtractConfig struct { LangType core.LangType ExtractType extractor.ExtractType FileFilter func(path string) bool }
ExtractConfig todo: should not use config ptr for parallel running
func DefaultConfig ¶
func DefaultConfig() *ExtractConfig
type FuncGraph ¶
type FuncGraph struct { ReverseCallGraph *FuncGraphType CallGraph *FuncGraphType }
FuncGraph
It is not a serious `call` graph. It based on references not real calls.
Why we used it: - We can still use something like `method_invocation` - But we mainly use it to evaluate the influence of a method - In many languages, scope of `invocation` is too small - For example, use `function` as a parameter.
func AnalyzeFuncGraph ¶
func AnalyzeFuncGraph(funcFiles []*extractor.FunctionFileResult, symbolFiles []*extractor.SymbolFileResult) (*FuncGraph, error)
func (*FuncGraph) FindCalls ¶
func (fg *FuncGraph) FindCalls(f *extractor.FunctionWithPath) []*extractor.FunctionWithPath
func (*FuncGraph) FindRelated ¶
func (fg *FuncGraph) FindRelated(f *extractor.FunctionWithPath) *FunctionContext
func (*FuncGraph) FindReverseCalls ¶
func (fg *FuncGraph) FindReverseCalls(f *extractor.FunctionWithPath) []*extractor.FunctionWithPath
type FuncGraphType ¶
type FuncGraphType struct { graph.Graph[string, *extractor.FunctionWithPath] // contains filtered or unexported fields }
func WrapFuncGraph ¶
func WrapFuncGraph(g graph.Graph[string, *extractor.FunctionWithPath]) *FuncGraphType
func (*FuncGraphType) GetAdjacencyMap ¶
func (fgt *FuncGraphType) GetAdjacencyMap() (*AdjacencyMapType, error)
type FunctionContext ¶
type FunctionContext struct { *extractor.FunctionWithPath Calls []*extractor.FunctionWithPath `json:"calls" bson:"calls"` ReverseCalls []*extractor.FunctionWithPath `json:"reverseCalls" bson:"reverseCalls"` }
func (*FunctionContext) ToGraph ¶
func (f *FunctionContext) ToGraph() *FuncGraphType
func (*FunctionContext) ToJson ¶ added in v0.8.0
func (f *FunctionContext) ToJson() ([]byte, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.