High-MCC functions in the Linux kernel

Ahmad Jbara, Adam Matan, Dror G. Feitelson

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

Abstract

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 attempt 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.

Original languageEnglish
Title of host publication2012 20th IEEE International Conference on Program Comprehension, ICPC 2012 - Proceedings
Pages83-92
Number of pages10
DOIs
StatePublished - 2012
Event2012 20th IEEE International Conference on Program Comprehension, ICPC 2012 - Passau, Germany
Duration: 11 Jun 201213 Jun 2012

Publication series

NameIEEE International Conference on Program Comprehension

Conference

Conference2012 20th IEEE International Conference on Program Comprehension, ICPC 2012
Country/TerritoryGermany
CityPassau
Period11/06/1213/06/12

Keywords

  • Linux Kernel
  • McCabe Cyclomatic Complexity
  • Software Complexity

All Science Journal Classification (ASJC) codes

  • Hardware and Architecture
  • Software

Fingerprint

Dive into the research topics of 'High-MCC functions in the Linux kernel'. Together they form a unique fingerprint.

Cite this