awslabs / sagemaker-privacy-for-nlp
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 59 units with 574 lines of code in units (33.1% 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)
    • 4 simple units (84 lines of code)
    • 55 very simple units (490 lines of code)
0% | 0% | 0% | 14% | 85%
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% | 14% | 85%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
source0% | 0% | 0% | 32% | 67%
source/sagemaker/src/package/container_build0% | 0% | 0% | 56% | 43%
source/sagemaker/src/package/data_privatization0% | 0% | 0% | 10% | 89%
source/sagemaker/src/package/model0% | 0% | 0% | 0% | 100%
deployment/solution-assistant/src0% | 0% | 0% | 0% | 100%
source/sagemaker/src/package0% | 0% | 0% | 0% | 100%
source/scripts0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def add_to_logbook()
in source/env_setup.py
16 7 2
def env_setup()
in source/env_setup.py
21 6 0
def create_clean_counter()
in source/sagemaker/src/package/data_privatization/data_privatization.py
15 6 2
def log_stream()
in source/sagemaker/src/package/container_build/logs.py
32 6 4
def in_logbook()
in source/env_setup.py
12 5 2
def privatize_example()
in source/sagemaker/src/package/data_privatization/data_privatization.py
16 5 4
def bash()
in source/env_setup.py
21 4 1
def train()
in source/sagemaker/src/package/data_privatization/container/train.py
21 4 5
def train()
in source/sagemaker/src/package/model/train.py
21 4 5
def get_current_folder()
in source/sagemaker/src/package/utils.py
7 4 1
def delete_sagemaker_endpoint()
in deployment/solution-assistant/src/lambda_function.py
16 3 1
def delete_sagemaker_endpoint_config()
in deployment/solution-assistant/src/lambda_function.py
18 3 1
def delete_sagemaker_model()
in deployment/solution-assistant/src/lambda_function.py
13 3 1
def get_sagemaker_mode()
in source/env_setup.py
8 2 0
def get_hostname()
in source/env_setup.py
11 2 0
def set_kernel_spec()
in source/scripts/set_kernelspec.py
9 2 3
def binary_accuracy()
in source/sagemaker/src/package/data_privatization/container/train.py
5 2 2
def evaluate()
in source/sagemaker/src/package/data_privatization/container/train.py
11 2 3
def train_one_epoch()
in source/sagemaker/src/package/data_privatization/container/train.py
14 2 4
def create_iterators()
in source/sagemaker/src/package/data_privatization/container/train.py
9 2 2