awslabs / realtime-fraud-detection-with-gnn-on-dgl
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 116 units with 2,705 lines of code in units (44.1% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 3 medium complex units (186 lines of code)
    • 12 simple units (355 lines of code)
    • 101 very simple units (2,164 lines of code)
0% | 0% | 6% | 13% | 80%
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% | 18% | 22% | 59%
ts0% | 0% | 0% | 8% | 91%
tsx0% | 0% | 0% | 0% | 100%
js0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/sagemaker0% | 0% | 15% | 23% | 60%
src/lambda.d0% | 0% | 25% | 20% | 54%
src/lib0% | 0% | 0% | 8% | 91%
frontend/src0% | 0% | 0% | 0% | 100%
src/scripts0% | 0% | 0% | 0% | 100%
src0% | 0% | 0% | 0% | 100%
frontend0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def query_target_subgraph()
in src/lambda.d/inference/func/inferenceApi.py
92 14 6
def recreate_grpha_data()
in src/sagemaker/FD_SL_DGL/code/fd_sl_deployment_entry_point.py
64 13 3
def save_model()
in src/sagemaker/FD_SL_DGL/gnn_fraud_detection_dgl/fd_sl_train_entry_point.py
30 12 6
def read_edges()
in src/sagemaker/FD_SL_DGL/gnn_fraud_detection_dgl/data.py
34 9 2
def construct_graph()
in src/sagemaker/FD_SL_DGL/gnn_fraud_detection_dgl/graph_utils.py
33 9 3
constructor()
in src/lib/stack.ts
138 8 3
def load_data_from_event()
in src/lambda.d/inference/func/inferenceApi.py
34 7 4
def forward()
in src/sagemaker/FD_SL_DGL/code/fd_sl_deployment_entry_point.py
9 7 3
def load_subgraph()
in src/sagemaker/FD_SL_DGL/clients_python/client_boto_demo.py
7 7 1
def parse_edgelist()
in src/sagemaker/FD_SL_DGL/gnn_fraud_detection_dgl/data.py
23 7 5
def forward()
in src/sagemaker/FD_SL_DGL/gnn_fraud_detection_dgl/pytorch_model.py
9 7 3
def forward()
in src/sagemaker/FD_SL_DGL/gnn_fraud_detection_dgl/pytorch_model.py
8 7 3
def insert_new_transaction_vertex_and_edge()
in src/lambda.d/inference/func/inferenceApi.py
39 6 5
def _get_mask()
in src/sagemaker/FD_SL_DGL/gnn_fraud_detection_dgl/data.py
11 6 5
def create_homogeneous_edgelist()
in src/sagemaker/data-preprocessing/graph_data_preprocessor.py
10 6 2
def handler()
in src/lambda.d/simulator/gen.py
30 5 2
def __init__()
in src/sagemaker/FD_SL_DGL/code/fd_sl_deployment_entry_point.py
12 5 8
def get_features()
in src/sagemaker/FD_SL_DGL/gnn_fraud_detection_dgl/data.py
22 5 2
def __init__()
in src/sagemaker/FD_SL_DGL/gnn_fraud_detection_dgl/pytorch_model.py
12 5 8
constructor()
in src/lib/training-stack.ts
19 4 2