microsoft / BotFramework-Emulator
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 1,334 units with 16,125 lines of code in units (35.2% of code).
    • 6 very long units (996 lines of code)
    • 19 long units (1,260 lines of code)
    • 167 medium size units (5,175 lines of code)
    • 274 small units (3,979 lines of code)
    • 868 very small units (4,715 lines of code)
6% | 7% | 32% | 24% | 29%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
tsx11% | 8% | 33% | 23% | 23%
ts3% | 7% | 30% | 25% | 32%
js0% | 0% | 26% | 33% | 39%
nsh0% | 0% | 100% | 0% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
packages/app/client11% | 5% | 31% | 24% | 26%
packages/app/shared17% | 0% | 9% | 19% | 54%
packages/app/main0% | 9% | 38% | 25% | 26%
packages/extensions/luis0% | 18% | 43% | 22% | 15%
packages/extensions/json0% | 41% | 8% | 38% | 12%
packages/sdk/ui-react0% | 10% | 52% | 13% | 23%
packages/extensions/qnamaker0% | 15% | 29% | 35% | 19%
packages/sdk/shared0% | 0% | 10% | 37% | 52%
packages/tools/test-bot0% | 0% | 100% | 0% | 0%
scripts0% | 0% | 0% | 83% | 16%
ROOT0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
export function chat()
in packages/app/shared/src/state/reducers/chat.ts
292 30 2
public render()
in packages/app/client/src/ui/editor/appSettingsEditor/appSettingsEditor.tsx
185 4 0
public render()
in packages/app/client/src/ui/dialogs/openBotDialog/openBotDialog.tsx
133 5 0
public render()
in packages/app/client/src/ui/dialogs/botCreationDialog/botCreationDialog.tsx
131 12 0
public render()
in packages/app/client/src/ui/editor/welcomePage/howToBuildABot.tsx
131 2 0
public render()
in packages/app/client/src/ui/shell/explorer/endpointExplorer/endpointEditor/endpointEditor.tsx
124 8 0
public static async globalHandles()
in packages/app/client/src/utils/eventHandlers.ts
95 31 1
private static async initHelpMenu()
in packages/app/main/src/appMenuBuilder.ts
82 2 0
export function createUploadHandler()
in packages/app/main/src/server/routes/directLine/handlers/upload.ts
79 15 1
export function createBotFrameworkAuthenticationMiddleware()
in packages/app/main/src/server/routes/handlers/botFrameworkAuthentication.ts
79 14 1
public componentWillMount()
in packages/extensions/luis/client/src/App.tsx
76 8 0
export function mountConversationsRoutes()
in packages/app/main/src/server/routes/channel/conversations/mountConversationsRoutes.ts
72 1 1
public componentWillMount()
in packages/extensions/qnamaker/client/src/App.tsx
72 9 0
protected accessoryClick()
in packages/extensions/json/src/windowHostReceiver.tsx
70 18 2
public async openBot()
in packages/app/main/src/protocolHandler.ts
69 21 1
public render()
in packages/app/client/src/ui/dialogs/botSettingsEditor/botSettingsEditor.tsx
62 5 0
public render()
in packages/app/client/src/ui/editor/emulator/parts/chat/chat.tsx
62 6 0
private static get viewMenu()
in packages/app/client/src/ui/shell/appMenu/appMenuTemplate.ts
60 4 0
public render()
in packages/sdk/ui-react/src/widget/splitButton/splitButton.tsx
58 3 0
public calculatePaneSizes()
in packages/sdk/ui-react/src/splitter/splitter.tsx
56 11 2