Class OverviewModel

java.lang.Object
io.jenkins.plugins.analysis.core.model.OverviewModel
All Implemented Interfaces:
ModelObject

public class OverviewModel extends Object implements 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
  • Method Details

    • getDisplayName

      public String getDisplayName()
      Specified by:
      getDisplayName in interface ModelObject
    • getUrlName

      public String getUrlName()
      Returns the URL of this page, relative to the Warnings tab.
      Returns:
      the URL name
    • getObject

      public Actionable getObject()
      Returns the run that owns the results. Required by l:run-subpage.
      Returns:
      the run
    • getTab

      public RunTab getTab()
      Returns the Warnings tab of the run. Used to render the app bar and the side panel.
      Returns:
      the tab
    • getActions

      public List<ResultAction> 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

      public List<OverviewModel.SeveritySegment> 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

      public List<OverviewModel.SeveritySegment> 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

      public List<edu.hm.hafner.analysis.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

      public String getSeverityLabel(edu.hm.hafner.analysis.Severity severity)
      Returns the localized name of the specified severity.
      Parameters:
      severity - the severity
      Returns:
      the localized name
    • getQualityGateActions

      public List<ResultAction> 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:
      true if there are active quality gates, false otherwise
    • 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.INACTIVE if there are no quality gates
    • getCriticalityIcon

      public String 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.
      Parameters:
      qualityGate - the quality gate
      Returns:
      the icon
    • getCriticalityColor

      public String getCriticalityColor(io.jenkins.plugins.util.QualityGate qualityGate)
      Returns the CSS class that defines the color of the criticality icon of the specified quality gate (see getCriticalityIcon(QualityGate)).
      Parameters:
      qualityGate - the quality gate
      Returns:
      the CSS class of the color
    • getCriticalityDescription

      public String 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. Shown as tooltip of the criticality icon.
      Parameters:
      qualityGate - the quality gate
      Returns:
      the localized description