A method that contains a high number of lines of code has a number of problems:

Break up long methods into smaller methods by extracting parts of their functionality into simpler methods, for example by using the 'Extract Method' refactoring from [Fowler]. As an approximate guide, a method should fit on one screen or side of Letter/A4 paper.

  • M. Fowler, Refactoring, pp. 89-95. Addison-Wesley, 1999.