aws-samples / amazon-devopsguru-cdk-samples
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 8 units with 333 lines of code in units (83.9% of code).
    • 1 very long units (133 lines of code)
    • 1 long units (52 lines of code)
    • 2 medium size units (100 lines of code)
    • 2 small units (31 lines of code)
    • 2 very small units (17 lines of code)
39% | 15% | 30% | 9% | 5%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts40% | 15% | 30% | 9% | 3%
py0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib40% | 15% | 30% | 9% | 3%
scripts0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 8 longest units
Unit# linesMcCabe index# params
constructor()
in lib/infrastructure-stack.ts
133 3 3
constructor()
in lib/cdk-devopsguru-org-uni-stack.ts
52 1 3
constructor()
in lib/cdk-devopsguru-multi-acc-reg-spec-stack.ts
50 1 3
constructor()
in lib/cdk-devopsguru-multi-acc-reg-stack.ts
50 1 3
constructor()
in lib/cdk-stackset-admin-role-stack.ts
19 1 3
constructor()
in lib/cdk-stackset-exec-role-stack.ts
12 1 3
var create_shop_struct = function()
in lib/infrastructure-stack.ts
10 1 1
def main()
in scripts/sendAPIRequest.py
7 2 0