Class FileChangesProcessor

java.lang.Object
io.jenkins.plugins.coverage.metrics.steps.FileChangesProcessor

public class FileChangesProcessor extends Object
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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    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.
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 tree
      codeChanges - 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 tree
      referenceNode - The root of the reference coverage tree
      oldPathMapping - 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 searched
      referenceNode - The root of the reference tree
      codeChanges - The code changes that has been applied between the two commits underlying the node and its reference
      oldPathMapping - A mapping between the report paths of the current and the reference coverage tree