awslabs / clencli
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 139 units with 1,832 lines of code in units (58.5% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (76 lines of code)
    • 5 medium complex units (193 lines of code)
    • 13 simple units (362 lines of code)
    • 120 very simple units (1,201 lines of code)
0% | 4% | 10% | 19% | 65%
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% | 10% | 19% | 65%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
cobra/aid0% | 11% | 16% | 10% | 61%
cobra/controller0% | 0% | 16% | 31% | 51%
box0% | 0% | 0% | 56% | 43%
helper0% | 0% | 0% | 15% | 84%
cobra/cmd0% | 0% | 0% | 49% | 50%
cobra/view0% | 0% | 0% | 14% | 85%
cobra/dao0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func writeInputs()
in cobra/aid/render.go
76 29 0
func writeOutputs()
in cobra/aid/render.go
50 19 0
func DownloadPhotoByID()
in cobra/aid/unsplash.go
37 17 2
func initRun()
in cobra/controller/init.go
45 13 2
func updateLogoFromConfigurations()
in cobra/controller/render.go
32 11 1
func InitCustomized()
in cobra/aid/init.go
29 11 2
func main()
in box/gen.go
50 10 0
func TrimRightFile()
in helper/files.go
40 10 2
func unsplashRun()
in cobra/controller/unsplash.go
38 10 2
func initConfig()
in cobra/cmd/root.go
29 9 0
func initTerraformProject()
in cobra/aid/init.go
11 8 0
func gitIgnoreRun()
in cobra/controller/gitignore.go
25 7 2
func updateLogoFromUnsplashFile()
in cobra/controller/render.go
36 7 0
func DownloadPhoto()
in cobra/aid/unsplash.go
25 7 3
func gitIgnorePreRun()
in cobra/controller/gitignore.go
19 6 2
func renderPreRun()
in cobra/controller/render.go
26 6 2
func buildURL()
in cobra/aid/unsplash.go
21 6 2
func getPhotoURLBySize()
in cobra/aid/unsplash.go
16 6 2
func askAboutInitialization()
in cobra/view/configure.go
26 6 2
func configureRun()
in cobra/controller/configure.go
21 5 2