aws / amazon-ec2-metadata-mock
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 92 units with 986 lines of code in units (43.2% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (51 lines of code)
    • 9 simple units (228 lines of code)
    • 82 very simple units (707 lines of code)
0% | 0% | 5% | 23% | 71%
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% | 5% | 23% | 71%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
pkg/mock/handlers0% | 0% | 56% | 21% | 22%
pkg/mock/spot0% | 0% | 0% | 56% | 43%
pkg/mock/events0% | 0% | 0% | 58% | 41%
pkg/config0% | 0% | 0% | 13% | 86%
pkg/cmd/events0% | 0% | 0% | 41% | 58%
pkg/mock/static0% | 0% | 0% | 56% | 43%
pkg/cmd/spot0% | 0% | 0% | 36% | 63%
pkg/mock/dynamic0% | 0% | 0% | 55% | 45%
pkg/cmd/root0% | 0% | 0% | 0% | 100%
pkg/server0% | 0% | 0% | 0% | 100%
pkg/mock/imdsv20% | 0% | 0% | 0% | 100%
pkg/cmd/cmdutil0% | 0% | 0% | 0% | 100%
cmd0% | 0% | 0% | 0% | 100%
pkg/mock/root0% | 0% | 0% | 0% | 100%
pkg/error0% | 0% | 0% | 0% | 100%
pkg/config/defaults0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func CatchAllHandler()
in pkg/mock/handlers/handlers.go
51 11 2
func Handler()
in pkg/mock/events/events.go
34 7 2
func handleSpotITN()
in pkg/mock/spot/spot.go
30 7 2
func LoadConfigForRoot()
in pkg/config/config.go
30 6 2
func RegisterHandlers()
in pkg/mock/static/static.go
23 6 1
func RegisterHandlers()
in pkg/mock/dynamic/dynamic.go
22 6 1
func Handler()
in pkg/mock/spot/spot.go
20 6 2
func ListRoutesHandler()
in pkg/mock/handlers/handlers.go
19 6 2
func ValidateLocalConfig()
in pkg/cmd/events/events.go
28 6 0
func ValidateLocalConfig()
in pkg/cmd/spot/spot.go
22 6 0
func SetMetadataDefaults()
in pkg/config/metadata.go
22 5 1
func unmarshalToNestedStruct()
in pkg/config/metadata.go
17 5 2
func SetDynamicDefaults()
in pkg/config/dynamic.go
22 5 1
20 5 0
func handleRebalance()
in pkg/mock/spot/spot.go
25 5 2
func formatRoutes()
in pkg/mock/handlers/handlers.go
20 5 0
func WriteConfigToFile()
in pkg/config/config.go
19 4 0
func createDir()
in pkg/config/config.go
13 4 1
func Handler()
in pkg/mock/static/static.go
18 4 2
func Handler()
in pkg/mock/dynamic/dynamic.go
18 4 2