facebook / flow
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 725 units with 10,105 lines of code in units (4.2% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (47 lines of code)
    • 16 medium complex units (883 lines of code)
    • 41 simple units (1,333 lines of code)
    • 667 very simple units (7,842 lines of code)
0% | <1% | 8% | 13% | 77%
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% | 10% | 12% | 76%
c0% | 0% | 3% | 14% | 81%
rb0% | 0% | 0% | 17% | 82%
cc0% | 0% | 0% | 47% | 52%
h0% | 0% | 0% | 36% | 63%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
packages/eslint-plugin-fb-flow0% | 15% | 28% | 9% | 45%
packages/flow-dev-tools0% | 0% | 23% | 15% | 60%
packages/flow-upgrade0% | 0% | 55% | 29% | 14%
packages/flow-remove-types0% | 0% | 11% | 35% | 52%
src/heap0% | 0% | 7% | 23% | 69%
website/_webpack0% | 0% | 0% | 29% | 70%
new_website/src0% | 0% | 0% | 23% | 76%
src/hack_forked0% | 0% | 0% | 9% | 90%
website/_plugins0% | 0% | 0% | 17% | 82%
packages/babel-plugin-transform-flow-enums0% | 0% | 0% | 84% | 15%
packages/flow-parser-bin0% | 0% | 0% | 47% | 52%
src/parser0% | 0% | 0% | 36% | 63%
lib0% | 0% | 0% | 0% | 100%
newtests/lsp0% | 0% | 0% | 0% | 100%
src/common0% | 0% | 0% | 0% | 100%
src/parser_utils0% | 0% | 0% | 0% | 100%
js0% | 0% | 0% | 0% | 100%
src/services0% | 0% | 0% | 0% | 100%
packages/flow-enums-runtime0% | 0% | 0% | 0% | 100%
newtests/jsx_pragma0% | 0% | 0% | 0% | 100%
newtests/unsupported_spread_args0% | 0% | 0% | 0% | 100%
newtests/autocomplete0% | 0% | 0% | 0% | 100%
newtests/array_literal_tuple_spread0% | 0% | 0% | 0% | 100%
newtests/tuples0% | 0% | 0% | 0% | 100%
newtests/sketchy_null0% | 0% | 0% | 0% | 100%
newtests/dynamic_import0% | 0% | 0% | 0% | 100%
new_website/components0% | 0% | 0% | 0% | 100%
new_website0% | 0% | 0% | 0% | 100%
src0% | 0% | 0% | 0% | 100%
newtests/shadow0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
47 26 1
87 20 3
50 18 2
98 17 1
77 17 6
65 16 1
40 16 2
61 15 6
44 15 1
56 14 0
45 13 4
85 13 1
27 12 3
29 12 3
31 11 2
32 11 2
56 11 1
26 10 3
63 10 6
13 10 1
31 9 1
20 9 3
37 9 1
28 9 0
20 9 3
51 9 2
23 8 1
49 8 2
33 8 1
21 8 2
32 8 1
22 8 1
65 8 1
94 7 2
45 7 3
50 7 1
24 7 2
13 7 1
30 7 5
31 7 2
20 7 2
36 7 1
35 7 4
17 6 1
29 6 1
45 6 1
17 6 1
31 6 2
40 6 1
27 6 2