microsoft / react-native-macos
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 26,757 units with 315,393 lines of code in units (60.3% of code).
    • 42 very complex units (11,769 lines of code)
    • 198 complex units (24,458 lines of code)
    • 879 medium complex units (53,178 lines of code)
    • 1,725 simple units (48,590 lines of code)
    • 23,913 very simple units (177,398 lines of code)
3% | 7% | 16% | 15% | 56%
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
js5% | 12% | 23% | 16% | 42%
h3% | <1% | 7% | 10% | 78%
cpp2% | 6% | 14% | 16% | 59%
cc4% | <1% | 13% | 31% | 50%
java0% | 4% | 9% | 14% | 71%
mm0% | 0% | 21% | 9% | 68%
m0% | 0% | 12% | 13% | 73%
py0% | 0% | 15% | 16% | 68%
ts0% | 0% | 12% | 16% | 71%
rb0% | 0% | 0% | 74% | 25%
kt0% | 0% | 0% | 0% | 100%
pyx0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
Libraries5% | 12% | 23% | 16% | 41%
Folly2% | 1% | 10% | 15% | 70%
ReactCommon5% | 7% | 12% | 11% | 63%
double-conversion8% | 0% | 12% | 36% | 42%
ReactAndroid0% | 4% | 9% | 14% | 71%
glog0% | 1% | 15% | 21% | 61%
React0% | 0% | 16% | 7% | 75%
packages0% | 0% | 12% | 10% | 76%
android-patches0% | 0% | 14% | 19% | 65%
bots0% | 0% | 9% | 27% | 63%
scripts0% | 0% | 0% | 45% | 54%
jest0% | 0% | 0% | 61% | 38%
local-cli0% | 0% | 0% | 18% | 81%
template0% | 0% | 0% | 14% | 85%
ROOT0% | 0% | 0% | 0% | 100%
ReactTurboModuleCxx0% | 0% | 0% | 0% | 100%
flow0% | 0% | 0% | 0% | 100%
jsc0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
bool FOLLY_EXPECTED_ID()
in Folly/folly/Expected.h
1047 162 1
static void YGNodelayoutImpl()
in ReactCommon/yoga/yoga/Yoga.cpp
736 141 15
double StringToDoubleConverter::StringToIeee()
in double-conversion/double-conversion/double-conversion.cc
248 97 4
function completeWork()
in Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js
324 85 3
function completeWork()
in Libraries/Renderer/implementations/ReactNativeRenderer-dev.js
314 83 3
static void calculateShadowViewMutationsFlattener()
in ReactCommon/react/renderer/mounting/Differentiator.cpp
369 82 9
function completeWork()
in Libraries/Renderer/implementations/ReactFabric-dev.fb.js
312 81 3
function completeWork()
in Libraries/Renderer/implementations/ReactFabric-dev.js
311 81 3
static void calculateShadowViewMutationsV2()
in ReactCommon/react/renderer/mounting/Differentiator.cpp
395 68 6
class alignas()
in Folly/folly/concurrency/detail/ConcurrentHashMap-detail.h
517 67 1
function updateClassComponent()
in Libraries/Renderer/implementations/ReactFabric-prod.fb.js
202 66 5
function updateClassComponent()
in Libraries/Renderer/implementations/ReactFabric-prod.js
202 66 5
function updateClassComponent()
in Libraries/Renderer/implementations/ReactFabric-profiling.fb.js
202 66 5
function updateClassComponent()
in Libraries/Renderer/implementations/ReactFabric-profiling.js
202 66 5
function updateClassComponent()
in Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js
202 66 5
function updateClassComponent()
in Libraries/Renderer/implementations/ReactNativeRenderer-prod.js
202 66 5
function updateClassComponent()
in Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js
202 66 5
function updateClassComponent()
in Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js
202 66 5
extractEvents: function()
in Libraries/Renderer/implementations/ReactFabric-prod.fb.js
267 63 4
extractEvents: function()
in Libraries/Renderer/implementations/ReactFabric-prod.js
267 63 4