facebook / componentkit
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 988 units with 9,660 lines of code in units (19.0% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (132 lines of code)
    • 4 medium complex units (875 lines of code)
    • 39 simple units (1,279 lines of code)
    • 944 very simple units (7,374 lines of code)
0% | 1% | 9% | 13% | 76%
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
mm0% | 2% | 4% | 19% | 73%
h0% | 0% | 15% | 6% | 78%
swift0% | 0% | 0% | 10% | 89%
m0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ComponentKit0% | 1% | 10% | 14% | 73%
RenderCore0% | 0% | 10% | 14% | 74%
CKSwiftTests0% | 0% | 0% | 20% | 79%
ComponentKitTests0% | 0% | 0% | 5% | 94%
ComponentTextKit0% | 0% | 0% | 0% | 100%
CKSwift0% | 0% | 0% | 0% | 100%
ComponentKitTestHelpers0% | 0% | 0% | 0% | 100%
ComponentKitApplicationTests0% | 0% | 0% | 0% | 100%
ComponentKitPerfTests0% | 0% | 0% | 0% | 100%
ComponentTextKitApplicationTests0% | 0% | 0% | 0% | 100%
ComponentKitApplicationTestsHost0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
132 29 3
638 23 1
66 22 2
61 21 3
110 19 3
30 10 1
42 10 5
61 10 6
16 10 1
59 9 9
37 9 4
28 9 8
13 9 2
34 8 0
31 8 1
38 8 3
34 8 2
23 8 4
175 8 1
29 8 5
36 8 2
79 8 13
19 7 2
20 7 3
21 7 0
61 7 5
17 7 1
17 7 1
17 7 1
9 7 4
34 6 3
31 6 2
8 6 0
11 6 2
21 6 5
23 6 4
45 6 7
17 6 1
46 6 2
16 6 2
36 6 1
10 6 2
15 6 1
20 6 1
23 5 1
14 5 2
14 5 3
14 5 3
14 5 2
8 5 3