facebookexperimental / eden
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 22,154 units with 278,536 lines of code in units (45.6% of code).
    • 11 very complex units (2,170 lines of code)
    • 113 complex units (12,494 lines of code)
    • 781 medium complex units (41,014 lines of code)
    • 1,658 simple units (45,326 lines of code)
    • 19,591 very simple units (177,532 lines of code)
<1% | 4% | 14% | 16% | 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
py1% | 8% | 24% | 21% | 44%
c7% | 2% | 18% | 34% | 37%
rs<1% | <1% | 5% | 8% | 84%
cpp0% | 2% | 11% | 21% | 63%
js0% | 0% | 19% | 15% | 64%
h0% | 0% | 3% | 8% | 87%
pyx0% | 0% | 0% | 9% | 90%
pyi0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
eden/scm1% | 6% | 19% | 17% | 55%
eden/fs0% | 1% | 10% | 20% | 67%
eden/mononoke0% | 0% | 4% | 8% | 86%
build/fbcode_builder0% | 0% | 13% | 26% | 59%
eden/integration0% | 0% | 6% | 12% | 81%
configerator/structs0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
common/fb3030% | 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
234 89 4
281 79 8
254 75 7
217 74 5
189 69 3
176 64 3
151 63 4
208 62 5
177 55 1
139 52 6
144 51 5
144 50 0
122 49 5
173 48 6
149 48 7
104 47 3
152 46 4
88 46 6
131 46 3
180 46 5
199 45 4
153 45 3
135 45 4
190 44 0
180 44 1
106 44 4
187 43 3
259 43 1
68 42 3
139 42 3
158 41 4
154 39 5
130 39 8
69 39 7
112 39 4
225 39 6
133 38 3
91 38 4
133 38 1
57 38 3
108 38 3
173 37 5
95 37 1
80 37 1
95 37 3
103 37 4
219 37 4
213 37 1
95 36 2
72 36 4