opensearch-project / project-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 41 units with 478 lines of code in units (6.4% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (51 lines of code)
    • 7 medium size units (232 lines of code)
    • 4 small units (59 lines of code)
    • 29 very small units (136 lines of code)
0% | 10% | 48% | 12% | 28%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
rb0% | 21% | 60% | 14% | 3%
js0% | 0% | 36% | 10% | 52%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
_plugins0% | 21% | 60% | 14% | 3%
assets0% | 0% | 36% | 10% | 52%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
self.add
in _plugins/search-indexer.rb
51 20 1
self.verify
in _plugins/link-checker.rb
48 14 1
self.check_external
in _plugins/link-checker.rb
42 10 1
define()
in assets/js/main.js
37 12 1
init: function()
in assets/js/mod/list-collapsing.js
30 2 0
self.init
in _plugins/link-checker.rb
30 13 1
self.check_internal
in _plugins/link-checker.rb
23 12 1
22 6 1
self.process
in _plugins/link-checker.rb
17 8 1
self.check
in _plugins/link-checker.rb
16 7 1
function selectPlatform()
in assets/js/mod/select_logic.js
14 1 1
define()
in assets/js/mod/clippify.js
12 1 4
init: function()
in assets/js/mod/mobile-menu.js
10 1 0
$()
in assets/js/mod/version-switcher.js
9 1 1
$()
in assets/js/mod/clippify.js
9 1 1
$()
in assets/js/mod/clippify.js
8 1 1
init: function()
in assets/js/mod/list-feature.js
8 4 0
$()
in assets/js/mod/search-key.js
7 3 1
$()
in assets/js/mod/select_logic.js
6 1 1
$()
in assets/js/mod/console-tabs.js
5 1 1