facebookresearch / alma
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 317 units with 3,531 lines of code in units (77.8% of code).
    • 0 very complex units (0 lines of code)
    • 5 complex units (511 lines of code)
    • 13 medium complex units (846 lines of code)
    • 13 simple units (354 lines of code)
    • 286 very simple units (1,820 lines of code)
0% | 14% | 23% | 10% | 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
py0% | 14% | 23% | 10% | 51%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
crlapi/sl/clmodels0% | 27% | 38% | 0% | 34%
crlapi/sl/architectures/firefly_vgg/sp0% | 11% | 23% | 23% | 42%
crlapi0% | 0% | 9% | 13% | 77%
crlapi/sl/architectures0% | 0% | 6% | 15% | 77%
crlapi/sl/architectures/firefly_vgg0% | 0% | 0% | 77% | 22%
crlapi/sl/streams0% | 0% | 0% | 0% | 100%
configs/mnist0% | 0% | 0% | 0% | 100%
configs/cifar100% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def split()
in crlapi/sl/clmodels/firefly.py
82 40 6
def split()
in crlapi/sl/architectures/firefly_vgg/sp/net.py
86 33 4
def update()
in crlapi/sl/clmodels/boosting.py
140 30 3
def update()
in crlapi/sl/clmodels/k_ensemble.py
102 28 3
def update()
in crlapi/sl/clmodels/bagging.py
101 27 3
def update()
in crlapi/sl/clmodels/agg_ensemble.py
74 21 3
def spffn_forward()
in crlapi/sl/architectures/firefly_vgg/sp/conv.py
62 19 3
def update()
in crlapi/sl/clmodels/debug_ensemble.py
82 17 3
def spffn_passive_grow()
in crlapi/sl/architectures/firefly_vgg/sp/conv.py
59 16 3
def update()
in crlapi/sl/clmodels/adaboost.py
103 16 3
def update()
in crlapi/sl/clmodels/ensemble.py
81 16 3
def update()
in crlapi/sl/clmodels/firefly.py
69 15 3
def update()
in crlapi/sl/clmodels/finetune_grow.py
71 14 3
def update()
in crlapi/sl/clmodels/finetune.py
75 14 3
def spffn()
in crlapi/sl/clmodels/firefly.py
38 13 4
def read_log()
in crlapi/logger.py
38 13 3
def grow()
in crlapi/sl/architectures/mixture_model.py
35 12 3
def spffn_active_grow()
in crlapi/sl/architectures/firefly_vgg/sp/conv.py
59 11 2
def _d2_actv()
in crlapi/sl/architectures/firefly_vgg/sp/module.py
25 10 3
def _activate()
in crlapi/sl/architectures/firefly_vgg/sp/module.py
19 9 2