golang / vscode-go
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 674 units with 14,705 lines of code in units (81.0% of code).
    • 4 very complex units (1,147 lines of code)
    • 4 complex units (477 lines of code)
    • 76 medium complex units (4,337 lines of code)
    • 122 simple units (3,688 lines of code)
    • 468 very simple units (5,056 lines of code)
7% | 3% | 29% | 25% | 34%
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
ts8% | 2% | 28% | 25% | 34%
go0% | 9% | 43% | 17% | 29%
js0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src8% | <1% | 29% | 27% | 33%
src/debugAdapter14% | 0% | 33% | 17% | 34%
src/goTest0% | 26% | 16% | 19% | 38%
tools/relnotes0% | 53% | 20% | 0% | 26%
tools0% | 0% | 64% | 12% | 23%
tools/goplssetting0% | 0% | 37% | 26% | 36%
src/utils0% | 0% | 14% | 30% | 55%
tools/installtools0% | 0% | 0% | 52% | 47%
media0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
constructor()
in src/debugAdapter/goDebug.ts
265 74 2
public async resolveDebugConfiguration()
in src/goDebugConfiguration.ts
190 69 3
495 56 1
private runGoCode()
in src/goSuggest.ts
197 52 10
async run()
in src/goTest/run.ts
139 38 3
static setup()
in src/goTest/explore.ts
146 29 1
92 28 8
func main()
in tools/relnotes/relnotes.go
100 26 0
94 24 4
export function goLint()
in src/goLint.ts
76 23 4
function spawnDlvDapServerProcess()
in src/goDebugFactory.ts
94 23 4
func main()
in tools/generate.go
124 22 0
protected scopesRequest()
in src/debugAdapter/goDebug.ts
150 22 2
private initLaunchAttachRequest()
in src/debugAdapter/goDebug.ts
60 22 2
private async processSymbol()
in src/goTest/resolve.ts
59 22 5
55 21 5
126 20 3
public provideTypeDefinition()
in src/goTypeDefinition.ts
83 20 3
func describeDebugProperty()
in tools/generate.go
53 19 1
43 19 3