facebookresearch / augmentation-corruption
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 533 units with 5,781 lines of code in units (79.4% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (100 lines of code)
    • 18 medium complex units (848 lines of code)
    • 34 simple units (841 lines of code)
    • 480 very simple units (3,992 lines of code)
0% | 1% | 14% | 14% | 69%
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% | 1% | 14% | 14% | 69%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
experiments/tools0% | 60% | 11% | 13% | 15%
experiments0% | 0% | 39% | 13% | 47%
experiments/overlap0% | 0% | 18% | 10% | 70%
experiments/overlap/augmentations0% | 0% | 5% | 13% | 80%
imagenet_c_bar0% | 0% | 9% | 22% | 68%
imagenet_c_bar/utils0% | 0% | 15% | 0% | 84%
notebook_utils0% | 0% | 0% | 26% | 73%
experiments/overlap/utils0% | 0% | 0% | 16% | 83%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def main()
in experiments/tools/summarize.py
100 32 0
def extract_features()
in experiments/overlap/extract_features.py
64 24 9
def calc_shifts()
in experiments/calc_distance_shifts.py
39 20 1
def train_net()
in experiments/overlap/train_net_jsd.py
80 20 15
def train_net()
in experiments/overlap/train_net.py
78 20 13
def train()
in experiments/closest_augs.py
91 17 1
def sample_matched_corruptions()
in experiments/sample_datasets.py
55 17 4
def bilinear_interpolation()
in experiments/overlap/augmentations/utils/image.py
16 17 2
def bilinear_interpolation()
in imagenet_c_bar/utils/image.py
16 17 2
def get_farthest_dataset()
in experiments/calc_distance_shifts.py
34 16 3
def transform()
in experiments/overlap/augmentations/color.py
37 16 3
def transform()
in imagenet_c_bar/corrupt.py
37 16 3
def build_sets()
in experiments/sample_datasets.py
53 15 2
def get_data()
in experiments/tools/get_target_error.py
19 12 3
def get_data()
in experiments/sample_datasets.py
19 12 3
def train()
in experiments/severity_scan_imagenet.py
84 11 2
def transform()
in experiments/overlap/augmentations/distortion.py
53 11 8
def transform()
in experiments/overlap/augmentations/blurs.py
20 11 4
def transform()
in imagenet_c_bar/corrupt.py
53 11 8
def dict_avg()
in experiments/tools/get_target_error.py
22 10 1