facebook / openbmc
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 7,923 units with 142,009 lines of code in units (28.5% of code).
    • 29 very complex units (8,584 lines of code)
    • 68 complex units (8,265 lines of code)
    • 494 medium complex units (30,104 lines of code)
    • 972 simple units (30,466 lines of code)
    • 6,360 very simple units (64,590 lines of code)
6% | 5% | 21% | 21% | 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
c8% | 7% | 24% | 21% | 38%
cpp4% | 2% | 19% | 23% | 50%
py1% | 3% | 13% | 20% | 60%
h0% | 0% | 12% | 4% | 83%
go0% | 0% | 0% | 26% | 73%
hpp0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
common/recipes-core6% | 5% | 30% | 20% | 37%
common/recipes-lib12% | 5% | 13% | 18% | 48%
common/recipes-utils8% | 11% | 18% | 17% | 44%
meta-facebook/meta-cloudripper21% | 10% | 18% | 22% | 26%
meta-facebook/meta-fby39% | 5% | 31% | 20% | 32%
meta-facebook/recipes-utils19% | 6% | 20% | 12% | 40%
meta-facebook/meta-galaxy10012% | 3% | 7% | 21% | 55%
meta-facebook/meta-wedge15% | 0% | 17% | 18% | 48%
meta-facebook/meta-cmm19% | 10% | 5% | 17% | 46%
meta-facebook/meta-fby24% | 0% | 20% | 30% | 44%
meta-facebook/meta-clearcreek0% | 14% | 27% | 23% | 34%
meta-facebook/meta-elbert0% | 9% | 11% | 18% | 60%
meta-bf/meta-mavericks0% | 13% | 18% | 22% | 45%
meta-facebook/meta-fbttn0% | 13% | 12% | 19% | 54%
meta-facebook/meta-fbep0% | 5% | 21% | 27% | 45%
meta-facebook/meta-fby350% | 4% | 29% | 24% | 41%
meta-portwell/meta-pwneptune0% | 6% | 31% | 15% | 46%
meta-facebook/meta-yamp0% | 11% | 9% | 23% | 56%
common/recipes-connectivity0% | 20% | 27% | 23% | 28%
meta-aspeed/recipes-utils0% | 15% | 5% | 31% | 47%
meta-facebook/meta-fuji0% | 3% | 15% | 25% | 55%
meta-facebook/meta-wedge1000% | 2% | 8% | 15% | 74%
meta-facebook/meta-fbal0% | 0% | 24% | 26% | 49%
meta-facebook/meta-fbtp0% | 0% | 26% | 22% | 50%
meta-facebook/meta-grandcanyon0% | 0% | 15% | 29% | 54%
meta-facebook/recipes-kernel0% | 0% | 30% | 28% | 41%
meta-facebook/meta-wedge4000% | 0% | 25% | 17% | 56%
meta-facebook/meta-minilaketb0% | 0% | 13% | 32% | 54%
tools/verified-boot0% | 0% | 28% | 18% | 52%
meta-facebook/meta-fbsp0% | 0% | 15% | 33% | 50%
meta-portwell/recipes-utils0% | 0% | 30% | 17% | 51%
meta-facebook/meta-yosemite0% | 0% | 20% | 31% | 48%
meta-facebook/meta-minipack0% | 0% | 4% | 40% | 54%
common/recipes-rest0% | 0% | 3% | 23% | 73%
common/recipes-devtools0% | 0% | 45% | 34% | 20%
meta-facebook/meta-lightning0% | 0% | 7% | 29% | 62%
common/recipes-qin0% | 0% | 2% | 5% | 92%
tools/flashy0% | 0% | 0% | 26% | 73%
tools/fw_upgrade0% | 0% | 0% | 31% | 68%
tests2/tools0% | 0% | 0% | 38% | 61%
common/recipes-kernel0% | 0% | 0% | 40% | 59%
common/recipes-benchmark0% | 0% | 0% | 63% | 36%
tests2/common0% | 0% | 0% | 19% | 80%
tests2/utils0% | 0% | 0% | 14% | 85%
tests20% | 0% | 0% | 7% | 92%
tools/circle-ci0% | 0% | 0% | 12% | 87%
tests2/experimental0% | 0% | 0% | 0% | 100%
meta-facebook/recipes-extended0% | 0% | 0% | 0% | 100%
common/recipes-support0% | 0% | 0% | 0% | 100%
experimental/buck-example0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
689 173 2
571 163 2
606 146 4
444 135 2
498 135 2
395 130 2
146 130 2
128 116 2
134 80 0
431 75 2
162 73 2
112 73 1
473 69 2
248 67 2
222 67 4
268 66 0
448 64 2
232 59 2
219 59 2
97 58 3
256 58 1
186 57 4
84 56 3
264 54 2
180 54 3
263 54 2
273 52 2
216 51 2
339 51 1
149 50 3
261 49 2
168 47 2
112 45 3
187 44 2
216 43 3
156 42 2
127 41 2
163 40 1
104 40 2
49 40 1
204 40 3
124 39 3
130 39 2
162 38 1
150 38 1
170 37 1
125 37 4
167 37 1
50 36 2
75 36 0