awslabs / aws-lambda-redshift-loader
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 203 units with 3,517 lines of code in units (73.8% of code).
    • 2 very long units (310 lines of code)
    • 12 long units (841 lines of code)
    • 24 medium size units (839 lines of code)
    • 53 small units (814 lines of code)
    • 112 very small units (713 lines of code)
8% | 23% | 23% | 23% | 20%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js8% | 24% | 23% | 22% | 20%
py0% | 0% | 0% | 100% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT9% | 24% | 24% | 21% | 20%
sample/scripts0% | 0% | 0% | 84% | 15%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
172 31 3
138 40 6
function()
in index.js
94 7 1
94 2 2
90 14 4
73 9 6
70 8 4
function doQuery()
in batchOperations.js
70 13 5
function v1_v2()
in upgrades.js
67 4 4
64 14 7
63 5 5
53 7 5
52 10 2
51 11 7
function updateBatchStatus()
in batchOperations.js
50 5 6
49 13 6
47 5 3
44 5 2
42 5 4
updateBatchStatus()
in batchOperations.js
40 11 6