Class CPDReport

java.lang.Object
net.sourceforge.pmd.cpd.CPDReport

public class CPDReport extends Object
The result of a CPD analysis. This is rendered by a CPDReportRenderer.
Since:
6.48.0
  • Method Details

    • getMatches

      public List<Match> getMatches()
      Return the list of duplication matches found by the CPD analysis.
    • getNumberOfTokensPerFile

      public Map<FileId,Integer> getNumberOfTokensPerFile()
      Return a map containing the number of tokens by processed file.
    • getProcessingErrors

      public List<Report.ProcessingError> getProcessingErrors()
      Returns the list of occurred processing errors.
    • getSourceCodeSlice

      public Chars getSourceCodeSlice(Mark mark)
      Return the slice of source code where the mark was found. This returns the entire lines from the start to the end line of the mark.
    • filterMatches

      public CPDReport filterMatches(Predicate<Match> filter)
      Creates a new CPD report taking all the information from this report, but filtering the matches. Note that the token count map is not filtered.
      Parameters:
      filter - when true, the match will be kept.
      Returns:
      copy of this report
    • getDisplayName

      public String getDisplayName(FileId fileId)
      Return the display name of the given file.
    • getLanguageVersion

      public LanguageVersion getLanguageVersion(FileId fileId)
      Return the LanguageVersion of the fileId
      Since:
      7.25.0