Class QualityGateEvaluator
- java.lang.Object
-
- io.jenkins.plugins.analysis.core.util.QualityGateEvaluator
-
public class QualityGateEvaluator extends Object
Evaluates a set of quality gates for a static analysis report.- Author:
- Ullrich Hafner
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
QualityGateEvaluator.FormattedLogger
Logs results of the quality gate evaluation.
-
Constructor Summary
Constructors Constructor Description QualityGateEvaluator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int size, QualityGate.QualityGateType type, QualityGate.QualityGateResult strength)
Appends the specified quality gates to the end of the list of quality gates.void
addAll(Collection<? extends QualityGate> additionalQualityGates)
Appends all of the quality gates in the specified collection to the end of the list of quality gates.QualityGateStatus
evaluate(IssuesStatistics report, QualityGateEvaluator.FormattedLogger logger)
Enforces this quality gate for the specified run.boolean
isEnabled()
Returns whether at least one quality gate has been added.
-
-
-
Method Detail
-
evaluate
public QualityGateStatus evaluate(IssuesStatistics report, QualityGateEvaluator.FormattedLogger logger)
Enforces this quality gate for the specified run.- Parameters:
report
- the report to evaluatelogger
- the logger that reports the passed and failed quality gate thresholds- Returns:
- result of the evaluation, expressed by a build state
-
add
public void add(int size, QualityGate.QualityGateType type, QualityGate.QualityGateResult strength)
Appends the specified quality gates to the end of the list of quality gates.- Parameters:
size
- the minimum number of issues that fails the quality gatetype
- the type of the quality gatestrength
- determines whether the quality gate is a warning or failure
-
addAll
public void addAll(Collection<? extends QualityGate> additionalQualityGates)
Appends all of the quality gates in the specified collection to the end of the list of quality gates.- Parameters:
additionalQualityGates
- the quality gates to add
-
isEnabled
public boolean isEnabled()
Returns whether at least one quality gate has been added.- Returns:
true
if at least one quality gate has been added,false
otherwise
-
-