Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

ReportGenerator converts coverage reports generated by coverlet, OpenCover, dotCover, Visual Studio, NCover, Cobertura, JaCoCo, Clover, gcov or lcov into human readable reports in various formats.

License

NotificationsYou must be signed in to change notification settings

danielpalme/ReportGenerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ReportGenerator
ReportGenerator

Powerful code coverage visualization

GitHub licenseCI-CD

ReportGenerator converts coverage reports generated by coverlet, OpenCover, dotCover, Visual Studio, NCover, Cobertura, JaCoCo, Clover, gcov, or lcov into human readable reports in various formats.

The reports show the coverage quotas and also visualize which lines of your source code have been covered.

ReportGenerator supports merging several coverage files into a single report.

Browse example HTML report

Input and output

License

Getting started

ReportGenerator is a commandline tool which works with full .NET Framework and .NET Core.
Use the onlineconfiguration tool to get started quickly.

Install the package matching your platform and needs

PackagePlatformsInstallation/Usage
ReportGenerator

NugetNuget
.NET Core >=8.0
.NET Framework 4.7
Use this package if your project is based on.NET Framework or.NET Core and you want to useReportGenerator via the command line or a build script.

Usage
dotnet $(UserProfile).nuget\packages\reportgenerator\x.y.z\tools\net8.0\ReportGenerator.dll [options]
$(UserProfile).nuget\packages\reportgenerator\x.y.z\tools\net8.0\ReportGenerator.exe [options]

$(UserProfile)\.nuget\packages\reportgenerator\x.y.z\tools\net47\ReportGenerator.exe [options]
dotnet-reportgenerator-globaltool

NugetNuget
.NET Core >=8.0Use this package if your project is based on.NET Core and you want to useReportGenerator as a (global) 'DotnetTool'.

Installation
dotnet tool install -g dotnet-reportgenerator-globaltool

dotnet tool install dotnet-reportgenerator-globaltool --tool-path tools

dotnet new tool-manifest
dotnet tool install dotnet-reportgenerator-globaltool

Usage
reportgenerator [options]
tools\reportgenerator.exe [options]
dotnet reportgenerator [options]
ReportGenerator.Core

NugetNuget
.NET Standard 2.0Use this package if you want to write a customplugin forReportGenerator or if you want to call/executeReportGenerator within your code base.

Plugin development
Custom reports
Custom history storage
Azure DevOps extension

Visual Studio Marketplace VersionVisual Studio Marketplace Installs - Azure DevOps Extension
.NET Core >=8.0Add the Azure DevOps extension to your build pipeline.
Learn more
GitHub Actions.NET Core >=8.0Add the GitHub Action to your build pipeline.
Learn more

Usage / Command line parameters

Use the onlineconfiguration tool to get started quickly.
The more advanced settings are documented in thewiki.

