facebookresearch / ppuda
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 192 units with 3,673 lines of code in units (88.9% of code).
    • 0 very complex units (0 lines of code)
    • 9 complex units (843 lines of code)
    • 27 medium complex units (1,210 lines of code)
    • 26 simple units (638 lines of code)
    • 130 very simple units (982 lines of code)
0% | 22% | 32% | 17% | 26%
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% | 22% | 32% | 17% | 26%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ppuda/deepnets1m0% | 30% | 29% | 14% | 25%
experiments0% | 49% | 45% | 0% | 5%
ppuda/ghn0% | 29% | 21% | 25% | 22%
ppuda0% | 100% | 0% | 0% | 0%
experiments/sgd/detector0% | 0% | 29% | 29% | 41%
ppuda/utils0% | 0% | 51% | 12% | 36%
ppuda/vision0% | 0% | 45% | 22% | 32%
experiments/sgd0% | 0% | 100% | 0% | 0%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def forward()
in ppuda/ghn/nn.py
94 46 6
def main()
in experiments/net_generator.py
196 41 0
def _build_graph()
in ppuda/deepnets1m/graph.py
90 40 1
def __init__()
in ppuda/deepnets1m/net.py
105 39 18
def init_config()
in ppuda/config.py
122 31 1
def forward()
in ppuda/deepnets1m/net.py
39 28 4
def _construct_features()
in ppuda/deepnets1m/graph.py
68 27 1
def visualize()
in ppuda/deepnets1m/graph.py
73 27 8
def _map_net_params()
in ppuda/ghn/nn.py
56 26 4
def _filter_graph()
in ppuda/deepnets1m/graph.py
41 25 1
def forward()
in ppuda/ghn/layers.py
37 23 4
def __getitem__()
in ppuda/deepnets1m/loader.py
39 21 2
def _init_graph()
in ppuda/deepnets1m/loader.py
55 21 4
def update()
in ppuda/utils/trainer.py
63 21 6
def main()
in experiments/train_ghn.py
103 20 0
def loadRes()
in experiments/sgd/detector/coco_eval.py
49 20 2
def _coco_remove_images_without_annotations()
in experiments/sgd/detector/coco_utils.py
27 20 2
def sample_genotype()
in ppuda/deepnets1m/genotypes.py
65 19 5
def adjust_net()
in ppuda/utils/utils.py
48 18 2
def forward()
in ppuda/ghn/gatedgnn.py
37 17 4