openai / baselines
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 842 units with 9,429 lines of code in units (57.6% of code).
    • 1 very complex units (206 lines of code)
    • 8 complex units (1,112 lines of code)
    • 14 medium complex units (737 lines of code)
    • 66 simple units (1,933 lines of code)
    • 753 very simple units (5,441 lines of code)
2% | 11% | 7% | 20% | 57%
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
py2% | 11% | 7% | 20% | 57%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
baselines2% | 11% | 7% | 20% | 57%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
206 51 28
232 44 19
96 44 3
130 42 3
137 35 25
200 34 28
111 31 3
73 29 3
133 29 25
58 24 4
36 17 12
110 15 19
56 15 4
64 15 1
29 14 3
47 14 12
69 13 2
35 13 1
50 12 1
42 12 3
67 12 2
43 11 5
31 11 3
44 10 6
31 10 4
61 10 2
37 10 32
58 10 14
73 10 5
28 9 1
36 9 5
38 9 1
30 9 7
34 9 12
18 9 2
74 9 5
41 9 1
43 8 4
25 8 2
22 8 4
61 8 6
58 8 11
21 8 1
53 8 5
11 8 6
10 8 5
19 8 4
26 8 6
41 8 4
27 8 1