aws-samples / serverless-refarch-for-proxysql
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 9 units with 205 lines of code in units (69.5% of code).
    • 1 very long units (102 lines of code)
    • 0 long units (0 lines of code)
    • 1 medium size units (27 lines of code)
    • 3 small units (52 lines of code)
    • 4 very small units (24 lines of code)
49% | 0% | 13% | 25% | 11%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts62% | 0% | 16% | 11% | 9%
py0% | 0% | 0% | 80% | 19%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src62% | 0% | 16% | 11% | 9%
lambda/hello_world0% | 0% | 0% | 80% | 19%
Alternative Visuals
Longest Units
Top 9 longest units
Unit# linesMcCabe index# params
constructor()
in src/proxysql.ts
102 13 3
constructor()
in src/proxysql.ts
27 2 3
constructor()
in src/proxysql.ts
19 2 3
def lambda_handler()
in lambda/hello_world/app.py
19 2 2
def build_conn()
in lambda/hello_world/app.py
14 1 0
function getOrCreateVpc()
in src/proxysql.ts
8 3 1
def respond()
in lambda/hello_world/app.py
8 3 2
constructor()
in src/proxysql.ts
5 1 2
function printOutput()
in src/proxysql.ts
3 1 3