tensorflow / examples
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 491 units with 6,042 lines of code in units (75.7% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 4 medium complex units (263 lines of code)
    • 29 simple units (792 lines of code)
    • 458 very simple units (4,987 lines of code)
0% | 0% | 4% | 13% | 82%
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% | 4% | 13% | 82%
kt0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
tensorflow_examples/lite/model_maker0% | 0% | 4% | 15% | 80%
tensorflow_examples/models/densenet0% | 0% | 14% | 17% | 68%
tensorflow_examples/profiling0% | 0% | 0% | 13% | 86%
tensorflow_examples/models/nmt_with_attention0% | 0% | 0% | 0% | 100%
tensorflow_examples/models/pix2pix0% | 0% | 0% | 0% | 100%
tensorflow_examples/models/dcgan0% | 0% | 0% | 0% | 100%
lite/codelabs/digit_classifier0% | 0% | 0% | 0% | 100%
lite/tools0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def run()
in tensorflow_examples/lite/model_maker/pip_package/setup_util.py
74 14 1
def __init__()
in tensorflow_examples/models/densenet/densenet.py
79 14 14
def gen_dataset()
in tensorflow_examples/lite/model_maker/core/data_util/audio_dataloader.py
67 13 7
def from_folder()
in tensorflow_examples/lite/model_maker/core/data_util/text_dataloader.py
43 12 7
def input_fn()
in tensorflow_examples/profiling/imagenet_preprocessing_ineffecient_input_pipeline.py
38 10 12
def _get_label_map()
in tensorflow_examples/lite/model_maker/core/data_util/object_detector_dataloader.py
21 10 1
def run()
in tensorflow_examples/lite/model_maker/core/task/model_util.py
29 10 2
def __init__()
in tensorflow_examples/lite/model_maker/core/task/model_spec/object_detector_spec.py
75 10 10
def from_folder()
in tensorflow_examples/lite/model_maker/core/data_util/image_dataloader.py
29 9 3
def write_packages()
in tensorflow_examples/lite/model_maker/core/api/api_util.py
28 9 9
def evaluate_tflite()
in tensorflow_examples/lite/model_maker/core/task/recommendation.py
22 9 3
def _setup_layer_v1()
in tensorflow_examples/lite/model_maker/core/task/hub_loader.py
32 9 3
def process_record_dataset()
in tensorflow_examples/profiling/imagenet_preprocessing_ineffecient_input_pipeline.py
27 8 10
def write_files()
in tensorflow_examples/lite/model_maker/core/data_util/object_detector_dataloader_util.py
30 8 4
def evaluate()
in tensorflow_examples/lite/model_maker/core/task/model_spec/text_spec.py
36 8 13
def calc_from_list()
in tensorflow_examples/models/densenet/densenet.py
9 8 3
def get_converter_with_quantization()
in tensorflow_examples/lite/model_maker/core/task/configs.py
18 7 3
def _prepare_nightly()
in tensorflow_examples/lite/model_maker/pip_package/setup_util.py
16 6 1
def _group_csv_lines()
in tensorflow_examples/lite/model_maker/core/data_util/object_detector_dataloader.py
17 6 5
def _generate_fake_data()
in tensorflow_examples/lite/model_maker/core/data_util/recommendation_testutil.py
19 6 1