Search code examples
cyclomatic-complexityklocwork

Klocwork Insight complexity for specific modules


The Insight Review allows the user to view the 15 most complex methods. I wish to see the complexity metrics for a specific C++ Visual Studio project and its component modules.

Earlier Insight user interfaces provided this. There was a directory browsing UI, that viewed metrics on any directory level down to individual files.

Please note that I do not wish to customize the reporting of the metrics. I simply wish to choose the module for the metrics view.

I am using 10.1


Solution

  • The directory type browsing still exists in the Complexity Details report, though it is maybe not very obvious. In the bottom section, in the table with the heading Full list of modules containing complexity > 20 you can click on the path component (ie. 'C:') to begin drilling down. You can also click on the bar in the graph.

    Finally, you can edit the report by clicking on the pencil icon in the top right, drill down to where you'd like the report to always show, give the report a unique name like "Complexity Details in My Code" and save it (you may need to click copy, since it's making a copy of a default report). Now you have a version of the report which is always drilled down by default to the modules you want to view.