edu.hm.hafner.analysis.parser.dry.simian.Set 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.dry.simian;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
/**
* Java Bean class for a Simian duplication set.
*
* @author Ullrich Hafner
*/
@SuppressWarnings("PMD.DataClass")
public class Set {
private int lineCount;
private final List blocks = new ArrayList<>();
/**
* Adds a new block to this duplication set.
*
* @param block
* the new block
*/
public void addBlock(final Block block) {
blocks.add(block);
}
/**
* Returns all blocks of this duplication set. The returned collection is
* read-only.
*
* @return all files
*/
public Collection getBlocks() {
return Collections.unmodifiableCollection(blocks);
}
/**
* Returns the number of duplicated lines.
*
* @return the lineCount
*/
public int getLineCount() {
return lineCount;
}
/**
* Sets the number of duplicated lines to the specified value.
*
* @param value the value to set
*/
public void setLineCount(final int value) {
lineCount = value;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy