DependencyNode.kt

1
package com.depanalyzer.core.graph
2
3
import com.depanalyzer.parser.Ecosystem
4
import com.depanalyzer.report.Vulnerability
5
6
data class DependencyNode(
7 1 1. getId : replaced return value with "" for com/depanalyzer/core/graph/DependencyNode::getId → KILLED
    val id: String,
8 1 1. getGroupId : replaced return value with "" for com/depanalyzer/core/graph/DependencyNode::getGroupId → KILLED
    val groupId: String,
9 1 1. getArtifactId : replaced return value with "" for com/depanalyzer/core/graph/DependencyNode::getArtifactId → KILLED
    val artifactId: String,
10 1 1. getVersion : replaced return value with "" for com/depanalyzer/core/graph/DependencyNode::getVersion → KILLED
    val version: String,
11 1 1. getParent : replaced return value with null for com/depanalyzer/core/graph/DependencyNode::getParent → KILLED
    val parent: DependencyNode? = null,
12 1 1. getChildren : replaced return value with Collections.emptyList for com/depanalyzer/core/graph/DependencyNode::getChildren → KILLED
    val children: MutableList<DependencyNode> = mutableListOf(),
13 1 1. getVulnerabilities : replaced return value with Collections.emptyList for com/depanalyzer/core/graph/DependencyNode::getVulnerabilities → KILLED
    val vulnerabilities: List<Vulnerability> = emptyList(),
14 1 1. getScope : replaced return value with "" for com/depanalyzer/core/graph/DependencyNode::getScope → SURVIVED
    val scope: String? = null,
15 2 1. isDependencyManagement : replaced boolean return with true for com/depanalyzer/core/graph/DependencyNode::isDependencyManagement → SURVIVED
2. isDependencyManagement : replaced boolean return with false for com/depanalyzer/core/graph/DependencyNode::isDependencyManagement → SURVIVED
    val isDependencyManagement: Boolean = false,
16
    val ecosystem: Ecosystem = Ecosystem.MAVEN
17
) {
18
19
    val coordinate: String
20 1 1. getCoordinate : replaced return value with "" for com/depanalyzer/core/graph/DependencyNode::getCoordinate → KILLED
        get() = "$groupId:$artifactId:$version"
21
22 2 1. isDirectDependency : replaced boolean return with true for com/depanalyzer/core/graph/DependencyNode::isDirectDependency → KILLED
2. isDirectDependency : negated conditional → KILLED
    fun isDirectDependency(): Boolean = parent == null
23
24 2 1. isVulnerable : replaced boolean return with true for com/depanalyzer/core/graph/DependencyNode::isVulnerable → KILLED
2. isVulnerable : negated conditional → KILLED
    fun isVulnerable(): Boolean = vulnerabilities.isNotEmpty()
25
26
    fun hasVulnerableTransitive(): Boolean = children.any { child ->
27 2 1. hasVulnerableTransitive : negated conditional → NO_COVERAGE
2. hasVulnerableTransitive : negated conditional → NO_COVERAGE
        child.isVulnerable() || child.hasVulnerableTransitive()
28 1 1. hasVulnerableTransitive : replaced boolean return with true for com/depanalyzer/core/graph/DependencyNode::hasVulnerableTransitive → NO_COVERAGE
    }
29
30
    fun addChild(child: DependencyNode) {
31 1 1. addChild : negated conditional → KILLED
        if (!children.contains(child)) {
32
            children.add(child)
33
        }
34
    }
35
36
    override fun toString(): String {
37 1 1. toString : negated conditional → NO_COVERAGE
        val parentStr = if (parent != null) " ← ${parent.groupId}:${parent.artifactId}" else ""
38 1 1. toString : replaced return value with "" for com/depanalyzer/core/graph/DependencyNode::toString → NO_COVERAGE
        return "$coordinate$parentStr"
39
    }
40
}

Mutations

7

1.1
Location : getId
Killed by : com.depanalyzer.core.graph.DependencyGraphTest.[engine:junit-jupiter]/[class:com.depanalyzer.core.graph.DependencyGraphTest]/[method:builds graph with direct and transitive dependencies()]
replaced return value with "" for com/depanalyzer/core/graph/DependencyNode::getId → KILLED

8

1.1
Location : getGroupId
Killed by : com.depanalyzer.report.DependencyTreeBuilderTest.[engine:junit-jupiter]/[class:com.depanalyzer.report.DependencyTreeBuilderTest]/[method:builds tree with only nodes that have problems()]
replaced return value with "" for com/depanalyzer/core/graph/DependencyNode::getGroupId → KILLED

9

1.1
Location : getArtifactId
Killed by : com.depanalyzer.report.DependencyTreeBuilderTest.[engine:junit-jupiter]/[class:com.depanalyzer.report.DependencyTreeBuilderTest]/[method:respects tree depth limit()]
replaced return value with "" for com/depanalyzer/core/graph/DependencyNode::getArtifactId → KILLED

