Files
codeql/cpp/ql/src/Metrics/Files/FTransitiveIncludes.qhelp
Chris Smowton 455b840712 Fix all dead qhelp links
For those documents with no obvious new home I've pointed the links to the Internet Archive.
2021-04-23 15:20:21 +01:00

39 lines
1.2 KiB
XML

<!DOCTYPE qhelp PUBLIC
"-//Semmle//qhelp//EN"
"qhelp.dtd">
<qhelp>
<overview>
<p>This metric measures the number of files that are directly or indirectly included using <code>#include</code>.</p>
<p>The value of this metric is usually directly correlated to the file's
build time: the more included files, the longer the compilation time.</p>
<p>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.</p>
</overview>
<recommendation>
<ul>
<li>Remove redundant <code>#include</code> directives</li>
<li>Use the specific header file required, if possible, rather than a high-level header that includes many other header files as well</li>
<li>Split header files that contain lots of unrelated definitions or include large unrelated header files</li>
</ul>
</recommendation>
<references>
<li>
<a href="http://www.learncpp.com/cpp-tutorial/19-header-files/">Header files</a>
</li>
<li>
<a href="http://www.drdobbs.com/cpp/decoupling-c-header-files/212701130">Decoupling C Header Files</a>
</li>
<li>
<a href="https://accu.org/journals/overload/14/72/griffiths_1995/">C++ Best Practice -
Designing Header Files</a>
</li>
</references>
</qhelp>