aws-samples / amazon-ecr-continuous-scan
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 21 units with 589 lines of code in units (70.5% of code).
    • 1 very long units (108 lines of code)
    • 1 long units (55 lines of code)
    • 10 medium size units (351 lines of code)
    • 2 small units (33 lines of code)
    • 7 very small units (42 lines of code)
18% | 9% | 59% | 5% | 7%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go18% | 9% | 59% | 5% | 7%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
configs61% | 0% | 12% | 18% | 7%
findings0% | 31% | 60% | 0% | 7%
summary0% | 0% | 90% | 0% | 9%
start-scan0% | 0% | 97% | 0% | 2%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func handler()
in configs/main.go
108 15 1
func handler()
in findings/main.go
55 8 1
func handler()
in summary/main.go
50 8 1
func startScan()
in start-scan/main.go
48 7 1
func describeScan()
in findings/main.go
48 7 1
func describeScan()
in summary/main.go
48 7 1
func handler()
in start-scan/main.go
35 6 0
func buildFeed()
in findings/main.go
34 5 1
func fetchScanSpec()
in start-scan/main.go
22 4 2
func fetchScanSpec()
in configs/main.go
22 4 2
func fetchScanSpec()
in findings/main.go
22 4 2
func fetchScanSpec()
in summary/main.go
22 4 2
func storeScanSpec()
in configs/main.go
18 3 2
func rmClusterSpec()
in configs/main.go
15 3 2
func serverError()
in configs/main.go
10 1 1
func serverError()
in findings/main.go
10 1 1
func serverError()
in summary/main.go
10 1 1
func main()
in start-scan/main.go
3 1 0
func main()
in configs/main.go
3 1 0
func main()
in findings/main.go
3 1 0