facebookresearch / ClassyVision
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 823 units with 7,693 lines of code in units (56.0% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (195 lines of code)
    • 17 medium complex units (698 lines of code)
    • 40 simple units (853 lines of code)
    • 765 very simple units (5,947 lines of code)
0% | 2% | 9% | 11% | 77%
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% | 2% | 9% | 11% | 76%
js0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
classy_vision/generic0% | 22% | 1% | 5% | 69%
classy_vision/tasks0% | 0% | 36% | 13% | 50%
classy_vision/models0% | 0% | 5% | 11% | 82%
classy_vision/hooks0% | 0% | 16% | 17% | 65%
classy_vision/optim0% | 0% | 19% | 20% | 60%
classy_vision/distributed0% | 0% | 33% | 0% | 66%
classy_vision/dataset0% | 0% | 0% | 8% | 91%
ROOT0% | 0% | 0% | 87% | 12%
classy_vision/meters0% | 0% | 0% | 7% | 92%
classy_vision/losses0% | 0% | 0% | 11% | 88%
classy_vision/trainer0% | 0% | 0% | 17% | 82%
website/core0% | 0% | 0% | 0% | 100%
classy_vision/heads0% | 0% | 0% | 0% | 100%
website/pages0% | 0% | 0% | 0% | 100%
scripts0% | 0% | 0% | 0% | 100%
classy_vision/templates0% | 0% | 0% | 0% | 100%
classy_vision/hub0% | 0% | 0% | 0% | 100%
hydra_plugins/classy_vision_path0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def _layer_flops()
in classy_vision/generic/profiler.py
195 33 3
def on_phase_end()
in classy_vision/hooks/tensorboard_plot_hook.py
72 20 2
def prepare()
in classy_vision/tasks/classification_task.py
61 18 1
def set_amp_args()
in classy_vision/tasks/classification_task.py
35 15 3
def set_classy_state()
in classy_vision/tasks/classification_task.py
29 15 2
def on_phase_end()
in classy_vision/hooks/visdom_hook.py
37 14 2
def run()
in classy_vision/distributed/launch_ray.py
51 13 6
def _init_parameter()
in classy_vision/models/resnext3d.py
29 13 2
def from_config()
in classy_vision/tasks/classification_task.py
82 12 3
def step()
in classy_vision/optim/rmsprop_tf.py
48 12 2
def split_batchnorm_params()
in classy_vision/generic/util.py
17 12 1
def prepare()
in classy_vision/tasks/fine_tuning_task.py
28 11 1
def get_classy_state()
in classy_vision/tasks/classification_task.py
32 11 2
def train_step()
in classy_vision/tasks/classification_task.py
45 11 1
def from_config()
in classy_vision/optim/adamw.py
25 11 3
def from_config()
in classy_vision/optim/adam.py
25 11 3
def forward()
in classy_vision/models/efficientnet.py
17 11 3
def _parse_config()
in classy_vision/models/resnext3d.py
65 11 1
def run_optimizer()
in classy_vision/tasks/classification_task.py
24 10 2
def set_param_groups()
in classy_vision/optim/classy_optimizer.py
24 10 3