facebookresearch / fvcore
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 226 units with 1,485 lines of code in units (58.3% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 6 medium complex units (169 lines of code)
    • 10 simple units (236 lines of code)
    • 210 very simple units (1,080 lines of code)
0% | 0% | 11% | 15% | 72%
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% | 11% | 15% | 72%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
fvcore/nn0% | 0% | 14% | 18% | 67%
fvcore/common0% | 0% | 15% | 9% | 75%
fvcore/transforms0% | 0% | 0% | 21% | 78%
ROOT0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def _analyze()
in fvcore/nn/jit_analysis.py
54 14 1
def _load_model()
in fvcore/common/checkpoint.py
45 14 2
def _strip_prefix_if_present()
in fvcore/common/checkpoint.py
17 13 3
def _filter_reused_missing_keys()
in fvcore/common/checkpoint.py
13 12 2
def keep_stat()
in fvcore/nn/print_model_statistics.py
13 11 1
def einsum_flop_jit()
in fvcore/nn/jit_handles.py
27 11 2
def parameter_count_table()
in fvcore/nn/parameter_count.py
34 10 2
def apply_polygons()
in fvcore/transforms/transform.py
21 10 2
def _model_stats_str()
in fvcore/nn/print_model_statistics.py
39 9 4
def apply_image()
in fvcore/transforms/transform.py
22 9 3
def _format_size()
in fvcore/nn/print_model_statistics.py
16 8 3
def fill()
in fvcore/nn/print_model_statistics.py
17 8 2
def step()
in fvcore/common/checkpoint.py
19 8 3
def __repr__()
in fvcore/transforms/transform.py
27 7 1
def _get_input_sizes()
in fvcore/nn/print_model_statistics.py
14 6 1
def decorator()
in fvcore/common/benchmark.py
27 6 2
def set_op_handle()
in fvcore/nn/jit_analysis.py
14 5 3
def _warn_uncalled_mods()
in fvcore/nn/jit_analysis.py
16 5 2
def _has_forward()
in fvcore/nn/jit_analysis.py
10 5 2
def _should_ignore_node()
in fvcore/nn/jit_analysis.py
9 5 2