kubernetes / node-problem-detector
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 256 units with 4,032 lines of code in units (70.7% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (105 lines of code)
    • 12 medium complex units (815 lines of code)
    • 34 simple units (1,056 lines of code)
    • 209 very simple units (2,056 lines of code)
0% | 2% | 20% | 26% | 50%
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% | 2% | 20% | 26% | 50%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
pkg/custompluginmonitor0% | 22% | 37% | 6% | 34%
pkg/systemstatsmonitor0% | 0% | 47% | 32% | 19%
pkg/util0% | 0% | 9% | 25% | 64%
pkg/systemlogmonitor0% | 0% | 9% | 28% | 62%
cmd/healthchecker0% | 0% | 21% | 32% | 45%
pkg/healthchecker0% | 0% | 0% | 36% | 63%
pkg/exporters0% | 0% | 0% | 15% | 84%
cmd/nodeproblemdetector0% | 0% | 0% | 40% | 59%
cmd/options0% | 0% | 0% | 41% | 58%
pkg/problemdetector0% | 0% | 0% | 67% | 32%
pkg/logcounter0% | 0% | 0% | 52% | 47%
pkg/problemmetrics0% | 0% | 0% | 0% | 100%
cmd/logcounter0% | 0% | 0% | 0% | 100%
pkg/problemdaemon0% | 0% | 0% | 0% | 100%
pkg/version0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func()
in pkg/custompluginmonitor/custom_plugin_monitor.go
105 28 1
func()
in pkg/custompluginmonitor/plugin/plugin.go
105 20 1
func()
in pkg/systemstatsmonitor/net_collector.go
76 19 1
func NewNetCollectorOrDie()
in pkg/systemstatsmonitor/net_collector.go
165 17 1
func()
in pkg/systemstatsmonitor/disk_collector.go
59 15 1
func()
in pkg/systemstatsmonitor/cpu_collector_linux.go
51 13 1
func()
in cmd/healthchecker/options/options.go
19 12 1
func NewSystemStatsMonitorOrDie()
in pkg/systemstatsmonitor/system_stats_monitor.go
45 12 1
func()
in pkg/custompluginmonitor/types/config.go
40 12 1
func()
in pkg/custompluginmonitor/types/config.go
33 12 1
func main()
in pkg/util/nethealth/nethealth.go
61 12 0
func NewCPUCollectorOrDie()
in pkg/systemstatsmonitor/cpu_collector.go
106 11 1
func()
in pkg/systemlogmonitor/log_monitor.go
55 11 1
func()
in pkg/systemstatsmonitor/disk_collector.go
45 10 1
func()
in pkg/systemstatsmonitor/cpu_collector_linux.go
23 10 1
func()
in pkg/systemstatsmonitor/osfeature_collector.go
38 10 1
func()
in pkg/problemdetector/problem_detector.go
36 10 1
func()
in pkg/systemstatsmonitor/memory_collector_linux.go
38 9 1
func NewDiskCollectorOrDie()
in pkg/systemstatsmonitor/disk_collector.go
95 9 1
func getJournal()
in pkg/systemlogmonitor/logwatchers/journald/log_watcher.go
41 9 2