microsoft / sarif-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 1,747 units with 24,794 lines of code in units (85.6% of code).
    • 32 very long units (5,623 lines of code)
    • 49 long units (3,564 lines of code)
    • 172 medium size units (5,312 lines of code)
    • 296 small units (4,272 lines of code)
    • 1,198 very small units (6,023 lines of code)
22% | 14% | 21% | 17% | 24%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js22% | 14% | 21% | 17% | 24%
cs0% | 25% | 21% | 8% | 43%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/SarifWeb/wwwroot/js22% | 14% | 21% | 17% | 24%
src/SarifWeb/Services0% | 45% | 18% | 14% | 21%
src/SarifWeb0% | 0% | 54% | 0% | 45%
src/SarifWeb/Controllers0% | 0% | 0% | 0% | 100%
src/SarifWeb/Utilities0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
(function (global, factory)()
in src/SarifWeb/wwwroot/js/bootstrap.bundle.js
623 10 2
define()
in src/SarifWeb/wwwroot/js/ace/worker-json.js
498 153 5
function()
in src/SarifWeb/wwwroot/js/bootstrap.bundle.js
353 83 0
function()
in src/SarifWeb/wwwroot/js/bootstrap.bundle.js
256 74 0
function()
in src/SarifWeb/wwwroot/js/bootstrap.bundle.js
242 73 0
function()
in src/SarifWeb/wwwroot/js/bootstrap.bundle.js
208 47 0
define()
in src/SarifWeb/wwwroot/js/ace/ext-modelist.js
184 3 7
define()
in src/SarifWeb/wwwroot/js/ace/ext-options.js
184 3 7
define()
in src/SarifWeb/wwwroot/js/ace/ext-searchbox.js
184 1 12
define()
in src/SarifWeb/wwwroot/js/ace/ext-settings_menu.js
184 3 7
define()
in src/SarifWeb/wwwroot/js/ace/ext-options.js
177 2 13
define()
in src/SarifWeb/wwwroot/js/ace/ext-settings_menu.js
177 2 13
define()
in src/SarifWeb/wwwroot/js/ace/theme-chaos.js
153 1 8
function()
in src/SarifWeb/wwwroot/js/bootstrap.bundle.js
140 28 0
define()
in src/SarifWeb/wwwroot/js/ace/theme-dreamweaver.js
137 1 8
define()
in src/SarifWeb/wwwroot/js/ace/theme-sqlserver.js
136 1 8
function()
in src/SarifWeb/wwwroot/js/bootstrap.bundle.js
126 29 0
define()
in src/SarifWeb/wwwroot/js/ace/ext-textarea.js
125 1 8
define()
in src/SarifWeb/wwwroot/js/ace/theme-textmate.js
125 1 8
define()
in src/SarifWeb/wwwroot/js/ace/theme-chrome.js
123 1 8