facebook / hhvm
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 37,881 units with 478,813 lines of code in units (45.6% of code).
    • 94 very complex units (26,969 lines of code)
    • 334 complex units (36,940 lines of code)
    • 1,437 medium complex units (81,293 lines of code)
    • 2,446 simple units (74,199 lines of code)
    • 33,570 very simple units (259,412 lines of code)
5% | 7% | 16% | 15% | 54%
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% | 9% | 21% | 18% | 43%
h7% | 2% | 5% | 6% | 78%
rs<1% | 2% | 8% | 10% | 77%
cc3% | 8% | 19% | 15% | 52%
php<1% | 3% | 6% | 9% | 80%
py0% | 6% | 12% | 22% | 59%
c0% | 0% | 5% | 16% | 77%
hack0% | 0% | 32% | 10% | 56%
pl0% | 0% | 0% | 70% | 29%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
hphp/runtime6% | 8% | 18% | 16% | 49%
hphp/hhbbc8% | 15% | 28% | 16% | 31%
hphp/tools7% | 15% | 18% | 19% | 38%
hphp/zend36% | 3% | 12% | 15% | 32%
hphp/hack<1% | 2% | 8% | 10% | 77%
hphp/vixl2% | 6% | 16% | 12% | 62%
hphp/hsl3% | 0% | 6% | 9% | 80%
hphp/util<1% | 3% | 11% | 20% | 63%
hphp/compiler0% | 21% | 27% | 26% | 24%
hphp/system0% | 0% | 6% | 10% | 83%
hphp/neo0% | 0% | 21% | 39% | 38%
hphp/hhvm0% | 0% | 23% | 43% | 33%
hphp/doc0% | 0% | 0% | 70% | 29%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
1206 693 1
677 670 1
680 670 1
731 331 5
731 331 5
731 331 5
731 331 5
290 280 2
290 280 1
228 222 1
228 222 1
173 166 1
249 161 1
662 140 1
484 136 2
365 133 4
672 132 2
473 126 3
376 126 6
307 126 2
332 124 2
221 122 1
203 121 3
312 114 5
443 112 6
387 104 2
427 103 2
354 102 7
209 95 2
1230 94 6
218 91 5
242 91 3
244 91 7
377 90 7
378 89 2
296 87 1
193 87 2
202 86 4
318 85 6
305 82 9
176 78 2
252 77 1
227 74 7
87 73 2
162 72 3
260 70 6
180 69 6
237 68 3
165 67 2
133 66 1