Class FileChangesProcessor
java.lang.Object
io.jenkins.plugins.coverage.metrics.steps.FileChangesProcessor
Calculates and attaches values to the
nodes of the coverage tree which represent the changes
concerning code and coverage.- Author:
- Florian Orendi
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidattachChangedCodeLines(edu.hm.hafner.coverage.Node coverageNode, Map<String, io.jenkins.plugins.forensics.delta.FileChanges> codeChanges) Attaches the changed code lines to the file nodes of the coverage tree.voidattachFileCoverageDeltas(edu.hm.hafner.coverage.Node root, edu.hm.hafner.coverage.Node referenceNode, Map<String, String> oldPathMapping) Attaches the delta between the total file coverage of all currently built files against the passed reference.voidattachIndirectCoveragesChanges(edu.hm.hafner.coverage.Node root, edu.hm.hafner.coverage.Node referenceNode, Map<String, io.jenkins.plugins.forensics.delta.FileChanges> codeChanges, Map<String, String> oldPathMapping) Attaches all found indirect coverage changes within the coverage tree, compared to a reference tree.
-
Constructor Details
-
FileChangesProcessor
public FileChangesProcessor()
-
-
Method Details
-
attachChangedCodeLines
public void attachChangedCodeLines(edu.hm.hafner.coverage.Node coverageNode, Map<String, io.jenkins.plugins.forensics.delta.FileChanges> codeChanges) Attaches the changed code lines to the file nodes of the coverage tree.- Parameters:
coverageNode- The root node of the coverage treecodeChanges- The code changes to be attached
-
attachFileCoverageDeltas
public void attachFileCoverageDeltas(edu.hm.hafner.coverage.Node root, edu.hm.hafner.coverage.Node referenceNode, Map<String, String> oldPathMapping) Attaches the delta between the total file coverage of all currently built files against the passed reference. The algorithm also covers renamed files.- Parameters:
root- The root of the coverage treereferenceNode- The root of the reference coverage treeoldPathMapping- A mapping between the report paths of the current and the reference coverage tree
-
attachIndirectCoveragesChanges
public void attachIndirectCoveragesChanges(edu.hm.hafner.coverage.Node root, edu.hm.hafner.coverage.Node referenceNode, Map<String, io.jenkins.plugins.forensics.delta.FileChanges> codeChanges, Map<String, String> oldPathMapping) Attaches all found indirect coverage changes within the coverage tree, compared to a reference tree.- Parameters:
root- The root of the tree in which indirect coverage changes are searchedreferenceNode- The root of the reference treecodeChanges- The code changes that has been applied between the two commits underlying the node and its referenceoldPathMapping- A mapping between the report paths of the current and the reference coverage tree
-