(report Report)
| 28 | } |
| 29 | |
| 30 | func 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 | } |
no test coverage detected