April 26

Another Update to My High Score

I have a job change coming up and I thought it would be a good idea to do an update to New High Score (update)! and New High Score! posts. Since those 2 posts I've had a couple work items that required updates to that monster class. Here is what the metrics look like now.

Maintainability IndexCyclomatic ComplexityDepth of InheritanceClass CouplingLines of Source Code
5094872102660516
Code metrics covering the class in aggregate.
Maintainability IndexCyclomatic ComplexityDepth of InheritanceClass CouplingLines of Source Code
512237822
0215481180
0284221237
Code metrics covering the 3 longest methods in the class.

I'm a big believer in leaving a code base better than you found it. I had a couple work items that required me to go in and refactor this monster class a bit. As a developer I feel a lot more comfortable making these kinds of changes (i.e. Strangler Fig design pattern) when I have the proper tools such as JetBrains ReSharper. The payoff for this change was that it allowed me to write unit tests to cover the part of the class that I needed to complete the work items. When you have a code base that is this convoluted, it's nice to have a series of unit tests to proof that the changes you made to the code base work. This came in handy in a discussion with a QA guy. I was able to walk him through each one of the tests I had written. Turns out the issue was in a basic understanding of the work item the way it was written. However, my code worked correctly in the end and I could prove it.

I wasn't the only one working on this code. There were at least 2 or 3 teams making changes to this code.

Category: .NET, C#, Design Patterns | Comments Off on Another Update to My High Score