microsoft / botbuilder-tools
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 373 units with 6,822 lines of code in units (28.2% of code).
    • 11 very long units (2,172 lines of code)
    • 7 long units (550 lines of code)
    • 63 medium size units (2,065 lines of code)
    • 64 small units (898 lines of code)
    • 228 very small units (1,137 lines of code)
31% | 8% | 30% | 13% | 16%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js33% | 4% | 27% | 15% | 18%
ts34% | 9% | 34% | 7% | 14%
cs15% | 21% | 34% | 16% | 12%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
packages/Ludown/lib43% | 6% | 21% | 15% | 12%
packages/MSBot/src35% | 9% | 35% | 6% | 13%
packages/LUISGen/src15% | 21% | 34% | 16% | 12%
packages/Chatdown/lib28% | 0% | 54% | 6% | 11%
packages/QnAMaker/lib0% | 0% | 33% | 19% | 47%
packages/QnAMaker0% | 0% | 42% | 43% | 13%
packages/LUIS/src0% | 0% | 0% | 52% | 47%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
async function processConfiguration()
in packages/MSBot/src/msbot-clone-services.ts
585 117 0
const parseAndHandleEntity = function()
in packages/Ludown/lib/parseFileContents.js
274 92 4
parseAndTranslate : async function()
in packages/Ludown/lib/translate-helpers.js
228 49 8
const parseAndHandleIntent = function()
in packages/Ludown/lib/parseFileContents.js
177 69 2
async function exportBot()
in packages/MSBot/src/msbot-export-services.ts
168 24 3
splitFileBySections : function()
in packages/Ludown/lib/helpers.js
152 42 2
validateLUISBlob: async function()
in packages/Ludown/lib/parseFileContents.js
134 35 1
collateLUISFiles: async function()
in packages/Ludown/lib/parseFileContents.js
127 37 1
public static void Main()
in packages/LUISGen/src/Program.cs
114 22 1
const writeOutFiles = function()
in packages/Ludown/lib/parser.js
109 63 6
async function readCommandsFromAggregate()
in packages/Chatdown/lib/index.js
104 33 2
generateMarkdown: async function()
in packages/Ludown/lib/toLU.js
99 26 1
static void Entities()
in packages/LUISGen/src/CSharp.cs
93 14 2
const parseAndHandleModelInfo = function()
in packages/Ludown/lib/parseFileContents.js
87 23 3
async function updateLocalSafeSettings()
in packages/MSBot/src/msbot-clone-services.ts
75 16 1
static void Entities()
in packages/LUISGen/src/Typescript.cs
72 14 2
async function processConfiguration()
in packages/MSBot/src/msbot-create.ts
72 16 0
async function processConnectAzureArgs()
in packages/MSBot/src/msbot-connect-bot.ts
52 22 1
function addCard()
in packages/Chatdown/lib/index.js
50 20 3
async function processConnectDispatch()
in packages/MSBot/src/msbot-connect-dispatch.ts
50 18 1