facebook / fbthrift
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 16,714 units with 139,214 lines of code in units (55.7% of code).
    • 7 very complex units (1,804 lines of code)
    • 34 complex units (4,208 lines of code)
    • 313 medium complex units (19,420 lines of code)
    • 686 simple units (21,594 lines of code)
    • 15,674 very simple units (92,188 lines of code)
1% | 3% | 13% | 15% | 66%
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
cpp4% | 3% | 11% | 15% | 64%
cc1% | 7% | 28% | 17% | 44%
h0% | 1% | 9% | 11% | 77%
php0% | 4% | 20% | 19% | 55%
go0% | 3% | 9% | 24% | 62%
py0% | 0% | 10% | 22% | 66%
java0% | 0% | 6% | 12% | 80%
rb0% | 0% | 53% | 35% | 10%
pyx0% | 0% | 0% | 9% | 90%
rs0% | 0% | 0% | 2% | 97%
c0% | 0% | 0% | 33% | 66%
pyi0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
thrift/lib1% | 1% | 9% | 14% | 73%
thrift/compiler1% | 6% | 25% | 17% | 48%
thrift/perf0% | 4% | 9% | 19% | 66%
build/fbcode_builder0% | 0% | 13% | 26% | 59%
thrift/conformance0% | 0% | 13% | 4% | 81%
thrift/example0% | 0% | 0% | 0% | 100%
build0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
247 73 2
296 63 5
269 62 4
352 58 1
309 54 3
91 54 1
240 51 5
99 46 5
118 45 0
254 41 4
95 41 5
164 38 3
157 37 4
112 37 2
138 37 4
107 36 1
125 35 1
156 34 4
73 33 6
120 31 4
321 31 1
103 30 3
172 30 5
115 30 8
77 30 4
140 29 4
103 28 5
109 28 2
94 28 2
86 27 3
89 27 1
84 27 0
173 27 0
86 27 4
28 27 1
112 27 6
120 27 4
192 26 3
165 26 5
58 26 2
63 26 4
108 25 1
102 25 0
110 25 3
115 25 2
101 25 2
90 25 3
131 25 3
155 25 4
79 25 0