Class OverviewModel
java.lang.Object
io.jenkins.plugins.analysis.core.model.OverviewModel
- All Implemented Interfaces:
ModelObject
Server side model that provides the data for the "Overview" page of the Warnings tab of a run. The page answers the
question: "How many warnings did the static analysis tools report in this build, and did the build pass the
quality gates?". It shows the total number of warnings, the new and the fixed warnings of all
results of the run, a table with these numbers (and the distribution by severity) for each result, and the
results of the quality gates of all results.
The page has no client side controls yet. All values are obtained from the AnalysisResult of the
individual actions, nothing is stored separately. The layout is defined in the associated Jelly view
index.jelly.
- Author:
- Ullrich Hafner
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA segment of the severity bar: the number of warnings of a given severity. -
Method Summary
Modifier and TypeMethodDescriptionReturns the results of the run (one for each static analysis tool or aggregated result).getCriticalityColor(io.jenkins.plugins.util.QualityGate qualityGate) Returns the CSS class that defines the color of the criticality icon of the specified quality gate (seegetCriticalityIcon(QualityGate)).getCriticalityDescription(io.jenkins.plugins.util.QualityGate qualityGate) Returns a localized description of the criticality of the specified quality gate, i.e., what happens with the step and the build if the quality gate is missed.getCriticalityIcon(io.jenkins.plugins.util.QualityGate qualityGate) Returns the icon that visualizes the criticality of the specified quality gate: an error icon for quality gates that fail the step or build, and a warning icon for quality gates that mark the step or build as unstable.intReturns the number of fixed warnings of all results.Returns the distribution of the new warnings by severity.intReturns the number of new warnings of all results.intgetNewSizeOf(edu.hm.hafner.analysis.Severity severity) Returns the number of new warnings of all results with the specified severity.Returns the run that owns the results.Returns the results that have at least one active quality gate.io.jenkins.plugins.util.QualityGateStatusReturns the overall quality gate status of the run, i.e., the worst status of all results.List<edu.hm.hafner.analysis.Severity> Returns the severities that have at least one warning in one of the results.getSeverityLabel(edu.hm.hafner.analysis.Severity severity) Returns the localized name of the specified severity.getTab()Returns the Warnings tab of the run.Returns the distribution of all warnings by severity.intReturns the total number of warnings of all results.intgetTotalSizeOf(edu.hm.hafner.analysis.Severity severity) Returns the number of warnings of all results with the specified severity.Returns the URL of this page, relative to the Warnings tab.booleanReturns whether at least one of the results has an active quality gate.
-
Method Details
-
getDisplayName
- Specified by:
getDisplayNamein interfaceModelObject
-
getUrlName
Returns the URL of this page, relative to the Warnings tab.- Returns:
- the URL name
-
getObject
Returns the run that owns the results. Required byl:run-subpage.- Returns:
- the run
-
getTab
Returns the Warnings tab of the run. Used to render the app bar and the side panel.- Returns:
- the tab
-
getActions
Returns the results of the run (one for each static analysis tool or aggregated result).- Returns:
- the results
-
getTotalSize
public int getTotalSize()Returns the total number of warnings of all results.- Returns:
- the total number of warnings
-
getNewSize
public int getNewSize()Returns the number of new warnings of all results.- Returns:
- the number of new warnings
-
getFixedSize
public int getFixedSize()Returns the number of fixed warnings of all results.- Returns:
- the number of fixed warnings
-
getTotalSizeOf
public int getTotalSizeOf(edu.hm.hafner.analysis.Severity severity) Returns the number of warnings of all results with the specified severity.- Parameters:
severity- the severity to count- Returns:
- the number of warnings with the specified severity
-
getNewSizeOf
public int getNewSizeOf(edu.hm.hafner.analysis.Severity severity) Returns the number of new warnings of all results with the specified severity.- Parameters:
severity- the severity to count- Returns:
- the number of new warnings with the specified severity
-
getTotalSegments
Returns the distribution of all warnings by severity. Used to render the segmented severity bar of the "Total" card. Severities without warnings are skipped.- Returns:
- the segments, ordered from the most to the least important severity
-
getNewSegments
Returns the distribution of the new warnings by severity. Used to render the segmented severity bar of the "New" card. Severities without new warnings are skipped.- Returns:
- the segments, ordered from the most to the least important severity
-
getSeverities
Returns the severities that have at least one warning in one of the results. Only these severities get a column in the results table.- Returns:
- the severities with warnings, ordered from the most to the least important severity
-
getSeverityLabel
Returns the localized name of the specified severity.- Parameters:
severity- the severity- Returns:
- the localized name
-
getQualityGateActions
Returns the results that have at least one active quality gate.- Returns:
- the results with active quality gates
-
hasQualityGates
public boolean hasQualityGates()Returns whether at least one of the results has an active quality gate.- Returns:
trueif there are active quality gates,falseotherwise
-
getQualityGateStatus
public io.jenkins.plugins.util.QualityGateStatus getQualityGateStatus()Returns the overall quality gate status of the run, i.e., the worst status of all results.- Returns:
- the overall quality gate status, or
QualityGateStatus.INACTIVEif there are no quality gates
-
getCriticalityIcon
Returns the icon that visualizes the criticality of the specified quality gate: an error icon for quality gates that fail the step or build, and a warning icon for quality gates that mark the step or build as unstable.- Parameters:
qualityGate- the quality gate- Returns:
- the icon
-
getCriticalityColor
Returns the CSS class that defines the color of the criticality icon of the specified quality gate (seegetCriticalityIcon(QualityGate)).- Parameters:
qualityGate- the quality gate- Returns:
- the CSS class of the color
-
getCriticalityDescription
Returns a localized description of the criticality of the specified quality gate, i.e., what happens with the step and the build if the quality gate is missed. Shown as tooltip of the criticality icon.- Parameters:
qualityGate- the quality gate- Returns:
- the localized description
-