microsoft / DirectML
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 1,301 units with 16,014 lines of code in units (63.6% of code).
    • 5 very complex units (951 lines of code)
    • 9 complex units (729 lines of code)
    • 49 medium complex units (2,303 lines of code)
    • 78 simple units (1,876 lines of code)
    • 1,160 very simple units (10,155 lines of code)
5% | 4% | 14% | 11% | 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
py7% | 6% | 14% | 17% | 54%
cpp9% | <1% | 20% | 11% | 57%
h0% | 5% | 7% | 3% | 83%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
PyTorch/yolov314% | 8% | 20% | 21% | 35%
DxDispatch/src11% | 1% | 16% | 11% | 59%
Python/src0% | 8% | 11% | 2% | 77%
TensorFlow/yolov30% | 18% | 0% | 7% | 74%
Libraries0% | 0% | 13% | 5% | 80%
TensorFlow/squeezenet0% | 0% | 11% | 14% | 74%
PyTorch/classification0% | 0% | 36% | 26% | 36%
Python0% | 0% | 0% | 64% | 35%
TensorFlow/VisionTransformer0% | 0% | 0% | 0% | 100%
PyTorch/torchvision_classification0% | 0% | 0% | 0% | 100%
PyTorch/resnet500% | 0% | 0% | 0% | 100%
PyTorch/squeezenet0% | 0% | 0% | 0% | 100%
PyTorch/data0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
DML_OPERATOR_TYPE ParseDmlOperatorType()
in DxDispatch/src/model/JsonParsersGenerated.cpp
162 308 1
DXGI_FORMAT ParseDxgiFormat()
in DxDispatch/src/model/JsonParsers.cpp
125 234 1
Model::DmlDispatchableDesc::BindPoints GetBindPoints()
in DxDispatch/src/model/JsonParsersGenerated.cpp
163 157 1
def train()
in PyTorch/yolov3/train.py
301 130 4
def test()
in PyTorch/yolov3/test.py
200 89 13
def detect()
in PyTorch/yolov3/detect.py
96 40 1
def main()
in TensorFlow/yolov3/train.py
170 40 1
def __init__()
in PyTorch/yolov3/utils/datasets.py
86 32 13
129 30 2
DML_TENSOR_DATA_TYPE ParseDmlTensorDataType()
in DxDispatch/src/model/JsonParsersGenerated.cpp
21 26 1
DML_REDUCE_FUNCTION ParseDmlReduceFunction()
in DxDispatch/src/model/JsonParsersGenerated.cpp
21 26 1
def parse_model()
in PyTorch/yolov3/models/yolo.py
48 26 2
def plot_images()
in PyTorch/yolov3/utils/plots.py
58 26 7
100 26 4
static void ParseDmlScalarUnion()
in DxDispatch/src/model/JsonParsers.cpp
41 23 3
inline GRUOutputs GRU()
in Libraries/DirectMLX.h
102 23 10
def forward()
in PyTorch/yolov3/models/common.py
37 20 5
void HlslDispatchable::Bind()
in DxDispatch/src/dxdispatch/HlslDispatchable.cpp
118 19 1
def non_max_suppression()
in PyTorch/yolov3/utils/general.py
55 19 7
def _run()
in TensorFlow/squeezenet/src/train_squeezenet.py
130 19 1