facebookresearch / Context-Aware-Representation-Crop-Yield-Prediction
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 242 units with 4,881 lines of code in units (84.2% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (73 lines of code)
    • 30 medium complex units (1,697 lines of code)
    • 43 simple units (1,303 lines of code)
    • 168 very simple units (1,808 lines of code)
0% | 1% | 34% | 26% | 37%
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% | 1% | 34% | 26% | 37%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
data_preprocessing/rescaling0% | 15% | 41% | 17% | 24%
ROOT0% | 0% | 84% | 4% | 10%
data_preprocessing/sample_quadruplets0% | 0% | 63% | 20% | 15%
data_preprocessing/postprocess0% | 0% | 57% | 34% | 8%
data_preprocessing/preprocess0% | 0% | 28% | 27% | 43%
crop_yield_prediction/plot0% | 0% | 64% | 14% | 20%
crop_yield_prediction/models0% | 0% | 11% | 23% | 65%
crop_yield_prediction0% | 0% | 12% | 58% | 29%
data_preprocessing/merge0% | 0% | 100% | 0% | 0%
data_preprocessing/plot0% | 0% | 0% | 32% | 67%
crop_yield_prediction/utils0% | 0% | 0% | 26% | 73%
data_preprocessing/utils0% | 0% | 0% | 16% | 83%
crop_yield_prediction/dataloader0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def cdl_upscale()
in data_preprocessing/rescaling/cdl_upscale.py
73 31 6
def generate_monthly_average()
in data_preprocessing/preprocess/lst.py
48 23 4
def crop_yield_train_semi_transformer()
in crop_yield_train_semi_transformer.py
142 21 9
def generate_training_for_counties()
in data_preprocessing/sample_quadruplets/sample_for_counties.py
114 21 12
def merge_various_days()
in data_preprocessing/merge/merge_various_days.py
44 21 6
def crop_yield_train_cnn_lstm()
in crop_yield_train_cnn_lstm.py
97 19 9
def crop_yield_train_c3d()
in crop_yield_train_c3d.py
92 19 9
def crop_yield_train_cross_location()
in crop_yield_train_cross_location.py
155 19 9
def combine_by_year()
in data_preprocessing/postprocess/combine_multi_vars.py
50 18 3
def _sample_distant_same()
in data_preprocessing/sample_quadruplets/sample_for_counties.py
25 17 8
def _sample_distant_same()
in data_preprocessing/sample_quadruplets/sample_for_pretrained.py
25 17 8
def plot_loss()
in crop_yield_prediction/plot/plot_loss.py
105 16 1
def _train()
in crop_yield_prediction/models/deep_gaussian_process/base.py
62 16 11
def generate_training_for_pretrained()
in data_preprocessing/sample_quadruplets/sample_for_pretrained.py
88 16 14
def generate_no_spatial_for_counties()
in data_preprocessing/postprocess/combine_multi_vars.py
57 15 9
def generate_no_spatial()
in data_preprocessing/postprocess/prism.py
46 14 4
def average_by_year()
in data_preprocessing/postprocess/prism.py
26 14 2
def reproject_prism()
in data_preprocessing/rescaling/prism_downscale.py
35 13 1
def reproject_lst()
in data_preprocessing/rescaling/lst.py
37 13 1
def reproject_sm()
in data_preprocessing/rescaling/soil_moisture.py
35 13 1