This project has moved. For the latest updates, please go here.

Ability to generate report with High Cyclomatic Complexity

Dec 12, 2014 at 1:40 PM
Is it possible to generate a report with methods with high Cyclomatic Complexity?

If not, could this feature be added?
Coordinator
Dec 12, 2014 at 2:34 PM
Can you explain what you want to do?
Where should Cyclomatic Complexity come from?

Should ReportGenerator calculate this metric for each class?
Dec 12, 2014 at 5:12 PM
Edited Dec 12, 2014 at 5:13 PM
Currently when the report is generated there are several metrics available, such as Cyclomatic Complexity, for a class when you click in to the class view. I am wondering simply if there is a method to generate these metrics for all classes and place them in a html page.
Coordinator
Dec 12, 2014 at 9:53 PM
Ok, now I understand.

Yes this is possible by writing a custom report.
If you like I can provide you a sample plugin.

If you want to try it yourself start here:
https://reportgenerator.codeplex.com/wikipage?title=Custom%20reports
Coordinator
Dec 15, 2014 at 10:10 AM
Edited Mar 16, 2015 at 11:06 AM
I created a plugin for ReportGenerator that shows the Cyclomatic Complexity in the summary report for each class.
https://www.codeplex.com/Download?ProjectName=reportgenerator&DownloadId=1439066

Please drop the DLL "bin/ReportGenerator.CyclomaticComplexityReport.dll" into your ReportGenerator directory.

Then use one of the following report types: CCHtml, CCHtmlSummary, CCTextSummary
E.g. ReportGenerator.exe -reporttypes:CCHTML -reports:MyOpenCoverReport.xml -tartgetdir:MyTargetDirectory

The archive also contains the source code of the plugin.
Marked as answer by kamran102 on 12/15/2014 at 6:17 AM
Dec 15, 2014 at 1:42 PM
Thanks Daniel, for the guideline and the sample code.

I can certainly work with this.
Mar 16, 2015 at 10:39 AM
Hi daniel,

I tries using the report u ve posted below and i am unable to make it works :(
i always get:
"Unknown report type 'CCHtmlSummary'."
Using following commandLine
ReportGenerator.exe -reporttype:CCHtml -reports:_CodeCoverageResult.xml -targetdir:CCReport

I only dropped the dll into reportGenerator installation directory.
Could u tell me where i am wrong?

Thx
Coordinator
Mar 16, 2015 at 10:42 AM
Edited Mar 16, 2015 at 10:43 AM
Probably just a typo, please try:
ReportGenerator.exe -reporttypes:CCHtml -reports:_CodeCoverageResult.xml -targetdir:CCReport
Mar 16, 2015 at 10:47 AM
Edited Mar 16, 2015 at 10:51 AM
same thing :(
ReportGenerator.exe -reporttypes:CCHtml -reports:_CodeCoverageResult.xml -targetdir:CCReport
-> Unknown report type 'CCHtml'.
Coordinator
Mar 16, 2015 at 11:07 AM
Please use this updated version:
https://www.codeplex.com/Download?ProjectName=reportgenerator&DownloadId=1439066

The old plugin was only compatible with ReportGenerator versions <2.1
Mar 16, 2015 at 11:35 AM
Unable to download :(
Coordinator
Mar 16, 2015 at 12:06 PM
The download works fine for me. I tried several browsers successfully.
Mar 16, 2015 at 2:06 PM
download works fine now & CC report aswell
Thx dude :)