graph

package
v0.0.0-...-2337e5f Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2025 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnableVerboseLogging

func EnableVerboseLogging()

func FilterEntities

func FilterEntities(node []*Node, query parser.Query) bool

func Fmt

func Fmt(format string, args ...interface{})

func FormatType

func FormatType(v interface{}) string

func GenerateMethodID

func GenerateMethodID(methodName string, parameters []string, sourceFile string) string

func GenerateSha256

func GenerateSha256(input string) string

func IsGitHubActions

func IsGitHubActions() bool

func Log

func Log(message string, args ...interface{})

func QueryEntities

func QueryEntities(graph *CodeGraph, query parser.Query) (nodes [][]*Node, output [][]interface{})

func ReplacePredicateVariables

func ReplacePredicateVariables(query parser.Query) string

Types

type CodeGraph

type CodeGraph struct {
	Nodes map[string]*Node
	Edges []*Edge
}

func Initialize

func Initialize(directory string) *CodeGraph

func NewCodeGraph

func NewCodeGraph() *CodeGraph

func (*CodeGraph) AddEdge

func (g *CodeGraph) AddEdge(from, to *Node)

func (*CodeGraph) AddNode

func (g *CodeGraph) AddNode(node *Node)

func (*CodeGraph) FindNodesByType

func (g *CodeGraph) FindNodesByType(nodeType string) []*Node

FindNodesByType finds all nodes of a given type.

type Edge

type Edge struct {
	From *Node
	To   *Node
}

type Env

type Env struct {
	Node *Node
}

func (*Env) GetAnnotations

func (env *Env) GetAnnotations() []string

func (*Env) GetArgumentNames

func (env *Env) GetArgumentNames() []string

func (*Env) GetArgumentTypes

func (env *Env) GetArgumentTypes() []string

func (*Env) GetAssertStmt

func (env *Env) GetAssertStmt() *model.AssertStmt

func (*Env) GetBinaryExpr

func (env *Env) GetBinaryExpr() *model.BinaryExpr

func (*Env) GetBlockStmt

func (env *Env) GetBlockStmt() *model.BlockStmt

func (*Env) GetBreakStmt

func (env *Env) GetBreakStmt() *model.BreakStmt

func (*Env) GetClassInstanceExpr

func (env *Env) GetClassInstanceExpr() *model.ClassInstanceExpr

func (*Env) GetClassInstanceExprName

func (env *Env) GetClassInstanceExprName() string

func (*Env) GetContinueStmt

func (env *Env) GetContinueStmt() *model.ContinueStmt

func (*Env) GetDoStmt

func (env *Env) GetDoStmt() *model.DoStmt

func (*Env) GetDoc

func (env *Env) GetDoc() *model.Javadoc

func (*Env) GetForStmt

func (env *Env) GetForStmt() *model.ForStmt

func (*Env) GetIfStmt

func (env *Env) GetIfStmt() *model.IfStmt

func (*Env) GetInterfaces

func (env *Env) GetInterfaces() []string

func (*Env) GetLeftOperand

func (env *Env) GetLeftOperand() string

func (*Env) GetName

func (env *Env) GetName() string

func (*Env) GetReturnStmt

func (env *Env) GetReturnStmt() *model.ReturnStmt

func (*Env) GetReturnType

func (env *Env) GetReturnType() string

func (*Env) GetRightOperand

func (env *Env) GetRightOperand() string

func (*Env) GetScope

func (env *Env) GetScope() string

func (*Env) GetSuperClass

func (env *Env) GetSuperClass() string

func (*Env) GetThrowsTypes

func (env *Env) GetThrowsTypes() []string

func (*Env) GetVariableDataType

func (env *Env) GetVariableDataType() string

func (*Env) GetVariableValue

func (env *Env) GetVariableValue() string

func (*Env) GetVisibility

func (env *Env) GetVisibility() string

func (*Env) GetWhileStmt

func (env *Env) GetWhileStmt() *model.WhileStmt

func (*Env) GetYieldStmt

func (env *Env) GetYieldStmt() *model.YieldStmt

func (*Env) HasAccess

func (env *Env) HasAccess() bool

func (*Env) IsJavaSourceFile

func (env *Env) IsJavaSourceFile() bool

func (*Env) ToString

func (env *Env) ToString() string

type Node

type Node struct {
	ID                   string
	Type                 string
	Name                 string
	CodeSnippet          string
	LineNumber           uint32
	OutgoingEdges        []*Edge
	IsExternal           bool
	Modifier             string
	ReturnType           string
	MethodArgumentsType  []string
	MethodArgumentsValue []string
	PackageName          string
	ImportPackage        []string
	SuperClass           string
	Interface            []string
	DataType             string
	Scope                string
	VariableValue        string

	File string

	ThrowsExceptions  []string
	Annotation        []string
	JavaDoc           *model.Javadoc
	BinaryExpr        *model.BinaryExpr
	ClassInstanceExpr *model.ClassInstanceExpr
	IfStmt            *model.IfStmt
	WhileStmt         *model.WhileStmt
	DoStmt            *model.DoStmt
	ForStmt           *model.ForStmt
	BreakStmt         *model.BreakStmt
	ContinueStmt      *model.ContinueStmt
	YieldStmt         *model.YieldStmt
	AssertStmt        *model.AssertStmt
	ReturnStmt        *model.ReturnStmt
	BlockStmt         *model.BlockStmt
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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