aws-samples / simple-nft-marketplace
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 18 units with 448 lines of code in units (24.6% of code).
    • 1 very long units (254 lines of code)
    • 0 long units (0 lines of code)
    • 2 medium size units (65 lines of code)
    • 4 small units (59 lines of code)
    • 11 very small units (70 lines of code)
56% | 0% | 14% | 13% | 15%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts72% | 0% | 18% | 4% | 4%
js0% | 0% | 0% | 44% | 55%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
provision/lib74% | 0% | 19% | 4% | 2%
ROOT0% | 0% | 0% | 47% | 52%
marketplace/src0% | 0% | 0% | 0% | 100%
contract/scripts0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 18 longest units
Unit# linesMcCabe index# params
constructor()
in provision/lib/provision-stack.ts
254 3 3
constructor()
in provision/lib/frontend-stack.ts
44 1 3
constructor()
in provision/lib/amb-stack.ts
21 1 3
18 1 3
private defineAPIRoute()
in provision/lib/provision-stack.ts
15 2 4
13 1 3
13 1 3
10 1 9
custom_header: async()
in marketplace/src/main.ts
9 2 0
8 1 6
8 1 3
8 1 3
private addAMBFullAccess()
in provision/lib/provision-stack.ts
7 1 1
async function main()
in contract/scripts/deploy.js
6 1 0
4 1 0
4 1 0
3 1 3
3 1 3