aws-samples / sagemaker-documentdb-train-gnn-for-millions-proteins
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 38 units with 375 lines of code in units (37.2% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (111 lines of code)
    • 2 medium size units (53 lines of code)
    • 7 small units (87 lines of code)
    • 27 very small units (124 lines of code)
0% | 29% | 14% | 23% | 33%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 29% | 14% | 23% | 33%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src0% | 39% | 10% | 26% | 24%
ROOT0% | 0% | 26% | 13% | 60%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in src/main.py
59 5 1
def parse_args()
in src/main.py
52 1 0
def __iter__()
in src/dataset.py
29 5 1
24 12 5
def step()
in src/helpers.py
15 4 3
14 6 1
def __init__()
in src/helpers.py
12 2 3
def __iter__()
in src/dataset.py
12 4 1
12 1 0
def roc_auc_score()
in src/helpers.py
11 2 1
def convert_to_graph()
in src/dataset.py
11 2 2
def get_secret()
in utils.py
9 1 1
9 2 2
def attention_scores()
in src/model.py
8 1 2
def setup()
in src/helpers.py
8 3 2
8 3 1
def __init__()
in src/model.py
7 1 4
def _conv_forward()
in src/model.py
7 1 2
def __init__()
in src/dataset.py
7 1 0
def gunzip_to_ram()
in pdb_parse.py
7 2 1