facebook / chef-cookbooks
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 484 units with 5,890 lines of code in units (21.1% of code).
    • 1 very complex units (255 lines of code)
    • 1 complex units (94 lines of code)
    • 19 medium complex units (1,266 lines of code)
    • 29 simple units (863 lines of code)
    • 434 very simple units (3,412 lines of code)
4% | 1% | 21% | 14% | 57%
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
rb4% | 1% | 21% | 14% | 57%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
cookbooks/fb_storage13% | 0% | 28% | 14% | 43%
cookbooks/fb_users0% | 61% | 0% | 25% | 12%
cookbooks/fb_fstab0% | 0% | 53% | 11% | 34%
cookbooks/fb_swap0% | 0% | 40% | 0% | 59%
cookbooks/fb_network_scripts0% | 0% | 24% | 17% | 57%
cookbooks/fb_systemd0% | 0% | 36% | 0% | 63%
cookbooks/fb_modprobe0% | 0% | 46% | 0% | 53%
cookbooks/fb_yum_repos0% | 0% | 30% | 23% | 45%
cookbooks/fb_helpers0% | 0% | 2% | 23% | 73%
cookbooks/fb_system_upgrade0% | 0% | 0% | 100% | 0%
cookbooks/fb_chef_hints0% | 0% | 0% | 51% | 48%
cookbooks/fb_collectd0% | 0% | 0% | 100% | 0%
cookbooks/fb_fluentbit0% | 0% | 0% | 16% | 83%
cookbooks/fb_timers0% | 0% | 0% | 38% | 61%
cookbooks/fb_apt0% | 0% | 0% | 0% | 100%
spec0% | 0% | 0% | 0% | 100%
cookbooks/fb_powershell0% | 0% | 0% | 0% | 100%
cookbooks/fb_choco0% | 0% | 0% | 0% | 100%
cookbooks/fb_grubby0% | 0% | 0% | 0% | 100%
cookbooks/fb_sdparm0% | 0% | 0% | 0% | 100%
cookbooks/fb_ipset0% | 0% | 0% | 0% | 100%
cookbooks/fb_iptables0% | 0% | 0% | 0% | 100%
cookbooks/fb_apache0% | 0% | 0% | 0% | 100%
cookbooks/fb_sysctl0% | 0% | 0% | 0% | 100%
cookbooks/fb_rsync0% | 0% | 0% | 0% | 100%
cookbooks/fb_readline0% | 0% | 0% | 0% | 100%
cookbooks/fb_launchd0% | 0% | 0% | 0% | 100%
cookbooks/fb_hdparm0% | 0% | 0% | 0% | 100%
cookbooks/fb_nscd0% | 0% | 0% | 0% | 100%
cookbooks/fb_ntp0% | 0% | 0% | 0% | 100%
cookbooks/fb_e2fsprogs0% | 0% | 0% | 0% | 100%
cookbooks/fb_dnf0% | 0% | 0% | 0% | 100%
cookbooks/fb_grub0% | 0% | 0% | 0% | 100%
spec/chefspec0% | 0% | 0% | 0% | 100%
cookbooks/fb_screen0% | 0% | 0% | 0% | 100%
cookbooks/fb_sysfs0% | 0% | 0% | 0% | 100%
cookbooks/fb_syslog0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
255 52 0
94 27 1
81 25 0
85 22 1
68 20 3
72 19 1
87 18 1
87 18 2
76 18 2
77 17 0
75 16 2
112 16 1
84 15 3
49 14 3
68 14 0
46 14 2
59 13 1
25 12 3
37 12 2
24 11 2
54 11 1
39 9 0
54 9 2
61 9 1
43 9 2
19 8 2
29 8 3
32 8 3
19 8 1
17 8 1
39 8 1
28 8 1
29 8 2
34 7 2
27 7 2
65 7 1
17 7 1
26 7 1
35 7 0
35 7 1
26 7 3
25 6 3
29 6 3
24 6 0
17 6 3
7 6 0
7 6 0
25 6 2
23 6 1
32 6 3