aws-samples / machine-learning-samples
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 91 units with 979 lines of code in units (61.1% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (22 lines of code)
    • 4 simple units (106 lines of code)
    • 86 very simple units (851 lines of code)
0% | 0% | 2% | 10% | 86%
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% | 2% | 11% | 86%
java0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
social-media0% | 0% | 6% | 17% | 75%
k-fold-cross-validation0% | 0% | 0% | 20% | 79%
ml-tools-python0% | 0% | 0% | 6% | 93%
cost-based-ml0% | 0% | 0% | 0% | 100%
targeted-marketing-python0% | 0% | 0% | 0% | 100%
mobile-android0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def determine_changed_bucket_policy()
in social-media/create-aml-model.py
22 12 2
def fetch_tweets()
in social-media/gather-data.py
30 9 1
def collect_perf()
in k-fold-cross-validation/collect_perf.py
29 9 1
def process_status()
in social-media/gather-data.py
32 8 2
def validate()
in ml-tools-python/awspyml.py
15 7 1
def main()
in social-media/create-lambda-function.py
11 5 0
def plot_class_histograms()
in cost-based-ml/cost_based_ml.py
15 5 1
def _guess_schema_from_data()
in ml-tools-python/awspyml.py
10 5 2
def _guess_variable_type()
in ml-tools-python/awspyml.py
20 5 2
def check_bucket_policy()
in social-media/create-aml-model.py
21 4 1
def read_test_predictions()
in cost-based-ml/cost_based_ml.py
10 4 2
def _new()
in ml-tools-python/awspyml.py
8 4 2
def build_folds()
in k-fold-cross-validation/build_folds.py
7 4 2
def poll_until_completed()
in targeted-marketing-python/use_model.py
12 3 2
def poll_until_ready()
in social-media/create-aml-model.py
10 3 1
def status_to_map()
in social-media/gather-data.py
15 3 2
def main()
in social-media/gather-data.py
16 3 1
def parse_handle()
in social-media/gather-data.py
8 3 1
def create_lambda_function_zip()
in social-media/create-lambda-function.py
12 3 0
def pause_until_kinesis_active()
in social-media/create-lambda-function.py
4 3 0