facebookresearch / hsd3
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 333 units with 5,598 lines of code in units (58.5% of code).
    • 1 very complex units (168 lines of code)
    • 5 complex units (777 lines of code)
    • 12 medium complex units (957 lines of code)
    • 39 simple units (1,466 lines of code)
    • 276 very simple units (2,230 lines of code)
3% | 13% | 17% | 26% | 39%
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
py3% | 13% | 17% | 26% | 39%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT14% | 17% | 19% | 19% | 28%
hucc/agents0% | 17% | 21% | 31% | 29%
hucc/envs0% | 7% | 9% | 31% | 51%
hucc0% | 0% | 13% | 29% | 56%
hucc/models0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def eval()
in train.py
168 51 2
def _update()
in hucc/agents/hsd3.py
305 48 1
def _update()
in hucc/agents/hsdb.py
190 33 1
def eval_mfdim()
in pretrain.py
133 31 2
76 30 1
def step()
in hucc/envs/ctrlgs.py
73 29 2
def _update()
in hucc/agents/sacmt.py
223 25 1
def __init__()
in hucc/agents/hsd3.py
115 21 3
def _update()
in hucc/agents/sachrl.py
88 20 1
def reset()
in hucc/envs/ctrlgs.py
55 19 1
def estimate_ctrlb()
in pretrain.py
144 17 1
def train_loop()
in train.py
90 16 1
def close_extras()
in hucc/envs/thmp_vector_env.py
28 16 3
def _update()
in hucc/agents/sac.py
97 15 1
def dim_select()
in hucc/utils.py
14 14 3
def action_hi()
in hucc/agents/hiro.py
41 12 3
def put_row()
in hucc/replaybuffer.py
34 12 3
def parse_lo_info()
in hucc/agents/hsd3.py
28 11 1
def worker()
in pretrain.py
64 10 5
def main()
in pretrain.py
46 10 1