Class IssuesRecorder

    • Constructor Detail

      • IssuesRecorder

        @DataBoundConstructor
        public IssuesRecorder()
        Creates a new instance of IssuesRecorder.
    • Method Detail

      • readResolve

        protected Object readResolve()
        Called after de-serialization to retain backward compatibility or to populate new elements (that would be otherwise initialized to null).
        Returns:
        this
      • setScm

        @DataBoundSetter
        public void setScm​(String scm)
        Sets the SCM that should be used to find the reference build for. The reference recorder will select the SCM based on a substring comparison, there is no need to specify the full name.
        Parameters:
        scm - the ID of the SCM to use (a substring of the full ID)
      • getScm

        public String getScm()
      • setQualityGates

        @DataBoundSetter
        public void setQualityGates​(List<QualityGate> qualityGates)
        Defines the optional list of quality gates.
        Parameters:
        qualityGates - the quality gates
      • addQualityGate

        public void addQualityGate​(int size,
                                   QualityGate.QualityGateType type,
                                   QualityGate.QualityGateResult result)
        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 gate
        type - the type of the quality gate
        result - determines whether the quality gate is a warning or failure
      • setId

        @DataBoundSetter
        public void setId​(String id)
        Defines the ID of the results. The ID is used as URL of the results and as name in UI elements. If no ID is given, then the ID of the associated result object is used.

        Note: this property is not used if isAggregatingResults is false. It is also not visible in the UI in order to simplify the user interface.

        Parameters:
        id - the ID of the results
      • getId

        public String getId()
      • setName

        @DataBoundSetter
        public void setName​(String name)
        Defines the name of the results. The name is used for all labels in the UI. If no name is given, then the name of the associated StaticAnalysisLabelProvider is used.

        Note: this property is not used if isAggregatingResults is false. It is also not visible in the UI in order to simplify the user interface.

        Parameters:
        name - the name of the results
      • getName

        public String getName()
      • getToolProxies

        @CheckForNull
        @Deprecated
        public List<ToolProxy> getToolProxies()
        Deprecated.
        this method is only intended to be called by the UI
        Gets the static analysis tools that will scan files and create issues.
        Returns:
        the static analysis tools (wrapped as ToolProxy)
        See Also:
        getTools()
      • setToolProxies

        @DataBoundSetter
        @Deprecated
        public void setToolProxies​(List<ToolProxy> toolProxies)
        Deprecated.
        this method is only intended to be called by the UI
        Sets the static analysis tools that will scan files and create issues.
        Parameters:
        toolProxies - the static analysis tools (wrapped as ToolProxy)
        See Also:
        setTools(List)
      • setTools

        @DataBoundSetter
        public void setTools​(List<Tool> tools)
        Sets the static analysis tools that will scan files and create issues.
        Parameters:
        tools - the static analysis tools
      • setTools

        public void setTools​(Tool tool,
                             Tool... additionalTools)
        Sets the static analysis tools that will scan files and create issues.
        Parameters:
        tool - the static analysis tool
        additionalTools - additional static analysis tools (might be empty)
        See Also:
        setTools(List)
      • getTools

        public List<Tool> getTools()
        Returns the static analysis tools that will scan files and create issues.
        Returns:
        the static analysis tools
      • getSourceCodeEncoding

        @CheckForNull
        public String getSourceCodeEncoding()
      • setSourceCodeEncoding

        @DataBoundSetter
        public void setSourceCodeEncoding​(String sourceCodeEncoding)
        Sets the encoding to use to read source files.
        Parameters:
        sourceCodeEncoding - the encoding, e.g. "ISO-8859-1"
      • getSourceDirectory

        public String getSourceDirectory()
      • setSourceDirectory

        @DataBoundSetter
        public void setSourceDirectory​(String sourceDirectory)
        Sets the path to the folder that contains the source code. If not relative and thus not part of the workspace then this folder needs to be added in Jenkins global configuration.
        Parameters:
        sourceDirectory - a folder containing the source code
      • getAggregatingResults

        public boolean getAggregatingResults()
        Returns whether the results for each configured static analysis result should be aggregated into a single result or if every tool should get an individual result.
        Returns:
        true if the results of each static analysis tool should be aggregated into a single result, false if every tool should get an individual result.
      • setAggregatingResults

        @DataBoundSetter
        public void setAggregatingResults​(boolean aggregatingResults)
      • getBlameDisabled

        public boolean getBlameDisabled()
        Returns whether SCM blaming should be disabled.
        Returns:
        true if SCM blaming should be disabled
      • setBlameDisabled

        @DataBoundSetter
        public void setBlameDisabled​(boolean blameDisabled)
      • isSkipBlames

        public boolean isSkipBlames()
        Returns whether SCM blaming should be disabled.
        Returns:
        true if SCM blaming should be disabled
      • setSkipBlames

        @DataBoundSetter
        public void setSkipBlames​(boolean skipBlames)
      • getForensicsDisabled

        @Deprecated
        public boolean getForensicsDisabled()
        Deprecated.
        Forensics will be automatically skipped if the Forensics recorder is not activated.
        Not used anymore.
        Returns:
        true if SCM forensics should be disabled
      • setForensicsDisabled

        @DataBoundSetter
        @Deprecated
        public void setForensicsDisabled​(boolean forensicsDisabled)
        Deprecated.
        Forensics will be automatically skipped if the Forensics recorder is not activated.
        Not used anymore.
        Parameters:
        forensicsDisabled - not used
      • isSkipPublishingChecks

        public boolean isSkipPublishingChecks()
        Returns whether publishing checks should be skipped.
        Returns:
        true if publishing checks should be skipped, false otherwise
      • setSkipPublishingChecks

        @DataBoundSetter
        public void setSkipPublishingChecks​(boolean skipPublishingChecks)
      • isPublishAllIssues

        public boolean isPublishAllIssues()
        Returns whether all issues should be published using the Checks API. If set to false only new issues will be published.
        Returns:
        true if all issues should be published, false if only new issues should be published
      • setPublishAllIssues

        @DataBoundSetter
        public void setPublishAllIssues​(boolean publishAllIssues)
      • setFailOnError

        @DataBoundSetter
        public void setFailOnError​(boolean failOnError)
        Determines whether to fail the build on errors during the step of recording issues.
        Parameters:
        failOnError - if true then the build will be failed on errors, false then errors are only reported in the UI
      • getFailOnError

        public boolean getFailOnError()
      • getEnabledForFailure

        public boolean getEnabledForFailure()
        Returns whether recording should be enabled for failed builds as well.
        Returns:
        true if recording should be enabled for failed builds as well, false if recording is enabled for successful or unstable builds only
      • setEnabledForFailure

        @DataBoundSetter
        public void setEnabledForFailure​(boolean enabledForFailure)
      • setIgnoreQualityGate

        @DataBoundSetter
        public void setIgnoreQualityGate​(boolean ignoreQualityGate)
        If true, then the result of the quality gate is ignored when selecting a reference build. This option is disabled by default so a failing quality gate will be passed from build to build until the original reason for the failure has been resolved.
        Parameters:
        ignoreQualityGate - if true then the result of the quality gate is ignored, otherwise only build with a successful quality gate are selected
      • getIgnoreQualityGate

        public boolean getIgnoreQualityGate()
      • setIgnoreFailedBuilds

        @DataBoundSetter
        public void setIgnoreFailedBuilds​(boolean ignoreFailedBuilds)
        If true, then only successful or unstable reference builds will be considered. This option is enabled by default, since analysis results might be inaccurate if the build failed. If false, every build that contains a static analysis result is considered, even if the build failed.
        Parameters:
        ignoreFailedBuilds - if true then a stable build is used as reference
      • getIgnoreFailedBuilds

        public boolean getIgnoreFailedBuilds()
      • setReferenceJobName

        @DataBoundSetter
        public void setReferenceJobName​(String referenceJobName)
        Sets the reference job to get the results for the issue difference computation.
        Parameters:
        referenceJobName - the name of reference job
      • getReferenceJobName

        public String getReferenceJobName()
        Returns the reference job to get the results for the issue difference computation. If the job is not defined, then NO_REFERENCE_DEFINED is returned.
        Returns:
        the name of reference job, or NO_REFERENCE_DEFINED if undefined
      • setReferenceBuildId

        public void setReferenceBuildId​(String referenceBuildId)
        Sets the reference build id to get the results for the issue difference computatation.
        Parameters:
        referenceBuildId - the build id of the reference job
      • getReferenceBuildId

        public String getReferenceBuildId()
        Returns the reference build id to get the results for the issue difference computation. If the build id not defined, then NO_REFERENCE_DEFINED is returned.
        Returns:
        the build id of the reference job, or NO_REFERENCE_DEFINED if undefined.
      • getHealthy

        public int getHealthy()
      • setHealthy

        @DataBoundSetter
        public void setHealthy​(int healthy)
        Sets the healthy threshold, i.e. the number of issues when health is reported as 100%.
        Parameters:
        healthy - the number of issues when health is reported as 100%
      • getUnhealthy

        public int getUnhealthy()
      • setUnhealthy

        @DataBoundSetter
        public void setUnhealthy​(int unhealthy)
        Sets the healthy threshold, i.e. the number of issues when health is reported as 0%.
        Parameters:
        unhealthy - the number of issues when health is reported as 0%
      • getMinimumSeverity

        @CheckForNull
        public String getMinimumSeverity()
      • setTrendChartType

        @DataBoundSetter
        public void setTrendChartType​(TrendChartType trendChartType)
        Sets the type of the trend chart that should be shown on the job page.
        Parameters:
        trendChartType - the type of the trend chart to use
      • setMinimumSeverity

        @DataBoundSetter
        public void setMinimumSeverity​(String minimumSeverity)
        Sets the minimum severity to consider when computing the health report. Issues with a severity less than this value will be ignored.
        Parameters:
        minimumSeverity - the severity to consider
      • setFilters

        @DataBoundSetter
        public void setFilters​(List<RegexpFilter> filters)
      • setChecksInfo

        public void setChecksInfo​(@CheckForNull
                                  io.jenkins.plugins.checks.steps.ChecksInfo checksInfo)
      • getRequiredMonitorService

        public BuildStepMonitor getRequiredMonitorService()
      • getUnstableTotalAll

        @Deprecated
        public int getUnstableTotalAll()
        Deprecated.
        replaced by getQualityGates()
        Gets the quality gate.
        Returns:
        0
      • getUnstableTotalHigh

        @Deprecated
        public int getUnstableTotalHigh()
        Deprecated.
        replaced by getQualityGates()
        Gets the quality gate.
        Returns:
        0
      • getUnstableNewAll

        @Deprecated
        public int getUnstableNewAll()
        Deprecated.
        replaced by getQualityGates()
        Gets the quality gate.
        Returns:
        0
      • getUnstableTotalNormal

        @Deprecated
        public int getUnstableTotalNormal()
        Deprecated.
        replaced by getQualityGates()
        Gets the quality gate.
        Returns:
        0
      • getUnstableTotalLow

        @Deprecated
        public int getUnstableTotalLow()
        Deprecated.
        replaced by getQualityGates()
        Gets the quality gate.
        Returns:
        0
      • getUnstableNewHigh

        @Deprecated
        public int getUnstableNewHigh()
        Deprecated.
        replaced by getQualityGates()
        Gets the quality gate.
        Returns:
        0
      • getUnstableNewNormal

        @Deprecated
        public int getUnstableNewNormal()
        Deprecated.
        replaced by getQualityGates()
        Gets the quality gate.
        Returns:
        0
      • getUnstableNewLow

        @Deprecated
        public int getUnstableNewLow()
        Deprecated.
        replaced by getQualityGates()
        Gets the quality gate.
        Returns:
        0
      • getFailedTotalAll

        @Deprecated
        public int getFailedTotalAll()
        Deprecated.
        replaced by getQualityGates()
        Gets the quality gate.
        Returns:
        0
      • getFailedTotalHigh

        @Deprecated
        public int getFailedTotalHigh()
        Deprecated.
        replaced by getQualityGates()
        Gets the quality gate.
        Returns:
        0
      • getFailedTotalNormal

        @Deprecated
        public int getFailedTotalNormal()
        Deprecated.
        replaced by getQualityGates()
        Gets the quality gate.
        Returns:
        0
      • getFailedTotalLow

        @Deprecated
        public int getFailedTotalLow()
        Deprecated.
        replaced by getQualityGates()
        Gets the quality gate.
        Returns:
        0
      • getFailedNewNormal

        @Deprecated
        public int getFailedNewNormal()
        Deprecated.
        replaced by getQualityGates()
        Gets the quality gate.
        Returns:
        0