facebookincubator / spectrum
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,542 units with 12,244 lines of code in units (38.5% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (158 lines of code)
    • 9 medium complex units (364 lines of code)
    • 64 simple units (1,356 lines of code)
    • 1,467 very simple units (10,366 lines of code)
0% | 1% | 2% | 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
cpp0% | 1% | 4% | 12% | 80%
java0% | 2% | <1% | 5% | 91%
mm0% | 0% | 0% | 41% | 58%
m0% | 0% | 0% | 29% | 70%
swift0% | 0% | 0% | 2% | 97%
h0% | 0% | 0% | <1% | 99%
kt0% | 0% | 0% | 0% | 100%
js0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
cpp/spectrum0% | 2% | 5% | 16% | 76%
android/src0% | 1% | <1% | 3% | 93%
androidLibs/fbjni0% | 0% | 4% | 6% | 89%
ios/SpectrumKit0% | 0% | 0% | 30% | 69%
ios/SpectrumKitSample0% | 0% | 0% | 3% | 96%
android/spectrumtestutils0% | 0% | 0% | 0% | 100%
cpp/testutils0% | 0% | 0% | 0% | 100%
android/sample0% | 0% | 0% | 0% | 100%
android/spectrumpluginplatform0% | 0% | 0% | 0% | 100%
android/spectrumpluginwebp0% | 0% | 0% | 0% | 100%
android/spectrumpluginpng0% | 0% | 0% | 0% | 100%
android/spectrumpluginjpeg0% | 0% | 0% | 0% | 100%
android/spectrumpluginavif0% | 0% | 0% | 0% | 100%
website/pages0% | 0% | 0% | 0% | 100%
website/core0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
119 32 3
39 28 1
82 24 0
67 20 0
59 16 0
25 13 3
25 11 0
17 11 1
31 11 1
25 11 2
33 11 2
47 10 4
11 10 1
51 10 4
32 10 2
22 9 2
21 9 1
21 9 1
21 9 1
20 9 1
21 9 1
22 9 2
48 9 0
16 9 1
23 9 1
22 9 1
22 9 1
22 9 1
23 9 1
22 9 1
25 9 1
14 9 1
19 8 1
19 8 1
19 8 2
20 8 1
15 8 1
15 8 1
15 8 1
15 8 1
10 8 1
10 8 1
30 8 2
17 7 1
17 7 1
17 7 1
19 7 1
23 7 0
21 7 1
20 7 1