facebook / proxygen
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 3,654 units with 34,677 lines of code in units (63.0% of code).
    • 1 very complex units (258 lines of code)
    • 6 complex units (698 lines of code)
    • 84 medium complex units (4,440 lines of code)
    • 257 simple units (7,052 lines of code)
    • 3,306 very simple units (22,229 lines of code)
<1% | 2% | 12% | 20% | 64%
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
cpp1% | 3% | 15% | 22% | 56%
py0% | 0% | 13% | 27% | 58%
h0% | 0% | 2% | 6% | 91%
c0% | 0% | 0% | 33% | 66%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
proxygen/lib/http1% | 2% | 14% | 18% | 63%
build/fbcode_builder/getdeps0% | 0% | 12% | 31% | 55%
build/fbcode_builder0% | 0% | 22% | 15% | 61%
proxygen/lib/utils0% | 0% | 4% | 29% | 66%
proxygen/httpserver0% | 0% | 5% | 17% | 77%
proxygen/lib/healthcheck0% | 0% | 82% | 0% | 17%
build/fbcode_builder/CMake0% | 0% | 0% | 31% | 68%
proxygen/lib/transport0% | 0% | 0% | 13% | 86%
proxygen/httpserver/filters0% | 0% | 0% | 27% | 72%
proxygen/lib/pools0% | 0% | 0% | 32% | 67%
proxygen/lib/ssl0% | 0% | 0% | 14% | 85%
proxygen/lib/services0% | 0% | 0% | 0% | 100%
proxygen/lib/stats0% | 0% | 0% | 0% | 100%
proxygen/lib/sampling0% | 0% | 0% | 0% | 100%
build0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
258 93 6
169 49 1
130 37 1
90 32 4
102 28 1
107 28 2
100 27 1
76 25 1
61 25 4
76 25 4
61 24 2
60 24 1
50 22 1
73 22 1
106 22 3
62 22 1
89 21 1
76 20 0
58 19 1
103 19 6
70 19 4
35 19 1
78 19 3
40 19 2
73 19 2
82 18 1
92 18 5
55 18 1
67 18 2
63 18 0
64 17 1
64 17 6
30 17 1
74 17 3
115 17 8
44 17 1
58 17 3
37 17 5
41 17 1
36 16 1
48 16 1
51 16 3
47 16 1
55 16 4
44 16 3
72 15 4
25 15 0
48 15 1
52 15 1
31 15 1