awslabs / dgl-ke
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 471 units with 5,439 lines of code in units (89.2% of code).
    • 1 very complex units (275 lines of code)
    • 2 complex units (222 lines of code)
    • 19 medium complex units (1,345 lines of code)
    • 25 simple units (821 lines of code)
    • 424 very simple units (2,776 lines of code)
5% | 4% | 24% | 15% | 51%
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
py5% | 4% | 24% | 15% | 51%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
python/dglke15% | 4% | 31% | 12% | 36%
python/dglke/models0% | 12% | 48% | 9% | 29%
python/dglke/dataloader0% | 0% | 18% | 24% | 56%
python/dglke/models/pytorch0% | 0% | 0% | 19% | 80%
python/dglke/models/mxnet0% | 0% | 0% | 12% | 87%
Most Complex Units
Top 20 most complex 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 train()
in python/dglke/train_pytorch.py
75 32 9
def test()
in python/dglke/train_pytorch.py
49 23 6
def _embed_sim()
in python/dglke/models/ke_model.py
96 23 8
def __init__()
in python/dglke/models/general_models.py
60 22 9
def train()
in python/dglke/train_mxnet.py
48 19 7
def main()
in python/dglke/eval.py
104 18 0
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 _infer_score_func()
in python/dglke/models/ke_model.py
57 17 6
def main()
in python/dglke/infer_emb_sim.py
60 15 0
def link_predict()
in python/dglke/models/ke_model.py
106 15 9
def SoftRelationPartition()
in python/dglke/dataloader/sampler.py
76 15 4
def topK()
in python/dglke/models/infer.py
81 13 6
def BalancedRelationPartition()
in python/dglke/dataloader/sampler.py
70 13 3
def topK()
in python/dglke/models/infer.py
105 12 6
def __init__()
in python/dglke/models/general_models.py
28 12 8
def get_dataset()
in python/dglke/dataloader/KGDataset.py
31 12 6
def test()
in python/dglke/train_mxnet.py
21 12 6