kubernetes / enhancements
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 98 units with 1,775 lines of code in units (13.6% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (122 lines of code)
    • 6 medium complex units (339 lines of code)
    • 12 simple units (353 lines of code)
    • 79 very simple units (961 lines of code)
0% | 6% | 19% | 19% | 54%
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% | 7% | 19% | 18% | 54%
py0% | 0% | 0% | 62% | 37%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
pkg/repo0% | 20% | 44% | 10% | 24%
pkg/kepval0% | 0% | 65% | 34% | 0%
api0% | 0% | 9% | 45% | 44%
cmd/kepify0% | 0% | 0% | 50% | 49%
pkg/proposal0% | 0% | 0% | 28% | 71%
hack0% | 0% | 0% | 62% | 37%
pkg/output0% | 0% | 0% | 14% | 85%
pkg/kepctl0% | 0% | 0% | 0% | 100%
api/apifakes0% | 0% | 0% | 0% | 100%
pkg/yaml0% | 0% | 0% | 0% | 100%
cmd/kepctl0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func()
in pkg/repo/repo.go
122 26 1
func()
in pkg/repo/query.go
64 23 1
func()
in pkg/repo/validate.go
63 15 1
func NewRepo()
in pkg/repo/repo.go
78 12 2
func ValidatePRR()
in pkg/kepval/approval.go
52 11 3
func()
in pkg/repo/repo.go
56 11 1
func()
in api/approval.go
26 11 1
func main()
in cmd/kepify/main.go
49 10 0
func ignore()
in cmd/kepify/main.go
15 9 1
func populateProposal()
in pkg/proposal/create.go
34 8 2
func()
in pkg/repo/repo.go
37 8 1
func()
in api/proposal.go
38 8 1
func()
in api/proposal.go
22 8 1
def edit_kep()
in hack/edit-keps.py
25 8 3
func isPRRRequired()
in pkg/kepval/approval.go
27 7 1
func()
in pkg/repo/query.go
25 7 1
func()
in pkg/output/output.go
20 6 1
func()
in api/groups.go
29 6 1
func()
in api/groups.go
32 6 1
func NewOutput()
in pkg/output/output.go
41 5 3