microsoft / TypeScript
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 13,747 units with 175,311 lines of code in units (72.9% of code).
    • 50 very complex units (10,505 lines of code)
    • 175 complex units (12,912 lines of code)
    • 897 medium complex units (33,754 lines of code)
    • 1,683 simple units (34,169 lines of code)
    • 10,942 very simple units (83,971 lines of code)
5% | 7% | 19% | 19% | 47%
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
ts6% | 7% | 19% | 19% | 47%
js0% | 9% | 23% | 35% | 31%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src6% | 7% | 19% | 19% | 47%
scripts0% | 4% | 28% | 26% | 40%
lib0% | 0% | 0% | 72% | 27%
ROOT0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
499 382 2
422 221 3
1120 208 1
1101 208 1
386 187 4
410 154 6
777 143 6
222 120 0
204 117 1
222 112 1
240 103 1
109 101 2
180 99 1
120 89 1
99 82 5
135 81 2
224 81 1
137 80 9
161 79 2
211 79 2
196 77 3
195 77 1
138 75 5
110 74 1
121 72 5
112 71 7
137 70 3
156 70 6
109 69 2
106 64 2
114 63 5
109 63 1
64 62 1
83 62 3
172 61 0
137 60 3
116 60 1
127 59 22
132 58 2
86 58 1
92 56 2
96 56 1
63 56 6
33 54 4
69 53 0
276 53 5
81 53 1
102 52 2
79 52 3
115 51 1