aws-samples / prometheus-for-ecs
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 13 units with 204 lines of code in units (32.8% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 4 medium size units (118 lines of code)
    • 2 small units (33 lines of code)
    • 7 very small units (53 lines of code)
0% | 0% | 57% | 16% | 25%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go0% | 0% | 57% | 16% | 25%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
pkg/aws0% | 0% | 56% | 22% | 21%
cmd0% | 0% | 62% | 0% | 37%
Alternative Visuals
Longest Units
Top 13 longest units
Unit# linesMcCabe index# params
func()
in pkg/aws/cloudmap.go
36 8 1
func main()
in cmd/main.go
36 7 0
func()
in pkg/aws/cloudmap.go
25 5 1
func GetPrometheusScrapeConfig()
in pkg/aws/cloudmap.go
21 4 1
func()
in pkg/aws/cloudmap.go
19 3 1
func()
in pkg/aws/cloudmap.go
14 3 1
func InitializeAWSSession()
in pkg/aws/session.go
10 3 0
func GetParameter()
in pkg/aws/ssm.go
9 2 1
9 2 0
func()
in pkg/aws/cloudmap.go
8 2 1
7 2 0
6 2 0
func getSSMClient()
in pkg/aws/ssm.go
4 1 0