facebook / fboss
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 10,664 units with 123,323 lines of code in units (54.7% of code).
    • 13 very complex units (2,353 lines of code)
    • 40 complex units (5,465 lines of code)
    • 270 medium complex units (16,068 lines of code)
    • 642 simple units (20,969 lines of code)
    • 9,699 very simple units (78,468 lines of code)
1% | 4% | 13% | 17% | 63%
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
cpp2% | 5% | 13% | 18% | 60%
hpp0% | 11% | 23% | 22% | 42%
py0% | 1% | 14% | 22% | 61%
h0% | 0% | 4% | 6% | 89%
c0% | 0% | 0% | 33% | 66%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
fboss/agent2% | 5% | 10% | 15% | 66%
fboss/util6% | 4% | 22% | 21% | 45%
fboss/cli0% | 7% | 21% | 21% | 48%
fboss/platform0% | 2% | 21% | 16% | 60%
fboss/py0% | 4% | 21% | 15% | 58%
fboss/lib0% | 1% | 10% | 15% | 72%
fboss/qsfp_service0% | 0% | 16% | 23% | 59%
build/fbcode_builder0% | 0% | 13% | 26% | 59%
fboss/mdio0% | 0% | 26% | 0% | 73%
fboss/bcm_wrapper0% | 0% | 0% | 32% | 67%
fboss/fsdb0% | 0% | 0% | 17% | 82%
installer/centos-7-x86_640% | 0% | 0% | 23% | 76%
common/fb3030% | 0% | 0% | 0% | 100%
fboss/mka_service0% | 0% | 0% | 0% | 100%
common/process0% | 0% | 0% | 0% | 100%
common/time0% | 0% | 0% | 0% | 100%
common/network0% | 0% | 0% | 0% | 100%
common/stats0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
281 98 2
316 98 4
431 86 2
89 82 1
87 81 1
87 81 1
87 81 1
87 81 1
87 81 1
204 70 3
230 65 3
199 52 4
168 51 3
169 50 3
160 49 3
102 49 1
100 48 0
96 46 1
204 45 2
112 45 2
79 45 0
162 42 3
132 42 2
254 42 0
122 40 4
84 39 1
107 38 2
140 37 2
226 36 2
194 36 3
45 36 1
51 35 1
84 35 2
81 35 1
172 34 1
66 34 1
159 33 4
104 33 1
183 32 2
262 31 5
125 31 3
148 29 0
262 29 4
100 29 0
126 28 0
169 28 2
132 28 2
132 28 3
126 27 2
108 27 2