whatsapp / otp
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 9,306 units with 177,746 lines of code in units (12.1% of code).
    • 51 very complex units (26,790 lines of code)
    • 110 complex units (15,142 lines of code)
    • 470 medium complex units (30,034 lines of code)
    • 781 simple units (25,550 lines of code)
    • 7,894 very simple units (80,230 lines of code)
15% | 8% | 16% | 14% | 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
c10% | 10% | 21% | 17% | 39%
cpp41% | 4% | 7% | 8% | 37%
h1% | 0% | 2% | 3% | 92%
java0% | 4% | 7% | 13% | 74%
py0% | 22% | 27% | 7% | 42%
js0% | 15% | 33% | 7% | 43%
inc0% | 0% | 0% | 25% | 74%
hpp0% | 0% | 0% | 19% | 80%
cc0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
erts/emulator13% | 8% | 16% | 15% | 45%
lib/wx74% | <1% | 1% | 2% | 20%
erts/etc18% | 17% | 22% | 14% | 27%
lib/erl_interface6% | 8% | 37% | 19% | 26%
lib/crypto7% | 24% | 33% | 11% | 23%
erts/lib_src4% | 5% | 10% | 9% | 71%
lib/asn133% | 0% | 14% | 17% | 34%
erts/epmd17% | 31% | 4% | 19% | 27%
lib/odbc0% | 13% | 32% | 22% | 31%
lib/jinterface0% | 4% | 7% | 13% | 74%
lib/os_mon0% | 4% | 38% | 33% | 22%
lib/erl_docgen0% | 15% | 33% | 7% | 43%
lib/runtime_tools0% | 0% | 26% | 29% | 43%
system/doc0% | 0% | 43% | 12% | 43%
erts/example0% | 0% | 6% | 23% | 70%
lib/hipe0% | 0% | 0% | 25% | 74%
erts/include0% | 0% | 0% | 0% | 100%
lib/tools0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
7045 913 6
3121 797 5
695 215 2
637 202 2
743 188 8
751 167 1
739 163 4
735 162 8
372 140 5
211 137 1
565 125 2
378 122 5
372 113 4
502 111 1
343 102 1
408 100 2
195 98 5
316 94 2
289 85 1
258 83 2
236 81 4
201 80 3
303 79 2
460 79 7
268 77 3
231 75 7
303 72 2
267 71 2
156 70 7
208 70 1
376 69 1
287 68 1
98 67 1
336 64 8
265 62 1
584 62 2
191 60 3
203 60 3
177 60 5
291 60 5
252 59 0
212 58 2
211 58 4
205 56 3
154 54 3
272 52 1
326 52 9
258 52 4
254 52 1
287 51 1