models

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2026 License: AGPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMethodID

func GetMethodID(className, methodName, signature string) string

Types

type CallEdge

type CallEdge struct {
	From string   `json:"from"`
	To   string   `json:"to"`
	Type CallType `json:"type"` // Type of call (static, virtual, interface, dynamic, reflective)
}

type CallGraph

type CallGraph struct {
	Nodes map[string]*MethodNode `json:"nodes"`
	Edges []*CallEdge            `json:"edges"`
}

func NewCallGraph

func NewCallGraph() *CallGraph

func (*CallGraph) AddEdge

func (cg *CallGraph) AddEdge(from, to string, callType CallType)

func (*CallGraph) AddNode

func (cg *CallGraph) AddNode(id string, node *MethodNode)

type CallType added in v0.2.0

type CallType string

CallType represents the type of method invocation

const (
	CallTypeStatic     CallType = "static"     // invokestatic
	CallTypeVirtual    CallType = "virtual"    // invokevirtual
	CallTypeInterface  CallType = "interface"  // invokeinterface
	CallTypeSpecial    CallType = "special"    // invokespecial (constructors, super)
	CallTypeDynamic    CallType = "dynamic"    // invokedynamic (lambdas)
	CallTypeReflective CallType = "reflective" // Reflection-based call
	CallTypeUnknown    CallType = "unknown"    // Unable to determine
)

type Dependency

type Dependency struct {
	GroupID    string `json:"group_id"`
	ArtifactID string `json:"artifact_id"`
	Version    string `json:"version"`
	Scope      string `json:"scope"`
	JARPath    string `json:"jar_path"`
}

type DependencyTree

type DependencyTree struct {
	Root         *Dependency   `json:"root"`
	Dependencies []*Dependency `json:"dependencies"`
}

type MethodNode

type MethodNode struct {
	ClassName  string `json:"class_name"`
	MethodName string `json:"method_name"`
	Signature  string `json:"signature"`
	IsExternal bool   `json:"is_external"`
	Package    string `json:"package"`

	// Edge case metadata for improved analysis
	IsReflective   bool     `json:"is_reflective,omitempty"`   // Method uses reflection (Class.forName, Method.invoke)
	IsLambda       bool     `json:"is_lambda,omitempty"`       // Lambda synthetic method
	IsDynamic      bool     `json:"is_dynamic,omitempty"`      // Uses invokedynamic
	Interfaces     []string `json:"interfaces,omitempty"`      // Implemented interfaces
	VirtualTargets []string `json:"virtual_targets,omitempty"` // Possible virtual dispatch targets
}

type ReachabilityStatus

type ReachabilityStatus string
const (
	StatusReachable   ReachabilityStatus = "REACHABLE"
	StatusUnreachable ReachabilityStatus = "UNREACHABLE"
	StatusUnknown     ReachabilityStatus = "UNKNOWN"
)

type TriageResult

type TriageResult struct {
	Vulnerability  *Vulnerability     `json:"vulnerability"`
	Status         ReachabilityStatus `json:"status"`
	Reason         string             `json:"reason"`
	Recommendation string             `json:"recommendation"`
}

type Vulnerability

type Vulnerability struct {
	ID              string   `json:"id"`
	Severity        string   `json:"severity"`
	AffectedPackage string   `json:"affected_package"`
	AffectedMethods []string `json:"affected_methods,omitempty"`
	FixedVersion    string   `json:"fixed_version,omitempty"`
	Description     string   `json:"description"`
	CVSS            float64  `json:"cvss,omitempty"`
}

Jump to

Keyboard shortcuts

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