aws / aws-nitro-enclaves-nsm-api
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 17 units with 371 lines of code in units (41.0% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (150 lines of code)
    • 5 medium size units (128 lines of code)
    • 5 small units (72 lines of code)
    • 5 very small units (21 lines of code)
0% | 40% | 34% | 19% | 5%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cc0% | 49% | 35% | 14% | 0%
rs0% | 0% | 31% | 38% | 30%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
nsm-test/src0% | 49% | 35% | 14% | 0%
nsm-io/src0% | 0% | 78% | 0% | 21%
nsm-driver/src0% | 0% | 0% | 62% | 37%
nsm-lib0% | 0% | 0% | 66% | 33%
Alternative Visuals
Longest Units
Top 17 longest units
Unit# linesMcCabe index# params
void check_pcr_locks()
in nsm-test/src/main.cc
97 22 2
void check_initial_pcrs()
in nsm-test/src/main.cc
53 15 2
void get_nsm_description()
in nsm-test/src/main.cc
42 9 2
void check_random()
in nsm-test/src/main.cc
22 5 1
22 1 0
void check_single_attestation()
in nsm-test/src/main.cc
21 3 7
int main()
in nsm-test/src/main.cc
21 2 1
void get_pcr_description()
in nsm-test/src/main.cc
17 3 4
size_t get_pcr_len()
in nsm-test/src/main.cc
15 4 1
fn nsm_ioctl()
in nsm-driver/src/lib.rs
15 1 2
void check_attestation()
in nsm-test/src/main.cc
13 1 1
fn main()
in nsm-lib/build.rs
12 1 0
fn output_dir()
in nsm-lib/build.rs
6 1 0
fn nsm_decode_response_from_cbor()
in nsm-driver/src/lib.rs
6 1 1
fn nsm_encode_request_to_cbor()
in nsm-driver/src/lib.rs
3 1 1
fn from()
in nsm-io/src/lib.rs
3 1 1
fn from()
in nsm-io/src/lib.rs
3 1 1