facebook / watchman
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,248 units with 30,471 lines of code in units (57.4% of code).
    • 1 very complex units (216 lines of code)
    • 11 complex units (1,269 lines of code)
    • 69 medium complex units (4,957 lines of code)
    • 238 simple units (7,566 lines of code)
    • 1,929 very simple units (16,463 lines of code)
<1% | 4% | 16% | 24% | 54%
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
cpp1% | 6% | 20% | 27% | 44%
c0% | 10% | 14% | 40% | 34%
py0% | 0% | 13% | 24% | 62%
js0% | 0% | 13% | 34% | 51%
java0% | 0% | 6% | 17% | 75%
h0% | 0% | 0% | 6% | 93%
rs0% | 0% | 0% | <1% | 99%
rb0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
watchman2% | 5% | 15% | 29% | 47%
watchman/winbuild0% | 48% | 7% | 8% | 35%
watchman/root0% | 20% | 16% | 32% | 30%
watchman/fs0% | 10% | 33% | 15% | 40%
watchman/python0% | 5% | 12% | 30% | 52%
watchman/watcher0% | 0% | 31% | 22% | 45%
build/fbcode_builder0% | 0% | 13% | 26% | 59%
watchman/query0% | 0% | 29% | 25% | 45%
watchman/cmds0% | 0% | 19% | 35% | 44%
watchman/integration0% | 0% | 16% | 9% | 73%
watchman/ruby0% | 0% | 28% | 35% | 36%
watchman/node0% | 0% | 14% | 36% | 49%
watchman/java0% | 0% | 6% | 17% | 75%
watchman/cppclient0% | 0% | 0% | 28% | 71%
watchman/rust0% | 0% | 0% | <1% | 99%
watchman/scm0% | 0% | 0% | 0% | 100%
watchman/build0% | 0% | 0% | 0% | 100%
watchman/saved_state0% | 0% | 0% | 0% | 100%
watchman/cli0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
216 62 3
106 33 5
113 31 5
144 30 0
123 30 4
173 30 6
124 29 3
99 29 2
178 28 7
67 28 2
58 27 1
84 26 2
162 25 2
76 25 4
147 24 1
138 24 4
107 24 6
145 24 4
148 24 1
115 23 2
74 22 0
62 22 1
84 21 2
80 21 3
111 20 6
131 20 4
142 20 0
60 20 2
86 20 3
94 19 2
152 19 2
109 19 4
53 19 2
40 19 2
73 19 2
69 18 2
62 17 4
84 17 2
37 17 5
41 17 1
56 16 3
55 16 4
44 16 3
66 15 3
126 15 0
53 15 2
41 15 2
99 14 0
33 14 3
106 14 2