aws-samples / aws-neptune-sagemaker-knowledge-graph-bert
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 24 units with 390 lines of code in units (86.3% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (40 lines of code)
    • 4 simple units (162 lines of code)
    • 19 very simple units (188 lines of code)
0% | 0% | 10% | 41% | 48%
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% | 10% | 41% | 48%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
code/source0% | 0% | 18% | 20% | 61%
code0% | 0% | 0% | 67% | 32%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def convert_single_example()
in code/source/bert_preprocessing.py
40 11 4
def create_sentences_out_of_dataframe()
in code/source/sentence_preprocessing.py
16 8 1
def split_and_duplicate_index()
in code/source/sentence_preprocessing.py
9 8 2
def main()
in code/train.py
118 7 1
def from_iob_to_io()
in code/source/sentence_preprocessing.py
19 7 1
def output_handler()
in code/inference.py
21 5 2
def preds_to_dict_single()
in code/source/postprocessing.py
10 5 2
def split()
in code/source/sentence_preprocessing.py
6 5 2
def map_split_preds_to_idx()
in code/source/postprocessing.py
14 4 2
def y2label()
in code/source/postprocessing.py
9 4 3
def y2label_for_report()
in code/source/postprocessing.py
10 3 4
def tag_sequence()
in code/source/sentence_preprocessing.py
2 3 1
def text_sequence()
in code/source/sentence_preprocessing.py
2 3 1
def input_handler()
in code/inference.py
35 2 2
def convert_examples_to_features()
in code/source/bert_preprocessing.py
16 2 4
def convert_text_to_examples()
in code/source/bert_preprocessing.py
7 2 2
def call()
in code/source/custom_layer.py
8 2 2
def compute_output_shape()
in code/source/custom_layer.py
5 2 2
def __init__()
in code/source/bert_preprocessing.py
5 1 5
def create_tokenizer_from_hub_module()
in code/source/bert_preprocessing.py
8 1 1