Class CoverageObject<SELF extends CoverageObject<SELF>>
- java.lang.Object
-
- com.vectorcast.plugins.vectorcastcoverage.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 Summary
Constructors Constructor Description CoverageObject()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
doGraph(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
Generates the graph that shows the coverage trend up to this report.Api
getApi()
Ratio
getBasisPathCoverage()
Ratio
getBranchCoverage()
abstract Run<?,?>
getBuild()
Gets the build object that owns the whole coverage report tree.Ratio
getComplexity()
Ratio
getFunctionCallCoverage()
Ratio
getFunctionCoverage()
MCDC coverage.protected Integer
getMaxHistory()
protected Integer
getMaxHistoryFreestyleJob(String xml)
protected Integer
getMaxHistoryPipelineJob(String xml)
Ratio
getMCDCCoverage()
MCDC coverage.abstract SELF
getPreviousResult()
Gets the corresponding coverage report object in the previous run that has the record.Ratio
getStatementCoverage()
boolean
hasBasisPathCoverage()
boolean
hasBranchCoverage()
boolean
hasComplexity()
boolean
hasCoverage()
boolean
hasFunctionCallCoverage()
boolean
hasFunctionCoverage()
boolean
hasMCDCCoverage()
boolean
hasStatementCoverage()
boolean
isFailed()
String
printFourCoverageColumns()
Used in the view to print out four table columns with the coverage info.protected static void
printRatioCell(boolean failed, Ratio ratio, StringBuilder buf)
protected static void
printRatioTable(Ratio ratio, StringBuilder buf)
void
setFailed()
Marks this coverage object as failed.
-
-
-
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()
-
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 requestrsp
- web response- Throws:
IOException
- if unable to read/parse
-
getApi
public Api getApi()
-
-