Coder Social home page Coder Social logo

dystudio / reportgenerator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from danielpalme/reportgenerator

0.0 1.0 0.0 21.76 MB

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

Home Page: https://danielpalme.github.io/ReportGenerator

License: Apache License 2.0

C# 85.40% JavaScript 0.60% PowerShell 1.15% F# 0.29% Batchfile 0.14% CSS 6.67% Java 0.22% TypeScript 5.35% HTML 0.10% Shell 0.06% C++ 0.03%

reportgenerator's Introduction

ReportGenerator
ReportGenerator

Powerful code coverage visualization

GitHub license Build Status Coverage

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

The reports do not only show the coverage quota, but also include the source code and visualize which lines have been covered.

ReportGenerator supports merging several reports into one.

Input and output

Getting started

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

Install the package matching your platform and needs

Package Platforms Installation/Usage
ReportGenerator

NugetNuget
.NET Core 2.x, 3.x
.NET Framework 4.7
Use this package if your project is based on .NET Framework or .NET Core and you want to use ReportGenerator via the command line or a build script.

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

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

NugetNuget
.NET Core 2.1, 3.x Use this package if your project is based on .NET Core and you want to use ReportGenerator as a (global) 'DotnetTool'.

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

Usage
reportgenerator [options]
tools\reportgenerator.exe [options]
dotnet-reportgenerator-cli

NugetNuget
.NET Core 2.0 Use this package if your project is based on .NET Core 2.x and you want to use ReportGenerator as a 'DotnetCliTool'.

Warning
This package is intended for .NET Core 2.x. It will not work with .NET Core 3.x.
Consider the dotnet-reportgenerator-globaltool for .NET Core 3.x.

Installation
Add <DotNetCliToolReference Include="dotnet-reportgenerator-cli" Version="x.y.z" /> to your project file.

Usage
dotnet reportgenerator [options]
ReportGenerator.Core

NugetNuget
.NET Standard 2.0 Use this package if you want to write a custom plugin for ReportGenerator or if you want to call/execute ReportGenerator 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 2.1 Add the Azure DevOps extension to your build pipeline.
Learn more

Usage / Command line parameters

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>]["]]
    [["]-verbosity:<Verbose|Info|Warning|Error|Off>["]]
    [["]-tag:<tag>["]]

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, Cobertura, CsvSummary, Html, HtmlChart, HtmlInline, 
                       HtmlInline_AzurePipelines, HtmlInline_AzurePipelines_Dark, HtmlSummary,
                       JsonSummary, Latex, LatexSummary, lcov, MHtml, PngChart, SonarQube, TeamCitySummary,
                       TextSummary, 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.
   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.
                       Exclusion filters take precedence over inclusion filters.                      
                       Wildcards are allowed.
   Verbosity:          The verbosity level of the log messages.
                       Values: Verbose, Info, Warning, Error, Off
   Tag:                Optional tag or build version.

Default values:
   -reporttypes:Html
   -assemblyfilters:+*
   -classfilters:+*
   -filefilters:+*
   -verbosity:Info

Examples:
   "-reports:coverage.xml" "-targetdir:C:\report"
   "-reports:target\*\*.xml" "-targetdir:C:\report" -reporttypes:Latex;HtmlSummary -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.*"

MSBuild
A MSBuild task also exists:

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

Supported input and output file formats

ReportGenerator supports several input and output formats.
The wiki explains the different output formats or you can download sample reports of all formats.
If you need a custom format, you can create a plugin.

Input formats Output formats
  • Html, HtmlSummary, HtmlInline, HtmlInline_AzurePipelines, HtmlInline_AzurePipelines_Dark, HtmlChart, MHtml
  • Cobertura
  • SonarQube
  • TeamCitySummary
  • lcov
  • Xml, XmlSummary
  • JsonSummary
  • Latex, LatexSummary
  • TextSummary
  • CsvSummary
  • PngChart
  • Badges
  • Custom reports

Screenshots

The screenshots show two snippets of the generated reports: Screenshot 1 Screenshot 2

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

Sample badge

Resources

Links

Download statistics

Nuget Nuget Nuget Nuget

Visual Studio Marketplace Installs - Azure DevOps Extension GitHub All Releases Chocolatey

Contact

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

reportgenerator's People

Contributors

abbotware avatar acesiddhu avatar arielvb avatar azure-pipelines[bot] avatar danielpalme avatar david-driscoll avatar dependabot[bot] avatar hunterjm avatar jm3105 avatar kant2002 avatar karanjitsingh avatar knom avatar kurattila avatar loganek avatar markpflug avatar martincostello avatar petli avatar rjasica avatar splatteredbits avatar suremaker avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.