facebookincubator / antlir
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,583 units with 15,233 lines of code in units (36.0% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (203 lines of code)
    • 16 medium complex units (711 lines of code)
    • 70 simple units (2,081 lines of code)
    • 1,495 very simple units (12,238 lines of code)
0% | 1% | 4% | 13% | 80%
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% | 1% | 7% | 18% | 72%
c0% | 36% | 30% | 0% | 33%
rs0% | 0% | 1% | 9% | 89%
js0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
antlir/btrfs_diff0% | 11% | 16% | 7% | 64%
antlir/nspawn_in_subvol0% | 8% | 10% | 10% | 71%
antlir/compiler0% | 0% | 8% | 35% | 56%
antlir/rpm0% | 0% | 6% | 16% | 76%
tools/testinfra0% | 0% | 49% | 48% | 1%
antlir0% | 0% | 3% | 16% | 79%
metalos/lib0% | 0% | 0% | 8% | 91%
antlir/bzl0% | 0% | 0% | 14% | 85%
metalos/host_configs0% | 0% | 0% | 8% | 91%
metalos/metalctl0% | 0% | 0% | 2% | 97%
antlir/vm0% | 0% | 0% | 0% | 100%
antlir/website0% | 0% | 0% | 0% | 100%
metalos/os0% | 0% | 0% | 0% | 100%
antlir/proxy0% | 0% | 0% | 0% | 100%
metalos/metalos_macros0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
85 28 2
118 27 1
52 25 1
63 23 2
58 23 2
43 19 1
49 19 2
72 18 2
45 14 3
35 14 4
23 13 2
36 13 2
31 13 1
32 12 3
37 12 2
19 12 4
40 12 2
76 11 0
39 10 1
71 10 2
25 10 2
34 10 1
16 10 1
91 10 1
226 10 6
25 9 4
15 9 4
24 9 2
21 9 2
23 9 1
15 9 1
48 9 1
34 9 2
16 9 1
38 9 1
49 9 0
52 8 1
20 8 1
19 8 1
19 8 2
16 8 1
15 8 2
20 8 2
19 8 1
32 8 3
24 8 1
7 8 2
33 8 1
26 8 3
18 7 3