kubernetes / kompose
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 198 units with 4,698 lines of code in units (86.6% of code).
    • 6 very long units (834 lines of code)
    • 16 long units (1,070 lines of code)
    • 44 medium size units (1,426 lines of code)
    • 66 small units (964 lines of code)
    • 66 very small units (404 lines of code)
17% | 22% | 30% | 20% | 8%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go17% | 22% | 30% | 20% | 8%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
pkg/transformer18% | 16% | 33% | 22% | 9%
pkg/loader16% | 39% | 24% | 15% | 4%
cmd53% | 27% | 0% | 10% | 8%
pkg/app0% | 46% | 38% | 9% | 5%
pkg/utils0% | 0% | 63% | 26% | 9%
pkg/kobject0% | 0% | 74% | 17% | 8%
pkg/testutils0% | 0% | 0% | 70% | 30%
ROOT0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func mergeComposeObject()
in pkg/loader/compose/v3.go
200 66 2
func runCompletionZsh()
in cmd/completion.go
144 24 2
func()
in pkg/transformer/kubernetes/k8sutils.go
134 36 1
func()
in pkg/transformer/kubernetes/kubernetes.go
130 31 1
func()
in pkg/transformer/openshift/openshift.go
122 39 1
func()
in pkg/transformer/kubernetes/kubernetes.go
104 26 1
func PrintList()
in pkg/transformer/kubernetes/k8sutils.go
99 25 2
func libComposeToKomposeMapping()
in pkg/loader/compose/v1v2.go
93 18 1
func dockerComposeToKomposeMapping()
in pkg/loader/compose/v3.go
90 16 1
func checkUnsupportedKey()
in pkg/loader/compose/compose.go
76 22 1
func init()
in cmd/convert.go
73 11 0
func ValidateFlags()
in pkg/app/app.go
70 25 3
func()
in pkg/transformer/kubernetes/kubernetes.go
66 6 1
func loadPorts()
in pkg/loader/compose/v1v2.go
63 17 2
func parseHealthCheckReadiness()
in pkg/loader/compose/v3.go
62 19 1
func()
in pkg/transformer/openshift/openshift.go
58 4 1
func()
in pkg/transformer/kubernetes/kubernetes.go
56 6 1
func()
in pkg/transformer/kubernetes/kubernetes.go
56 9 1
func parseWindowsVolume()
in pkg/transformer/utils.go
53 15 1
func parseHealthCheck()
in pkg/loader/compose/v3.go
52 13 2