microsoft / vscode-mssql
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 825 units with 9,058 lines of code in units (41.6% of code).
    • 1 very long units (116 lines of code)
    • 13 long units (857 lines of code)
    • 100 medium size units (2,875 lines of code)
    • 165 small units (2,403 lines of code)
    • 546 very small units (2,807 lines of code)
1% | 9% | 31% | 26% | 30%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts1% | 9% | 31% | 26% | 31%
js0% | 0% | 60% | 11% | 27%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/controllers5% | 10% | 29% | 20% | 32%
src/models0% | 10% | 33% | 25% | 30%
src/objectExplorer0% | 29% | 8% | 25% | 36%
src/views0% | 8% | 37% | 28% | 26%
src/azure0% | 9% | 39% | 14% | 36%
lib/ads-adal-library0% | 11% | 50% | 27% | 10%
src/languageservice0% | 0% | 26% | 42% | 30%
src/prompts0% | 0% | 41% | 33% | 25%
src/services0% | 0% | 33% | 49% | 17%
src/scripting0% | 0% | 73% | 18% | 8%
src0% | 0% | 22% | 59% | 18%
src/connectionconfig0% | 0% | 25% | 43% | 31%
tasks0% | 0% | 34% | 19% | 45%
src/queryHistory0% | 0% | 0% | 19% | 80%
src/credentialstore0% | 0% | 0% | 39% | 60%
src/configurations0% | 0% | 0% | 0% | 100%
src/firewall0% | 0% | 0% | 0% | 100%
src/metadata0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
private initializeObjectExplorer()
in src/controllers/mainController.ts
116 13 0
public async copyResults()
in src/controllers/queryRunner.ts
85 19 4
83 16 5
function handleKeyDown()
in src/views/htmlcontent/src/js/slick.dragrowselector.ts
74 23 1
public async connect()
in src/controllers/connectionManager.ts
71 14 3
public async createSession()
in src/objectExplorer/objectExplorerService.ts
69 16 3
private handleSessionCreatedNotification()
in src/objectExplorer/objectExplorerService.ts
68 19 0
public async getAuthorizationCode()
in src/azure/azureAuthRequest.ts
65 5 2
public static async createProfile()
in src/models/connectionProfile.ts
62 10 6
public async getAccountSecurityToken()
in lib/ads-adal-library/src/engine/AzureAuth.ts
58 10 3
private initializeQueryHistory()
in src/controllers/mainController.ts
58 5 0
public promptToManageProfiles()
in src/views/connectionUI.ts
56 7 0
public static async ensureRequiredPropertiesSet()
in src/models/connectionCredentials.ts
54 14 7
async getChildren()
in src/objectExplorer/objectExplorerService.ts
54 11 1
private static getRuntimeIdHelper()
in src/models/platform.ts
49 23 2
public createScriptingParams()
in src/scripting/scriptingService.ts
45 10 3
public async refreshAzureAccountToken()
in src/controllers/connectionManager.ts
44 12 1
public async activate()
in src/controllers/mainController.ts
44 2 0
function handleClick()
in src/views/htmlcontent/src/js/slick.dragrowselector.ts
44 14 1
public createQueryRunner()
in src/models/sqlOutputContentProvider.ts
43 5 3