microsoft / mu_basecore
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 6,633 units with 116,868 lines of code in units (12.1% of code).
    • 70 very complex units (22,658 lines of code)
    • 152 complex units (15,707 lines of code)
    • 563 medium complex units (26,279 lines of code)
    • 687 simple units (16,650 lines of code)
    • 5,161 very simple units (35,574 lines of code)
19% | 13% | 22% | 14% | 30%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
py21% | 13% | 23% | 13% | 26%
c7% | 12% | 16% | 16% | 46%
pyw0% | 0% | 27% | 35% | 37%
h0% | 0% | 10% | 18% | 70%
cpp0% | 0% | 0% | 35% | 64%
pl0% | 0% | 0% | 100% | 0%
nsh0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
BaseTools20% | 13% | 22% | 14% | 29%
MdeModulePkg0% | 25% | 22% | 25% | 26%
CryptoPkg0% | 30% | 12% | 19% | 37%
StandaloneMmPkg0% | 0% | 100% | 0% | 0%
NetworkPkg0% | 0% | 9% | 28% | 62%
MdePkg0% | 0% | 0% | 0% | 100%
ShellPkg0% | 0% | 0% | 0% | 100%
UefiCpuPkg0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def macro_statement()
in BaseTools/Source/Python/Ecc/CParser3/CParser.py
2094 1466 1
def macro_statement()
in BaseTools/Source/Python/Eot/CParser3/CParser.py
2094 1466 1
def assignment_expression()
in BaseTools/Source/Python/Ecc/CParser3/CParser.py
1526 802 1
def assignment_expression()
in BaseTools/Source/Python/Eot/CParser3/CParser.py
1526 802 1
def compound_statement()
in BaseTools/Source/Python/Ecc/CParser3/CParser.py
1126 763 1
def compound_statement()
in BaseTools/Source/Python/Eot/CParser3/CParser.py
1126 763 1
def statement_list()
in BaseTools/Source/Python/Ecc/CParser3/CParser.py
993 715 1
def statement_list()
in BaseTools/Source/Python/Eot/CParser3/CParser.py
993 715 1
def direct_declarator()
in BaseTools/Source/Python/Ecc/CParser3/CParser.py
346 196 1
def direct_declarator()
in BaseTools/Source/Python/Eot/CParser3/CParser.py
346 196 1
def statement()
in BaseTools/Source/Python/Ecc/CParser3/CParser.py
174 178 1
def statement()
in BaseTools/Source/Python/Eot/CParser3/CParser.py
174 178 1
def direct_abstract_declarator()
in BaseTools/Source/Python/Ecc/CParser3/CParser.py
209 141 1
def direct_abstract_declarator()
in BaseTools/Source/Python/Eot/CParser3/CParser.py
209 141 1
def GenerateReportDetail()
in BaseTools/Source/Python/build/BuildReport.py
266 122 5
def function_definition()
in BaseTools/Source/Python/Ecc/CParser3/CParser.py
193 118 1
def function_definition()
in BaseTools/Source/Python/Eot/CParser3/CParser.py
193 118 1
def CreateAsBuiltInf()
in BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
288 117 1
def parameter_declaration()
in BaseTools/Source/Python/Ecc/CParser3/CParser.py
136 113 1
def parameter_declaration()
in BaseTools/Source/Python/Eot/CParser3/CParser.py
136 113 1