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 Index | Cyclomatic Complexity | Depth of Inheritance | Class Coupling | Lines of Source Code |
50 | 9487 | 2 | 1026 | 60516 |
Maintainability Index | Cyclomatic Complexity | Depth of Inheritance | Class Coupling | Lines of Source Code |
5 | 122 | 37 | 822 | |
0 | 215 | 48 | 1180 | |
0 | 284 | 22 | 1237 |
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.