facebookincubator / cinder
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 23,800 units with 241,871 lines of code in units (31.2% of code).
    • 24 very complex units (8,785 lines of code)
    • 114 complex units (10,418 lines of code)
    • 1,006 medium complex units (43,240 lines of code)
    • 2,123 simple units (50,010 lines of code)
    • 20,533 very simple units (129,418 lines of code)
3% | 4% | 17% | 20% | 53%
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
cpp11% | 4% | 16% | 18% | 49%
py1% | 4% | 19% | 21% | 54%
h26% | 2% | 1% | 6% | 63%
c1% | 4% | 17% | 26% | 50%
inc0% | 0% | 21% | 29% | 48%
js0% | 0% | 0% | 7% | 92%
pyi0% | 0% | 0% | 0% | 100%
m0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
Jit17% | 3% | 16% | 17% | 45%
Objects72% | 1% | 3% | 5% | 17%
Lib1% | 3% | 19% | 21% | 54%
Tools1% | 8% | 18% | 19% | 52%
Python5% | 1% | 16% | 30% | 45%
PC3% | 6% | 14% | 30% | 44%
Modules0% | 5% | 20% | 23% | 49%
ROOT0% | 32% | 20% | 13% | 33%
StrictModules0% | 3% | 7% | 14% | 75%
Mac0% | 0% | 46% | 27% | 26%
Doc0% | 0% | 12% | 18% | 69%
Parser0% | 0% | 8% | 27% | 63%
RuntimeTests0% | 0% | 16% | 26% | 56%
PCbuild0% | 0% | 23% | 14% | 62%
Include0% | 0% | 5% | 39% | 55%
Experiments0% | 0% | 0% | 19% | 81%
Programs0% | 0% | 0% | 9% | 90%
Misc0% | 0% | 0% | 0% | 100%
CinderVM0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
1990 1836 1
2068 343 1
601 169 4
330 168 1
430 157 1
266 145 2
197 134 1
145 133 0
142 132 1
315 125 1
290 100 0
193 86 5
185 74 1
141 73 1
108 71 4
146 65 0
167 62 20
111 60 4
193 58 2
95 56 8
317 56 5
104 53 1
143 52 2
108 51 6
218 50 1
174 49 3
97 49 4
184 49 1
107 48 2
92 47 2
175 45 2
111 45 4
190 45 2
123 45 19
111 45 5
58 44 2
142 42 1
90 41 2
70 41 1
73 41 2
207 41 1
86 40 3
208 39 2
139 39 0
163 39 0
97 39 2
140 38 1
131 38 5
128 37 8
66 37 2