aws-samples / aws-ecs-anywhere-workshop-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 35 units with 552 lines of code in units (75.5% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (91 lines of code)
    • 8 medium size units (235 lines of code)
    • 7 small units (105 lines of code)
    • 19 very small units (121 lines of code)
0% | 16% | 42% | 19% | 21%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go0% | 16% | 42% | 19% | 21%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
s3-trigger-ecs-task/s3-file-processor/utils0% | 21% | 35% | 22% | 20%
s3-trigger-ecs-task/s3-file-processor0% | 0% | 68% | 12% | 19%
s3-trigger-ecs-task/sam-lambda-s3-dynamodb0% | 0% | 88% | 0% | 11%
ssm-secrets-manager0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func BatchWriteItem()
in workload-management/s3-trigger-ecs-task/s3-file-processor/utils/Dynamodb.go
91 11 1
func DeleteItems()
in workload-management/s3-trigger-ecs-task/s3-file-processor/utils/Dynamodb.go
41 9 1
func main()
in workload-management/s3-trigger-ecs-task/s3-file-processor/main.go
40 9 0
func createTable()
in workload-management/s3-trigger-ecs-task/s3-file-processor/utils/Dynamodb.go
30 4 0
func DeleteProcessedData()
in workload-management/s3-trigger-ecs-task/s3-file-processor/utils/FileHelper.go
28 6 0
func pollForTableDeletion()
in workload-management/s3-trigger-ecs-task/s3-file-processor/utils/Dynamodb.go
27 6 0
func pollForTableCreation()
in workload-management/s3-trigger-ecs-task/s3-file-processor/utils/Dynamodb.go
24 5 0
func handler()
in workload-management/s3-trigger-ecs-task/sam-lambda-s3-dynamodb/main.go
23 2 1
func initialize()
in workload-management/s3-trigger-ecs-task/s3-file-processor/main.go
22 5 0
func GetOutputFile()
in workload-management/s3-trigger-ecs-task/s3-file-processor/utils/FileHelper.go
18 4 1
func deleteTable()
in workload-management/s3-trigger-ecs-task/s3-file-processor/utils/Dynamodb.go
18 4 0
func MarshalRecord()
in workload-management/s3-trigger-ecs-task/s3-file-processor/utils/ProcessHelper.go
17 1 1
func CopyS3ToTmp()
in workload-management/s3-trigger-ecs-task/s3-file-processor/utils/FileHelper.go
15 2 0
func RecreateTable()
in workload-management/s3-trigger-ecs-task/s3-file-processor/utils/Dynamodb.go
15 4 0
func AppendFile()
in workload-management/s3-trigger-ecs-task/s3-file-processor/utils/FileHelper.go
11 3 2
func success()
in workload-management/s3-trigger-ecs-task/s3-file-processor/main.go
11 2 0
func processRecords()
in workload-management/s3-trigger-ecs-task/s3-file-processor/main.go
10 3 2
func TruncateFile()
in workload-management/s3-trigger-ecs-task/s3-file-processor/utils/FileHelper.go
9 2 1
func handler()
in workload-management/ssm-secrets-manager/main.go
9 2 2
func GetFile()
in workload-management/s3-trigger-ecs-task/s3-file-processor/utils/FileHelper.go
8 2 1