Package net.sourceforge.pmd.reporting
Class Report
java.lang.Object
net.sourceforge.pmd.reporting.Report
A
Report collects all information during a PMD execution. This includes violations,
suppressed violations, metrics, recoverable errors (that occurred during processing)
and configuration errors.
A report may be created by a Report.GlobalReportBuilderListener that you
use as the GlobalAnalysisListener in PMD's entry point.
You can also create one manually with buildReport(Consumer).
For special use cases, like filtering the report after PMD analysis and before rendering the report, some transformation operations are provided:
These methods create a newReport rather than modifying their receiver.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents a configuration error for a specific rule.static final classAGlobalAnalysisListenerthat accumulates the events of all files into aReport.static classRepresents a recovered error that occurred during analysis.static final classAFileAnalysisListenerthat accumulates events into aReport.static classRepresents a violation, that has been suppressed. -
Method Summary
Modifier and TypeMethodDescriptionstatic ReportbuildReport(Consumer<? super FileAnalysisListener> lambda) Create a report by making side effects on aFileAnalysisListener.filterViolations(Predicate<RuleViolation> filter) Creates a new report taking all the information from this report, but filtering the violations.Returns an unmodifiable list of configuration errors that have been recorded until now.Returns an unmodifiable list of processing errors that have been recorded until now.Returns an unmodifiable list of violations that were suppressed.Returns an unmodifiable list of violations that have been recorded until now.Creates a new report by combining this report with another report.
-
Method Details
-
getSuppressedViolations
Returns an unmodifiable list of violations that were suppressed. -
getViolations
Returns an unmodifiable list of violations that have been recorded until now. None of those violations were suppressed.The violations list is sorted with
RuleViolation.DEFAULT_COMPARATOR. -
getProcessingErrors
Returns an unmodifiable list of processing errors that have been recorded until now. -
getConfigurationErrors
Returns an unmodifiable list of configuration errors that have been recorded until now. -
buildReport
Create a report by making side effects on aFileAnalysisListener. This wraps aReport.ReportBuilderListener. -
filterViolations
Creates a new report taking all the information from this report, but filtering the violations.- Parameters:
filter- when true, the violation will be kept.- Returns:
- copy of this report
-
union
Creates a new report by combining this report with another report. The lowest start time and greatest end time are kept in the copy.- Parameters:
other- the other report to combine- Returns:
- a new report which is the combination of this and the other report.
-