microsoft / BotBuilder-V3
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 3,206 units with 38,524 lines of code in units (68.5% of code).
    • 16 very long units (2,950 lines of code)
    • 52 long units (3,300 lines of code)
    • 382 medium size units (11,533 lines of code)
    • 617 small units (9,055 lines of code)
    • 2,139 very small units (11,686 lines of code)
7% | 8% | 29% | 23% | 30%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs12% | 6% | 23% | 23% | 33%
js3% | 10% | 36% | 22% | 27%
ts4% | 9% | 32% | 25% | 28%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
CSharp/Library13% | 6% | 23% | 22% | 34%
Node/core3% | 8% | 35% | 24% | 28%
Node/calling9% | 6% | 30% | 23% | 30%
CSharp/Tools65% | 0% | 22% | 6% | 5%
Cognitive Services/CSharp11% | 12% | 35% | 22% | 19%
Azure/Node0% | 30% | 35% | 18% | 15%
Cognitive Services/Node0% | 16% | 42% | 23% | 17%
Azure/CSharp0% | 7% | 22% | 32% | 37%
Node/Generator0% | 0% | 52% | 20% | 26%
CSharp/Generator0% | 0% | 0% | 84% | 15%
CSharp/EchoBot0% | 0% | 0% | 63% | 36%
Node/snippets0% | 0% | 0% | 50% | 49%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public delegate Task DefineAsyncDelegate()
in CSharp/Library/Microsoft.Bot.Builder/FormFlow/Field.cs
597 58 2
protected override void Load()
in CSharp/Library/Microsoft.Bot.Builder.Autofac/Dialogs/DialogModule.cs
287 1 1
private string ExpandTemplate()
in CSharp/Library/Microsoft.Bot.Builder/FormFlow/IPrompt.cs
233 65 7
public async Task MessageReceived()
in CSharp/Library/Microsoft.Bot.Builder/FormFlow/FormDialog.cs
223 43 2
private bool MoveToNext()
in CSharp/Library/Microsoft.Bot.Builder/FormFlow/FormDialog.cs
186 50 1
Prompts.prototype.replyReceived = function()
in Node/calling/lib/dialogs/Prompts.js
173 45 1
public replyReceived()
in Node/calling/src/dialogs/Prompts.ts
170 45 1
public async Task ProcessAsync()
in CSharp/Library/Microsoft.Bot.Builder/FormFlow/Steps.cs
164 33 5
ChatConnector.prototype.verifyBotFramework = function()
in Node/core/lib/bots/ChatConnector.js
130 38 3
private verifyBotFramework()
in Node/core/src/bots/ChatConnector.ts
127 38 3
static void Main()
in CSharp/Tools/RView/Program.cs
116 20 1
function PromptChoice()
in Node/core/lib/dialogs/PromptChoice.js
113 37 1
public delegate Task PromptAsyncDelegate()
in CSharp/Library/Microsoft.Bot.Builder/FormFlow/IPrompt.cs
111 18 4
constructor()
in Node/core/src/dialogs/PromptChoice.ts
108 36 1
protected void AddField()
in CSharp/Library/Microsoft.Bot.Builder/FormFlow/FieldReflector.cs
106 28 3
private static bool AssignEntitiesToMembers()
in Cognitive Services/CSharp/Library/LuisActionBinding/LuisActionResolver.cs
106 28 5
function evaluate()
in Cognitive Services/Node/lib/LuisActionBinding.js
98 21 5
function evaluate()
in Cognitive Services/Node/src/LuisActionBinding.js
93 21 5
protected override async Task HandleAuthenticateAsync()
in CSharp/Library/Microsoft.Bot.Connector.AspNetCore2/BotAuthenticationHandler.cs
91 13 0
protected override void Load()
in Azure/CSharp/Library/Microsoft.Bot.Builder.Azure/AzureModule.cs
84 6 1