Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCoberturaParser ¶
func NewCoberturaParser(fileReader filereader.Reader) parsers.IParser
Types ¶
type ClassXML ¶
type ClassXML struct { Name string `xml:"name,attr"` Filename string `xml:"filename,attr"` LineRate string `xml:"line-rate,attr"` BranchRate string `xml:"branch-rate,attr"` Complexity string `xml:"complexity,attr"` Methods MethodsXML `xml:"methods"` Lines LinesXML `xml:"lines"` }
<class>
type CoberturaParser ¶
type CoberturaParser struct {
// contains filtered or unexported fields
}
CoberturaParser implements the parsers.IParser interface for Cobertura XML reports.
func (*CoberturaParser) Name ¶
func (p *CoberturaParser) Name() string
func (*CoberturaParser) Parse ¶
func (p *CoberturaParser) Parse(filePath string, config parsers.ParserConfig) (*parsers.ParserResult, error)
Parse unmarshals the Cobertura XML report and delegates the conversion to a flat list of FileCoverage objects to the processingOrchestrator.
func (*CoberturaParser) SupportsFile ¶
func (p *CoberturaParser) SupportsFile(filePath string) bool
SupportsFile performs a fast check to see if this parser can handle the given file. It verifies the file has a ".xml" extension and that its root element is "<coverage>".
type CoberturaRoot ¶
type CoberturaRoot struct { XMLName xml.Name `xml:"coverage"` LineRate string `xml:"line-rate,attr"` BranchRate string `xml:"branch-rate,attr"` LinesCovered string `xml:"lines-covered,attr"` LinesValid string `xml:"lines-valid,attr"` BranchesCovered string `xml:"branches-covered,attr"` BranchesValid string `xml:"branches-valid,attr"` Complexity string `xml:"complexity,attr"` Version string `xml:"version,attr"` Timestamp string `xml:"timestamp,attr"` Sources Sources `xml:"sources"` Packages Packages `xml:"packages"` }
<coverage>
type ConditionXML ¶
type ConditionXML struct { Number string `xml:"number,attr"` Type string `xml:"type,attr"` Coverage string `xml:"coverage,attr"` }
<condition>
type ConditionsXML ¶
type ConditionsXML struct {
Condition []ConditionXML `xml:"condition"`
}
<conditions>
type LineXML ¶
type LineXML struct { Number string `xml:"number,attr"` Hits string `xml:"hits,attr"` Branch string `xml:"branch,attr"` // "true" or "false" ConditionCoverage string `xml:"condition-coverage,attr"` Conditions ConditionsXML `xml:"conditions"` }
<line>
type MethodXML ¶
type MethodXML struct { Name string `xml:"name,attr"` Signature string `xml:"signature,attr"` LineRate string `xml:"line-rate,attr"` BranchRate string `xml:"branch-rate,attr"` Complexity string `xml:"complexity,attr"` Lines LinesXML `xml:"lines"` // Lines specific to this method }
<method>
type PackageXML ¶
type PackageXML struct { Name string `xml:"name,attr"` LineRate string `xml:"line-rate,attr"` BranchRate string `xml:"branch-rate,attr"` Complexity string `xml:"complexity,attr"` Classes ClassesXML `xml:"classes"` }
<package>
Click to show internal directories.
Click to hide internal directories.