Ludwig
Unit Size

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 1,089 units with 10,573 lines of code in units (44.6% of code).
    • 6 very long units (1,058 lines of code)
    • 7 long units (452 lines of code)
    • 80 medium size units (2,520 lines of code)
    • 157 small units (2,276 lines of code)
    • 839 very small units (4,267 lines of code)
10% | 4% | 23% | 21% | 40%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
py10% | 4% | 23% | 21% | 40%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Logical Component
primary logical decomposition
ludwig42% | 7% | 16% | 6% | 26%
ludwig/encoders10% | 0% | 37% | 25% | 26%
ludwig/features0% | 6% | 24% | 17% | 51%
ludwig/utils0% | 2% | 19% | 18% | 59%
ludwig/decoders0% | 21% | 18% | 30% | 29%
ludwig/modules0% | 4% | 26% | 38% | 30%
ludwig/hyperopt0% | 0% | 44% | 23% | 31%
ludwig/data0% | 0% | 29% | 33% | 36%
ludwig/models0% | 0% | 25% | 35% | 38%
ludwig/contribs0% | 0% | 13% | 59% | 27%
ludwig/combiners0% | 0% | 0% | 33% | 66%
Legend:
101+
51-100
21-50
11-20
1-10
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
def cli()
in ludwig/experiment.py
248 3 1
def cli()
in ludwig/train.py
206 2 1
def cli()
in ludwig/hyperopt_cli.py
194 2 1
def cli()
in ludwig/visualize.py
169 2 1
def cli()
in ludwig/predict.py
126 2 1
def __init__()
in ludwig/encoders/sequence_encoders.py
115 15 31
def cli_collect_activations()
in ludwig/collect.py
86 1 1
def main()
in ludwig/api.py
75 4 1
def postprocess_for_neuropod()
in ludwig/utils/neuropod_utils.py
69 10 2
def concat_dependencies()
in ludwig/features/base_feature.py
60 6 3
def prepare_encoder_output_state()
in ludwig/decoders/sequence_decoders.py
56 34 2
def feature_meta()
in ludwig/features/text_feature.py
54 1 2
def sequence_sampled_softmax_cross_entropy()
in ludwig/modules/loss_modules.py
52 1 8
def cli_collect_weights()
in ludwig/collect.py
49 1 1
def get_experiment_description()
in ludwig/utils/misc_utils.py
49 13 11
def extract_sequence_probabilities()
in ludwig/decoders/sequence_decoders.py
49 7 3
def __init__()
in ludwig/encoders/sequence_encoders.py
48 1 0
def initialize_tensorflow()
in ludwig/utils/tf_utils.py
47 22 4
def get_feature_meta()
in ludwig/features/text_feature.py
46 1 2
def __init__()
in ludwig/features/base_feature.py
45 6 4
def merge_with_defaults()
in ludwig/utils/defaults.py
45 11 1
def date_to_list()
in ludwig/features/date_feature.py
41 3 3
def populate_defaults()
in ludwig/features/sequence_feature.py
41 3 1
def cli()
in ludwig/utils/neuropod_utils.py
41 1 0
def sample_values_from_classes()
in ludwig/modules/loss_modules.py
41 5 7
def _read_audio_and_transform_to_feature()
in ludwig/features/audio_feature.py
40 6 7
def cli()
in ludwig/serve.py
40 1 1
def load_nlp_pipeline()
in ludwig/utils/nlp_utils.py
40 5 1
def _perform_sanity_checks()
in ludwig/utils/defaults.py
39 4 1
def _get_2D_feature()
in ludwig/features/audio_feature.py
38 8 4
def predictions()
in ludwig/models/ecd.py
38 9 3
def build_metadata()
in ludwig/data/preprocessing.py
38 5 3
def train()
in ludwig/api.py
37 1 0
def experiment()
in ludwig/experiment.py
37 1 0
def full_experiment()
in ludwig/experiment.py
37 1 0
def execute()
in ludwig/hyperopt/execution.py
37 1 0
def hyperopt()
in ludwig/hyperopt_cli.py
36 1 0
def clip_optimizer()
in ludwig/modules/optimization_modules.py
36 5 5
def __init__()
in ludwig/encoders/image_encoders.py
35 1 7
def __init__()
in ludwig/encoders/sequence_encoders.py
35 1 0
def __init__()
in ludwig/encoders/sequence_encoders.py
35 1 0
def execute()
in ludwig/hyperopt/execution.py
35 1 0
def execute()
in ludwig/hyperopt/execution.py
35 1 0
def execute()
in ludwig/hyperopt/execution.py
35 1 0
def train_and_eval_on_split()
in ludwig/hyperopt/execution.py
35 1 0
def feature_data()
in ludwig/features/text_feature.py
34 1 3
def full_train()
in ludwig/train.py
34 1 0
def populate_defaults()
in ludwig/features/category_feature.py
33 3 1
def train()
in ludwig/models/trainer.py
33 1 0
def load_glove()
in ludwig/utils/data_utils.py
32 8 1