awslabs / aws-cloudmap-prometheus-sd
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 17 units with 301 lines of code in units (77.2% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 6 medium size units (179 lines of code)
    • 6 small units (89 lines of code)
    • 5 very small units (33 lines of code)
0% | 0% | 59% | 29% | 10%
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% | 59% | 29% | 10%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
pkg/discovery0% | 0% | 70% | 28% | 1%
ROOT0% | 0% | 100% | 0% | 0%
pkg/adapter0% | 0% | 26% | 43% | 30%
Alternative Visuals
Longest Units
Top 17 longest units
Unit# linesMcCabe index# params
func main()
in main.go
38 6 0
func()
in pkg/discovery/discovery.go
34 5 1
func()
in pkg/discovery/discovery.go
29 4 1
func()
in pkg/discovery/discovery.go
27 6 1
func generateTargetGroups()
in pkg/adapter/adapter.go
26 6 1
func()
in pkg/discovery/discovery.go
25 6 1
func()
in pkg/adapter/adapter.go
19 4 1
func()
in pkg/discovery/discovery.go
18 2 1
func()
in pkg/discovery/discovery.go
17 5 1
func()
in pkg/adapter/adapter.go
13 5 1
func NewAdapter()
in pkg/adapter/adapter.go
11 1 5
func NewDiscovery()
in pkg/discovery/discovery.go
11 1 2
func()
in pkg/adapter/adapter.go
10 3 1
func fingerprint()
in pkg/adapter/adapter.go
8 2 1
func mapToArray()
in pkg/adapter/adapter.go
7 2 1
func()
in pkg/adapter/adapter.go
5 1 1
func()
in pkg/discovery/discovery.go
3 1 1