10

1.1
Location : getVersion
Killed by : com.depanalyzer.report.DependencyTreeBuilderTest.[engine:junit-jupiter]/[class:com.depanalyzer.report.DependencyTreeBuilderTest]/[method:builds tree with only nodes that have problems()]
replaced return value with "" for com/depanalyzer/core/graph/DependencyNode::getVersion → KILLED

11

1.1
Location : getParent
Killed by : com.depanalyzer.core.graph.ChainResolverTest.[engine:junit-jupiter]/[class:com.depanalyzer.core.graph.ChainResolverTest]/[method:classifies direct vulnerabilities correctly()]
replaced return value with null for com/depanalyzer/core/graph/DependencyNode::getParent → KILLED

12

1.1
Location : getChildren
Killed by : com.depanalyzer.report.DependencyTreeBuilderTest.[engine:junit-jupiter]/[class:com.depanalyzer.report.DependencyTreeBuilderTest]/[method:respects tree depth limit()]
replaced return value with Collections.emptyList for com/depanalyzer/core/graph/DependencyNode::getChildren → KILLED

13

1.1
Location : getVulnerabilities
Killed by : com.depanalyzer.report.DependencyTreeBuilderTest.[engine:junit-jupiter]/[class:com.depanalyzer.report.DependencyTreeBuilderTest]/[method:respects tree depth limit()]
replaced return value with Collections.emptyList for com/depanalyzer/core/graph/DependencyNode::getVulnerabilities → KILLED

14

1.1
Location : getScope
Killed by : none
replaced return value with "" for com/depanalyzer/core/graph/DependencyNode::getScope → SURVIVED
Covering tests

15

1.1
Location : isDependencyManagement
Killed by : none
replaced boolean return with true for com/depanalyzer/core/graph/DependencyNode::isDependencyManagement → SURVIVED
Covering tests

2.2
Location : isDependencyManagement
Killed by : none
replaced boolean return with false for com/depanalyzer/core/graph/DependencyNode::isDependencyManagement → SURVIVED Covering tests

20

1.1
Location : getCoordinate
Killed by : com.depanalyzer.report.DependencyTreeBuilderTest.[engine:junit-jupiter]/[class:com.depanalyzer.report.DependencyTreeBuilderTest]/[method:respects tree depth limit()]
replaced return value with "" for com/depanalyzer/core/graph/DependencyNode::getCoordinate → KILLED

22

1.1
Location : isDirectDependency
Killed by : com.depanalyzer.core.graph.ChainResolverTest.[engine:junit-jupiter]/[class:com.depanalyzer.core.graph.ChainResolverTest]/[method:classifies direct vulnerabilities correctly()]
replaced boolean return with true for com/depanalyzer/core/graph/DependencyNode::isDirectDependency → KILLED

2.2
Location : isDirectDependency
Killed by : com.depanalyzer.core.graph.ChainResolverTest.[engine:junit-jupiter]/[class:com.depanalyzer.core.graph.ChainResolverTest]/[method:classifies direct vulnerabilities correctly()]
negated conditional → KILLED

24

1.1
Location : isVulnerable
Killed by : com.depanalyzer.core.graph.DependencyGraphTest.[engine:junit-jupiter]/[class:com.depanalyzer.core.graph.DependencyGraphTest]/[method:identifies all vulnerable nodes()]
replaced boolean return with true for com/depanalyzer/core/graph/DependencyNode::isVulnerable → KILLED

2.2
Location : isVulnerable
Killed by : com.depanalyzer.core.graph.DependencyGraphTest.[engine:junit-jupiter]/[class:com.depanalyzer.core.graph.DependencyGraphTest]/[method:identifies all vulnerable nodes()]
negated conditional → KILLED

27

1.1
Location : hasVulnerableTransitive
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : hasVulnerableTransitive
Killed by : none
negated conditional → NO_COVERAGE

28

1.1
Location : hasVulnerableTransitive
Killed by : none
replaced boolean return with true for com/depanalyzer/core/graph/DependencyNode::hasVulnerableTransitive → NO_COVERAGE

31

1.1
Location : addChild
Killed by : com.depanalyzer.report.DependencyTreeBuilderTest.[engine:junit-jupiter]/[class:com.depanalyzer.report.DependencyTreeBuilderTest]/[method:respects tree depth limit()]
negated conditional → KILLED

37

1.1
Location : toString
Killed by : none
negated conditional → NO_COVERAGE

38

1.1
Location : toString
Killed by : none
replaced return value with "" for com/depanalyzer/core/graph/DependencyNode::toString → NO_COVERAGE

42

1.1
Location : hasVulnerableTransitive
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : hasVulnerableTransitive
Killed by : none
negated conditional → NO_COVERAGE

43

1.1
Location : hasVulnerableTransitive
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : hasVulnerableTransitive
Killed by : none
negated conditional → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.22.1