
edu.hm.hafner.analysis.parser.pmd.Pmd Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of analysis-model Show documentation
Show all versions of analysis-model Show documentation
This library provides a Java object model to read, aggregate, filter, and query static analysis reports.
It is used by Jenkins' warnings next generation plug-in to visualize the warnings of individual builds.
Additionally, this library is used by a GitHub action to autograde student software projects based on a given set of
metrics (unit tests, code and mutation coverage, static analysis warnings).
package edu.hm.hafner.analysis.parser.pmd;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
/**
* Java Bean class for warnings of the PMD format.
*
* @author Ullrich Hafner
*/
public class Pmd {
private final List files = new ArrayList<>();
private final List errors = new ArrayList<>();
/**
* Adds a new file.
*
* @param file
* the file to add
*/
public void addFile(final File file) {
files.add(file);
}
/**
* Adds a new error.
*
* @param error
* the error to add
*/
public void addError(final PmdError error) {
errors.add(error);
}
/**
* Returns all files. The returned collection is read-only.
*
* @return all files
*/
public Collection getFiles() {
return Collections.unmodifiableCollection(files);
}
/**
* Returns all errors. The returned collection is read-only.
*
* @return all errors
*/
public Collection getErrors() {
return Collections.unmodifiableCollection(errors);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy