facebook / fbt
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 347 units with 4,507 lines of code in units (30.2% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 8 medium complex units (386 lines of code)
    • 34 simple units (1,240 lines of code)
    • 305 very simple units (2,881 lines of code)
0% | 0% | 8% | 27% | 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
js0% | 0% | 8% | 28% | 63%
java0% | 0% | 0% | 0% | 100%
mm0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
packages/babel-plugin-fbt0% | 0% | 12% | 23% | 64%
runtime/shared0% | 0% | 12% | 36% | 50%
auto-param-new-string-helper0% | 0% | 0% | 76% | 23%
packages/babel-plugin-standalone0% | 0% | 0% | 20% | 79%
packages/babel-plugin-fbt-runtime0% | 0% | 0% | 61% | 38%
packages/fb-babel-plugin-utils0% | 0% | 0% | 18% | 81%
packages/gulp-rewrite-flowtyped-modules0% | 0% | 0% | 40% | 59%
packages/fb-tiger-hash0% | 0% | 0% | 0% | 100%
demo-app/src0% | 0% | 0% | 0% | 100%
packages/react-native-fbt0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
runtime/nonfb0% | 0% | 0% | 0% | 100%
packages/default-collection-transform0% | 0% | 0% | 0% | 100%
packages/gulp-strip-docblock-pragmas0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
36 18 2
96 18 3
68 16 3
27 16 2
30 16 2
62 13 4
27 11 3
40 11 2
74 10 3
66 10 1
44 10 1
39 10 1
21 9 1
33 9 4
17 8 1
76 8 3
72 8 5
76 8 5
12 8 1
31 8 2
33 8 1
28 7 2
44 7 3
12 7 2
14 7 1
34 7 1
11 7 1
23 7 1
36 7 5
45 7 1
79 6 4
33 6 5
15 6 2
34 6 1
8 6 1
21 6 3
25 6 2
39 6 5
49 6 2
22 6 0
36 6 1
38 6 1
16 5 0
17 5 1
30 5 5
27 5 1
9 5 1
28 5 1
8 5 1
21 5 1