danielpalme / ReportGenerator

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.
https://reportgenerator.io
Apache License 2.0
2.56k stars 279 forks source link

Ability to exclude classes from Risk Hotspots #664

Closed ricardoboss closed 3 months ago

ricardoboss commented 4 months ago

Hi there!

I'd like to exclude certain classes/files from Risk Hotspots. Is this possible without disabling the whole Risk Hotspot section?

danielpalme commented 4 months ago

@ricardoboss Filters for the Risk Hotspots via command line arguments are currently not supported.

But you can limit the number of results by selecting an assembly or by entering a search term: image

ricardoboss commented 4 months ago

Hi! Thanks for taking the time to respond.

We are using Report Generator as part of our Azure Pipeline and generate a HTML inline report for Azure. Can we pass any arguments to the ADO task to exclude them before generating the report?

danielpalme commented 4 months ago

No there is currently no option. The problem with the report within Azure DevOps is, that all JavaScript is blocked and you can't filter dynamically. You can download the report from the build artifacts and browse it locally (with dynamic filtering).

ricardoboss commented 4 months ago

Not sure dynamic filtering is what I need. Ideally there'd be a way to permanently exclude certain files/classes from risk hotspots.

danielpalme commented 4 months ago

Maybe in a next release.

danielpalme commented 3 months ago

The latest release 5.3.4 offers two new command line parameters:

Those two settings let you filter the risk hotspots. See also: https://reportgenerator.io/usage