awslabs / aws-fleet-predictive-maintenance
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 45 units with 576 lines of code in units (59.4% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 0 medium complex units (0 lines of code)
    • 5 simple units (169 lines of code)
    • 40 very simple units (407 lines of code)
0% | 0% | 0% | 29% | 70%
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% | 0% | 29% | 70%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
sagemaker/source0% | 0% | 0% | 58% | 41%
sagemaker/source/preprocessing0% | 0% | 0% | 81% | 18%
sagemaker/source/visualization0% | 0% | 0% | 21% | 78%
sagemaker/source/dl_utils0% | 0% | 0% | 0% | 100%
sagemaker/source/dataset0% | 0% | 0% | 0% | 100%
sagemaker/source/config0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def run()
in sagemaker/source/train.py
77 9 0
def pivot_data()
in sagemaker/source/preprocessing/preprocessing.py
35 7 1
def append()
in sagemaker/source/preprocessing/dataframewriter.py
14 7 2
def get_best_training_job()
in sagemaker/source/visualization/model_visualisation_utils.py
21 7 3
def sample_dataset()
in sagemaker/source/preprocessing/preprocessing.py
22 6 2
def run_epoch()
in sagemaker/source/train.py
28 5 5
def _get_vehicle_properties_headers()
in sagemaker/source/dl_utils/dataset.py
11 5 2
def _generate_sensor_logs()
in sagemaker/source/dataset/dataset_generator.py
18 4 2
def get_dfs_from_hpt()
in sagemaker/source/visualization/model_visualisation_utils.py
30 4 2
def plot_df_list()
in sagemaker/source/visualization/model_visualisation_utils.py
29 4 4
def model_fn()
in sagemaker/source/dl_utils/inference.py
22 4 1
def _get_means()
in sagemaker/source/dl_utils/dataset.py
8 4 2
def _generate_fleet_info()
in sagemaker/source/dataset/dataset_generator.py
16 3 1
def __next__()
in sagemaker/source/dataset/dataset_generator.py
10 3 1
def build_chart()
in sagemaker/source/visualization/plot_utils.py
16 3 2
def __init__()
in sagemaker/source/config/__init__.py
7 3 3
def _build_sensor_output_data()
in sagemaker/source/dl_utils/dataset.py
12 3 4
def flush_buffer()
in sagemaker/source/preprocessing/dataframewriter.py
10 2 1
def threshold()
in sagemaker/source/dataset/dataset_generator.py
9 2 1
def __repr__()
in sagemaker/source/config/__init__.py
5 2 1