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

Function main

example/javascript/main.go:28–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

26}
27
28func main() {
29
30 projectDir := "../../test/javascript/5"
31
32 sca := javascript.Sca{}
33
34 var files []*model.File
35 filepath.WalkDir(projectDir, func(path string, d fs.DirEntry, err error) error {
36 if !sca.Filter(path) {
37 return nil
38 }
39 file := model.NewFile(path, strings.TrimPrefix(path, projectDir))
40 files = append(files, file)
41 return nil
42 })
43
44 sca.Sca(context.TODO(), nil, files, func(file *model.File, root ...*model.DepGraph) {
45 for _, dep := range root {
46 dep.Build(false, sca.Language())
47 logs.Infof("file %s:\n%s", file.Relpath(), dep.Tree(false, false))
48 }
49 })
50}

Callers

nothing calls this directly

Calls 8

FilterMethod · 0.95
ScaMethod · 0.95
LanguageMethod · 0.95
RelpathMethod · 0.95
NewFileFunction · 0.92
InfofFunction · 0.92
BuildMethod · 0.80
TreeMethod · 0.80

Tested by

no test coverage detected