tensorflow / tcav
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 99 units with 1,197 lines of code in units (82.3% of code).
    • 0 very long units (0 lines of code)
    • 3 long units (193 lines of code)
    • 15 medium size units (430 lines of code)
    • 22 small units (333 lines of code)
    • 59 very small units (241 lines of code)
0% | 16% | 35% | 27% | 20%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 16% | 35% | 27% | 20%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
tcav0% | 15% | 32% | 29% | 22%
tcav/tcav_examples/discrete0% | 32% | 20% | 23% | 23%
tcav/tcav_examples/image_models/imagenet0% | 0% | 76% | 20% | 2%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def plot_results()
in tcav/utils_plot.py
73 24 5
def _run_single_set()
in tcav/tcav.py
65 3 4
def make_concepts_targets_and_randoms()
in tcav/tcav_examples/discrete/make_kdd99_concepts.py
55 8 1
38 13 3
def make_keras_model()
in tcav/tcav_examples/discrete/kdd99_model.py
34 5 1
def print_results()
in tcav/utils.py
34 18 5
def load_images_from_files()
in tcav/activation_generator.py
32 10 7
def fetch_imagenet_class()
in tcav/tcav_examples/image_models/imagenet/imagenet_and_broden_fetcher.py
30 10 4
def _try_loading_model()
in tcav/model.py
30 5 2
def __init__()
in tcav/tcav.py
30 4 11
def download_texture_to_working_folder()
in tcav/tcav_examples/image_models/imagenet/imagenet_and_broden_fetcher.py
29 10 4
27 4 8
def process_and_load_activations()
in tcav/activation_generator.py
26 10 3
26 6 6
25 10 4
def generate_random_folders()
in tcav/tcav_examples/image_models/imagenet/imagenet_and_broden_fetcher.py
24 7 5
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 __init__()
in tcav/model.py
20 1 4
def __init__()
in tcav/model.py
20 1 4