facebookresearch / mobile-vision
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 703 units with 5,278 lines of code in units (46.2% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 9 medium complex units (275 lines of code)
    • 38 simple units (661 lines of code)
    • 656 very simple units (4,342 lines of code)
0% | 0% | 5% | 12% | 82%
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% | 0% | 5% | 12% | 82%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
mobile_cv/arch/fbnet_v20% | 0% | 9% | 15% | 75%
mobile_cv/predictor0% | 0% | 18% | 0% | 81%
mobile_cv/lut/lib0% | 0% | 3% | 4% | 91%
mobile_cv/arch/utils0% | 0% | 4% | 10% | 84%
runtime_lut/code0% | 0% | 7% | 33% | 59%
mobile_cv/model_zoo/models0% | 0% | 0% | 22% | 77%
mobile_cv/model_zoo/tools0% | 0% | 0% | 9% | 90%
mobile_cv/arch/layers0% | 0% | 0% | 21% | 78%
mobile_cv/common/misc0% | 0% | 0% | 9% | 90%
mobile_cv/model_zoo/tasks0% | 0% | 0% | 0% | 100%
runtime_lut/scripts0% | 0% | 0% | 0% | 100%
mobile_cv/arch/quantization0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
mobile_cv/model_zoo/datasets0% | 0% | 0% | 0% | 100%
mobile_cv/common0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def forward()
in mobile_cv/arch/fbnet_v2/fbnet_fpn.py
20 15 2
def _init_repr_shape()
in mobile_cv/lut/lib/pt/flops_utils.py
35 13 1
def filter_kwargs()
in mobile_cv/arch/utils/helper.py
30 13 3
def forward()
in mobile_cv/arch/fbnet_v2/asymmetric_correlation.py
38 12 3
def _verify_init()
in mobile_cv/arch/fbnet_v2/fbnet_fpn.py
47 12 3
def forward()
in mobile_cv/predictor/model_wrappers.py
36 12 2
def get_ops_from_net()
in runtime_lut/code/api.py
27 12 3
def build_relu()
in mobile_cv/arch/fbnet_v2/basic_blocks.py
21 11 3
def expand_repeats()
in mobile_cv/arch/fbnet_v2/fbnet_builder.py
21 11 1
def update_dict()
in mobile_cv/arch/utils/helper.py
20 10 3
def forward()
in mobile_cv/arch/layers/batch_norm.py
50 9 2
def forward()
in mobile_cv/arch/fbnet_v2/irf_3d_block.py
15 9 2
def forward()
in mobile_cv/arch/fbnet_v2/irf_3d_block.py
15 9 2
def forward()
in mobile_cv/arch/fbnet_v2/irf_block.py
19 9 2
def _yield_obj()
in mobile_cv/common/misc/iter_utils.py
15 8 4
def _find_input_nodes()
in mobile_cv/arch/utils/fuse_utils.py
13 8 2
def forward()
in mobile_cv/arch/fbnet_v2/gb_block.py
17 8 2
def _init_conv_weight()
in mobile_cv/arch/fbnet_v2/basic_blocks.py
13 8 2
def count_strides()
in mobile_cv/arch/fbnet_v2/fbnet_builder.py
14 8 1
def forward()
in mobile_cv/arch/fbnet_v2/sg_block.py
17 8 2