aws-samples / aws-iot-device-defender-agent-sdk-python
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 54 units with 416 lines of code in units (78.9% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 5 medium size units (169 lines of code)
    • 6 small units (89 lines of code)
    • 43 very small units (158 lines of code)
0% | 0% | 40% | 21% | 37%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 0% | 40% | 21% | 37%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
AWSIoTDeviceDefenderAgentSDK0% | 0% | 40% | 21% | 37%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def connect()
in AWSIoTDeviceDefenderAgentSDK/agent.py
41 5 1
def main()
in AWSIoTDeviceDefenderAgentSDK/agent.py
41 6 0
def parse_args()
in AWSIoTDeviceDefenderAgentSDK/agent.py
37 2 0
def main()
in AWSIoTDeviceDefenderAgentSDK/collector.py
29 5 0
def _v1_metrics()
in AWSIoTDeviceDefenderAgentSDK/metrics.py
21 6 1
def add_network_stats()
in AWSIoTDeviceDefenderAgentSDK/metrics.py
20 2 5
def __init__()
in AWSIoTDeviceDefenderAgentSDK/metrics.py
18 4 3
def listening_ports()
in AWSIoTDeviceDefenderAgentSDK/collector.py
17 7 2
def network_connections()
in AWSIoTDeviceDefenderAgentSDK/collector.py
12 6 1
def add_listening_ports()
in AWSIoTDeviceDefenderAgentSDK/metrics.py
11 7 3
def __init__()
in AWSIoTDeviceDefenderAgentSDK/agent.py
11 1 10
def custom_callback()
in AWSIoTDeviceDefenderAgentSDK/agent.py
10 2 3
def collect_metrics()
in AWSIoTDeviceDefenderAgentSDK/collector.py
10 2 1
def add_network_connection()
in AWSIoTDeviceDefenderAgentSDK/metrics.py
9 3 5
def listening_ports()
in AWSIoTDeviceDefenderAgentSDK/metrics.py
8 3 2
def subscribe()
in AWSIoTDeviceDefenderAgentSDK/agent.py
8 1 3
def _sample_list()
in AWSIoTDeviceDefenderAgentSDK/metrics.py
7 3 2
def __get_interface_name()
in AWSIoTDeviceDefenderAgentSDK/collector.py
7 6 1
def network_stats()
in AWSIoTDeviceDefenderAgentSDK/collector.py
7 1 1
def to_json_string()
in AWSIoTDeviceDefenderAgentSDK/metrics.py
6 2 2