Monday, April 23, 2012

DevExpress Complexity (Maintenance & Cyclomatic

I have been using DecExpress’s CodeRush tools a lot recently. One of the many great features COdeRush gives you is inline Cyclomatic and Maintenance complexity scores of your classes and methods.


The challenge is to remember how those scores rank so you know when you should start refactoring your methods. I found a great post here that I wanted to move over to my own blog just to make sure I could find it again and have it handy. There is also a PDF reference to all this info.

Here is my summary of the key things (in case the other post goes away):

Cyclomatic Complexity

Probably the simplest measure of complexity. CC is the number of decision points for a method plus one. It also happens to represent the minimum number of test cases needed to travel through all branches of a method.


Maintenance Complexity

The purpose of Maintenance Complexity is to give you a picture of how much code you have in a given member.