openai / openai-python
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 2,516 units with 17,960 lines of code in units (26.8% of code).
    • 1 very complex units (115 lines of code)
    • 4 complex units (397 lines of code)
    • 18 medium complex units (691 lines of code)
    • 38 simple units (664 lines of code)
    • 2,455 very simple units (16,093 lines of code)
<1% | 2% | 3% | 3% | 89%
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
py<1% | 2% | 3% | 3% | 89%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src<1% | 2% | 3% | 3% | 89%
scripts0% | 0% | 27% | 0% | 72%
ROOT0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
115 55 2
72 38 4
110 37 3
110 36 3
105 34 2
44 21 4
21 17 3
71 16 0
55 15 2
55 15 2
61 15 4
18 15 4
24 14 0
36 14 2
45 13 1
41 12 4
40 12 2
41 12 4
33 12 1
19 11 3
18 11 3
53 11 1
16 11 2
53 10 1
16 9 1
16 9 1
18 9 19
18 9 19
16 9 2
24 9 1
20 9 2
18 8 2
12 8 1
12 8 1
19 8 2
20 8 2
22 8 3
14 8 2
7 8 1
18 8 2
22 8 2
29 8 0
29 7 1
37 7 3
12 7 2
8 7 1
9 7 2
23 7 2
16 7 0
11 6 1