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

Method ImportPathStack

opensca/sca/java/pom.go:309–327  ·  view source on GitHub ↗

ImportPathStack 引入路径栈

()

Source from the content-addressed store, hash-verified

307
308// ImportPathStack 引入路径栈
309func (dep PomDependency) ImportPathStack() string {
310 var importPaths []string
311 paths := dep.ImportPath()
312 for i, d := range paths {
313 importPath := fmt.Sprintf("[%s]", d.Index4())
314 if i > 0 {
315 pre := paths[i-1]
316 importPath += fmt.Sprintf("(line:%d-%d)", pre.Start, pre.End)
317 }
318 if d.RefProperty != nil {
319 if d.RefProperty.Define != nil {
320 importPath += fmt.Sprintf("#[%s](line:%d)", d.RefProperty.Define.Index4(), d.RefProperty.Start)
321 }
322 importPath += fmt.Sprintf("${%s}=%s", d.RefProperty.Key, d.RefProperty.Value)
323 }
324 importPaths = append(importPaths, importPath)
325 }
326 return strings.Join(importPaths, "<=")
327}

Callers 2

mainFunction · 0.80
parsePomFunction · 0.80

Calls 2

ImportPathMethod · 0.95
Index4Method · 0.80

Tested by

no test coverage detected