tensorflow / tcav
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 99 units with 1,197 lines of code in units (82.3% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 3 medium complex units (145 lines of code)
    • 13 simple units (344 lines of code)
    • 83 very simple units (708 lines of code)
0% | 0% | 12% | 28% | 59%
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% | 12% | 28% | 59%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
tcav0% | 0% | 16% | 18% | 64%
tcav/tcav_examples/image_models/imagenet0% | 0% | 0% | 87% | 12%
tcav/tcav_examples/discrete0% | 0% | 0% | 32% | 67%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def plot_results()
in tcav/utils_plot.py
73 24 5
def print_results()
in tcav/utils.py
34 18 5
38 13 3
def fetch_imagenet_class()
in tcav/tcav_examples/image_models/imagenet/imagenet_and_broden_fetcher.py
30 10 4
def download_texture_to_working_folder()
in tcav/tcav_examples/image_models/imagenet/imagenet_and_broden_fetcher.py
29 10 4
def process_and_load_activations()
in tcav/activation_generator.py
26 10 3
def load_images_from_files()
in tcav/activation_generator.py
32 10 7
25 10 4
def make_concepts_targets_and_randoms()
in tcav/tcav_examples/discrete/make_kdd99_concepts.py
55 8 1
def generate_random_folders()
in tcav/tcav_examples/image_models/imagenet/imagenet_and_broden_fetcher.py
24 7 5
def load_image_from_file()
in tcav/activation_generator.py
20 7 3
def run()
in tcav/tcav.py
23 7 5
def make_concepts_targets_and_randoms()
in tcav/tcav_examples/image_models/imagenet/download_and_make_datasets.py
22 6 3
def download_image()
in tcav/tcav_examples/image_models/imagenet/imagenet_and_broden_fetcher.py
15 6 2
def train()
in tcav/cav.py
17 6 2
26 6 6
def make_keras_model()
in tcav/tcav_examples/discrete/kdd99_model.py
34 5 1
def __init__()
in tcav/model.py
11 5 3
def _try_loading_model()
in tcav/model.py
30 5 2
11 5 2