Ludwig
Conditional Complexity

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 1,089 units with 10,573 lines of code in units (44.6% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (56 lines of code)
    • 7 medium complex units (324 lines of code)
    • 30 simple units (758 lines of code)
    • 1,051 very simple units (9,435 lines of code)
0% | <1% | 3% | 7% | 89%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
py0% | <1% | 3% | 7% | 89%
Legend:
51+
26-50
11-25
6-10
1-5
Conditional Complexity per Logical Component
primary logical decomposition
ludwig/decoders0% | 21% | 6% | 18% | 52%
ludwig/utils0% | 0% | 6% | 9% | 83%
ludwig/encoders0% | 0% | 10% | 0% | 89%
ludwig/models0% | 0% | 5% | 7% | 86%
ludwig/features0% | 0% | 0% | 12% | 87%
ludwig/data0% | 0% | 0% | 18% | 81%
ludwig/contribs0% | 0% | 0% | 28% | 71%
ludwig/hyperopt0% | 0% | 0% | 8% | 91%
ludwig0% | 0% | 0% | 1% | 98%
ludwig/combiners0% | 0% | 0% | 0% | 100%
ludwig/modules0% | 0% | 0% | 0% | 100%
Legend:
51+
26-50
11-25
6-10
1-5
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
def prepare_encoder_output_state()
in ludwig/decoders/sequence_decoders.py
56 34 2
def initialize_tensorflow()
in ludwig/utils/tf_utils.py
47 22 4
def __init__()
in ludwig/encoders/sequence_encoders.py
115 15 31
def get_experiment_description()
in ludwig/utils/misc_utils.py
49 13 11
def __init__()
in ludwig/utils/metrics_utils.py
23 12 5
def merge_with_defaults()
in ludwig/utils/defaults.py
45 11 1
def call()
in ludwig/models/ecd.py
28 11 4
def build_decoder_initial_state()
in ludwig/decoders/sequence_decoders.py
17 11 4
def postprocess_for_neuropod()
in ludwig/utils/neuropod_utils.py
69 10 2
def print_test_results()
in ludwig/predict.py
18 9 1
def train_epoch_end()
in ludwig/contribs/comet.py
25 9 2
def next_batch()
in ludwig/utils/batcher.py
31 9 1
def predictions()
in ludwig/models/ecd.py
38 9 3
def _get_2D_feature()
in ludwig/features/audio_feature.py
38 8 4
def load_glove()
in ludwig/utils/data_utils.py
32 8 1
def generate_image()
in ludwig/data/dataset_synthesizer.py
30 8 1
def use_contrib()
in ludwig/contrib.py
10 7 3
def save_hdf5()
in ludwig/utils/data_utils.py
15 7 3
def load_pretrained_embeddings()
in ludwig/utils/data_utils.py
22 7 2
def is_model_dir()
in ludwig/utils/data_utils.py
14 7 1
def extract_sequence_probabilities()
in ludwig/decoders/sequence_decoders.py
49 7 3
def handle_missing_values()
in ludwig/data/preprocessing.py
27 7 3
def replace_text_feature_level()
in ludwig/data/preprocessing.py
17 7 2
def __init__()
in ludwig/hyperopt/sampling.py
20 7 6
def __init__()
in ludwig/hyperopt/sampling.py
19 7 6
def call()
in ludwig/features/category_feature.py
11 6 4
def should_regularize()
in ludwig/features/feature_utils.py
8 6 1
def overwrite_defaults()
in ludwig/features/base_feature.py
11 6 2
def __init__()
in ludwig/features/base_feature.py
45 6 4
def concat_dependencies()
in ludwig/features/base_feature.py
60 6 3
def _read_audio_and_transform_to_feature()
in ludwig/features/audio_feature.py
40 6 7
def import_call()
in ludwig/contribs/comet.py
15 6 2
def train_model()
in ludwig/contribs/comet.py
15 6 6
def topological_sort()
in ludwig/utils/algorithms_utils.py
18 6 1
def topological_sort_feature_dependencies()
in ludwig/utils/algorithms_utils.py
13 6 1
def sum_dicts()
in ludwig/utils/misc_utils.py
16 6 2
def default()
in ludwig/utils/data_utils.py
13 6 2
def get()
in ludwig/data/dataset.py
19 6 3
def call()
in ludwig/features/text_feature.py
15 5 4
def update_metrics()
in ludwig/features/sequence_feature.py
8 5 3
def _get_feature_dim()
in ludwig/features/audio_feature.py
17 5 2
def server()
in ludwig/serve.py
27 5 1
def resize_image()
in ludwig/utils/image_utils.py
19 5 3
def int_type()
in ludwig/utils/math_utils.py
9 5 1
def load_nlp_pipeline()
in ludwig/utils/nlp_utils.py
40 5 1
def strdelta()
in ludwig/utils/time_utils.py
16 5 1
def merge_dict()
in ludwig/utils/misc_utils.py
9 5 2
def _preprocess_to_padded_matrix()
in ludwig/utils/audio_utils.py
18 5 4
def shuffle_unison_inplace()
in ludwig/utils/data_utils.py
9 5 2
def shuffle_inplace()
in ludwig/utils/data_utils.py
11 5 1