Class IssuesDetail

java.lang.Object
io.jenkins.plugins.datatables.DefaultAsyncTableContentProvider
io.jenkins.plugins.analysis.core.model.IssuesDetail
All Implemented Interfaces:
ModelObject, io.jenkins.plugins.datatables.AsyncTableContentProvider
Direct Known Subclasses:
FixedWarningsDetail

public class IssuesDetail extends io.jenkins.plugins.datatables.DefaultAsyncTableContentProvider implements ModelObject
Build view that shows the details for a subset of issues.
Author:
Ullrich Hafner
  • Constructor Details

    • IssuesDetail

      public IssuesDetail(Run<?,?> owner, AnalysisResult result, edu.hm.hafner.analysis.Report report, edu.hm.hafner.analysis.Report newIssues, edu.hm.hafner.analysis.Report outstandingIssues, edu.hm.hafner.analysis.Report fixedIssues, String displayName, String url, StaticAnalysisLabelProvider labelProvider, Charset sourceEncoding)
      Creates a new detail model with the corresponding view IssuesDetail/index.jelly.
      Parameters:
      owner - the associated build/run of this view
      result - the analysis result
      report - all issues that should be shown in this details view
      newIssues - all new issues
      outstandingIssues - all outstanding issues
      fixedIssues - all fixed issues
      displayName - the human-readable name of this view (shown in breadcrumb)
      url - the relative URL of this view
      labelProvider - the label provider for the static analysis tool
      sourceEncoding - the encoding to use when displaying source files
    • IssuesDetail

      public IssuesDetail(Run<?,?> owner, AnalysisResult result, edu.hm.hafner.analysis.Report report, edu.hm.hafner.analysis.Report newIssues, edu.hm.hafner.analysis.Report outstandingIssues, edu.hm.hafner.analysis.Report fixedIssues, String displayName, String url, StaticAnalysisLabelProvider labelProvider, Charset sourceEncoding, HealthDescriptor healthDescriptor)
      Creates a new detail model with the corresponding view IssuesDetail/index.jelly.
      Parameters:
      owner - the associated build/run of this view
      result - the analysis result
      report - all issues that should be shown in this details view
      newIssues - all new issues
      outstandingIssues - all outstanding issues
      fixedIssues - all fixed issues
      displayName - the human-readable name of this view (shown in breadcrumb)
      url - the relative URL of this view
      labelProvider - the label provider for the static analysis tool
      sourceEncoding - the encoding to use when displaying source files
      healthDescriptor - health descriptor
    • IssuesDetail

      public IssuesDetail(Run<?,?> owner, AnalysisResult result, StaticAnalysisLabelProvider labelProvider, HealthDescriptor healthDescriptor, Charset sourceEncoding)
      Creates a new detail model with the corresponding view IssuesDetail/index.jelly.
      Parameters:
      owner - the associated build/run of this view
      result - the analysis result
      labelProvider - the label provider for the static analysis tool
      healthDescriptor - the health descriptor
      sourceEncoding - the charset to visualize source files with
  • Method Details

    • getErrorMessages

      public Collection<String> getErrorMessages()
      Returns the error messages of the static analysis run.
      Returns:
      the error messages
    • getInfoMessages

      public Collection<String> getInfoMessages()
      Returns the information messages of the static analysis run.
      Returns:
      the information messages
    • getApi

      public Api getApi()
      Gets the remote API for this action. Depending on the path, a different result is selected.
      Returns:
      the remote API
    • getLabelProvider

      public StaticAnalysisLabelProvider getLabelProvider()
      Returns the label provider to render the localized labels.
      Returns:
      the label provider
    • getTableModel

      public io.jenkins.plugins.datatables.TableModel getTableModel(String id)
      Returns the UI model for the specified table.
      Specified by:
      getTableModel in interface io.jenkins.plugins.datatables.AsyncTableContentProvider
      Parameters:
      id - the ID of the table
      Returns:
      the UI model as JSON
    • resetReference

      @JavaScriptMethod public String resetReference()
      Resets the quality gate for the owner of this view.
      Returns:
      unused string (since Firefox requires that Ajax calls return something)
    • getUrlForBuild

      @JavaScriptMethod public String getUrlForBuild(String build, String detailsUrl)
      Returns the URL for same results of the selected build.
      Parameters:
      build - the selected build to open the new results for
      detailsUrl - the absolute URL to this details view results
      Returns:
      the URL to the results or an empty string if the results are not available
    • getSeverityModel

      @JavaScriptMethod public String getSeverityModel()
      Returns the UI model for an ECharts doughnut chart that shows the severities.
      Returns:
      the UI model as JSON
    • getTrendModel

      @JavaScriptMethod public String getTrendModel()
      Returns the UI model for an ECharts doughnut chart that shows the new, fixed, and outstanding issues.
      Returns:
      the UI model as JSON
    • getModifiedModel

      @JavaScriptMethod public String getModifiedModel()
      Returns the UI model for an ECharts doughnut chart that shows the issues in modified code.
      Returns:
      the UI model as JSON
    • getBuildTrend

      @JavaScriptMethod public String getBuildTrend(String configuration)
      Returns the UI model for an ECharts line chart that shows the issues stacked by severity.
      Parameters:
      configuration - determines whether the Jenkins build number should be used on the X-axis or the date
      Returns:
      the UI model as JSON
    • getToolsTrend

      @JavaScriptMethod public String getToolsTrend(String configuration)
      Returns the UI model for an ECharts line chart that shows the issues by tool.
      Parameters:
      configuration - determines whether the Jenkins build number should be used on the X-axis or the date
      Returns:
      the UI model as JSON
    • getNewVersusFixedTrend

      @JavaScriptMethod public String getNewVersusFixedTrend(String configuration)
      Returns the UI model for an ECharts line chart that shows the new and fixed issues.
      Parameters:
      configuration - determines whether the Jenkins build number should be used on the X-axis or the date
      Returns:
      the UI model as JSON
    • getHealthTrend

      @JavaScriptMethod public String getHealthTrend(String configuration)
      Returns the UI model for an ECharts line chart that shows the issues by tool.
      Parameters:
      configuration - determines whether the Jenkins build number should be used on the X-axis or the date
      Returns:
      the UI model as JSON
    • isHealthReportEnabled

      public boolean isHealthReportEnabled()
      Returns whether a health report has been enabled.
      Returns:
      true if health reporting is enabled, false otherwise
    • hasIssuesInModifiedCode

      public boolean hasIssuesInModifiedCode()
      Returns whether there are any issues in the associated static analysis run that are part of modified code.
      Returns:
      true if there are issues in modified code, false otherwise
    • getIssues

      public edu.hm.hafner.analysis.Report getIssues()
      Returns all issues of the associated static analysis run.
      Returns:
      all issues
    • getNewIssues

      public edu.hm.hafner.analysis.Report getNewIssues()
      Returns all new issues of the associated static analysis run. I.e., all issues that are part of the current report but have not been shown up in the previous report.
      Returns:
      all new issues
    • getFixedIssues

      public edu.hm.hafner.analysis.Report getFixedIssues()
      Returns all fixed issues of the associated static analysis run. I.e., all issues that are part of the previous report but are not present in the current report anymore.
      Returns:
      all fixed issues
    • getOutstandingIssues

      public edu.hm.hafner.analysis.Report getOutstandingIssues()
      Returns all outstanding issues of the associated static analysis run. I.e., all issues that are part of the current and previous report.
      Returns:
      all outstanding issues
    • isBlameVisible

      public boolean isBlameVisible()
      Returns whether author and commit information should be shown or not.
      Returns:
      on true the SCM blames will be shown in the UI
    • isForensicsVisible

      public boolean isForensicsVisible()
      Returns whether SCM forensics will be shown or not.
      Returns:
      on true the SCM forensics will be shown in the UI
    • canDisplayFile

      public boolean canDisplayFile(edu.hm.hafner.analysis.Issue issue)
      Returns whether the affected file of the specified issue can be shown in the UI.
      Parameters:
      issue - the issue to get the affected file for
      Returns:
      true if the file could be shown, false otherwise
    • getFileDisplayName

      public String getFileDisplayName(edu.hm.hafner.analysis.Issue issue)
      Returns the short name for an absolute path name.
      Parameters:
      issue - the issue to get the file name for
      Returns:
      the file name
    • getTabLabelProvider

      public TabLabelProvider getTabLabelProvider()
      Returns the label provider for the localized tab names.
      Returns:
      the label provider
    • getLocalizedSeverity

      public String getLocalizedSeverity(edu.hm.hafner.analysis.Severity severity)
      Returns a localized severity name.
      Parameters:
      severity - the severity
      Returns:
      localized severity name
    • getDetails

      public PropertyStatistics getDetails(String propertyName)
      Returns statics for the specified property.
      Parameters:
      propertyName - the name of the property
      Returns:
      the statistics
    • getDisplayName

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

      public Object getDynamic(String link, org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response)
      Returns a new subpage for the selected link.
      Parameters:
      link - the link to identify the subpage to show
      request - Stapler request
      response - Stapler response
      Returns:
      the new subpage
    • getOwner

      public final Run<?,?> getOwner()
      Returns the build as owner of this object.
      Returns:
      the owner
    • isCurrent

      public final boolean isCurrent()
      Returns whether this build is the last available build.
      Returns:
      true if this build is the last available build
    • getUrl

      public String getUrl()
      Returns the (relative) URL of this model object.
      Returns:
      this model objects' URL