awslabs / aws-c-iot
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 106 units with 2,168 lines of code in units (75.5% of code).
    • 1 very complex units (255 lines of code)
    • 0 complex units (0 lines of code)
    • 5 medium complex units (471 lines of code)
    • 10 simple units (335 lines of code)
    • 90 very simple units (1,107 lines of code)
11% | 0% | 21% | 15% | 51%
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
c11% | 0% | 21% | 15% | 51%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
source14% | 0% | 15% | 13% | 56%
source/linux0% | 0% | 58% | 25% | 15%
source/apple0% | 0% | 0% | 0% | 100%
source/windows0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
static int s_get_metric_report_json()
in source/device_defender.c
255 63 7
55 18 3
int get_network_config_and_transfer()
in source/linux/network.c
95 16 2
static void s_reporting_task_fn()
in source/device_defender.c
92 14 3
106 12 5
static int s_defender_task_create()
in source/device_defender.c
123 12 5
33 10 3
33 10 3
bool secure_tunneling_send_data_call()
in source/secure_tunneling.c
25 8 3
static int s_init_custom_metric_data()
in source/device_defender.c
31 8 2
static void s_get_custom_metrics_data()
in source/device_defender.c
52 8 3
int read_proc_net_from_file()
in source/linux/network.c
37 7 4
int get_network_connections()
in source/linux/network.c
51 7 3
static void s_process_iot_st_msg()
in source/secure_tunneling.c
25 7 2
int aws_secure_tunnel_options_validate()
in source/secure_tunneling.c
20 6 1
static int s_secure_tunneling_send_data()
in source/secure_tunneling.c
28 6 2
25 5 2
static void s_process_received_data()
in source/secure_tunneling.c
23 5 1
static int s_secure_tunneling_connect()
in source/secure_tunneling.c
11 4 1
static int s_init_data_tunnel_pair()
in source/secure_tunneling.c
33 4 4