reactjs / zh-hant.reactjs.org
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 191 units with 3,795 lines of code in units (29.1% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 3 medium complex units (295 lines of code)
    • 11 simple units (405 lines of code)
    • 177 very simple units (3,095 lines of code)
0% | 0% | 7% | 10% | 81%
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
tsx0% | 0% | 14% | 12% | 72%
js0% | 0% | 0% | 8% | 91%
ts0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
beta/src0% | 0% | 14% | 12% | 73%
src/templates0% | 0% | 0% | 34% | 65%
beta/scripts0% | 0% | 0% | 14% | 85%
src/components0% | 0% | 0% | 3% | 96%
src0% | 0% | 0% | 10% | 89%
src/pages0% | 0% | 0% | 0% | 100%
scripts0% | 0% | 0% | 0% | 100%
src/utils0% | 0% | 0% | 0% | 100%
beta/plugins0% | 0% | 0% | 0% | 100%
gatsby0% | 0% | 0% | 0% | 100%
beta/public0% | 0% | 0% | 0% | 100%
static/js0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
beta0% | 0% | 0% | 0% | 100%
plugins/gatsby-remark-header-custom-ids0% | 0% | 0% | 0% | 100%
plugins/gatsby-transformer-versions-yaml0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
159 25 5
58 13 9
78 12 4
44 9 1
40 9 7
97 8 0
27 7 2
33 7 3
48 6 2
47 6 4
17 6 0
17 6 1
15 6 1
20 6 1
26 5 8
33 5 2
18 5 0
66 5 5
30 5 5
35 5 0
19 5 0
22 5 3
11 5 2
186 5 0
152 5 0
22 4 1
12 4 1
34 4 2
33 4 7
15 4 2
16 4 1
38 4 0
12 4 0
13 4 2
16 4 0
5 3 1
10 3 1
10 3 1
18 3 1
13 3 1
16 3 1
34 3 2
10 3 1
32 3 6
7 3 1
34 3 4
9 3 1
35 3 0
8 3 1
10 3 1