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

Function main

example/php/main.go:29–51  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

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