All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edu.hm.hafner.analysis.parser.dry.simian.Set Maven / Gradle / Ivy

Go to download

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).

There is a newer version: 12.9.1
Show newest version
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