CoverageChecker 0.6.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package CoverageChecker --version 0.6.3
                    
NuGet\Install-Package CoverageChecker -Version 0.6.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CoverageChecker" Version="0.6.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CoverageChecker" Version="0.6.3" />
                    
Directory.Packages.props
<PackageReference Include="CoverageChecker" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CoverageChecker --version 0.6.3
                    
#r "nuget: CoverageChecker, 0.6.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package CoverageChecker@0.6.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CoverageChecker&version=0.6.3
                    
Install as a Cake Addin
#tool nuget:?package=CoverageChecker&version=0.6.3
                    
Install as a Cake Tool

Coverage Checker Library

The Coverage Checker library is a .NET library for extracting code coverage metrics from various code coverage formats. It is intended to be used as a development dependency if you need to extract code coverage metrics as part of a .NET project.

For general information about the Coverage Checker project, see the repository's main README file.

Installation

To use the Coverage Checker library in your .NET project, add the CoverageChecker NuGet package to your project:

dotnet add package CoverageChecker

Usage

The CoverageAnalyser class is the entry point for extracting code coverage metrics from a coverage file.

The following example shows how to use the CoverageAnalyser class to extract code coverage metrics from a Cobertura coverage file:

using CoverageChecker;

CoverageAnalyser coverageAnalyser = new(CoverageFormat.Cobertura, ".", "**/coverage.cobertura.xml");
Coverage coverage = coverageAnalyser.AnalyseCoverage();

Options

The CoverageAnalyser class has the following options:

  • coverageFormat: The format of the coverage file. Options: SonarQube, Cobertura
  • directory: The directory to search for the coverage file(s) within.

and either one of the following:

  • globPattern: The glob pattern to use to match the coverage file(s).
  • globPatterns: The glob patterns to use to match the coverage file(s).
  • matcher: The glob pattern matcher to use to match the coverage file(s).

Results

The CoverageAnalyser class returns a Coverage object, which contains all the code coverage metrics. The Coverage object can contain multiple FileCoverage objects, which can each contain multiple LineCoverage objects.

Coverage Object

  • Files property: A collection of FileCoverage objects.
  • CalculateOverallCoverage(coverageType) method: Calculates the overall code coverage of the specified type for all files.
  • CalculatePackageCoverage(packageName, coverageType) method: Calculates the code coverage of the specified type for all files that are part of the specified package.

FileCoverage Object

  • Lines property: A collection of LineCoverage objects.
  • CalculateFileCoverage(coverageType) method: Calculates the code coverage of the specified type for the file.
  • CalculateClassCoverage(className, coverageType) method: Calculates the code coverage of the specified type for all lines that are part of the specified class.
  • CalculateMethodCoverage(methodName, coverageType) method: Calculates the code coverage of the specified type for all lines that are part of the specified method.

LineCoverage Object

  • Line property: The line number.
  • IsCovered property: Whether the line is covered.
  • Branches property: The number of branches in the line.
  • CoveredBranches property: The number of covered branches in the line.
  • ClassName property: The name of the class the line is part of.
  • MethodName property: The name of the method the line is part of.
  • MethodSignature property: The method signature of the method the line is part of.
  • CalculateLineCoverage(coverageType) method: Calculates the code coverage of the specified type for the line.
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.9.0 124 2/15/2026
0.8.0 118 1/11/2026
0.7.0 186 10/4/2025
0.6.6 171 9/28/2025
0.6.5 171 11/24/2024
0.6.4 168 11/13/2024
0.6.3 172 11/10/2024
0.6.2 163 11/10/2024
0.6.1 168 10/25/2024
0.6.0 180 10/20/2024
0.5.1 164 9/29/2024
0.5.0 168 9/29/2024
0.4.0 187 9/7/2024
0.3.1 388 7/12/2024
0.3.0 186 7/7/2024
0.2.2 172 6/14/2024
0.2.1 185 6/13/2024
0.2.0 170 6/9/2024
0.1.0 178 6/8/2024