microsoft / react-native-windows
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 6,976 units with 72,690 lines of code in units (51.6% of code).
    • 7 very complex units (2,734 lines of code)
    • 30 complex units (4,319 lines of code)
    • 160 medium complex units (7,824 lines of code)
    • 395 simple units (10,586 lines of code)
    • 6,384 very simple units (47,227 lines of code)
3% | 5% | 10% | 14% | 64%
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
cpp6% | 9% | 11% | 14% | 58%
js3% | 0% | 17% | 15% | 63%
ts1% | 3% | 12% | 18% | 63%
h0% | 5% | 1% | 6% | 86%
cs0% | 1% | 11% | 18% | 67%
tsx0% | 0% | 7% | 10% | 81%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
vnext/Microsoft.ReactNative4% | 7% | 10% | 17% | 59%
vnext/ReactCommon21% | 26% | 16% | 7% | 27%
packages/react-native-platform-override12% | 16% | 9% | 11% | 49%
vnext/src9% | 0% | 26% | 19% | 44%
packages/@rnw-scripts6% | 0% | 6% | 31% | 55%
vnext/Mso0% | 7% | 3% | 4% | 84%
packages/@react-native-windows0% | 4% | 13% | 16% | 66%
vnext/Shared0% | 3% | 10% | 16% | 69%
vnext/Microsoft.ReactNative.Managed.CodeGen0% | 5% | 20% | 25% | 48%
packages/@office-iss0% | 0% | 16% | 12% | 71%
vnext/Microsoft.ReactNative.Managed0% | 0% | 7% | 17% | 75%
packages/react-native-windows-init0% | 0% | 43% | 13% | 43%
vnext/Desktop0% | 0% | 12% | 10% | 76%
vnext/Microsoft.ReactNative.Cxx0% | 0% | 2% | 13% | 83%
packages/playground0% | 0% | 11% | 36% | 51%
vnext/codegen0% | 0% | 2% | 2% | 94%
vnext/Chakra0% | 0% | 3% | 5% | 91%
packages/@react-native0% | 0% | 0% | 9% | 90%
vnext/Microsoft.ReactNative.IntegrationTests0% | 0% | 0% | 8% | 91%
packages/sample-apps0% | 0% | 0% | 2% | 97%
vnext/Microsoft.ReactNative.ComponentTests0% | 0% | 0% | 0% | 100%
vnext/Desktop.IntegrationTests0% | 0% | 0% | 0% | 100%
vnext/Scripts0% | 0% | 0% | 0% | 100%
vnext/Common0% | 0% | 0% | 0% | 100%
vnext/template0% | 0% | 0% | 0% | 100%
vnext/Desktop.ABITests0% | 0% | 0% | 0% | 100%
vnext/stubs0% | 0% | 0% | 0% | 100%
vnext0% | 0% | 0% | 0% | 100%
vnext/Folly0% | 0% | 0% | 0% | 100%
vnext/include0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
static void YGNodelayoutImpl()
in vnext/ReactCommon/Yoga.cpp
736 141 15
static void YGNodelayoutImpl()
in packages/react-native-platform-override/src/e2etest/collateral/sampleOverrideRepo/ReactCommon/yoga/yoga/Yoga.cpp
721 140 15
bool FrameworkElementViewManager::UpdateProperty()
in vnext/Microsoft.ReactNative/Views/FrameworkElementViewManager.cpp
316 112 3
static void StyleYogaNode()
in vnext/Microsoft.ReactNative/Modules/NativeUIManager.cpp
292 108 3
void TextInputShadowNode::updateProperties()
in vnext/Microsoft.ReactNative/Views/TextInputViewManager.cpp
214 91 1
function InternalTextInput()
in vnext/src/Libraries/Components/TextInput/TextInput.windows.js
325 71 1
function transformElement()
in packages/@rnw-scripts/doxysaurus/src/markdown.ts
130 69 2
void TextInputShadowNode::registerEvents()
in vnext/Microsoft.ReactNative/Views/TextInputViewManager.cpp
152 46 0
static void YGNodeComputeFlexBasisForChild()
in packages/react-native-platform-override/src/e2etest/collateral/sampleOverrideRepo/ReactCommon/yoga/yoga/Yoga.cpp
173 43 14
173 43 14
bool YGLayoutNodeInternal()
in packages/react-native-platform-override/src/e2etest/collateral/sampleOverrideRepo/ReactCommon/yoga/yoga/Yoga.cpp
232 38 15
winrt::fire_and_forget ReactImage::SetBackground()
in vnext/Microsoft.ReactNative/Views/Image/ReactImage.cpp
151 38 1
bool YGLayoutNodeInternal()
in vnext/ReactCommon/Yoga.cpp
234 38 15
void ScrollViewShadowNode::updateProperties()
in vnext/Microsoft.ReactNative/Views/ScrollViewManager.cpp
101 37 1
static float YGDistributeFreeSpaceSecondPass()
in packages/react-native-platform-override/src/e2etest/collateral/sampleOverrideRepo/ReactCommon/yoga/yoga/Yoga.cpp
175 35 17
void FlyoutShadowNode::updateProperties()
in vnext/Microsoft.ReactNative/Views/FlyoutViewManager.cpp
90 35 1
175 35 17
static void YGNodeAbsoluteLayoutChild()
in packages/react-native-platform-override/src/e2etest/collateral/sampleOverrideRepo/ReactCommon/yoga/yoga/Yoga.cpp
176 34 11
bool TextViewManager::UpdateProperty()
in vnext/Microsoft.ReactNative/Views/TextViewManager.cpp
101 34 3
static void YGNodeAbsoluteLayoutChild()
in vnext/ReactCommon/Yoga.cpp
176 34 11