microsoft / botframework-cli
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 2,728 units with 47,672 lines of code in units (70.6% of code).
    • 49 very long units (8,741 lines of code)
    • 97 long units (6,660 lines of code)
    • 484 medium size units (15,225 lines of code)
    • 642 small units (9,321 lines of code)
    • 1,456 very small units (7,725 lines of code)
18% | 13% | 31% | 19% | 16%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts19% | 14% | 30% | 19% | 16%
js12% | 13% | 37% | 19% | 17%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
packages/orchestratorlib38% | 11% | 30% | 13% | 6%
packages/dispatcher14% | 14% | 29% | 21% | 20%
packages/lu11% | 13% | 37% | 21% | 16%
packages/dialog6% | 26% | 31% | 18% | 15%
packages/orchestrator21% | 40% | 35% | 1% | <1%
packages/qnamaker9% | 8% | 29% | 24% | 28%
packages/luis9% | 8% | 44% | 23% | 13%
packages/chatdown20% | 0% | 57% | 11% | 10%
packages/lg0% | 13% | 39% | 32% | 15%
common/scripts0% | 10% | 42% | 32% | 15%
packages/plugins0% | 0% | 40% | 22% | 36%
packages/command0% | 0% | 18% | 47% | 33%
packages/config0% | 0% | 0% | 25% | 74%
packages/cli0% | 0% | 0% | 0% | 100%
common/config0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
497 58 4
public static async mainAutoActiveLearner()
in packages/dispatcher/src/model/supervised/classifier/auto_active_learning/AppAutoActiveLearner.ts
432 8 0
public static aggregateBinaryConfusionMatrixArrayIntoEvaluationOutputs()
in packages/dispatcher/src/mathematics/confusion_matrix/UtilityConfusionMatrix.ts
408 59 8
public static async runAsync()
in packages/orchestratorlib/src/evaluate.ts
334 18 10
public static async runAsync()
in packages/orchestratorlib/src/test.ts
316 14 11
const parseAndHandleSimpleIntentSection = function()
in packages/lu/src/parser/lufile/parseFileContents.js
295 105 3
public generateConfusionMatrixMetricStructure()
in packages/dispatcher/src/mathematics/confusion_matrix/ConfusionMatrixBase.ts
280 1 1
public static async runAsync()
in packages/orchestratorlib/src/assess.ts
263 12 4
public static scoreBatchObjectLabels()
in packages/orchestratorlib/src/utilitylabelresolver.ts
209 36 4
parseAndTranslate : async function()
in packages/lu/src/parser/lufile/translate-helpers.js
200 46 2
public getMetricValues()
in packages/dispatcher/src/mathematics/confusion_matrix/BinaryConfusionMatrix.ts
197 1 11
public static scoreBatchStringLabels()
in packages/orchestratorlib/src/utilitylabelresolver.ts
196 30 4
public static async mainAutoActiveLearnerWithColumnarContent()
in packages/dispatcher/src/model/supervised/classifier/auto_active_learning/AppAutoActiveLearner.ts
195 4 7
public static generateLabelStringEvaluationReport()
in packages/orchestratorlib/src/utility.ts
194 1 4
public static generateLabelObjectEvaluationReport()
in packages/orchestratorlib/src/utility.ts
193 1 4
public getMetricNames()
in packages/dispatcher/src/mathematics/confusion_matrix/BinaryConfusionMatrix.ts
186 1 0
public static async mainAutoActiveLearnerWithDataWithSubwordFeaturizer()
in packages/dispatcher/src/model/supervised/classifier/auto_active_learning/AppAutoActiveLearner.ts
184 4 7
public static async mainAutoActiveLearnerWithLuContent()
in packages/dispatcher/src/model/supervised/classifier/auto_active_learning/AppAutoActiveLearner.ts
181 4 3
public static scoreObjectLabels()
in packages/orchestratorlib/src/utilitylabelresolver.ts
180 31 4
public static utteranceLabelsToJsonString()
in packages/orchestratorlib/src/labelresolver.ts
178 38 1