MCPcopy Create free account
hub / github.com/XmirrorSecurity/OpenSCA-cli / AppendChild

Method AppendChild

opensca/model/dep.go:40–58  ·  view source on GitHub ↗

AppendChild 添加子依赖

(child *DepGraph)

Source from the content-addressed store, hash-verified

38
39// AppendChild 添加子依赖
40func (dep *DepGraph) AppendChild(child *DepGraph) {
41 if dep == nil || child == nil {
42 return
43 }
44 if dep.cset == nil {
45 dep.cset = map[*DepGraph]bool{}
46 }
47 if child.pset == nil {
48 child.pset = map[*DepGraph]bool{}
49 }
50 if !dep.cset[child] {
51 dep.Children = append(dep.Children, child)
52 dep.cset[child] = true
53 }
54 if !child.pset[dep] {
55 child.Parents = append(child.Parents, dep)
56 child.pset[dep] = true
57 }
58}
59
60// RemoveChild 移除子依赖
61func (dep *DepGraph) RemoveChild(child *DepGraph) {

Callers 15

taskReportFunction · 0.95
mainFunction · 0.95
Dep3Function · 0.95
RunTaskCaseFunction · 0.95
pipenvGraphFunction · 0.95
ParseSetupFunction · 0.95
ParsePipfileFunction · 0.95
ParsePipfileLockFunction · 0.95
ParseRequirementTxtFunction · 0.95
ParseRequirementInFunction · 0.95
ParseGopkgTomlFunction · 0.95
ParseGopkgLockFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected