aws-samples / aws-nitro-enclaves-workshop
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 32 units with 336 lines of code in units (48.2% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 5 medium size units (115 lines of code)
    • 9 small units (129 lines of code)
    • 18 very small units (92 lines of code)
0% | 0% | 34% | 38% | 27%
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% | 34% | 38% | 27%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
resources/code/my-first-enclave/cryptographic-attestation0% | 0% | 48% | 23% | 28%
resources/code/my-first-enclave/secure-local-channel0% | 0% | 16% | 60% | 23%
resources/code/my-first-enclave/nitro-enclaves-cli0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in resources/code/my-first-enclave/cryptographic-attestation/client.py
26 4 0
def server()
in resources/code/my-first-enclave/secure-local-channel/traffic_forwarder.py
23 2 4
def server()
in resources/code/my-first-enclave/cryptographic-attestation/traffic_forwarder.py
23 2 4
def parse_args()
in resources/code/my-first-enclave/cryptographic-attestation/client.py
22 1 0
def main()
in resources/code/my-first-enclave/cryptographic-attestation/server.py
21 3 0
def main()
in resources/code/my-first-enclave/secure-local-channel/client.py
17 2 0
def prepare_server_request()
in resources/code/my-first-enclave/cryptographic-attestation/client.py
17 1 1
def main()
in resources/code/my-first-enclave/secure-local-channel/server.py
15 2 0
def recv_data()
in resources/code/my-first-enclave/secure-local-channel/server.py
14 6 1
def main()
in resources/code/my-first-enclave/secure-local-channel/traffic_forwarder.py
14 2 1
def main()
in resources/code/my-first-enclave/cryptographic-attestation/traffic_forwarder.py
14 2 1
def get_s3_ip_by_region()
in resources/code/my-first-enclave/secure-local-channel/server.py
13 4 1
def decrypt_cipher()
in resources/code/my-first-enclave/cryptographic-attestation/server.py
13 1 5
def forward()
in resources/code/my-first-enclave/secure-local-channel/traffic_forwarder.py
12 3 2
def forward()
in resources/code/my-first-enclave/cryptographic-attestation/traffic_forwarder.py
9 3 2
def get_plaintext()
in resources/code/my-first-enclave/cryptographic-attestation/server.py
8 1 1
def connect()
in resources/code/my-first-enclave/secure-local-channel/client.py
7 3 2
def send_data()
in resources/code/my-first-enclave/secure-local-channel/client.py
7 1 2
def encrypt_string()
in resources/code/my-first-enclave/cryptographic-attestation/client.py
7 1 3
def client_handler()
in resources/code/my-first-enclave/secure-local-channel/client.py
6 2 1