awslabs / serverless-fixity-for-digital-preservation-compliance
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 143 units with 1,269 lines of code in units (41.5% of code).
    • 0 very long units (0 lines of code)
    • 3 long units (192 lines of code)
    • 14 medium size units (415 lines of code)
    • 19 small units (264 lines of code)
    • 107 very small units (398 lines of code)
0% | 15% | 32% | 20% | 31%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 15% | 32% | 20% | 31%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
source/checksum/lib/api0% | 32% | 34% | 14% | 18%
source/checksum/lib/algorithm0% | 27% | 34% | 5% | 33%
source/custom-resources/lib/shared0% | 40% | 0% | 19% | 40%
source/checksum/lib/validation0% | 0% | 40% | 38% | 20%
source/checksum/lib/restore0% | 0% | 34% | 44% | 20%
source/custom-resources/lib/solution0% | 0% | 84% | 0% | 15%
source/checksum/lib/metrics0% | 0% | 86% | 0% | 13%
source/checksum/lib/shared0% | 0% | 16% | 7% | 76%
source/checksum/lib/sns0% | 0% | 71% | 0% | 28%
source/custom-resources/lib/sns0% | 0% | 0% | 71% | 28%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
async onPOST()
in source/checksum/lib/api/index.js
75 24 0
async compute()
in source/checksum/lib/algorithm/sha1.js
60 7 0
async send()
in source/custom-resources/lib/shared/cfResponse.js
57 5 2
async compute()
in source/checksum/lib/algorithm/md5.js
50 7 0
static async sendAnonymousData()
in source/custom-resources/lib/solution/metrics.js
38 5 2
static async sendAnonymousData()
in source/checksum/lib/metrics/index.js
38 5 2
async onGET()
in source/checksum/lib/api/index.js
36 8 0
async createTags()
in source/checksum/lib/validation/index.js
33 3 0
async bestGuessMD5()
in source/checksum/lib/validation/index.js
33 8 0
async checkStatus()
in source/checksum/lib/restore/index.js
26 8 0
async initLib()
in source/checksum/lib/algorithm/base.js
25 5 0
async bestGuessSHA1()
in source/checksum/lib/validation/index.js
24 4 0
constructor()
in source/checksum/lib/shared/baseStateData.js
24 8 2
async send()
in source/checksum/lib/sns/index.js
23 4 2
static get Constants()
in source/checksum/lib/api/index.js
22 1 0
async request()
in source/checksum/lib/api/index.js
22 5 0
reverseLookup()
in source/checksum/lib/restore/index.js
21 5 1
parseKeyValuePair()
in source/checksum/lib/restore/index.js
19 3 1
constructor()
in source/custom-resources/lib/sns/sns.js
18 3 2
async sendMetrics()
in source/checksum/lib/validation/index.js
17 4 0