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

Method RemoveDedup

cmd/detail/detail.go:100–118  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

98}
99
100func (d *DepDetailGraph) RemoveDedup() {
101 // map[key]
102 depSet := map[string]*DepDetailGraph{}
103 d.ForEach(func(n *DepDetailGraph) bool {
104 if dep, ok := depSet[n.Key()]; ok {
105 dep.Paths = append(dep.Paths, n.Paths...)
106 } else {
107 depSet[n.Key()] = n
108 }
109 return true
110 })
111 d.Children = nil
112 for _, c := range depSet {
113 if c != d {
114 c.Children = nil
115 d.Children = append(d.Children, c)
116 }
117 }
118}
119
120func (d *DepDetailGraph) RemoveDev() {
121 d.ForEach(func(n *DepDetailGraph) bool {

Callers 1

taskReportFunction · 0.80

Calls 2

ForEachMethod · 0.95
KeyMethod · 0.80

Tested by

no test coverage detected