aws-solutions / machine-to-cloud-connectivity-framework
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 204 units with 4,701 lines of code in units (72.5% of code).
    • 8 very long units (1,416 lines of code)
    • 8 long units (593 lines of code)
    • 46 medium size units (1,353 lines of code)
    • 57 small units (824 lines of code)
    • 85 very small units (515 lines of code)
30% | 12% | 28% | 17% | 10%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts38% | 11% | 28% | 15% | 5%
tsx27% | 35% | 20% | 9% | 6%
py0% | 0% | 35% | 31% | 33%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
infrastructure/lib81% | 12% | 4% | 1% | <1%
ui/src20% | 27% | 27% | 17% | 6%
lambda/lib11% | 5% | 43% | 27% | 12%
lambda/greengrass-deployer49% | 0% | 45% | 0% | 4%
lambda/custom-resource0% | 45% | 45% | 8% | 0%
lambda/connection-builder0% | 49% | 27% | 23% | 0%
machine_connector/m2c2_opcda_connector0% | 0% | 44% | 28% | 27%
machine_connector/m2c2_publisher0% | 0% | 37% | 29% | 32%
machine_connector/utils0% | 0% | 12% | 42% | 45%
infrastructure/utils0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in source/infrastructure/lib/greengrass.ts
272 1 3
constructor()
in source/infrastructure/lib/machine-to-cloud-connectivity-stack.ts
230 1 3
constructor()
in source/infrastructure/lib/connection-builder.ts
195 1 3
constructor()
in source/infrastructure/lib/api.ts
194 1 3
export default function ConnectionForm()
in source/ui/src/views/ConnectionForm.tsx
173 16 0
public getSolutionGreengrassDefaultDefinitions()
in source/lambda/lib/greengrass-handler.ts
146 6 1
constructor()
in source/infrastructure/lib/ui.ts
105 1 3
async function deployConnection()
in source/lambda/greengrass-deployer/index.ts
101 10 1
async function createGreengrassCertAndKeys()
in source/lambda/custom-resource/index.ts
97 4 2
export default function Dashboard()
in source/ui/src/views/Dashboard.tsx
91 11 1
constructor()
in source/infrastructure/lib/sqs-message-consumer.ts
85 1 3
async function handleConnection()
in source/ui/src/views/ConnectionForm.tsx
69 15 1
export default function ConnectionLogsModal()
in source/ui/src/views/ConnectionLogsModal.tsx
69 12 1
constructor()
in source/infrastructure/lib/custom-resources.ts
63 1 3
public async deleteConnectionFromGreengrassDefinitions()
in source/lambda/lib/greengrass-handler.ts
63 9 1
async function processConnection()
in source/lambda/connection-builder/index.ts
56 9 1
def job_execution()
in source/machine_connector/m2c2_opcda_connector/m2c2_opcda_connector.py
49 14 3
48 6 1
public async addConnection()
in source/lambda/lib/dynamodb-handler.ts
45 6 1
public async updateGreengrassGroupDefinitions()
in source/lambda/lib/greengrass-handler.ts
43 9 1