microsoft / vscode-cpptools
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 792 units with 10,725 lines of code in units (72.1% of code).
    • 6 very long units (986 lines of code)
    • 30 long units (2,024 lines of code)
    • 92 medium size units (2,932 lines of code)
    • 161 small units (2,315 lines of code)
    • 503 very small units (2,468 lines of code)
9% | 18% | 27% | 21% | 23%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts9% | 19% | 27% | 21% | 22%
cpp0% | 0% | 68% | 0% | 31%
js0% | 0% | 0% | 81% | 18%
h0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Extension/src/LanguageServer11% | 23% | 27% | 16% | 21%
Extension/src/Debugger10% | 14% | 24% | 29% | 20%
Extension/src0% | 4% | 32% | 31% | 31%
Extension/ui0% | 0% | 24% | 56% | 18%
Code Samples/Fib0% | 0% | 82% | 0% | 17%
Extension/tools0% | 0% | 23% | 43% | 33%
Extension0% | 0% | 0% | 84% | 15%
Code Samples/BoxConsoleSample0% | 0% | 0% | 0% | 100%
Code Samples/BoxConsoleSample/Objects0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
private createLanguageClient()
in Extension/src/LanguageServer/client.ts
400 11 1
private updateServerOnFolderSettingsChange()
in Extension/src/LanguageServer/configurations.ts
133 56 0
public populateEditorConfig()
in Extension/src/LanguageServer/settings.ts
123 20 1
constructor()
in Extension/src/LanguageServer/client.ts
115 27 2
private parsePropertiesFile()
in Extension/src/LanguageServer/configurations.ts
108 34 0
async provideDebugConfigurations()
in Extension/src/Debugger/configurationProvider.ts
107 28 2
export function createProtocolFilter()
in Extension/src/LanguageServer/protocolFilter.ts
99 15 1
public processResults()
in Extension/src/LanguageServer/references.ts
94 31 1
export function initialize()
in Extension/src/Debugger/extension.ts
92 19 1
private updateStatus()
in Extension/src/LanguageServer/client.ts
91 23 1
export async function activate()
in Extension/src/LanguageServer/extension.ts
83 23 0
public onDidChangeSettings()
in Extension/src/LanguageServer/client.ts
79 29 2
public sendAllSettings()
in Extension/src/LanguageServer/client.ts
76 5 0
private getErrorsForConfigUI()
in Extension/src/LanguageServer/configurations.ts
74 26 1
private registerFileWatcher()
in Extension/src/LanguageServer/client.ts
73 17 0
public async getTasks()
in Extension/src/LanguageServer/cppBuildTaskProvider.ts
72 26 1
private reportProgress()
in Extension/src/LanguageServer/references.ts
71 21 3
private updateConfig()
in Extension/src/LanguageServer/settingsPanel.ts
71 23 1
public set CompilerDefaults()
in Extension/src/LanguageServer/configurations.ts
70 16 1
private async doBuild()
in Extension/src/LanguageServer/cppBuildTaskProvider.ts
69 11 0