facebookresearch / dlrm
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 175 units with 4,185 lines of code in units (61.2% of code).
    • 1 very complex units (788 lines of code)
    • 3 complex units (324 lines of code)
    • 20 medium complex units (728 lines of code)
    • 25 simple units (742 lines of code)
    • 126 very simple units (1,603 lines of code)
18% | 7% | 17% | 17% | 38%
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
py18% | 7% | 17% | 17% | 38%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT23% | 9% | 17% | 15% | 34%
tools0% | 0% | 15% | 23% | 60%
optim0% | 0% | 65% | 24% | 10%
tricks0% | 0% | 0% | 41% | 58%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def run()
in dlrm_s_pytorch.py
788 132 0
def adagrad_optimizer()
in dlrm_s_caffe2.py
129 33 8
def init_distributed()
in extend_distributed.py
122 33 5
def sgd_optimizer()
in dlrm_s_caffe2.py
73 31 5
def parallel_forward()
in dlrm_s_pytorch.py
62 25 4
def __getitem__()
in dlrm_data_pytorch.py
30 17 2
def __getitem__()
in dlrm_data_caffe2.py
26 16 2
def create_emb()
in dlrm_s_caffe2.py
70 15 5
def plot_one_class_3()
in tools/visualize.py
32 14 13
def create_input()
in dlrm_s_caffe2.py
24 14 5
def visualize_embeddings_umap()
in tools/visualize.py
60 13 6
def AddLayerWrapper()
in dlrm_s_caffe2.py
35 13 7
14 13 3
def FeedBlobWrapper()
in dlrm_s_caffe2.py
25 12 6
def step()
in optim/rwsadagrad.py
49 12 2
34 12 6
def trace_profile()
in dlrm_data_caffe2.py
24 12 2
def __getitem__()
in dlrm_data_pytorch.py
39 12 2
def trace_profile()
in dlrm_data_pytorch.py
24 12 2
def create_mlp()
in dlrm_s_caffe2.py
45 11 5