opensearch-project / documentation-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 15 units with 178 lines of code in units (5.3% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 3 medium size units (86 lines of code)
    • 4 small units (52 lines of code)
    • 8 very small units (40 lines of code)
0% | 0% | 48% | 29% | 22%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
rb0% | 0% | 61% | 28% | 9%
js0% | 0% | 0% | 30% | 69%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
_plugins0% | 0% | 61% | 28% | 9%
assets/js0% | 0% | 0% | 30% | 69%
Alternative Visuals
Longest Units
Top 15 longest units
Unit# linesMcCabe index# params
self.add
in _plugins/search-indexer.rb
33 10 1
self.check_internal
in _plugins/link-checker.rb
28 13 1
self.verify
in _plugins/link-checker.rb
25 9 1
self.check_external
in _plugins/link-checker.rb
15 3 1
self.process
in _plugins/link-checker.rb
14 6 1
async connectedCallback()
in assets/js/_version-selector.js
12 1 0
self.check
in _plugins/link-checker.rb
11 4 1
_instrument()
in assets/js/_version-selector.js
9 3 1
constructor()
in assets/js/_version-selector.js
8 1 0
self.init
in _plugins/link-checker.rb
5 1 1
self.save
in _plugins/search-indexer.rb
5 1 0
_expand()
in assets/js/_version-selector.js
4 2 1
static get observedAttributes()
in assets/js/_version-selector.js
3 1 0
_makeFragment()
in assets/js/_version-selector.js
3 1 1
self.init
in _plugins/search-indexer.rb
3 1 1