Parameters:    ["]-reports:<report>[;<report>][;<report>]["]    ["]-targetdir:<target directory>["]    [["]-reporttypes:<Html|HtmlSummary|...>[;<Html|HtmlSummary|...>]["]]    [["]-sourcedirs:<directory>[;<directory>][;<directory>]["]]    [["]-historydir:<history directory>["]]    [["]-plugins:<plugin>[;<plugin>][;<plugin>]["]]    [["]-assemblyfilters:<(+|-)filter>[;<(+|-)filter>][;<(+|-)filter>]["]]    [["]-classfilters:<(+|-)filter>[;<(+|-)filter>][;<(+|-)filter>]["]]    [["]-filefilters:<(+|-)filter>[;<(+|-)filter>][;<(+|-)filter>]["]]    [["]-riskhotspotassemblyfilters:<(+|-)filter>[;<(+|-)filter>][;<(+|-)filter>]["]]    [["]-riskhotspotclassfilters:<(+|-)filter>[;<(+|-)filter>][;<(+|-)filter>]["]]    [["]-verbosity:<Verbose|Info|Warning|Error|Off>["]]    [["]-title:<title>["]]    [["]-tag:<tag>["]]    [["]-license:<license>["]]Explanations:   Reports:            The coverage reports that should be parsed (separated by semicolon).                       Globbing is supported.   Target directory:   The directory where the generated report should be saved.   Report types:       The output formats and scope (separated by semicolon).                       Values: Badges, Clover, Cobertura, CsvSummary,                        MarkdownSummary, MarkdownAssembliesSummary, MarkdownSummaryGithub, MarkdownDeltaSummary                       OpenCover                       Html, Html_Light, Html_Dark, Html_BlueRed                       HtmlChart, HtmlInline, HtmlSummary, Html_BlueRed_Summary                       HtmlInline_AzurePipelines, HtmlInline_AzurePipelines_Light, HtmlInline_AzurePipelines_Dark                       JsonSummary, CodeClimate, Latex, LatexSummary, lcov, MHtml, SvgChart, SonarQube, TeamCitySummary                       TextSummary, TextDeltaSummary                       Xml, XmlSummary   Source directories: Optional directories which contain the corresponding source code (separated by semicolon).                       The source directories are used if coverage report contains classes without path information.                       Globbing is not supported.   History directory:  Optional directory for storing persistent coverage information.                       Can be used in future reports to show coverage evolution.   Plugins:            Optional plugin files for custom reports or custom history storage (separated by semicolon).    Assembly filters:   Optional list of assemblies that should be included or excluded in the report.   Class filters:      Optional list of classes that should be included or excluded in the report.   File filters:       Optional list of files that should be included or excluded in the report.   Risk hotspot assembly filters: Optional list of assemblies that should be included or excluded in the risk hotspots.   Risk hotspot class filters:    Optional list of classes that should be included or excluded in the risk hotspots.                         Exclusion filters take precedence over inclusion filters.                       Wildcards are allowed.   Verbosity:          The verbosity level of the log messages.                       Values: Verbose, Info, Warning, Error, Off   Title:              Optional title.   Tag:                Optional tag or build version.   License:            Optional license for PRO version. Get your license here: https://reportgenerator.io/pro                       License can also be supplied via 'REPORTGENERATOR_LICENSE' environment variable.Default values:   -reporttypes:Html   -assemblyfilters:+*   -classfilters:+*   -filefilters:+*   -riskhotspotassemblyfilters:+*   -riskhotspotclassfilters:+*   -verbosity:InfoExamples:   "-reports:coverage.xml" "-targetdir:C:\report"   "-reports:target\*\*.xml" "-targetdir:C:\report" -reporttypes:Latex;HtmlSummary -title:IntegrationTest -tag:v1.4.5   "-reports:coverage1.xml;coverage2.xml" "-targetdir:report" "-sourcedirs:C:\MyProject" -plugins:CustomReports.dll   "-reports:coverage.xml" "-targetdir:C:\report" "-assemblyfilters:+Included;-Excluded.*"

.netconfig support

All the above parameters can also be persisted in a.netconfig file, under a[ReportGenerator]section. Examples:

[ReportGenerator]reports="coverage.xml"targetdir="C:\\report"reporttypes="Latex;HtmlSummary"assemblyfilters="+Test;-Test"classfilters="+Test2;-Test2"

All the plural options can also be specified as multiple singular entries, like:

[ReportGenerator]report="coverage1.xml"report="coverage2.xml"reporttype="Latex"reporttype="HtmlSummary"assemblyfilter="+Test"assemblyfilter="-Test"classfilter="+Test2"classfilter="-Test2"filefilter="+cs"filefilter="-vb"riskhotspotassemblyfilter="+Test"riskhotspotassemblyfilter="-Test"riskhotspotclassfilter="+Test2"riskhotspotclassfilter="-Test2"sourcedir="src"sourcedir="test"

Adding/removing values is trivial using thedotnet-config CLI:

