facebook / fb303
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 981 units with 8,814 lines of code in units (56.5% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 16 medium complex units (782 lines of code)
    • 74 simple units (1,936 lines of code)
    • 891 very simple units (6,096 lines of code)
0% | 0% | 8% | 21% | 69%
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
py0% | 0% | 14% | 26% | 59%
h0% | 0% | 1% | 5% | 92%
cpp0% | 0% | 0% | 26% | 73%
c0% | 0% | 0% | 33% | 66%
rs0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
build/fbcode_builder/getdeps0% | 0% | 12% | 31% | 55%
build/fbcode_builder0% | 0% | 22% | 15% | 61%
fb303/detail0% | 0% | 12% | 38% | 48%
fb3030% | 0% | 0% | 12% | 87%
build/fbcode_builder/CMake0% | 0% | 0% | 31% | 68%
fb303/thrift0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
76 25 4
62 22 1
40 19 2
73 19 2
37 17 5
41 17 1
55 16 4
44 16 3
41 15 2
128 13 3
31 12 3
50 12 4
9 12 2
31 11 4
31 11 2
33 11 3
24 10 3
23 10 4
29 10 3
43 10 2
26 10 6
25 10 3
15 10 3
45 10 2
45 10 6
40 10 2
29 9 2
27 9 2
41 9 1
34 9 3
108 9 3
46 8 2
17 8 2
25 8 1
16 8 2
23 8 3
18 8 3
27 8 3
14 8 5
17 8 3
17 8 2
47 8 2
14 7 2
78 7 0
14 7 2
14 7 4
11 7 2
14 7 3
19 7 2
27 7 0