aws-samples / amazon-sagemaker-bert-classify-pytorch
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 64 units with 497 lines of code in units (85.2% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (70 lines of code)
    • 1 simple units (16 lines of code)
    • 62 very simple units (411 lines of code)
0% | 0% | 14% | 3% | 82%
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% | 14% | 3% | 82%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src0% | 0% | 14% | 3% | 82%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def run_train()
in src/bert_train.py
70 11 7
def __init__()
in src/bert_train.py
16 8 8
def predict_fn()
in src/serve.py
16 5 2
def __init__()
in src/bert_model.py
10 5 6
def upload_files()
in src/s3_util.py
10 4 5
def __init__()
in src/dbpedia_dataset_label_mapper.py
5 4 2
def __init__()
in src/builder.py
32 4 15
def upload_file()
in src/s3_util.py
10 3 4
def download_file()
in src/s3_util.py
12 3 4
11 3 1
def get_network()
in src/builder.py
11 3 1
8 3 1
def _get_bucketname_key()
in src/s3_util.py
10 2 1
def download_object()
in src/s3_util.py
10 2 3
def list_files()
in src/s3_util.py
7 2 2
def download_files()
in src/s3_util.py
8 2 5
def download_objects()
in src/s3_util.py
5 2 3
def snapshot()
in src/bert_train.py
7 2 4
def validate()
in src/bert_train.py
16 2 4
def create_checkpoint()
in src/bert_train.py
8 2 3