Posted by Anuraj on Wednesday, July 4, 2018 Reading time :1 minute
While implementing CI for one of the project, I implemented code quality check using
Resharper Code Quality Analysis task. This task can fail the build, but this task will not generate a report. Since this task is internally using
Inspectcode.exe, it will be able to generate the output XML file. In this post, I am writing a simple PowerShell script, which can be used as task, which will generate html report.
So first you need to include the Resharper Code Quality Analysis task in your build pipeline. I am using a Desktop application, so I am building the solution, copying the files to artifacts directory. Then I am running the code quality check.
By default this task won’t create the report xml file. So you need to configure it. You can do it by clicking on the task, select
Advanced Options, and set the
Results output file path property.
Set it to
Next you need to add a PowerShell task. Select the
Inline type. And add following code in the Script textbox.
So in this script, I am checking for a XSLT file in the artifacts directory and if not found downloading it from GitHub. Then I am loading the XSLT and transforming it to HTML using
Here is the report is generated via this task.
I have one more task added, which will send an email with report as attachment to the development team. You can do this using email notification tasks or using PowerShell.
Happy Programming :)
What do you think? I would like to hear your thoughts, suggestions, and questions in the comments section below.