Klasse CodeDeltaCalculator

java.lang.Object
io.jenkins.plugins.coverage.model.CodeDeltaCalculator

public class CodeDeltaCalculator extends Object
Calculates the code delta between a Jenkins build and a reference build.
Autor:
Florian Orendi
  • Konstruktorübersicht

    Konstruktoren
    Konstruktor
    Beschreibung
    CodeDeltaCalculator(Run<?,?> build, FilePath workspace, TaskListener listener, String scm)
    Creates a code delta calculator for a specific build.
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    Optional<io.jenkins.plugins.forensics.delta.Delta>
    calculateCodeDeltaToReference(Run<?,?> referenceBuild, edu.hm.hafner.util.FilteredLog log)
    Calculates the code delta between the build and the passed reference build.
    createOldPathMapping(CoverageNode root, CoverageNode referenceRoot, Map<String,io.jenkins.plugins.forensics.delta.FileChanges> changes, edu.hm.hafner.util.FilteredLog log)
    Creates a mapping between the currently used coverage report paths and the corresponding paths that has been used for the same coverage nodes before the modifications.
    Set<io.jenkins.plugins.forensics.delta.FileChanges>
    getCoverageRelevantChanges(io.jenkins.plugins.forensics.delta.Delta delta)
    Gets all code changes which are relevant for the coverage (added, renamed and modified files).
    Map<String,io.jenkins.plugins.forensics.delta.FileChanges>
    mapScmChangesToReportPaths(Set<io.jenkins.plugins.forensics.delta.FileChanges> changes, CoverageNode root, edu.hm.hafner.util.FilteredLog log)
    Maps the passed code changes to the corresponding fully qualified names as they are used by the coverage reporting tools - usually the fully qualified name of the file.

    Von Klasse geerbte Methoden java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Konstruktordetails

    • CodeDeltaCalculator

      public CodeDeltaCalculator(Run<?,?> build, FilePath workspace, TaskListener listener, String scm)
      Creates a code delta calculator for a specific build.
      Parameter:
      build - The build
      workspace - The workspace
      listener - The listener
      scm - The selected SCM
  • Methodendetails

    • calculateCodeDeltaToReference

      public Optional<io.jenkins.plugins.forensics.delta.Delta> calculateCodeDeltaToReference(Run<?,?> referenceBuild, edu.hm.hafner.util.FilteredLog log)
      Calculates the code delta between the build and the passed reference build.
      Parameter:
      referenceBuild - The reference build
      log - The log
      Gibt zurück:
      the code delta as Optional if existent, else an empty Optional
    • getCoverageRelevantChanges

      public Set<io.jenkins.plugins.forensics.delta.FileChanges> getCoverageRelevantChanges(io.jenkins.plugins.forensics.delta.Delta delta)
      Gets all code changes which are relevant for the coverage (added, renamed and modified files).
      Parameter:
      delta - The calculated code Delta
      Gibt zurück:
      the relevant code changes
    • mapScmChangesToReportPaths

      public Map<String,io.jenkins.plugins.forensics.delta.FileChanges> mapScmChangesToReportPaths(Set<io.jenkins.plugins.forensics.delta.FileChanges> changes, CoverageNode root, edu.hm.hafner.util.FilteredLog log) throws CodeDeltaException
      Maps the passed code changes to the corresponding fully qualified names as they are used by the coverage reporting tools - usually the fully qualified name of the file.
      Parameter:
      changes - The code changes
      root - The root of the coverage tree
      log - The log
      Gibt zurück:
      the create code changes mapping
      Löst aus:
      CodeDeltaException - when creating the mapping failed due to ambiguous paths
    • createOldPathMapping

      public Map<String,String> createOldPathMapping(CoverageNode root, CoverageNode referenceRoot, Map<String,io.jenkins.plugins.forensics.delta.FileChanges> changes, edu.hm.hafner.util.FilteredLog log) throws CodeDeltaException
      Creates a mapping between the currently used coverage report paths and the corresponding paths that has been used for the same coverage nodes before the modifications. This affects only renamed and untouched / modified files without a renaming, since added files did not exist before and deleted files do not exist anymore.
      Parameter:
      root - The root of the coverage tree
      referenceRoot - The root of the coverage tree from the reference build
      changes - The changes, mapped by the currently used coverage report path to which they correspond to
      log - The log
      Gibt zurück:
      the created mapping whose keys are the currently used paths and whose values are the paths before the modifications
      Löst aus:
      CodeDeltaException - if the SCM path mapping is ambiguous