Class CoverageObject<SELF extends CoverageObject<SELF>>

  • Direct Known Subclasses:
    AbstractReport, VectorCASTBuildAction

    @ExportedBean
    public abstract class CoverageObject<SELF extends CoverageObject<SELF>>
    extends Object
    Base class of all coverage objects.
    Author:
    Kohsuke Kawaguchi
    • Constructor Detail

      • CoverageObject

        public CoverageObject()
    • Method Detail

      • hasCoverage

        public boolean hasCoverage()
      • isFailed

        public boolean isFailed()
      • setFailed

        public void setFailed()
        Marks this coverage object as failed.
        See Also:
        Rule
      • getStatementCoverage

        @Exported(inline=true)
        public Ratio getStatementCoverage()
      • getBranchCoverage

        @Exported(inline=true)
        public Ratio getBranchCoverage()
      • getComplexity

        @Exported(inline=true)
        public Ratio getComplexity()
      • getBasisPathCoverage

        @Exported(inline=true)
        public Ratio getBasisPathCoverage()
      • getMCDCCoverage

        @Exported(inline=true)
        public Ratio getMCDCCoverage()
        MCDC coverage. Can be null if this information is not collected.
        Returns:
        coverage value (null if not collected)
      • getFunctionCoverage

        @Exported(inline=true)
        public Ratio getFunctionCoverage()
        MCDC coverage. Can be null if this information is not collected.
        Returns:
        function coverage (null if not collected)
      • getFunctionCallCoverage

        @Exported(inline=true)
        public Ratio getFunctionCallCoverage()
      • getBuild

        public abstract Run<?,​?> getBuild()
        Gets the build object that owns the whole coverage report tree.
        Returns:
        the run instance
      • getPreviousResult

        @Exported
        public abstract SELF getPreviousResult()
        Gets the corresponding coverage report object in the previous run that has the record.
        Returns:
        null if no earlier record was found.
      • printFourCoverageColumns

        public String printFourCoverageColumns()
        Used in the view to print out four table columns with the coverage info.
        Returns:
        four columns string
      • hasFunctionCoverage

        public boolean hasFunctionCoverage()
      • hasFunctionCallCoverage

        public boolean hasFunctionCallCoverage()
      • hasMCDCCoverage

        public boolean hasMCDCCoverage()
      • hasStatementCoverage

        public boolean hasStatementCoverage()
      • hasBranchCoverage

        public boolean hasBranchCoverage()
      • hasComplexity

        public boolean hasComplexity()
      • hasBasisPathCoverage

        public boolean hasBasisPathCoverage()
      • getMaxHistoryFreestyleJob

        protected Integer getMaxHistoryFreestyleJob​(String xml)
      • getMaxHistoryPipelineJob

        protected Integer getMaxHistoryPipelineJob​(String xml)
      • getMaxHistory

        protected Integer getMaxHistory()
      • printRatioCell

        protected static void printRatioCell​(boolean failed,
                                             Ratio ratio,
                                             StringBuilder buf)
      • printRatioTable

        protected static void printRatioTable​(Ratio ratio,
                                              StringBuilder buf)
      • doGraph

        public void doGraph​(org.kohsuke.stapler.StaplerRequest req,
                            org.kohsuke.stapler.StaplerResponse rsp)
                     throws IOException
        Generates the graph that shows the coverage trend up to this report.
        Parameters:
        req - web request
        rsp - web response
        Throws:
        IOException - if unable to read/parse
      • getApi

        public Api getApi()