aws-samples / aws-iot-device-defender-agent-sdk-python
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 54 units with 416 lines of code in units (78.9% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 0 medium complex units (0 lines of code)
    • 6 simple units (109 lines of code)
    • 48 very simple units (307 lines of code)
0% | 0% | 0% | 26% | 73%
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% | 0% | 0% | 26% | 73%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
AWSIoTDeviceDefenderAgentSDK0% | 0% | 0% | 26% | 73%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def add_listening_ports()
in AWSIoTDeviceDefenderAgentSDK/metrics.py
11 7 3
def listening_ports()
in AWSIoTDeviceDefenderAgentSDK/collector.py
17 7 2
def _v1_metrics()
in AWSIoTDeviceDefenderAgentSDK/metrics.py
21 6 1
def main()
in AWSIoTDeviceDefenderAgentSDK/agent.py
41 6 0
def __get_interface_name()
in AWSIoTDeviceDefenderAgentSDK/collector.py
7 6 1
def network_connections()
in AWSIoTDeviceDefenderAgentSDK/collector.py
12 6 1
def connect()
in AWSIoTDeviceDefenderAgentSDK/agent.py
41 5 1
def main()
in AWSIoTDeviceDefenderAgentSDK/collector.py
29 5 0
def __init__()
in AWSIoTDeviceDefenderAgentSDK/metrics.py
18 4 3
def on_connection_resumed()
in AWSIoTDeviceDefenderAgentSDK/agent.py
6 4 4
def listening_ports()
in AWSIoTDeviceDefenderAgentSDK/metrics.py
8 3 2
def add_network_connection()
in AWSIoTDeviceDefenderAgentSDK/metrics.py
9 3 5
def _sample_list()
in AWSIoTDeviceDefenderAgentSDK/metrics.py
7 3 2
def on_resubscribe_complete()
in AWSIoTDeviceDefenderAgentSDK/agent.py
6 3 1
def add_network_stats()
in AWSIoTDeviceDefenderAgentSDK/metrics.py
20 2 5
def to_json_string()
in AWSIoTDeviceDefenderAgentSDK/metrics.py
6 2 2
def parse_args()
in AWSIoTDeviceDefenderAgentSDK/agent.py
37 2 0
def custom_callback()
in AWSIoTDeviceDefenderAgentSDK/agent.py
10 2 3
def get()
in AWSIoTDeviceDefenderAgentSDK/tags.py
5 2 2
def __init__()
in AWSIoTDeviceDefenderAgentSDK/collector.py
4 2 3