microsoft / frameworkcontroller
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 373 units with 5,155 lines of code in units (73.9% of code).
    • 5 very long units (885 lines of code)
    • 11 long units (767 lines of code)
    • 33 medium size units (1,044 lines of code)
    • 75 small units (1,082 lines of code)
    • 249 very small units (1,377 lines of code)
17% | 14% | 20% | 20% | 26%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go17% | 14% | 20% | 20% | 26%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
pkg/controller31% | 22% | 31% | 6% | 7%
pkg/apis15% | 9% | 17% | 24% | 33%
pkg/barrier0% | 63% | 11% | 18% | 6%
pkg/client0% | 0% | 9% | 37% | 53%
pkg/internal0% | 0% | 24% | 58% | 16%
pkg/common0% | 0% | 0% | 28% | 71%
cmd/frameworkbarrier0% | 0% | 0% | 0% | 100%
cmd/frameworkcontroller0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func()
in pkg/controller/controller.go
293 55 1
func()
in pkg/controller/controller.go
211 40 1
func NewConfig()
in pkg/apis/frameworkcontroller/v1/config.go
151 39 0
func initCompletionCodeInfos()
in pkg/apis/frameworkcontroller/v1/completion.go
122 1 0
func buildFrameworkSchema()
in pkg/apis/frameworkcontroller/v1/crd.go
108 1 0
func()
in pkg/controller/controller.go
95 20 1
func()
in pkg/apis/frameworkcontroller/v1/funcs.go
89 8 1
func()
in pkg/controller/controller.go
85 20 1
func()
in pkg/apis/frameworkcontroller/v1/zz_generated.deepcopy.go
76 16 1
func generateInjector()
in pkg/barrier/barrier.go
74 11 1
func()
in pkg/controller/controller.go
65 11 1
func()
in pkg/controller/controller.go
64 16 1
func newConfig()
in pkg/barrier/barrier.go
57 9 0
func()
in pkg/barrier/barrier.go
56 7 1
func matchContainerPattern()
in pkg/apis/frameworkcontroller/v1/completion.go
54 15 2
func()
in pkg/controller/controller.go
52 11 1
func()
in pkg/apis/frameworkcontroller/v1/funcs.go
49 15 1
func NewFrameworkController()
in pkg/controller/controller.go
48 1 0
func()
in pkg/controller/controller.go
45 9 1
func()
in pkg/apis/frameworkcontroller/v1/funcs.go
44 2 1