aws / amazon-cloudwatch-agent
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 2,012 units with 21,872 lines of code in units (55.4% of code).
    • 0 very complex units (0 lines of code)
    • 9 complex units (1,017 lines of code)
    • 56 medium complex units (2,972 lines of code)
    • 185 simple units (5,112 lines of code)
    • 1,762 very simple units (12,771 lines of code)
0% | 4% | 13% | 23% | 58%
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% | 4% | 13% | 23% | 58%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
cmd0% | 50% | 0% | 12% | 36%
plugins0% | 4% | 22% | 24% | 48%
tool0% | 7% | 8% | 27% | 56%
translator0% | 1% | 7% | 19% | 71%
internal0% | 0% | 11% | 33% | 54%
awscsm0% | 0% | 9% | 14% | 76%
logs0% | 0% | 60% | 0% | 40%
metric0% | 0% | 0% | 46% | 53%
cfg0% | 0% | 0% | 7% | 92%
handlers0% | 0% | 0% | 82% | 17%
profiler0% | 0% | 0% | 0% | 100%
logger0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func MapOldWindowsConfigToNewConfig()
in tool/processors/migration/windows/windows_migration_core.go
151 44 1
func main()
in cmd/amazon-cloudwatch-agent/amazon-cloudwatch-agent.go
173 40 0
func()
in plugins/inputs/statsd/statsd.go
126 37 1
func()
in plugins/outputs/cloudwatch/cloudwatch.go
108 31 1
func main()
in cmd/config-downloader/downloader.go
119 29 0
func GenerateMergedJsonConfigMap()
in translator/cmdutil/translatorutil.go
82 27 1
func()
in plugins/inputs/logfile/tail/tail.go
90 27 1
func()
in plugins/outputs/cloudwatchlogs/pusher.go
56 26 1
func runAgent()
in cmd/amazon-cloudwatch-agent/amazon-cloudwatch-agent.go
112 26 3
func()
in plugins/inputs/logfile/logfile.go
97 23 1
func()
in plugins/inputs/logfile/fileconfig.go
56 23 1
func()
in plugins/inputs/logfile/tailersrc.go
102 23 1
func()
in plugins/processors/k8sdecorator/stores/podstore.go
58 20 1
func()
in plugins/processors/k8sdecorator/stores/podstore.go
47 20 1
func SetMetricPathForOneInput()
in translator/setMetricPath.go
70 19 4
func()
in plugins/outputs/cloudwatchlogs/cloudwatchlogs.go
66 19 1
func()
in tool/data/config/metric/collection.go
58 19 1
func SetMetricPath()
in translator/setMetricPath.go
65 18 2
func()
in translator/translate/translate.go
68 18 1
func()
in plugins/outputs/cloudwatchlogs/pusher.go
85 18 1