reactjs / react-codemod
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 517 units with 3,819 lines of code in units (48.5% of code).
    • 1 very complex units (231 lines of code)
    • 4 complex units (909 lines of code)
    • 7 medium complex units (593 lines of code)
    • 5 simple units (140 lines of code)
    • 500 very simple units (1,946 lines of code)
6% | 23% | 15% | 3% | 50%
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
js6% | 23% | 15% | 3% | 50%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
transforms12% | 36% | 32% | 4% | 13%
transforms/utils0% | 83% | 0% | 0% | 16%
transforms/__testfixtures__/class0% | 0% | 0% | 6% | 93%
transforms/__testfixtures__0% | 0% | 0% | 0% | 100%
transforms/__testfixtures__/rename-unsafe-lifecycles0% | 0% | 0% | 0% | 100%
transforms/__testfixtures__/React-PropTypes-to-prop-types0% | 0% | 0% | 0% | 100%
transforms/__testfixtures__/manual-bind-to-arrow0% | 0% | 0% | 0% | 100%
transforms/__testfixtures__/ReactNative-View-propTypes0% | 0% | 0% | 0% | 100%
transforms/__testfixtures__/React-DOM-to-react-dom-factories0% | 0% | 0% | 0% | 100%
transforms/__testfixtures__/error-boundaries0% | 0% | 0% | 0% | 100%
transforms/__testfixtures__/custom-sort-group0% | 0% | 0% | 0% | 100%
transforms/__testfixtures__/custom-sort0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
231 64 3
282 50 3
285 45 3
248 38 1
94 34 3
133 20 3
60 17 3
138 16 3
123 16 3
56 13 2
53 12 3
30 11 2
21 10 3
30 8 2
24 8 0
38 8 2
27 7 1
13 5 2
29 5 3
18 5 2
11 4 2
13 4 2
21 4 2
7 3 2
20 3 2
7 3 2
23 3 1
19 3 3
10 3 0
10 3 0
18 3 2
15 3 1
11 2 3
18 2 2
15 2 0
15 2 0
5 2 0
6 2 1
7 2 1
10 2 2
3 2 2
13 2 2
7 2 1
10 2 2
10 2 2
5 2 1
4 1 2
8 1 1
11 1 1
3 1 0