|
1
|
|
package com.depanalyzer.core.graph |
|
2
|
|
|
|
3
|
|
import com.depanalyzer.report.Vulnerability |
|
4
|
|
import com.fasterxml.jackson.annotation.JsonInclude |
|
5
|
|
|
|
6
|
|
enum class VulnerabilityClassification { |
|
7
|
|
DIRECTLY_VULNERABLE, |
|
8
|
|
|
|
9
|
|
INDIRECTLY_VULNERABLE, |
|
10
|
|
|
|
11
|
|
TRANSITIVE_VULNERABLE |
|
12
|
|
} |
|
13
|
|
|
|
14
|
|
@JsonInclude(JsonInclude.Include.NON_NULL) |
|
15
|
|
data class VulnerabilityChain( |
|
16
|
1
1. getChain : replaced return value with Collections.emptyList for com/depanalyzer/core/graph/VulnerabilityChain::getChain → KILLED
|
val chain: List<DependencyNode>, |
|
17
|
1
1. getVulnerabilities : replaced return value with Collections.emptyList for com/depanalyzer/core/graph/VulnerabilityChain::getVulnerabilities → KILLED
|
val vulnerabilities: List<Vulnerability>, |
|
18
|
2
1. isShortestPath : replaced boolean return with true for com/depanalyzer/core/graph/VulnerabilityChain::isShortestPath → SURVIVED
2. isShortestPath : replaced boolean return with false for com/depanalyzer/core/graph/VulnerabilityChain::isShortestPath → KILLED
|
val isShortestPath: Boolean = false, |
|
19
|
|
val classification: VulnerabilityClassification = VulnerabilityClassification.TRANSITIVE_VULNERABLE |
|
20
|
|
) { |
|
21
|
|
|
|
22
|
|
init { |
|
23
|
2
1. <init> : negated conditional → KILLED
2. <init> : negated conditional → KILLED
|
require(chain.isNotEmpty()) { "Chain debe contener al menos un nodo" } |
|
24
|
2
1. <init> : negated conditional → KILLED
2. <init> : negated conditional → KILLED
|
require(vulnerabilities.isNotEmpty()) { "Chain debe contener al menos una vulnerabilidad" } |
|
25
|
|
} |
|
26
|
|
|
|
27
|
|
val directDependency: DependencyNode |
|
28
|
|
get() = chain.first() |
|
29
|
|
|
|
30
|
|
val vulnerableNode: DependencyNode |
|
31
|
|
get() = chain.last() |
|
32
|
|
|
|
33
|
|
val depth: Int |
|
34
|
2
1. getDepth : Replaced integer subtraction with addition → SURVIVED
2. getDepth : replaced int return with 0 for com/depanalyzer/core/graph/VulnerabilityChain::getDepth → KILLED
|
get() = chain.size - 1 |
|
35
|
|
|
|
36
|
|
val cveIds: List<String> |
|
37
|
1
1. getCveIds : replaced return value with Collections.emptyList for com/depanalyzer/core/graph/VulnerabilityChain::getCveIds → KILLED
|
get() = vulnerabilities.map { it.cveId } |
|
38
|
|
|
|
39
|
|
fun formatAsDetailedPath(): String { |
|
40
|
1
1. formatAsDetailedPath$lambda$0 : replaced return value with null for com/depanalyzer/core/graph/VulnerabilityChain::formatAsDetailedPath$lambda$0 → NO_COVERAGE
|
val pathStr = chain.joinToString(" → ") { it.coordinate } |
|
41
|
|
val cveStr = cveIds.joinToString(", ") |
|
42
|
1
1. formatAsDetailedPath : replaced return value with "" for com/depanalyzer/core/graph/VulnerabilityChain::formatAsDetailedPath → NO_COVERAGE
|
return "$pathStr [$cveStr]" |
|
43
|
|
} |
|
44
|
|
|
|
45
|
1
1. toString : replaced return value with "" for com/depanalyzer/core/graph/VulnerabilityChain::toString → NO_COVERAGE
|
override fun toString(): String = formatAsDetailedPath() |
|
46
|
|
} |
| | Mutations |
| 16 |
|
1.1 Location : getChain Killed by : com.depanalyzer.core.graph.ChainResolverTest.[engine:junit-jupiter]/[class:com.depanalyzer.core.graph.ChainResolverTest]/[method:resolves 4-level chain correctly()] replaced return value with Collections.emptyList for com/depanalyzer/core/graph/VulnerabilityChain::getChain → KILLED
|
| 17 |
|
1.1 Location : getVulnerabilities Killed by : com.depanalyzer.core.graph.ChainResolverTest.[engine:junit-jupiter]/[class:com.depanalyzer.core.graph.ChainResolverTest]/[method:chains include all necessary information for reporting()] replaced return value with Collections.emptyList for com/depanalyzer/core/graph/VulnerabilityChain::getVulnerabilities → KILLED
|
| 18 |
|
1.1 Location : isShortestPath Killed by : com.depanalyzer.core.graph.ChainResolverTest.[engine:junit-jupiter]/[class:com.depanalyzer.core.graph.ChainResolverTest]/[method:marks shortest paths correctly()] replaced boolean return with false for com/depanalyzer/core/graph/VulnerabilityChain::isShortestPath → KILLED
2.2 Location : isShortestPath Killed by : none replaced boolean return with true for com/depanalyzer/core/graph/VulnerabilityChain::isShortestPath → SURVIVED
Covering tests
Covered by tests:
- com.depanalyzer.core.graph.ChainResolverTest.[engine:junit-jupiter]/[class:com.depanalyzer.core.graph.ChainResolverTest]/[method:marks shortest paths correctly()]
|
| 23 |
|
1.1 Location : <init> Killed by : com.depanalyzer.core.graph.ChainResolverTest.[engine:junit-jupiter]/[class:com.depanalyzer.core.graph.ChainResolverTest]/[method:handles circular references without infinite loops()] negated conditional → KILLED
2.2 Location : <init> Killed by : com.depanalyzer.core.graph.ChainResolverTest.[engine:junit-jupiter]/[class:com.depanalyzer.core.graph.ChainResolverTest]/[method:handles circular references without infinite loops()] negated conditional → KILLED
|
| 24 |
|
1.1 Location : <init> Killed by : com.depanalyzer.core.graph.ChainResolverTest.[engine:junit-jupiter]/[class:com.depanalyzer.core.graph.ChainResolverTest]/[method:handles circular references without infinite loops()] negated conditional → KILLED
2.2 Location : <init> Killed by : com.depanalyzer.core.graph.ChainResolverTest.[engine:junit-jupiter]/[class:com.depanalyzer.core.graph.ChainResolverTest]/[method:handles circular references without infinite loops()] negated conditional → KILLED
|
| 34 |
|
1.1 Location : getDepth Killed by : none Replaced integer subtraction with addition → SURVIVED
Covering tests
Covered by tests:
- com.depanalyzer.core.graph.ChainResolverTest.[engine:junit-jupiter]/[class:com.depanalyzer.core.graph.ChainResolverTest]/[method:handles circular references without infinite loops()]
- com.depanalyzer.core.graph.ChainResolverTest.[engine:junit-jupiter]/[class:com.depanalyzer.core.graph.ChainResolverTest]/[method:classifies direct vulnerabilities correctly()]
- com.depanalyzer.core.graph.ChainResolverTest.[engine:junit-jupiter]/[class:com.depanalyzer.core.graph.ChainResolverTest]/[method:deduplicates semantically identical chains()]
- com.depanalyzer.core.graph.ChainResolverTest.[engine:junit-jupiter]/[class:com.depanalyzer.core.graph.ChainResolverTest]/[method:resolves 4-level chain correctly()]
- com.depanalyzer.core.graph.ChainResolverTest.[engine:junit-jupiter]/[class:com.depanalyzer.core.graph.ChainResolverTest]/[method:handles diamond dependency with multiple paths()]
- com.depanalyzer.core.graph.ChainResolverTest.[engine:junit-jupiter]/[class:com.depanalyzer.core.graph.ChainResolverTest]/[method:chains include all necessary information for reporting()]
- com.depanalyzer.core.graph.ChainResolverTest.[engine:junit-jupiter]/[class:com.depanalyzer.core.graph.ChainResolverTest]/[method:marks shortest paths correctly()]
- com.depanalyzer.core.graph.ChainResolverTest.[engine:junit-jupiter]/[class:com.depanalyzer.core.graph.ChainResolverTest]/[method:resolves 3-level chain correctly()]
- com.depanalyzer.core.graph.ChainResolverTest.[engine:junit-jupiter]/[class:com.depanalyzer.core.graph.ChainResolverTest]/[method:resolves multiple paths to same vulnerable library()]
- com.depanalyzer.core.graph.ChainResolverTest.[engine:junit-jupiter]/[class:com.depanalyzer.core.graph.ChainResolverTest]/[method:resolves 2-level chain correctly()]
- com.depanalyzer.core.graph.ChainResolverTest.[engine:junit-jupiter]/[class:com.depanalyzer.core.graph.ChainResolverTest]/[method:handles multiple CVEs in single node()]
2.2 Location : getDepth Killed by : com.depanalyzer.core.graph.ChainResolverTest.[engine:junit-jupiter]/[class:com.depanalyzer.core.graph.ChainResolverTest]/[method:chains include all necessary information for reporting()] replaced int return with 0 for com/depanalyzer/core/graph/VulnerabilityChain::getDepth → KILLED
|
| 37 |
|
1.1 Location : getCveIds Killed by : com.depanalyzer.core.graph.ChainResolverTest.[engine:junit-jupiter]/[class:com.depanalyzer.core.graph.ChainResolverTest]/[method:handles multiple CVEs in single node()] replaced return value with Collections.emptyList for com/depanalyzer/core/graph/VulnerabilityChain::getCveIds → KILLED
|
| 40 |
|
1.1 Location : formatAsDetailedPath$lambda$0 Killed by : none replaced return value with null for com/depanalyzer/core/graph/VulnerabilityChain::formatAsDetailedPath$lambda$0 → NO_COVERAGE
|
| 42 |
|
1.1 Location : formatAsDetailedPath Killed by : none replaced return value with "" for com/depanalyzer/core/graph/VulnerabilityChain::formatAsDetailedPath → NO_COVERAGE
|
| 45 |
|
1.1 Location : toString Killed by : none replaced return value with "" for com/depanalyzer/core/graph/VulnerabilityChain::toString → NO_COVERAGE
|