aws-samples / protecting-workloads-workshop
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 177 units with 2,120 lines of code in units (22.6% of code).
    • 1 very long units (418 lines of code)
    • 0 long units (0 lines of code)
    • 19 medium size units (579 lines of code)
    • 29 small units (416 lines of code)
    • 128 very small units (707 lines of code)
19% | 0% | 27% | 19% | 33%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js20% | 0% | 28% | 19% | 32%
py0% | 0% | 0% | 100% | 0%
php0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
app/html/libs/bootstrap95% | 0% | 0% | 0% | 5%
app/html/libs/bootstrap/js0% | 0% | 35% | 23% | 40%
app/html/libs/bootstrap/grunt0% | 0% | 35% | 29% | 35%
artifacts0% | 0% | 0% | 100% | 0%
app/html/modules0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
module.exports = function()
in app/html/libs/bootstrap/Gruntfile.js
418 8 1
Tooltip.prototype.show = function()
in app/html/libs/bootstrap/js/tooltip.js
50 21 0
Carousel.prototype.slide = function()
in app/html/libs/bootstrap/js/carousel.js
43 11 2
Modal.prototype.show = function()
in app/html/libs/bootstrap/js/modal.js
41 8 1
Tokenizer.prototype._shift = function()
in app/html/libs/bootstrap/grunt/bs-lessdoc-parser.js
41 10 0
Modal.prototype.backdrop = function()
in app/html/libs/bootstrap/js/modal.js
37 16 1
Tab.prototype.show = function()
in app/html/libs/bootstrap/js/tab.js
32 6 0
Collapse.prototype.show = function()
in app/html/libs/bootstrap/js/collapse.js
30 13 0
Affix.prototype.checkPosition = function()
in app/html/libs/bootstrap/js/affix.js
30 11 0
function walkAsync()
in app/html/libs/bootstrap/grunt/change-version.js
29 7 4
ScrollSpy.prototype.refresh = function()
in app/html/libs/bootstrap/js/scrollspy.js
28 8 0
function next()
in app/html/libs/bootstrap/js/tab.js
28 4 0
Tooltip.prototype.applyPlacement = function()
in app/html/libs/bootstrap/js/tooltip.js
27 8 2
Tooltip.prototype.init = function()
in app/html/libs/bootstrap/js/tooltip.js
26 12 3
Dropdown.prototype.toggle = function()
in app/html/libs/bootstrap/js/dropdown.js
25 6 1
ScrollSpy.prototype.process = function()
in app/html/libs/bootstrap/js/scrollspy.js
25 11 0
Tooltip.prototype.getViewportAdjustedDelta = function()
in app/html/libs/bootstrap/js/tooltip.js
24 9 4
Alert.prototype.close = function()
in app/html/libs/bootstrap/js/alert.js
21 9 1
Collapse.prototype.hide = function()
in app/html/libs/bootstrap/js/collapse.js
21 5 0
Dropdown.prototype.keydown = function()
in app/html/libs/bootstrap/js/dropdown.js
21 15 1