microsoft / rushstack.io-website
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 13 units with 269 lines of code in units (2.8% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (59 lines of code)
    • 3 medium size units (117 lines of code)
    • 4 small units (68 lines of code)
    • 5 very small units (25 lines of code)
0% | 21% | 43% | 25% | 9%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts0% | 45% | 24% | 26% | 3%
js0% | 0% | 61% | 24% | 14%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
scripts0% | 22% | 44% | 25% | 7%
experimental0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 13 longest units
Unit# linesMcCabe index# params
function renderNavNodes()
in scripts/docsite.ts
59 10 5
var _loop_1 = function()
in scripts/docsite.js
49 9 1
suggestion: function()
in scripts/top_nav.js
36 17 1
suggestion: function()
in scripts/top_nav.ts
32 17 1
function renderNavTree()
in scripts/docsite.ts
18 2 0
function updateNavNode()
in scripts/docsite.js
17 4 1
function renderNavTree()
in scripts/docsite.js
17 2 0
function updateNavNode()
in scripts/docsite.ts
16 4 1
function renderNavNodes()
in scripts/docsite.js
6 2 5
function htmlEncode()
in experimental/test-login.js
5 1 1
function getUrlForComparison()
in scripts/docsite.js
5 1 1
function getUrlForComparison()
in scripts/docsite.ts
5 1 1
liElement.onclick = function()
in scripts/docsite.js
4 1 0