facebook / metro
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 662 units with 10,052 lines of code in units (44.0% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (88 lines of code)
    • 20 medium complex units (1,317 lines of code)
    • 47 simple units (1,598 lines of code)
    • 594 very simple units (7,049 lines of code)
0% | <1% | 13% | 15% | 70%
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
js0% | <1% | 13% | 15% | 70%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
packages/metro-source-map0% | 12% | 7% | 1% | 78%
packages/metro0% | 0% | 8% | 13% | 78%
packages/metro-transform-plugins0% | 0% | 37% | 23% | 38%
packages/metro-runtime0% | 0% | 28% | 40% | 31%
packages/metro-config0% | 0% | 48% | 0% | 51%
packages/metro-resolver0% | 0% | 25% | 21% | 52%
scripts0% | 0% | 23% | 18% | 57%
packages/metro-memory-fs0% | 0% | 14% | 8% | 76%
packages/metro-inspector-proxy0% | 0% | 17% | 22% | 59%
eslint-rules0% | 0% | 31% | 31% | 36%
packages/metro-transform-worker0% | 0% | 0% | 40% | 59%
packages/metro-react-native-babel-transformer0% | 0% | 0% | 87% | 12%
packages/metro-cache0% | 0% | 0% | 28% | 71%
packages/metro-hermes-compiler0% | 0% | 0% | 62% | 37%
packages/metro-symbolicate0% | 0% | 0% | 0% | 100%
packages/buck-worker-tool0% | 0% | 0% | 0% | 100%
packages/metro-babel-register0% | 0% | 0% | 0% | 100%
packages/metro-core0% | 0% | 0% | 0% | 100%
packages/ob10% | 0% | 0% | 0% | 100%
packages/metro-minify-uglify0% | 0% | 0% | 0% | 100%
packages/metro-minify-terser0% | 0% | 0% | 0% | 100%
packages/metro-babel-transformer0% | 0% | 0% | 0% | 100%
packages/metro-react-native-babel-preset0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
packages/metro-cache-key0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
88 33 1
195 25 2
112 24 2
55 22 1
91 20 2
83 19 3
41 16 1
50 15 2
50 15 4
48 15 2
59 14 3
84 14 2
72 14 2
51 14 2
50 13 2
70 13 4
50 13 3
43 13 3
46 12 2
32 11 3
35 11 1
25 10 3
79 10 3
37 10 1
29 10 1
25 10 2
71 10 1
27 9 3
30 9 1
44 8 1
21 8 2
18 8 1
47 8 1
39 8 4
37 8 4
30 8 3
40 8 2
29 8 2
20 8 4
40 7 2
17 7 1
33 7 2
25 7 0
29 7 3
30 7 2
22 7 2
79 7 3
45 7 3
34 7 5
15 7 1