hhvm / user-documentation
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 1,585 units with 16,144 lines of code in units (74.8% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (167 lines of code)
    • 8 medium complex units (500 lines of code)
    • 53 simple units (1,913 lines of code)
    • 1,523 very simple units (13,564 lines of code)
0% | 1% | 3% | 11% | 84%
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
php0% | 2% | 5% | 20% | 72%
hack0% | 0% | 1% | 4% | 94%
js0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/markdown-extensions0% | 15% | 20% | 14% | 50%
src/api-gen0% | 0% | 16% | 52% | 30%
src/utils0% | 0% | 21% | 6% | 72%
src/build0% | 0% | 3% | 17% | 79%
src/site0% | 0% | 0% | 14% | 85%
build/extracted-examples0% | 0% | 0% | 4% | 95%
src/search0% | 0% | 0% | 48% | 51%
src0% | 0% | 0% | 9% | 90%
src/hh-apidoc-extensions0% | 0% | 0% | 16% | 83%
public0% | 0% | 0% | 100% | 0%
public/js0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
167 32 2
84 17 2
38 15 1
84 14 3
63 14 8
23 13 1
72 13 2
75 13 3
61 11 0
39 10 0
58 10 2
21 10 2
53 10 2
24 10 1
40 10 5
31 10 2
60 10 0
63 10 1
31 10 2
30 9 0
33 9 1
54 9 2
37 9 2
41 9 6
40 8 1
24 8 2
44 8 0
33 8 1
44 8 0
50 8 2
111 8 0
33 8 1
30 8 1
26 7 0
26 7 1
24 7 2
33 7 3
34 7 4
35 7 1
34 7 1
36 7 0
14 6 2
23 6 0
24 6 0
23 6 0
25 6 0
25 6 0
25 6 0
23 6 0
25 6 0