aws-samples / algorithmic-trading
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 55 units with 556 lines of code in units (33.5% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 8 medium size units (260 lines of code)
    • 8 small units (113 lines of code)
    • 39 very small units (183 lines of code)
0% | 0% | 46% | 20% | 32%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 0% | 46% | 20% | 32%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
4_Kinesis/model0% | 0% | 52% | 15% | 31%
2_Strategies/model0% | 0% | 52% | 15% | 31%
1_Data0% | 0% | 0% | 70% | 29%
3_Models/model0% | 0% | 0% | 51% | 48%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def __init__()
in 4_Kinesis/model/algo_sim_feed.py
40 11 2
def __init__()
in 2_Strategies/model/algo_sim_feed.py
40 11 2
def performance()
in 4_Kinesis/model/algo_base.py
36 3 1
def performance()
in 2_Strategies/model/algo_base.py
36 3 1
def pull()
in 4_Kinesis/model/algo_live_feed.py
29 4 1
def pull()
in 2_Strategies/model/algo_live_feed.py
29 4 1
def submit()
in 4_Kinesis/model/algo_base.py
25 4 1
def submit()
in 2_Strategies/model/algo_base.py
25 4 1
def save_stock_data()
in 1_Data/data_prep.py
19 3 3
def transformation()
in 3_Models/model/predictor.py
18 2 0
def _load()
in 4_Kinesis/model/algo_sim_feed.py
15 2 1
def _load()
in 2_Strategies/model/algo_sim_feed.py
15 2 1
def __init__()
in 4_Kinesis/model/algo_base.py
12 1 3
def __init__()
in 2_Strategies/model/algo_base.py
12 1 3
def next()
in 4_Kinesis/model/algo_base.py
11 4 1
def next()
in 2_Strategies/model/algo_base.py
11 4 1
def notify_order()
in 4_Kinesis/model/algo_base.py
10 3 2
def notify_order()
in 2_Strategies/model/algo_base.py
10 3 2
def ping()
in 4_Kinesis/model/predictor.py
7 2 0
def __init__()
in 4_Kinesis/model/algo_base.py
7 1 1