This metric measures the number of files that are directly included using #include.

Files with lots of #include directives often either have too many responsibilities or not all of the directives are needed. In the former case, the file may be hard to comprehend and maintain; the latter causes build-times to be unnecessarily long.

Split and/or refactor files with too many responsibilities, and remove any unnecessary #include directives.

  • M. Fowler. Refactoring. Addison-Wesley, 1999.
  • Wikipedia: Code refactoring
  • Refactoring as Meta Programming?