microsoft / BotFramework-WebChat
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 680 units with 8,613 lines of code in units (41.3% of code).
    • 9 very long units (1,207 lines of code)
    • 11 long units (787 lines of code)
    • 76 medium size units (2,468 lines of code)
    • 133 small units (1,924 lines of code)
    • 451 very small units (2,227 lines of code)
14% | 9% | 28% | 22% | 25%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts24% | 15% | 25% | 18% | 16%
js4% | 4% | 28% | 24% | 37%
tsx0% | 0% | 47% | 32% | 19%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
packages/component19% | 10% | 25% | 22% | 21%
packages/api17% | 4% | 30% | 20% | 26%
packages/directlinespeech23% | 10% | 36% | 13% | 15%
packages/bundle10% | 16% | 25% | 26% | 20%
packages/support0% | 19% | 27% | 10% | 42%
packages/core0% | 0% | 20% | 26% | 53%
packages/embed0% | 0% | 52% | 24% | 23%
packages/playground0% | 0% | 44% | 44% | 11%
ROOT0% | 0% | 89% | 0% | 10%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
export default async function create()
in packages/directlinespeech/src/createAdapters.js
181 48 8
export default function createBubbleStyle()
in packages/component/src/Styles/StyleSet/Bubble.ts
150 7 20
export default function createSuggestedActionStyle()
in packages/component/src/Styles/StyleSet/SuggestedAction.ts
142 7 44
export default function createSuggestedActionsStyle()
in packages/component/src/Styles/StyleSet/SuggestedActions.ts
139 5 13
export default function createAdaptiveCardsHostConfig()
in packages/bundle/src/adaptiveCards/Styles/adaptiveCardHostConfig.ts
130 1 1
export default function createToasterStyle()
in packages/component/src/Styles/StyleSet/Toaster.ts
127 1 15
export default function normalizeStyleOptions()
in packages/api/src/normalizeStyleOptions.ts
123 31 3
function useObserveFocusVisibleForLegacyBrowsers()
in packages/component/src/hooks/internal/useObserveFocusVisible.ts
108 15 2
export default function normalizeLanguage()
in packages/api/src/utils/normalizeLanguage.ts
107 58 1
export default function createSendBoxButtonStyle()
in packages/component/src/Styles/StyleSet/SendBoxButton.ts
99 2 19
export default async function playCognitiveServicesStream()
in packages/directlinespeech/src/playCognitiveServicesStream.js
83 18 3
export default function CarouselFilmStrip()
in packages/component/src/Styles/StyleSet/CarouselFilmStrip.ts
80 1 4
export default function createToastStyle()
in packages/component/src/Styles/StyleSet/Toast.ts
75 1 9
export default function createStackedLayoutStyle()
in packages/component/src/Styles/StyleSet/StackedLayout.ts
71 1 5
export default function()
in packages/support/cldr-data-downloader/src/index.js
70 14 4
export default function createDirectLineSpeechAdapters()
in packages/bundle/src/createDirectLineSpeechAdapters.ts
67 6 13
export default function()
in packages/bundle/src/adaptiveCards/Styles/StyleSet/AdaptiveCardRenderer.ts
65 1 5
export default function createCognitiveServicesSpeechServicesPonyfillFactory()
in packages/bundle/src/createCognitiveServicesSpeechServicesPonyfillFactory.ts
64 9 9
function getAllLocalizedStrings()
in packages/api/src/localization/getAllLocalizedStrings.ts
60 2 0
export default function useSendFiles()
in packages/component/src/hooks/useSendFiles.ts
53 7 0