microsoft / etcd3
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 282 units with 2,039 lines of code in units (44.8% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 0 medium complex units (0 lines of code)
    • 6 simple units (183 lines of code)
    • 276 very simple units (1,856 lines of code)
0% | 0% | 0% | 8% | 91%
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
ts0% | 0% | 0% | 8% | 91%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src0% | 0% | 0% | 8% | 91%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
private async loop()
in src/election.ts
57 9 0
public async exec()
in src/connection-pool.ts
44 8 4
25 8 1
15 7 1
private setLeader()
in src/election.ts
13 6 1
private commit()
in src/stm.ts
29 6 0
public getMetadata()
in src/connection-pool.ts
42 5 0
private async start()
in src/election.ts
28 5 0
public static from()
in src/range.ts
12 5 1
19 5 2
11 5 1
17 5 2
12 5 1
31 5 0
9 4 0
public resetAllServices()
in src/connection-pool.ts
13 4 0
private hasSecureHost()
in src/connection-pool.ts
14 4 0
public leader()
in src/election.ts
7 4 1
public async revoke()
in src/lease.ts
14 4 1
private keepalive()
in src/lease.ts
42 4 0