-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathUnusedMavenDependencies.qll
More file actions
28 lines (25 loc) · 1007 Bytes
/
UnusedMavenDependencies.qll
File metadata and controls
28 lines (25 loc) · 1007 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/** Provides classes and predicates for working with Maven dependencies. */
import java
import semmle.code.xml.MavenPom
/**
* Holds if the source code in the project represented by the given pom depends on any code
* within the given container (folder, jar file etc.).
*/
predicate pomDependsOnContainer(Pom f, Container g) {
exists(RefType source, RefType target |
source.getFile().getParentContainer*() = f.getFile().getParentContainer() and
target.getFile().getParentContainer*() = g and
depends(source, target)
)
}
/**
* Holds if the source code in the project represented by the sourcePom depends on any code
* within the project represented by the targetPom.
*/
predicate pomDependsOnPom(Pom sourcePom, Pom targetPom) {
exists(RefType source, RefType target |
source.getFile().getParentContainer*() = sourcePom.getFile().getParentContainer() and
target.getFile().getParentContainer*() = targetPom.getFile().getParentContainer() and
depends(source, target)
)
}