microsoft / TSS.MSR
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 10,814 units with 60,872 lines of code in units (35.1% of code).
    • 8 very complex units (1,451 lines of code)
    • 12 complex units (1,805 lines of code)
    • 86 medium complex units (5,515 lines of code)
    • 158 simple units (5,082 lines of code)
    • 10,550 very simple units (47,019 lines of code)
2% | 2% | 9% | 8% | 77%
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
cs2% | 6% | 18% | 15% | 55%
cpp2% | 0% | 4% | 7% | 84%
ts3% | 0% | 1% | <1% | 94%
java1% | 1% | <1% | 1% | 95%
py1% | 0% | 1% | <1% | 96%
h0% | 0% | 0% | <1% | 99%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
TSS.NET/TSS.Net3% | 4% | 6% | 14% | 70%
Tpm2Tester/TestSubstrate5% | 11% | 27% | 15% | 39%
PCPTool.v11/exe90% | 0% | 0% | 0% | 9%
TSS.JS/src3% | 0% | 1% | <1% | 94%
TSS.Java/src1% | 1% | <1% | 1% | 95%
TSS.CPP/Src1% | 0% | 3% | 7% | 87%
TSS.Py/src1% | 0% | 1% | <1% | 96%
TssCodeGen/src0% | 10% | 41% | 13% | 35%
Tpm2Tester/TpmProxy0% | 0% | 58% | 0% | 41%
PCPTool.v11/dll0% | 0% | 84% | 15% | 0%
TSS.NET/TSS.Net.UWP0% | 0% | 5% | 41% | 53%
Tpm2Tester/TestSuite0% | 0% | 3% | 6% | 89%
TSS.CPP/include0% | 0% | 0% | 0% | 100%
TSS.CPP/CryptoEngine0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
static void Create()
in TSS.CPP/Src/TpmTypes.cpp
125 95 2
public static create()
in TSS.JS/src/TpmTypes.ts
138 95 2
U create()
in TSS.Java/src/tss/tpm/UnionFactory.java
136 95 2
Type UnionElementFromSelector()
in TSS.NET/TSS.Net/X_TpmDefs.cs
162 95 2
def create()
in TSS.Py/src/TpmTypes.py
98 95 2
internal bool DispatchMethod()
in TSS.NET/TSS.Net/Tpm2.cs
267 62 5
private void InitTpmParams()
in Tpm2Tester/TestSubstrate/TestFramework.cs
325 55 1
int __cdecl wmain()
in PCPTool.v11/exe/PCPTool.cpp
200 51 2
void GenStructure()
in TssCodeGen/src/CGenDotNet.cs
211 43 1
private void PrepareRequestSessions()
in TSS.NET/TSS.Net/Tpm2.cs
150 41 2
protected void DispatchCommand()
in TSS.Java/src/tss/TpmBase.java
151 35 3
internal bool RunTestSession()
in Tpm2Tester/TestSubstrate/TestFramework.cs
155 35 0
void DoFuzzDecomposedStruct()
in Tpm2Tester/TestSubstrate/TestFuzzer.cs
178 35 2
private void UpdateHandleData()
in TSS.NET/TSS.Net/Tpm2.cs
201 33 4
void GenStruct()
in TssCodeGen/src/CGenJava.cs
169 32 1
void GenStructDecl()
in TssCodeGen/src/CGenCpp.cs
139 30 1
internal void DispatchCommand()
in TSS.NET/TSS.Net/SlotManager.cs
134 28 4
private bool RunTest()
in Tpm2Tester/TestSubstrate/TestFramework.cs
84 28 4
private bool RunTestsSerially()
in Tpm2Tester/TestSubstrate/TestFramework.cs
112 26 7
List TraverseTpmStructure()
in Tpm2Tester/TestSubstrate/TestFuzzer.cs
121 26 3