colinramsay.co.uk

Code Metrics - Controller Methods

22 Oct 2007

Just a quick one: I have a method in my controller which is about 30 lines long, and also calls another private method in that class which is about 15 lines long. The main method is 50% comments. The private method is only that long due to the formatting of parameters in a constructor and was extracted from the main method for readability; it's not reused. So my question to you is: when does excessive method length start to become a code smell? Does this situation sound like it's ripe for refactoring? What sort of thing makes you shudder when you open a class file?

Feedback or questions on this post? Create an issue on GitHub.