facebook / folly
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 11,772 units with 95,293 lines of code in units (53.2% of code).
    • 5 very complex units (2,602 lines of code)
    • 16 complex units (1,763 lines of code)
    • 185 medium complex units (11,006 lines of code)
    • 551 simple units (15,473 lines of code)
    • 11,015 very simple units (64,449 lines of code)
2% | 1% | 11% | 16% | 67%
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
h4% | <1% | 6% | 10% | 78%
cpp1% | 4% | 17% | 22% | 54%
py0% | 0% | 14% | 24% | 60%
pyx0% | 0% | 23% | 0% | 76%
c0% | 0% | 0% | 33% | 66%
pyi0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
folly6% | 3% | 9% | 10% | 68%
folly/concurrency37% | 0% | 9% | 3% | 49%
folly/experimental<1% | 3% | 11% | 19% | 65%
folly/io0% | 2% | 17% | 18% | 61%
build/fbcode_builder0% | 0% | 13% | 26% | 59%
folly/logging0% | 0% | 30% | 18% | 50%
folly/container0% | 0% | 14% | 9% | 75%
folly/futures0% | 0% | 14% | 12% | 72%
folly/fibers0% | 0% | 9% | 18% | 72%
folly/stats0% | 0% | 16% | 16% | 67%
folly/hash0% | 0% | 13% | 28% | 57%
folly/net0% | 0% | 13% | 16% | 70%
folly/portability0% | 0% | 8% | 15% | 76%
folly/detail0% | 0% | 9% | 23% | 66%
folly/compression0% | 0% | 7% | 30% | 62%
folly/synchronization0% | 0% | 2% | 15% | 82%
folly/gen0% | 0% | 5% | 13% | 81%
folly/system0% | 0% | 13% | 15% | 71%
folly/chrono0% | 0% | 23% | 0% | 76%
folly/executors0% | 0% | 2% | 19% | 78%
folly/memory0% | 0% | 5% | 0% | 94%
folly/python0% | 0% | 6% | 0% | 93%
folly/ssl0% | 0% | 0% | 10% | 89%
folly/lang0% | 0% | 0% | 7% | 92%
folly/support0% | 0% | 0% | 17% | 82%
folly/init0% | 0% | 0% | 53% | 46%
folly/functional0% | 0% | 0% | 0% | 100%
folly/tracing0% | 0% | 0% | 0% | 100%
folly/tools0% | 0% | 0% | 0% | 100%
folly/poly0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
963 172 1
655 72 1
388 70 3
453 55 1
143 51 4
135 38 2
179 38 6
109 37 0
105 36 4
160 35 1
101 34 6
86 31 1
118 29 3
94 29 3
114 28 3
68 27 1
60 26 1
97 26 1
112 26 6
148 26 3
77 26 3
76 25 4
169 25 2
56 25 3
97 24 1
51 24 1
57 24 1
113 23 5
93 23 1
90 23 4
83 23 4
37 23 1
80 23 2
116 23 5
114 23 2
62 22 1
78 22 3
102 22 4
102 22 4
125 22 7
80 22 4
66 21 0
83 21 0
106 20 2
84 20 0
78 20 2
82 20 2
90 20 1
76 20 3
40 19 2