facebook / react-native
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 12,233 units with 140,604 lines of code in units (52.8% of code).
    • 21 very complex units (5,731 lines of code)
    • 90 complex units (11,909 lines of code)
    • 348 medium complex units (19,841 lines of code)
    • 737 simple units (19,861 lines of code)
    • 11,037 very simple units (83,262 lines of code)
4% | 8% | 14% | 14% | 59%
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
js6% | 14% | 19% | 15% | 43%
cpp7% | 7% | 12% | 10% | 61%
h2% | 1% | 9% | 10% | 75%
java0% | 4% | 9% | 15% | 70%
mm0% | 0% | 20% | 9% | 69%
m0% | 0% | 13% | 13% | 73%
rb0% | 0% | 27% | 31% | 41%
kt0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
Libraries6% | 15% | 20% | 16% | 41%
ReactCommon4% | 6% | 12% | 11% | 63%
ReactAndroid1% | 4% | 8% | 14% | 71%
packages3% | 0% | 11% | 9% | 74%
React0% | 0% | 16% | 7% | 76%
scripts0% | 0% | 26% | 30% | 43%
bots0% | 0% | 7% | 29% | 63%
template0% | 0% | 0% | 7% | 92%
ROOT0% | 0% | 0% | 0% | 100%
jest0% | 0% | 0% | 0% | 100%
flow0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
155 151 1
736 141 15
365 82 9
392 68 6
202 66 5
202 66 5
202 66 5
202 66 5
267 63 4
267 63 4
267 63 4
267 63 4
444 63 1
400 61 1
225 57 2
201 54 0
201 54 0
185 51 3
183 51 3
183 51 3
185 51 3
192 49 3
189 48 2
189 48 2
234 48 9
190 47 3
156 46 3
185 45 2
185 45 2
254 45 1
139 44 2
92 44 3
173 43 14
145 42 2
145 42 0
145 42 0
145 42 2
137 40 2
137 40 2
95 40 1
147 40 1
238 40 0
85 39 4
85 39 4
85 39 4
85 39 4
234 38 15
177 38 3
108 38 1
177 38 3