facebook / draft-js
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 248 units with 4,235 lines of code in units (33.0% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (137 lines of code)
    • 9 medium complex units (669 lines of code)
    • 21 simple units (825 lines of code)
    • 216 very simple units (2,604 lines of code)
0% | 3% | 15% | 19% | 61%
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% | 3% | 15% | 19% | 61%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/component/handlers0% | 7% | 33% | 9% | 48%
src/component/utils0% | 24% | 0% | 14% | 61%
src/component/selection0% | 0% | 37% | 19% | 42%
src/model/immutable0% | 0% | 0% | 21% | 78%
src/model/modifier0% | 0% | 0% | 63% | 36%
website/src/components0% | 0% | 0% | 57% | 42%
src/model/transaction0% | 0% | 0% | 16% | 83%
src/component/base0% | 0% | 0% | 50% | 49%
src/model/encoding0% | 0% | 0% | 10% | 89%
src/model/entity0% | 0% | 0% | 0% | 100%
src/component/contents0% | 0% | 0% | 0% | 100%
src/model/decorators0% | 0% | 0% | 0% | 100%
website/src/pages0% | 0% | 0% | 0% | 100%
scripts/jest0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
src/model/paste0% | 0% | 0% | 0% | 100%
src/util0% | 0% | 0% | 0% | 100%
src/model/keys0% | 0% | 0% | 0% | 100%
src/stubs0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
53 43 1
84 28 2
102 24 2
93 22 1
109 21 2
78 19 5
95 14 5
53 14 4
59 13 1
34 13 3
46 13 2
55 9 3
64 9 1
25 9 3
63 9 4
80 9 5
51 8 2
25 8 2
38 8 1
50 8 2
82 7 1
24 7 2
31 7 1
15 6 1
16 6 2
13 6 1
24 6 2
37 6 1
9 6 1
45 6 4
52 6 7
26 6 2
13 5 1
12 5 1
18 5 1
26 5 4
17 5 5
11 5 1
11 5 1
12 5 1
49 5 1
23 5 3
11 5 3
10 5 3
12 5 1
31 5 2
21 5 3
26 5 2
8 4 1
6 4 1