awslabs / aws-go-multi-module-repository-tools
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 224 units with 3,534 lines of code in units (82.2% of code).
    • 0 very complex units (0 lines of code)
    • 3 complex units (328 lines of code)
    • 18 medium complex units (824 lines of code)
    • 40 simple units (1,031 lines of code)
    • 163 very simple units (1,351 lines of code)
0% | 9% | 23% | 29% | 38%
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% | 9% | 23% | 29% | 38%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
cmd/eachmodule0% | 56% | 16% | 0% | 26%
release0% | 22% | 6% | 54% | 16%
cmd/changelog0% | 27% | 5% | 51% | 15%
internal/semver0% | 0% | 41% | 22% | 36%
gomod0% | 0% | 24% | 13% | 62%
cmd/updatemodulemeta0% | 0% | 70% | 0% | 29%
cmd/annotatestablegen0% | 0% | 78% | 0% | 21%
cmd/makerelative0% | 0% | 34% | 19% | 45%
cmd/moduleversion0% | 0% | 74% | 0% | 25%
cmd/calculaterelease0% | 0% | 81% | 0% | 18%
cmd/generatechangelog0% | 0% | 18% | 51% | 30%
cmd/gomodgen0% | 0% | 26% | 54% | 18%
cmd/tagrelease0% | 0% | 73% | 0% | 26%
cmd/editmoduledependency0% | 0% | 50% | 0% | 49%
changelog0% | 0% | 0% | 60% | 39%
ROOT0% | 0% | 0% | 29% | 70%
cmd/updaterequires0% | 0% | 0% | 37% | 62%
git0% | 0% | 0% | 0% | 100%
manifest0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func run()
in cmd/eachmodule/main.go
129 31 0
func Calculate()
in release/calculate.go
110 30 4
func runCreateCommand()
in cmd/changelog/create.go
89 27 2
func main()
in cmd/annotatestablegen/main.go
75 24 0
func main()
in cmd/updatemodulemeta/main.go
61 18 0
func Parse()
in internal/semver/semver.go
63 17 1
func UpdateRequires()
in gomod/version.go
56 16 4
func prepareTargetDirectory()
in cmd/gomodgen/main.go
45 15 2
func comparePrerelease()
in internal/semver/semver.go
44 14 2
func main()
in cmd/generatechangelog/main.go
47 14 0
func main()
in cmd/moduleversion/main.go
57 14 0
func main()
in cmd/editmoduledependency/main.go
34 14 0
func addRelativeReplaces()
in cmd/makerelative/main.go
59 13 3
func main()
in cmd/calculaterelease/main.go
54 13 0
func calculateNextVersion()
in release/release.go
31 12 3
func parsePrerelease()
in internal/semver/semver.go
23 12 1
func getModuleGoPackage()
in cmd/updatemodulemeta/main.go
36 12 1
func()
in gomod/module_tree.go
47 11 1
func validateCreateCommandArguments()
in cmd/changelog/create.go
19 11 2
func CommandWorker()
in cmd/eachmodule/cmd.go
37 11 4