microsoft / BotFramework-Composer
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 2,578 units with 28,559 lines of code in units (24.3% of code).
    • 15 very long units (2,457 lines of code)
    • 37 long units (2,597 lines of code)
    • 253 medium size units (7,750 lines of code)
    • 454 small units (6,491 lines of code)
    • 1,819 very small units (9,264 lines of code)
8% | 9% | 27% | 22% | 32%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts10% | 8% | 26% | 24% | 29%
tsx4% | 11% | 26% | 17% | 40%
js0% | 0% | 39% | 25% | 34%
nsh0% | 0% | 100% | 0% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Composer/packages5% | 9% | 25% | 22% | 36%
extensions/azurePublish40% | 17% | 22% | 11% | 8%
extensions/packageManager10% | 0% | 64% | 15% | 9%
extensions/mongoStorage0% | 24% | 0% | 66% | 8%
extensions/scripts0% | 0% | 58% | 12% | 28%
extensions/runtimes0% | 0% | 27% | 68% | 4%
extensions/localPublish0% | 0% | 55% | 24% | 20%
extensions/pvaPublish0% | 0% | 31% | 44% | 24%
extensions/sample-ui-plugin0% | 0% | 47% | 52% | 0%
extensions/azurePublishNew0% | 0% | 0% | 32% | 67%
Composer/scripts0% | 0% | 0% | 100% | 0%
extensions/mockRemotePublish0% | 0% | 0% | 68% | 31%
scripts0% | 0% | 0% | 61% | 38%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
export default async()
in extensions/azurePublish/src/node/index.ts
442 52 1
export function useShell()
in Composer/packages/client/src/shell/useShell.ts
217 14 2
public async deployQnAReource()
in extensions/azurePublish/src/node/azureResourceManager/azureResourceManager.ts
201 8 1
protected async completion()
in Composer/packages/tools/language-servers/language-understanding/src/LUServer.ts
198 29 1
public async create()
in extensions/azurePublish/src/node/provision.ts
153 15 1
manifestUrl: formatMessage()
in Composer/packages/client/src/components/AddRemoteSkillModal/CreateSkillModal.tsx
152 8 1
protected async completion()
in Composer/packages/tools/language-servers/language-generation/src/LGServer.ts
139 20 1
name: formatMessage()
in Composer/packages/client/src/pages/knowledge-base/table-view.tsx
127 18 1
public static async createProjectAsync()
in Composer/packages/server/src/services/project.ts
127 16 2
public static async migrateProjectAsync()
in Composer/packages/server/src/services/project.ts
125 17 2
import: async function()
in extensions/packageManager/src/node/index.ts
125 21 2
export function resolveFieldWidget()
in Composer/packages/adaptive-form/src/utils/resolveFieldWidget.ts
124 66 1
public async deployCosmosDBResource()
in extensions/azurePublish/src/node/azureResourceManager/azureResourceManager.ts
114 7 1
export async function publishLuisToPrediction()
in extensions/azurePublish/src/node/luisAndQnA.ts
110 19 8
export function convertLuParseResultToLuFile()
in Composer/packages/lib/indexers/src/utils/luUtil.ts
103 13 4
text: formatMessage()
in Composer/packages/client/src/components/AddRemoteSkillModal/CreateSkillModal.tsx
94 13 1
export function useBotOperations()
in Composer/packages/client/src/components/BotRuntimeController/useBotOperations.ts
93 13 0
items: getTemplatesMoreButtons()
in Composer/packages/client/src/pages/language-generation/table-view.tsx
91 5 1
export function switchCaseLayouter()
in Composer/packages/adaptive-flow/src/adaptive-flow-renderer/layouters/switchCaseLayouter.ts
87 5 3
title: formatMessage()
in Composer/packages/client/src/constants.tsx
85 1 1