# set a single-valued variabledotnet config reportgenerator.reporttypes Latex;HtmlSummary# add to multi-valued variabledotnet config --add reportgenerator.report coverage3.xml# clear all multi-valued entries for a variabledotnet config --unset-all reportgenerator.assemblyfilter

Of course it's equally trivial to just edit the.netconfig file by hand.

MSBuild

A MSBuild task also exists:

<?xml version="1.0" encoding="utf-8"?><ProjectDefaultTargets="Coverage"xmlns="http://schemas.microsoft.com/developer/msbuild/2003"ToolsVersion="4.0">  <ItemGroup>    <PackageReferenceInclude="ReportGenerator"Version="x.y.z" />  </ItemGroup>  <TargetName="Coverage">    <ItemGroup>      <CoverageFilesInclude="OpenCover.xml" />    </ItemGroup>    <ReportGeneratorProjectDirectory="$(MSBuildProjectDirectory)"ReportFiles="@(CoverageFiles)"TargetDirectory="report"ReportTypes="Html;Latex"HistoryDirectory="history"Plugins="CustomReports.dll"AssemblyFilters="+Include;-Excluded"VerbosityLevel="Verbose" />  </Target></Project>

The MSBuild task parameters can be complemented with the.netconfig, if used. That means that parameterscan be omitted if they are provided via.netconfig, which is useful when reusing fixed settings acrossmultiple projects in a solution, where the MSBuild task is only provided the dynamic values for the currentproject:

Given the following.netconfig:

[ReportGenerator]reporttypes="Html;Latex"targetdirectory="report"historydirectory="history"assemblyfilters="+Include;-Excluded"verbosityLevel="Verbose"

The above target could be simplified as:

  <TargetName="Coverage">    <ItemGroup>      <CoverageFilesInclude="OpenCover.xml" />    </ItemGroup>    <ReportGeneratorProjectDirectory="$(MSBuildProjectDirectory)"ReportFiles="@(CoverageFiles)"Plugins="CustomReports.dll" />  </Target>

Supported input and output file formats

ReportGenerator supports several input and output formats.
The wiki explains the differentoutput formats or you can downloadsample reports of all supported output formats.
If you need a custom format, you can create aplugin.

Input formatsOutput formats


  • Html, Html_Light, Html_Dark, Html_BlueRed, HtmlSummary, HtmlChart, HtmlInline, HtmlInline_AzurePipelines, HtmlInline_AzurePipelines_Light, HtmlInline_AzurePipelines_Dark,MHtml
  • Clover
  • Cobertura
  • OpenCover (PRO version only)
  • SonarQube
  • TeamCitySummary
  • lcov
  • Xml, XmlSummary
  • JsonSummary
  • Latex, LatexSummary
  • TextSummary, TextDeltaSummary
  • CsvSummary
  • MarkdownSummary, MarkdownAssembliesSummary, MarkdownSummaryGithub, MarkdownDeltaSummary
  • SvgChart
  • Badges
  • Custom reports

Screenshots

The screenshots show two snippets of the generated reports:

Screenshot 1

Screenshot 2

Badges
Badges in SVG format can be generated if-reporttypes:Badges is used:

Example:Sample badge

See all badges

Resources

Visual Studio extensions

The following extensions exist to visualize coverage in Visual Studio:

NameCoverage toolLinks
Run Coverlet Report VS2022coverletGitHub
Marketplace
FineCodeCoveragecoverlet,OpenCoverGitHub
Marketplace

Links

Download statistics

NugetNugetNuget

Visual Studio Marketplace Installs - Azure DevOps ExtensionGitHub All ReleasesChocolatey

Trends

Nuget downloads
GitHub stars

Contact

Author: Daniel Palme
Blog:www.palmmedia.de
Twitter:@danielpalme

About

ReportGenerator converts coverage reports generated by coverlet, OpenCover, dotCover, Visual Studio, NCover, Cobertura, JaCoCo, Clover, gcov or lcov into human readable reports in various formats.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp