microsoft / vscode-cmake-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 1,102 units with 13,008 lines of code in units (75.8% of code).
    • 6 very long units (881 lines of code)
    • 33 long units (2,342 lines of code)
    • 117 medium size units (3,614 lines of code)
    • 190 small units (2,773 lines of code)
    • 756 very small units (3,398 lines of code)
6% | 18% | 27% | 21% | 26%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts6% | 18% | 27% | 21% | 26%
js0% | 0% | 0% | 70% | 29%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src6% | 19% | 26% | 20% | 27%
src/drivers8% | 9% | 33% | 23% | 25%
src/diagnostics0% | 36% | 25% | 18% | 19%
src/drivers/cmakefileapi0% | 0% | 29% | 56% | 13%
src/installs0% | 0% | 100% | 0% | 0%
src/cmake0% | 0% | 100% | 0% | 0%
ROOT0% | 0% | 0% | 70% | 29%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
getWebviewMarkup()
in src/cache-view.ts
210 4 0
async configure()
in src/drivers/driver.ts
172 41 5
156 1 0
121 41 5
120 30 4
async addConfigurePreset()
in src/presetsController.ts
102 22 0
99 25 2
95 26 3
89 17 1
87 24 6
82 40 3
82 21 7
async runBuild()
in src/cmake-tools.ts
81 25 2
constructor()
in src/extension.ts
79 16 1
private _parseDiags()
in src/diagnostics/cmake.ts
78 13 1
private _updateCodeModel()
in src/extension.ts
77 20 1
const funs:()
in src/extension.ts
76 2 1
static async init()
in src/presetsController.ts
75 7 2
static parseCache()
in src/cache.ts
74 14 1
async configureInternal()
in src/cmake-tools.ts
74 12 3