microsoft / ApplicationInsights-JS
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 995 units with 15,171 lines of code in units (59.8% of code).
    • 9 very long units (1,805 lines of code)
    • 34 long units (2,117 lines of code)
    • 155 medium size units (4,857 lines of code)
    • 241 small units (3,641 lines of code)
    • 556 very small units (2,751 lines of code)
11% | 13% | 32% | 23% | 18%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts11% | 14% | 31% | 24% | 18%
js17% | 10% | 36% | 21% | 13%
tsx0% | 0% | 22% | 33% | 43%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
extensions/applicationinsights-analytics-js55% | 6% | 11% | 8% | 18%
ROOT83% | 0% | 16% | 0% | 0%
extensions/applicationinsights-debugplugin-js40% | 11% | 18% | 13% | 16%
tools/chrome-debug-extension13% | 4% | 35% | 29% | 17%
shared/AppInsightsCore6% | 21% | 18% | 25% | 27%
extensions/applicationinsights-dependencies-js11% | 16% | 33% | 21% | 17%
extensions/applicationinsights-properties-js22% | 25% | 16% | 18% | 17%
shared/AppInsightsCommon0% | 15% | 48% | 24% | 11%
channels/applicationinsights-channel-js0% | 27% | 27% | 30% | 14%
tools/release-tools0% | 15% | 57% | 23% | 2%
tools/subResourceIntegrity0% | 65% | 31% | 0% | 2%
extensions/applicationinsights-react-native0% | 51% | 0% | 18% | 29%
tools/rollup-es30% | 18% | 36% | 23% | 21%
extensions/applicationinsights-perfmarkmeasure-js0% | 51% | 27% | 0% | 20%
tools/updateDistEsm0% | 45% | 54% | 0% | 0%
common/scripts0% | 0% | 47% | 41% | 11%
extensions/applicationinsights-clickanalytics-js0% | 0% | 44% | 27% | 27%
AISKU/src0% | 0% | 49% | 14% | 35%
scripts0% | 0% | 100% | 0% | 0%
tools/rollup-plugin-uglify3-js0% | 0% | 66% | 0% | 33%
tools/shims0% | 0% | 11% | 60% | 28%
AISKU/snippet0% | 0% | 0% | 59% | 40%
extensions/applicationinsights-react-js0% | 0% | 0% | 58% | 41%
AISKULight0% | 0% | 0% | 21% | 78%
AISKULight/dist-history0% | 0% | 0% | 0% | 100%
AISKU0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in extensions/applicationinsights-analytics-js/src/JavaScriptSDK/ApplicationInsights.ts
439 99 0
430 2 1
export function formatLogElements()
in extensions/applicationinsights-debugplugin-js/src/components/helpers.ts
166 38 8
export function formatLogElements()
in tools/chrome-debug-extension/src/helpers.ts
166 42 8
constructor()
in shared/AppInsightsCore/src/JavaScriptSDK/BaseCore.ts
140 29 0
constructor()
in extensions/applicationinsights-debugplugin-js/src/DebugPlugin.ts
136 21 0
constructor()
in extensions/applicationinsights-dependencies-js/src/ajax.ts
112 35 0
constructor()
in extensions/applicationinsights-debugplugin-js/src/components/Dashboard.ts
110 18 1
constructor()
in extensions/applicationinsights-properties-js/src/TelemetryContext.ts
106 17 2
export function createCookieMgr()
in shared/AppInsightsCore/src/JavaScriptSDK/CookieMgr.ts
96 33 2
constructor()
in extensions/applicationinsights-dependencies-js/src/ajaxRecord.ts
93 24 3
constructor()
in shared/AppInsightsCore/src/JavaScriptSDK/DiagnosticLogger.ts
79 17 1
function parseArgs()
in tools/release-tools/setVersion.js
76 48 0
function getFilename()
in tools/subResourceIntegrity/generateIntegrityFile.js
76 13 2
constructor()
in extensions/applicationinsights-react-native/src/ReactNativePlugin.ts
75 14 1
function _populatePerfData()
in extensions/applicationinsights-dependencies-js/src/ajaxRecord.ts
74 16 2
constructor()
in extensions/applicationinsights-properties-js/src/Context/User.ts
71 21 2
function _doFetchSender()
in channels/applicationinsights-channel-js/src/Sender.ts
67 13 2
function myFunc()
in extensions/applicationinsights-debugplugin-js/sample/public/sample.js
67 2 0
function _serializeObject()
in channels/applicationinsights-channel-js/src/Serializer.ts
63 21 2