awslabs / dgl-ke
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 471 units with 5,439 lines of code in units (89.2% of code).
    • 7 very long units (991 lines of code)
    • 16 long units (1,074 lines of code)
    • 44 medium size units (1,364 lines of code)
    • 50 small units (721 lines of code)
    • 354 very small units (1,289 lines of code)
18% | 19% | 25% | 13% | 23%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py18% | 19% | 25% | 13% | 23%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
python/dglke34% | 22% | 28% | 4% | 8%
python/dglke/models29% | 37% | 6% | 7% | 18%
python/dglke/dataloader0% | 15% | 38% | 29% | 17%
python/dglke/models/mxnet0% | 8% | 18% | 12% | 59%
python/dglke/models/pytorch0% | 0% | 33% | 21% | 45%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in python/dglke/train.py
275 63 0
def _exclude_pos()
in python/dglke/models/ke_model.py
147 38 10
def main()
in python/dglke/infer_score.py
143 18 0
def dist_train_test()
in python/dglke/train_pytorch.py
111 18 10
def link_predict()
in python/dglke/models/ke_model.py
106 15 9
def topK()
in python/dglke/models/infer.py
105 12 6
def main()
in python/dglke/eval.py
104 18 0
def __init__()
in python/dglke/utils.py
97 1 1
def _embed_sim()
in python/dglke/models/ke_model.py
96 23 8
def topK()
in python/dglke/models/infer.py
81 13 6
def start_client()
in python/dglke/kvclient.py
77 9 1
def SoftRelationPartition()
in python/dglke/dataloader/sampler.py
76 15 4
def train()
in python/dglke/train_pytorch.py
75 32 9
def BalancedRelationPartition()
in python/dglke/dataloader/sampler.py
70 13 3
def main()
in python/dglke/infer_emb_sim.py
60 15 0
def __init__()
in python/dglke/models/general_models.py
60 22 9
def __init__()
in python/dglke/eval.py
59 1 1
def _infer_score_func()
in python/dglke/models/ke_model.py
57 17 6
def score()
in python/dglke/models/general_models.py
55 10 5
def _topk_exclude_pos()
in python/dglke/models/ke_model.py
54 5 9