facebook / fbjs
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 335 units with 3,728 lines of code in units (63.5% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (69 lines of code)
    • 5 medium complex units (201 lines of code)
    • 38 simple units (817 lines of code)
    • 291 very simple units (2,641 lines of code)
0% | 1% | 5% | 21% | 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% | 5% | 21% | 70%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
fbjs/src0% | 2% | 3% | 23% | 70%
babel-preset-fbjs0% | 0% | 100% | 0% | 0%
babel-preset-fbjs/plugins0% | 0% | 7% | 37% | 54%
fbjs-scripts/gulp0% | 0% | 0% | 49% | 50%
eslint-config-fbjs0% | 0% | 0% | 0% | 100%
fbjs0% | 0% | 0% | 0% | 100%
fbjs-scripts/jest0% | 0% | 0% | 0% | 100%
signedsource0% | 0% | 0% | 0% | 100%
fbjs-eslint-utils0% | 0% | 0% | 0% | 100%
eslint-config-fbjs/utils0% | 0% | 0% | 0% | 100%
fbjs-scripts/babel0% | 0% | 0% | 0% | 100%
fbjs-scripts/node0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
69 30 4
35 20 1
35 18 2
34 18 3
71 11 1
26 11 2
23 10 2
23 10 1
27 10 4
24 10 2
23 9 2
14 9 1
29 9 1
39 8 2
24 8 2
23 8 2
17 8 2
10 8 1
16 8 1
12 8 1
17 8 2
19 7 2
33 7 1
11 7 2
15 7 1
13 7 3
45 7 0
66 7 3
27 6 2
20 6 3
18 6 2
18 6 2
18 6 1
21 6 0
26 6 0
28 6 2
13 6 1
11 6 1
9 6 1
17 6 1
16 6 1
17 6 2
19 6 2
16 6 2
46 5 1
14 5 2
20 5 2
14 5 4
20 5 1
7 5 2