NCover Documentation

Clear Coverage Filters

Clear the existing filters on the view. This is processed before the XmlFilters flag.

Usage:
clearCoverageFilters="true"

Coverage Filters

Filters can either exclude elements from coverage metrics and reporting, or include elements into coverage metrics and reporting (excluding all elements that are not included). All include filters are applied before any exclude filters, but once all filters are applied, excluded items are not considered when applying other options. NOTE: filtered items still exist in saved coverage data MergedCoverageDataFileName and reports. If you want excluded elements to be stripped from reports, use the //rdf flag ReportDataFilter.

<ncoverexplorer>
    <coverageFilters>
        <filter
            pattern=".nunit."
            type="Assembly"
            isRegex="true"
            isInclude="false"
        />
    </coverageFilters>
</ncoverexplorer>

'pattern' specifies the regular expression or wildcard pattern that the filter matches element names against. Elements whose name matches the expression or wildcard are then included or excluded (depending on which type the filter is)

'type' specifies the element type that the filter applies to. The filter's Pattern will be matched against the name of every element of the specified type.
Possible Values: Assembly, Namespace, Class, Method, Document

'isRegex' identifies the 'Pattern' as a regular expression or as a wildcard pattern.

'isInclude' identifies the filter as an include filter (everything that matches the filter will be included) or as an exclude filter (everything that matches the filter will be excluded)

Rebased Source File Paths

When searching for source files, treat source files paths that begin with the <SourcePath /> as if they began with the <RebasedPath />. If multiple rebased paths are present, they are applied in the order in which they appear.

<ncoverexplorer>
    <rebasedPaths>
       <path from="C:\dev\source" to="F:\test\build-233\source" />
       <path from="F:\som\path" to="D:\storage\path\for\source" />
    </rebasedPaths>
</ncoverexplorer>

'from' is the absolute path to the file(s) as they were on the build machine.

'to' is the absolute path to the same file(s) as it is on the local machine.

Minimum Coverage Thresholds

Complete Edition Feature

Minimum coverage thresholds fail the build if the merged coverage data does not satisfy them. Thresholds can be set for any of the supported coverage types, for any particular value, from 0% to 100% (or any value >= 0 for the CyclomaticComplexity metric). Thresholds can apply to the overall coverage percentage, or to assemblies, namespaces, or classes.

Usage:
<ncoverreporting>
    <minimumCoverage>
        <threshold
            coverageMetric="MethodCoverage"
            type="View"
            value="100.0"
            pattern="system.io.path"
        />
    </minimumCoverage>
</ncoverreporting>

'Coverage Metric' specifies the metric this threshold applies to.
Allowed values: SymbolCoverage, BranchCoverage, MethodCoverage, and CyclomaticComplexity

'Type' restricts the threshold to items of the given type
Allowed Values: View, Module, Namespace, Class
Default Value: 'View' (the overall coverage of the entire merged coverage data).

Value' specifies the minimum value the given coverage metric is allowed to have. If the coverage value for the given metric is below this value, the build will fail. Allowed values: 0.0 - 100% for everything but CyclomaticComplexity. CyclomaticComplexity must be > 0.

'Pattern' restricts the threshold to items of the given type whose name matches the value in this field The value can be a regular expression, or it can be a specific name. The value matches the fully-qualified name of the item, i.e. match a class by entering 'System.IO.Path' (case-insensitive match).

Use Minimum Coverage

When set, NCover.Reporting will copy the FailBuildThresholds into the SatisfactoryThresholds, merging the two together to create SatisfactoryThresholds

Usage:

        
<NCoverReporting satCoverageFromMinCoverage="true" />

Xml Report Filter

Works with the ReportType parameter of the XmlReports argument to strip unnecessary data from the xml reports. By default, the unnecessary data is retained in the report and ignored, but for large projects the unnecessary data makes the xml reports render slowly on some build systems.

Usage:
reportDataFilter="Assembly | Namespace"

Report Invalid Files

By default, when preparing coverage data for reporting, NCover Reporting will not create any reports if any of the coverage files are invalid coverage files. Using this argument tells NCover Reporting to report any invalid coverage files and create reports from the data in the valid coverage files (if any).

Usage:
reportInvalidFiles="true"

Satisfactory Coverage Thresholds

Complete Edition Feature

Satisfactory coverage thresholds report the items in the merged coverage data that do not satisfy them. Thresholds can be set for any of the supported coverage types, for any particular value, from 0% to 100% (or any value greater than 0 for the CyclomaticComplexity metric). Thresholds can apply to the overall coverage percentage, or to assemblies, namespaces, or classes.

Usage:
<ncoverreporting>
    <satisfactoryCoverage>
        <threshold
            coverageMetric="MethodCoverage"
            type="View"
            value="100.0"
            pattern="system.io.path"
        />
    </satisfactoryCoverage>
</ncoverreporting>

'Coverage Metric' specifies the metric this threshold applies to.
Allowed values: SymbolCoverage, BranchCoverage, MethodCoverage, and CyclomaticComplexity

'Type' restricts the threshold to items of the given type
Allowed Values: View, Assembly, Namespace, Class
Default Value: 'View' (the overall coverage of the entire merged coverage data).

Value' specifies the minimum value the given coverage metric is allowed to have. If the coverage value for the given metric is below this value, the item will be reported.
Allowed values: 0.0 - 100% for everything but CyclomaticComplexity. CyclomaticComplexity must be greater than 0.

'Pattern' restricts the threshold to items of the given type whose name matches the value in this field The value can be a regular expression, or it can be a specific name. The value matches the fully-qualified name of the item, i.e. match a class by entering 'System.IO.Path' (case-insensitive match).

Max Failed to Report

By default, NCover.Reporting will only show the first 50 items that fail the minimum coverage thresholds. Set this value to change how many items NCover.Reporting will list in detail (the total number that failed is always reported).

Usage:
maxFailedToShow="500"

If you still need technical assistance, we can help:

Submit A Support Ticket

Try NCover Free Contact Us Online