High-MCC Functions in the Linux Kernel

Ahmad Jbara, Adam Matan, Dror G. Feitelson
<span title="2013-09-12">2013</span> <i title="Springer Nature"> <a target="_blank" rel="noopener" href="https://fatcat.wiki/container/73dwwe6bxbfctibeikedgeom3m" style="color: black;">Empirical Software Engineering</a> </i> &nbsp;
McCabe's Cyclomatic Complexity (MCC) is a widely used metric for the complexity of control flow. Common usage decrees that functions should not have an MCC above 50, and preferably much less. However, the Linux kernel includes more than 800 functions with MCC values above 50, and over the years 369 functions have had an MCC of 100 or more. Moreover, some of these functions undergo extensive evolution, indicating that developers are successful in coping with the supposed high complexity. We
more &raquo; ... pt to explain this by analyzing the structure of such functions and showing that in many cases they are in fact well-structured. At the same time, we observe cases where developers indeed refactor the code in order to reduce complexity. These observations indicate that a high MCC is not necessarily an impediment to code comprehension, and support the notion that complexity cannot be fully captured using simple syntactic code metrics.
<span class="external-identifiers"> <a target="_blank" rel="external noopener noreferrer" href="https://doi.org/10.1007/s10664-013-9275-7">doi:10.1007/s10664-013-9275-7</a> <a target="_blank" rel="external noopener" href="https://fatcat.wiki/release/3h2vmcbbtbca7cehlzon37llze">fatcat:3h2vmcbbtbca7cehlzon37llze</a> </span>
<a target="_blank" rel="noopener" href="https://web.archive.org/web/20131017210926/http://www.cs.huji.ac.il/~feit/papers/MCC12ICPC.pdf" title="fulltext PDF download" data-goatcounter-click="serp-fulltext" data-goatcounter-title="serp-fulltext"> <button class="ui simple right pointing dropdown compact black labeled icon button serp-button"> <i class="icon ia-icon"></i> Web Archive [PDF] <div class="menu fulltext-thumbnail"> <img src="https://blobs.fatcat.wiki/thumbnail/pdf/df/02/df0284db244b1aa47db0582a38427505437877b9.180px.jpg" alt="fulltext thumbnail" loading="lazy"> </div> </button> </a> <a target="_blank" rel="external noopener noreferrer" href="https://doi.org/10.1007/s10664-013-9275-7"> <button class="ui left aligned compact blue labeled icon button serp-button"> <i class="external alternate icon"></i> springer.com </button> </a>