facebookresearch / suncet
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 139 units with 2,004 lines of code in units (53.3% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (482 lines of code)
    • 2 medium complex units (339 lines of code)
    • 13 simple units (274 lines of code)
    • 122 very simple units (909 lines of code)
0% | 24% | 16% | 13% | 45%
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% | 24% | 16% | 13% | 45%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src0% | 26% | 18% | 11% | 43%
ROOT0% | 0% | 0% | 35% | 64%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def main()
in src/paws_train.py
251 33 1
def main()
in src/suncet_train.py
231 33 1
def main()
in src/fine_tune.py
180 23 1
def main()
in src/snn_fine_tune.py
159 12 1
def step()
in src/lars.py
24 10 1
32 9 5
def step()
in src/sgd.py
25 8 1
def __getitem__()
in src/data_manager.py
18 8 2
def __getitem__()
in src/data_manager.py
17 8 2
def init_distributed()
in src/utils.py
24 7 3
20 7 1
def init_transform()
in src/data_manager.py
25 7 6
def __iter__()
in src/data_manager.py
17 7 1
def __call__()
in main_distributed.py
22 6 1
def __init__()
in src/sgd.py
12 6 6
def forward()
in src/resnet.py
19 6 3
def forward()
in src/wide_resnet.py
19 6 3
def _make_layer()
in src/resnet.py
38 5 6
def forward()
in src/utils.py
10 5 2
9 5 1