This metric measures the number of lines of code for each class.

Large classes can be problematic:

Classes are generally too large because they are taking on more responsibilities than they should (see [Martin] for more on responsibilities). In general, the solution is to identify each of the different responsibilities the class is taking on, and split them out into multiple classes, e.g. using the 'Extract Class' refactoring from [Fowler].

  • M. Fowler. Refactoring pp. 65, 122-5. Addison-Wesley, 1999.
  • R. Martin. The Single Responsibility Principle. Published online.