This post originated from an RSS feed registered with .NET Buzz
by Jonathan Cogley.
Original Post: Maintenance Complexity leads to more methods?
Feed Title: Jonathan Cogley's Blog
Feed URL: http://www.asp.net/err404.htm?aspxerrorpath=/jcogley/Rss.aspx
Feed Description: C#, Test Driven Development, Remote Scripting, CShark! :)
Mark Millertalks about a new metric he is calling Maintenance Complexity. The system assigns operators and constructs a point score representing their contributing complexity. A method is then analyzed and all the points add up to yield the Maintenance Complexity score. I like the concept but tackling a report of complex methods would probably just result in breaking them apart into more methods. Many might argue that this is a Good Thing although it really depends on how the methods are split.
It also seems that determining the complexity of a method should also take into account the parameters to the method especially if any of the parameters are out since that could indicate greater coupling and more possible side effects of the code in general.
Automated tools and reports provide a great way to home in on problems area in code (Just look at the marvels a coverage report can do for statement coverage!) - but once you find the problem areas ... how do you fix them? How does the tool/metric naturally select for simpler logic and less complexity?