golang / vulndb
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 193 units with 3,225 lines of code in units (16.1% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (199 lines of code)
    • 14 medium complex units (732 lines of code)
    • 33 simple units (1,009 lines of code)
    • 144 very simple units (1,285 lines of code)
0% | 6% | 22% | 31% | 39%
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% | 6% | 22% | 31% | 39%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
internal/report0% | 23% | 21% | 25% | 29%
internal/database0% | 35% | 38% | 6% | 19%
internal/worker0% | 0% | 21% | 34% | 44%
devtools/cmd0% | 0% | 86% | 0% | 13%
cmd/vulnreport0% | 0% | 29% | 40% | 30%
internal/gitrepo0% | 0% | 34% | 0% | 65%
cmd/worker0% | 0% | 0% | 63% | 36%
internal/cvelistrepo0% | 0% | 0% | 61% | 38%
internal/cveschema0% | 0% | 0% | 66% | 33%
internal0% | 0% | 0% | 76% | 23%
internal/issues0% | 0% | 0% | 0% | 100%
internal/derrors0% | 0% | 0% | 0% | 100%
cmd/dbdiff0% | 0% | 0% | 0% | 100%
internal/stdlib0% | 0% | 0% | 0% | 100%
cmd/gendb0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func()
in internal/report/lint.go
105 46 1
func Generate()
in internal/database/generate.go
94 27 3
func()
in internal/worker/update.go
77 20 1
func triageV4CVE()
in internal/worker/triage.go
79 17 3
func loadDB()
in internal/database/load.go
52 14 1
func main()
in cmd/vulnreport/main.go
50 13 0
func run()
in devtools/cmd/populate_firestore/populate_firestore.go
57 12 1
func CVEToReport()
in internal/report/cve.go
54 12 2
func checkModVersions()
in internal/report/lint.go
39 12 2
func()
in internal/worker/update.go
63 12 1
func CreateIssues()
in internal/worker/worker.go
64 12 4
func addTODOs()
in cmd/vulnreport/main.go
32 11 1
func updateDB()
in devtools/cmd/populate_firestore/populate_firestore.go
39 11 5
func ReadTxtarRepo()
in internal/gitrepo/gitrepo.go
42 11 2
func updateFalsePositives()
in internal/worker/false_positives.go
35 11 2
func GenerateOSVEntry()
in internal/database/generate.go
49 11 3
func addExportedReportSymbols()
in cmd/vulnreport/main.go
29 10 1
func candidateModulePaths()
in internal/worker/paths.go
28 10 1
func findExportedSymbols()
in cmd/vulnreport/main.go
29 9 3
func ToCVE()
in internal/report/cve.go
86 9 1