awslabs / realtime-fraud-detection-with-gnn-on-dgl
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 116 units with 2,705 lines of code in units (44.1% of code).
    • 4 very long units (1,087 lines of code)
    • 5 long units (352 lines of code)
    • 19 medium size units (508 lines of code)
    • 32 small units (427 lines of code)
    • 56 very small units (331 lines of code)
40% | 13% | 18% | 15% | 12%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts66% | 8% | 10% | 6% | 7%
py0% | 21% | 34% | 24% | 19%
tsx0% | 0% | 0% | 84% | 15%
js0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/lib69% | 8% | 10% | 4% | 6%
src/lambda.d0% | 40% | 33% | 17% | 7%
src/sagemaker0% | 10% | 35% | 27% | 26%
frontend/src0% | 0% | 0% | 79% | 20%
src/scripts0% | 0% | 0% | 73% | 26%
src0% | 0% | 0% | 0% | 100%
frontend0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in src/lib/training-stack.ts
623 1 3
constructor()
in src/lib/etl-glue.ts
217 1 3
constructor()
in src/lib/stack.ts
138 8 3
constructor()
in src/lib/sar.ts
109 1 3
def query_target_subgraph()
in src/lambda.d/inference/func/inferenceApi.py
92 14 6
constructor()
in src/lib/inference-stack.ts
75 1 3
65 1 5
def recreate_grpha_data()
in src/sagemaker/FD_SL_DGL/code/fd_sl_deployment_entry_point.py
64 13 3
def handler()
in src/lambda.d/inference/func/inferenceApi.py
56 1 2
def insert_new_transaction_vertex_and_edge()
in src/lambda.d/inference/func/inferenceApi.py
39 6 5
def load_data_from_event()
in src/lambda.d/inference/func/inferenceApi.py
34 7 4
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
def handler()
in src/lambda.d/simulator/gen.py
30 5 2
def save_model()
in src/sagemaker/FD_SL_DGL/gnn_fraud_detection_dgl/fd_sl_train_entry_point.py
30 12 6
DATASET_URL: getDatasetMapping()
in src/lib/training-stack.ts
28 1 1
public visit()
in src/lib/utils.ts
26 4 1
def train_fg()
in src/sagemaker/FD_SL_DGL/gnn_fraud_detection_dgl/fd_sl_train_entry_point.py
26 3 12
25 1 2
constructor()
in src/lib/dashboard-stack.ts
25 3 2