facebook / redex
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 8,735 units with 132,859 lines of code in units (68.1% of code).
    • 33 very complex units (8,920 lines of code)
    • 90 complex units (9,877 lines of code)
    • 511 medium complex units (31,857 lines of code)
    • 864 simple units (26,661 lines of code)
    • 7,237 very simple units (55,544 lines of code)
6% | 7% | 23% | 20% | 41%
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
cpp7% | 8% | 26% | 21% | 35%
py6% | 2% | 12% | 15% | 62%
h1% | 0% | 7% | 8% | 82%
js0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
libredex10% | 6% | 17% | 19% | 45%
libresource19% | 13% | 16% | 14% | 36%
service7% | 7% | 31% | 21% | 32%
tools4% | 4% | 15% | 20% | 54%
opt1% | 9% | 33% | 22% | 33%
sparta0% | 0% | 14% | 7% | 77%
ROOT0% | 0% | 40% | 9% | 50%
liblocator0% | 0% | 65% | 0% | 34%
pyredex0% | 0% | 6% | 10% | 82%
shared0% | 0% | 9% | 32% | 58%
analysis0% | 0% | 0% | 19% | 80%
util0% | 0% | 0% | 9% | 90%
website0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
684 244 2
460 226 1
302 214 2
672 208 3
546 195 2
239 183 2
226 174 0
214 173 1
239 173 1
211 171 1
338 167 1
480 161 13
194 97 2
485 96 0
283 94 4
266 84 0
110 83 1
164 80 0
95 80 0
284 75 2
413 74 12
327 73 2
216 73 3
75 69 1
105 63 2
262 62 3
120 61 1
117 58 4
91 55 5
60 53 1
166 53 2
225 53 3
251 52 2
259 47 5
57 47 0
115 47 2
91 47 1
53 47 1
56 47 1
129 46 6
271 43 2
215 43 3
93 42 1
62 42 2
47 41 1
135 41 7
95 40 2
52 40 2
122 40 2
131 39 9