The blog has moved to a new address. The blog is now located at

Monday, July 23, 2007

Cyclomatic complexity measurement tool

ccm is a tool that analyzes C/C++ and C# code and reports back on Cyclomatic Complexity.Cyclomatic complexity is computed using a graph that describes the control flow of the program. The nodes of the graph correspond to the function of a program. A directed edge connects two nodes if the second function might be executed immediately after the first function. This technique is useful to determine how complex the function of code is.

ccm is a command line tool that accepts the path to directory you want to analyze. Using an /XML switch it will output the result as XML, making it easy to integrate with other tools, such as CruiseControl.NET, etc.



Running ccm without any parameters tells you about the available switches.

Missing parameters.

 ccm directory [/r] [/xml] [/n:x] [/e:folderlist] [/v]
     r            - act recursively on folders
     xml          - output into xml
     n:x          - list n-number of metrics (defaults to 30)
     v            - verbose
     e:folderlist - comma-separated list of folders or paths to exclude

ccm.exe ..\..\relativepath-to-sources /n:15

Download ccm


Anonymous said...

Thanks, nice tool. A GUI would be an added advantage.


Taras said...

Yes .I think so .As I know in new Visual Studio Team Edition(Orcas) we should get something similar with UI.

Anonymous said...

You know... even one example of how to use the tool here would be just a really nice thing. ;-)

Taras said...


Anonymous said...

Are you going to open-source the code base?

Taras said...

No ,I'm not author of this tool .You may find the contact information on url that I provided in my post.

RashGinger said...

i m not able to run the code plz can u guide me how to pass the arguments

Anonymous said...

I only get "Access to the path [MY_PATH] is denied."
I tried copying the directory next to the exe, and shortening the paths, nothing works. (XP/SP3 here, code checked out using SVN)