This metric measures the number of files that are directly or indirectly included using #include, excluding header files which are outside the main source tree (for example, system headers).

The value of this metric is usually correlated to the file's build time: the more included files, the longer the compilation time. Since we don't count system headers, however, it is also a measure of the amount of the current code base that the present file relies on.

Often, files with a large number of includes do not require most of the included definitions, so they are contributing to unnecessarily long build times and creating artificial build dependencies.

  • Header files
  • Decoupling C Header Files
  • C++ Best Practice - Designing Header Files