microsoft / dpu-utils
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 434 units with 4,308 lines of code in units (78.5% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (129 lines of code)
    • 8 medium complex units (422 lines of code)
    • 42 simple units (1,038 lines of code)
    • 383 very simple units (2,719 lines of code)
0% | 2% | 9% | 24% | 63%
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
py0% | 6% | 11% | 23% | 58%
cs0% | 0% | 8% | 24% | 67%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
python/dpu_utils/ptutils0% | 43% | 0% | 5% | 51%
python/dpu_utils/tfmodels0% | 0% | 43% | 46% | 9%
dotnet/CSharpSourceGraphExtraction/Utils0% | 0% | 23% | 42% | 34%
dotnet/CSharpSourceGraphExtraction/GraphBuilders0% | 0% | 11% | 15% | 72%
python/dpu_utils/utils0% | 0% | 8% | 13% | 77%
python/dpu_utils/codeutils0% | 0% | 9% | 43% | 46%
dotnet/Utils0% | 0% | 0% | 22% | 77%
dotnet/CSharpSourceGraphExtraction0% | 0% | 0% | 20% | 79%
python/dpu_utils/tfutils0% | 0% | 0% | 46% | 53%
python/dpu_utils/mlutils0% | 0% | 0% | 19% | 80%
python/dpu_utils/tf2utils0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def train()
in python/dpu_utils/ptutils/componenttrainer.py
129 26 12
public static void AddDataFlowEdges()
in dotnet/CSharpSourceGraphExtraction/GraphBuilders/DataFlowGraphBuilder.cs
76 23 4
def sparse_gnn_layer()
in python/dpu_utils/tfmodels/sparsegnn.py
95 20 8
public void Add()
in dotnet/CSharpSourceGraphExtraction/Utils/TypeHierarchy.cs
51 15 1
public static()
in dotnet/CSharpSourceGraphExtraction/Utils/MethodUtils.cs
57 13 3
def read_by_file_suffix()
in python/dpu_utils/utils/richpath.py
14 13 1
def create()
in python/dpu_utils/utils/richpath.py
51 12 2
def get_code_in_range()
in python/dpu_utils/codeutils/text.py
23 11 5
def __init__()
in python/dpu_utils/tfmodels/sparsegnn.py
55 11 3
public override void Visit()
in dotnet/CSharpSourceGraphExtraction/Utils/RoslynUtils.cs
15 10 1
def async_ggnn_layer()
in python/dpu_utils/tfmodels/asyncgnn.py
103 10 8
def __cache_file_locally()
in python/dpu_utils/utils/richpath.py
31 10 2
public static ISymbol GetTokenSymbolReference()
in dotnet/CSharpSourceGraphExtraction/Utils/RoslynUtils.cs
24 9 2
public static bool GetTypeSymbol()
in dotnet/CSharpSourceGraphExtraction/Utils/RoslynUtils.cs
19 9 2
def tokenize()
in python/dpu_utils/mlutils/bpevocabulary.py
17 9 2
def get_activation()
in python/dpu_utils/tfutils/activation.py
23 9 1
def pick_indices_from_probs()
in python/dpu_utils/tfutils/pick_indices.py
22 9 4
public override void VisitInvocationExpression()
in dotnet/CSharpSourceGraphExtraction/MethodUseInformationCollector.cs
37 8 1
public static IEnumerable GetAvailableValueSymbols()
in dotnet/CSharpSourceGraphExtraction/Utils/RoslynUtils.cs
33 8 2
def get_language_keywords()
in python/dpu_utils/codeutils/keywords/keywordlist.py
10 8 1