facebookincubator / mvfst
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,484 units with 32,775 lines of code in units (62.7% of code).
    • 3 very complex units (1,399 lines of code)
    • 17 complex units (2,399 lines of code)
    • 85 medium complex units (5,606 lines of code)
    • 203 simple units (6,362 lines of code)
    • 2,176 very simple units (17,009 lines of code)
4% | 7% | 17% | 19% | 51%
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
cpp5% | 9% | 19% | 18% | 46%
h0% | 4% | 1% | 11% | 82%
py0% | 0% | 14% | 26% | 59%
c0% | 0% | 0% | 33% | 66%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
quic/server11% | 12% | 14% | 20% | 41%
quic/client25% | 7% | 25% | 16% | 25%
quic/state12% | 9% | 7% | 17% | 53%
quic/api0% | 10% | 18% | 22% | 48%
quic/codec0% | 15% | 19% | 13% | 51%
quic/loss0% | 29% | 24% | 33% | 12%
quic0% | 18% | 26% | 19% | 36%
quic/logging0% | 4% | 26% | 8% | 60%
build/fbcode_builder0% | 0% | 13% | 26% | 59%
quic/congestion_control0% | 0% | 27% | 17% | 55%
quic/common0% | 0% | 20% | 14% | 64%
quic/dsr0% | 0% | 32% | 18% | 49%
quic/fizz0% | 0% | 4% | 9% | 85%
quic/d6d0% | 0% | 0% | 45% | 54%
quic/happyeyeballs0% | 0% | 0% | 68% | 31%
quic/flowcontrol0% | 0% | 0% | 12% | 87%
quic/tools0% | 0% | 0% | 5% | 94%
quic/handshake0% | 0% | 0% | 9% | 90%
build0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
514 107 3
559 90 2
326 60 6
263 49 5
121 41 3
107 40 3
271 38 7
140 36 5
68 36 1
163 36 1
64 36 1
187 34 2
157 34 0
151 34 0
68 31 1
87 31 0
135 30 4
67 30 2
188 29 2
162 28 3
76 25 4
94 25 7
114 24 3
104 24 1
179 23 2
141 23 2
122 23 2
130 23 6
49 23 1
62 22 1
88 22 0
79 22 2
62 21 0
102 21 1
115 21 2
67 20 3
40 19 2
73 19 2
106 19 1
118 19 3
118 18 1
104 18 6
105 18 2
37 17 5
41 17 1
78 17 1
69 17 4
55 16 4
44 16 3
67 16 4