microsoft / BotBuilder-Samples
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,647 units with 21,526 lines of code in units (41.1% of code).
    • 7 very long units (873 lines of code)
    • 50 long units (2,969 lines of code)
    • 157 medium size units (4,382 lines of code)
    • 548 small units (7,924 lines of code)
    • 885 very small units (5,378 lines of code)
4% | 13% | 20% | 36% | 24%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts15% | 14% | 28% | 23% | 18%
js2% | 26% | 6% | 36% | 27%
cs0% | <1% | 29% | 43% | 26%
java0% | 0% | 23% | 48% | 27%
py0% | 0% | 0% | 55% | 44%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
experimental/adaptive-tool29% | 5% | 33% | 18% | 13%
experimental/adaptive-dialog9% | 34% | 14% | 30% | 11%
experimental/generation5% | 24% | 29% | 24% | 16%
composer-samples/csharp_dotnetcore0% | 16% | 13% | 40% | 29%
composer-samples/javascript_nodejs0% | 27% | 0% | 39% | 33%
experimental/composer-samples0% | 17% | 16% | 37% | 28%
Migration/MigrationV3V40% | 1% | 27% | 45% | 25%
generators/java0% | 8% | 26% | 40% | 23%
experimental/sso-with-skills0% | 0% | 28% | 39% | 31%
generators/vsix-vs-win0% | 0% | 21% | 46% | 32%
experimental/immediate-accept-adapter0% | 0% | 42% | 34% | 22%
generators/generator-botbuilder0% | 0% | 17% | 42% | 39%
generators/dotnet-templates0% | 0% | 18% | 49% | 32%
Migration/Dispatch0% | 0% | 32% | 43% | 23%
generators/python0% | 0% | 0% | 55% | 44%
experimental/adaptive-runtime-packages0% | 0% | 0% | 41% | 58%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in experimental/adaptive-dialog/javascript_nodejs/08.todo-bot-with-luis-qnamaker/dialogs/rootDialog/rootDialog.js
175 1 0
async function processTemplate()
in experimental/generation/generator/packages/library/src/dialogGenerator.ts
135 39 9
export function provideCompletionItems()
in experimental/adaptive-tool/server/lu/src/providers/completion.ts
119 11 2
export function provideCompletionItems()
in experimental/adaptive-tool/server/qna/src/providers/completion.ts
117 13 2
function processSuggestions()
in experimental/adaptive-tool/server/lu/src/providers/completion.ts
115 20 3
function onEnterKey()
in experimental/adaptive-tool/server/lu/src/providers/keyBinding.ts
111 11 3
export function provideCompletionItems()
in experimental/adaptive-tool/server/lg/src/providers/completion.ts
101 25 2
export async function updateDiagnostics()
in experimental/adaptive-tool/server/lg/src/providers/diagnostics.ts
99 19 2
function substitutions()
in experimental/generation/generator/packages/library/src/substitutions.ts
94 28 4
constructor()
in experimental/adaptive-dialog/javascript_nodejs/08.todo-bot-with-luis-qnamaker/dialogs/getUserProfileDialog/getUserProfileDialog.js
90 1 0
constructor()
in experimental/adaptive-dialog/javascript_nodejs/08.todo-bot-with-luis-qnamaker/dialogs/deleteToDoDialog/deleteToDoDialog.js
88 1 0
export async function generateTest()
in experimental/generation/generator/packages/library/src/testGenerator.ts
81 17 5
constructor()
in experimental/adaptive-dialog/javascript_nodejs/01.multi-turn-prompt/dialogs/userProfileDialog.js
74 1 0
constructor()
in experimental/adaptive-dialog/javascript_nodejs/05.interruptions-bot/dialogs/getUserProfileDialog/getUserProfileDialog.js
73 1 0
async function processTemplates()
in experimental/generation/generator/packages/library/src/dialogGenerator.ts
73 19 8
constructor()
in experimental/adaptive-dialog/javascript_nodejs/08.todo-bot-with-luis-qnamaker/dialogs/addToDoDialog/addToDoDialog.js
72 1 0
private void LoadDialogs()
in experimental/generation/runbot/RunBot.cs
72 6 0
constructor()
in experimental/adaptive-dialog/javascript_nodejs/03.core-bot/dialogs/rootDialog.js
70 1 0
function expandSchema()
in experimental/generation/generator/packages/library/src/dialogGenerator.ts
69 29 6
export async function swaggerGenerate()
in experimental/generation/generator/packages/library/src/swaggerDialogGenerator.ts
65 14 6