aws / aws-nitro-enclaves-samples
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 25 units with 188 lines of code in units (45.9% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 1 medium size units (21 lines of code)
    • 5 small units (81 lines of code)
    • 19 very small units (86 lines of code)
0% | 0% | 11% | 43% | 45%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
rs0% | 0% | 25% | 33% | 41%
py0% | 0% | 0% | 50% | 49%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
vsock_sample/rs/src0% | 0% | 29% | 21% | 49%
vsock_sample/py0% | 0% | 0% | 45% | 54%
att_doc_retriever_sample/py0% | 0% | 0% | 62% | 37%
att_doc_retriever_sample/rs/src0% | 0% | 0% | 100% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
fn vsock_connect()
in vsock_sample/rs/src/lib.rs
21 2 2
def main()
in vsock_sample/py/vsock-sample.py
20 2 0
def main()
in att_doc_retriever_sample/py/att_doc_retriever_sample.py
20 2 0
fn main()
in vsock_sample/rs/src/main.rs
15 1 0
def recv_data()
in vsock_sample/py/vsock-sample.py
13 5 1
fn main()
in att_doc_retriever_sample/rs/src/main.rs
13 1 0
fn ok_or_exit()
in vsock_sample/rs/src/utils.rs
9 1 2
def recv_data()
in vsock_sample/py/vsock-sample.py
7 3 1
def client_handler()
in vsock_sample/py/vsock-sample.py
7 1 1
fn parse_port()
in vsock_sample/rs/src/command_parser.rs
7 1 1
def client_handler()
in att_doc_retriever_sample/py/att_doc_retriever_sample.py
6 1 1
def server_handler()
in att_doc_retriever_sample/py/att_doc_retriever_sample.py
6 2 1
def send_data()
in vsock_sample/py/vsock-sample.py
5 2 2
fn parse_cid_client()
in vsock_sample/rs/src/command_parser.rs
5 1 1
fn drop()
in vsock_sample/rs/src/lib.rs
5 1 1
def connect()
in vsock_sample/py/vsock-sample.py
4 1 2
def bind()
in vsock_sample/py/vsock-sample.py
4 1 2
def server_handler()
in vsock_sample/py/vsock-sample.py
4 1 1
fn ok_or_exit()
in vsock_sample/rs/src/utils.rs
3 2 2
fn new()
in vsock_sample/rs/src/lib.rs
3 1 1