microsoft / lsif-node
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 893 units with 8,442 lines of code in units (70.4% of code).
    • 1 very complex units (198 lines of code)
    • 7 complex units (692 lines of code)
    • 27 medium complex units (1,198 lines of code)
    • 60 simple units (1,502 lines of code)
    • 798 very simple units (4,852 lines of code)
2% | 8% | 14% | 17% | 57%
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
ts2% | 8% | 14% | 17% | 57%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
tsc/src4% | 8% | 10% | 23% | 53%
sqlite/src0% | 11% | 23% | 12% | 53%
tooling/src0% | 41% | 12% | 16% | 29%
npm/src0% | 0% | 40% | 8% | 51%
tsc/src/common0% | 0% | 14% | 15% | 69%
protocol/src0% | 0% | 0% | 7% | 92%
tsc/src/npm0% | 0% | 0% | 0% | 100%
lsif/src0% | 0% | 0% | 0% | 100%
tsc/src/emitters0% | 0% | 0% | 0% | 100%
npm/src/common0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
export async function run()
in tsc/src/main.ts
198 54 2
163 47 7
private validateEdge()
in tooling/src/validate.ts
128 45 1
public compress()
in sqlite/src/compress.ts
114 32 3
protected walkType()
in tsc/src/lsif.ts
79 32 6
private computeExportPath()
in tsc/src/lsif.ts
45 29 2
public insert()
in sqlite/src/blobStore.ts
81 27 1
protected visit()
in tsc/src/lsif.ts
82 26 1
export async function run()
in npm/src/main.ts
87 25 1
private addReferencedData()
in sqlite/src/blobStore.ts
65 19 2
private computeHash()
in sqlite/src/blobStore.ts
64 18 0
private handleDocumentEnd()
in sqlite/src/blobStore.ts
52 18 1
public handleMoniker()
in npm/src/main.ts
52 17 1
45 16 1
export async function run()
in sqlite/src/main.ts
45 15 2
public item()
in tsc/src/common/graph.ts
62 14 4
public documentProcessed()
in tsc/src/lsif.ts
53 14 1
43 14 1
29 14 1
async run()
in sqlite/src/store.ts
67 13 0