mapillary / OpenSfM
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 2,972 units with 20,733 lines of code in units (52.6% of code).
    • 1 very complex units (433 lines of code)
    • 1 complex units (59 lines of code)
    • 32 medium complex units (2,056 lines of code)
    • 98 simple units (2,724 lines of code)
    • 2,840 very simple units (15,461 lines of code)
2% | <1% | 9% | 13% | 74%
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
cc10% | 0% | 20% | 10% | 58%
js0% | 1% | 4% | 13% | 80%
py0% | 0% | 9% | 17% | 73%
h0% | 0% | 6% | 7% | 86%
pyi0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
opensfm/src5% | 0% | 13% | 8% | 73%
viewer/src0% | 2% | 2% | 7% | 88%
opensfm0% | 0% | 12% | 15% | 72%
opensfm/actions0% | 0% | 10% | 16% | 73%
viewer/legacy0% | 0% | 13% | 40% | 46%
annotation_gui_gcp/js0% | 0% | 6% | 10% | 82%
annotation_gui_gcp0% | 0% | 0% | 44% | 55%
annotation_gui_gcp/lib0% | 0% | 0% | 31% | 68%
opensfm/large0% | 0% | 0% | 40% | 59%
opensfm/synthetic_data0% | 0% | 0% | 3% | 96%
opensfm/commands0% | 0% | 0% | 0% | 100%
viewer0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
433 73 0
59 26 0
148 22 5
62 21 2
85 21 2
165 21 6
145 21 5
39 16 2
72 14 2
43 14 5
56 14 1
42 14 1
46 13 1
31 13 1
37 13 2
39 12 1
24 12 2
36 12 4
46 12 3
61 12 4
71 12 3
114 11 3
129 11 1
25 11 1
91 11 1
76 11 1
50 11 4
57 11 3
32 11 3
54 11 5
53 11 1
53 11 1
48 11 4
26 11 1
27 10 1
22 10 5
21 10 2
28 10 1
42 10 4
71 10 0
61 10 3
59 10 3
117 9 2
14 9 1
21 9 1
26 9 1
24 9 3
57 9 1
18 9 1
53 9 3