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

Function dsdxDoc

cmd/format/dsdx.go:30–59  ·  view source on GitHub ↗
(report Report)

Source from the content-addressed store, hash-verified

28}
29
30func dsdxDoc(report Report) *model.DsdxDocument {
31
32 doc := model.NewDsdxDocument(report.TaskInfo.AppName, "opensca-cli")
33
34 report.DepDetailGraph.ForEach(func(n *detail.DepDetailGraph) bool {
35
36 if n.Name == "" {
37 return true
38 }
39
40 lics := []string{}
41 for _, lic := range n.Licenses {
42 lics = append(lics, lic.ShortName)
43 }
44 doc.AppendComponents(n.ID, n.Vendor, n.Name, n.Version, n.Language, lics)
45
46 childrenIds := []string{}
47 for _, c := range n.Children {
48 if c.Name == "" {
49 continue
50 }
51 childrenIds = append(childrenIds, c.ID)
52 }
53 doc.AppendDependencies(n.ID, childrenIds)
54
55 return true
56 })
57
58 return doc
59}

Callers 3

DsdxFunction · 0.85
DsdxJsonFunction · 0.85
DsdxXmlFunction · 0.85

Calls 4

AppendComponentsMethod · 0.95
AppendDependenciesMethod · 0.95
NewDsdxDocumentFunction · 0.92
ForEachMethod · 0.45

Tested by

no test coverage detected