kubernetes / sample-apiserver
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 152 units with 1,082 lines of code in units (68.4% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 2 medium complex units (81 lines of code)
    • 2 simple units (72 lines of code)
    • 148 very simple units (929 lines of code)
0% | 0% | 7% | 6% | 85%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
go0% | 0% | 7% | 6% | 85%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
pkg/apis/wardle0% | 0% | 10% | 5% | 83%
pkg/admission/plugin0% | 0% | 0% | 59% | 40%
pkg/registry/wardle0% | 0% | 0% | 0% | 100%
pkg/cmd/server0% | 0% | 0% | 0% | 100%
pkg/apiserver0% | 0% | 0% | 0% | 100%
pkg/admission/wardleinitializer0% | 0% | 0% | 0% | 100%
pkg/registry0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func ValidateFlunderSpec()
in pkg/apis/wardle/validation/validation.go
18 14 2
func RegisterConversions()
in pkg/apis/wardle/v1alpha1/zz_generated.conversion.go
63 13 1
func RegisterConversions()
in pkg/apis/wardle/v1beta1/zz_generated.conversion.go
43 9 1
func()
in pkg/admission/plugin/banflunder/admission.go
29 8 1
func NewCommandStartWardleServer()
in pkg/cmd/server/start.go
23 4 2
func()
in pkg/cmd/server/start.go
27 4 1
func SetDefaults_FlunderSpec()
in pkg/apis/wardle/v1alpha1/defaults.go
6 4 1
func autoConvert_v1alpha1_FlunderList_To_wardle_FlunderList()
in pkg/apis/wardle/v1alpha1/zz_generated.conversion.go
15 4 3
func autoConvert_wardle_FlunderList_To_v1alpha1_FlunderList()
in pkg/apis/wardle/v1alpha1/zz_generated.conversion.go
15 4 3
func Convert_v1alpha1_FlunderSpec_To_wardle_FlunderSpec()
in pkg/apis/wardle/v1alpha1/conversion.go
13 4 3
func()
in pkg/cmd/server/start.go
16 3 1
func()
in pkg/apiserver/apiserver.go
21 3 1
func autoConvert_v1alpha1_Flunder_To_wardle_Flunder()
in pkg/apis/wardle/v1alpha1/zz_generated.conversion.go
10 3 3
func autoConvert_wardle_Flunder_To_v1alpha1_Flunder()
in pkg/apis/wardle/v1alpha1/zz_generated.conversion.go
10 3 3
func Convert_wardle_FlunderSpec_To_v1alpha1_FlunderSpec()
in pkg/apis/wardle/v1alpha1/conversion.go
13 3 3
func()
in pkg/apis/wardle/v1alpha1/zz_generated.deepcopy.go
13 3 1
func()
in pkg/apis/wardle/v1alpha1/zz_generated.deepcopy.go
13 3 1
func autoConvert_v1beta1_Flunder_To_wardle_Flunder()
in pkg/apis/wardle/v1beta1/zz_generated.conversion.go
10 3 3
func autoConvert_wardle_Flunder_To_v1beta1_Flunder()
in pkg/apis/wardle/v1beta1/zz_generated.conversion.go
10 3 3
func()
in pkg/apis/wardle/v1beta1/zz_generated.deepcopy.go
13 3 1