microsoft / WebTemplateStudio
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 428 units with 4,263 lines of code in units (19.0% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (95 lines of code)
    • 36 medium size units (1,034 lines of code)
    • 103 small units (1,519 lines of code)
    • 288 very small units (1,615 lines of code)
0% | 2% | 24% | 35% | 37%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts0% | 2% | 27% | 36% | 33%
java0% | 0% | 48% | 23% | 27%
tsx0% | 0% | 24% | 49% | 25%
js0% | 0% | 8% | 42% | 49%
cs0% | 0% | 8% | 25% | 65%
py0% | 0% | 0% | 19% | 80%
m0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/extension/src0% | 2% | 27% | 37% | 32%
src/client/src0% | 0% | 27% | 35% | 36%
templates/RN/Projects0% | 0% | 38% | 12% | 49%
src/client/scripts0% | 0% | 60% | 28% | 10%
templates/Web/_composition0% | 0% | 0% | 35% | 64%
templates/Web/Pages0% | 0% | 0% | 0% | 100%
templates/RN/_composition0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public async createCosmosDB()
in src/extension/src/azure/azure-cosmosDB/cosmosDbModule.ts
95 4 2
export function getPackageInfo()
in src/extension/src/utils/packageInfo.ts
42 9 1
function handleError()
in src/extension/src/telemetry/callWithTelemetryAndErrorHandling.ts
41 9 4
public static async deployAppService()
in src/extension/src/azure/azureServices.ts
40 5 4
public static void initializeFlipper()
in templates/RN/Projects/Default/android/app/src/debug/java/com/Param_ProjectToLower/ReactNativeFlipper.java
39 3 2
APP_SERVICE_UNDEFINED_ID: localize()
in src/extension/src/constants/messages.ts
38 1 2
LOGOUT_FAILED: localize()
in src/extension/src/constants/messages.ts
37 1 2
LOGIN_TIMEOUT: localize()
in src/extension/src/constants/messages.ts
36 1 2
private getAppServiceARMParameter()
in src/extension/src/azure/azure-app-service/appServiceProvider.ts
35 1 1
SESSION_NOT_AVAILABLE: localize()
in src/extension/src/constants/messages.ts
35 1 2
function registerValidSW()
in src/client/src/serviceWorker.ts
33 8 2
SUBSCRIPTION_NOT_DEFINED: localize()
in src/extension/src/constants/messages.ts
31 1 2
export function parseError()
in src/extension/src/telemetry/parseError.ts
31 12 1
export function reportAnIssue()
in src/extension/src/telemetry/reportAnIssue.ts
31 3 3
public async createWebApp()
in src/extension/src/azure/azure-app-service/appServiceProvider.ts
30 2 2
public async checkWebAppName()
in src/extension/src/azure/azure-app-service/appServiceProvider.ts
28 5 2
public async getConnectionString()
in src/extension/src/azure/azure-cosmosDB/cosmosDbModule.ts
28 3 3
AZURE_RESOURCE_CLIENT_NOT_DEFINED: localize()
in src/extension/src/constants/messages.ts
27 1 2
private constructor()
in src/extension/src/controller.ts
27 1 2
private _getHtmlForWebview()
in src/extension/src/reactPanel.ts
27 1 0