awslabs / flowgger
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 228 units with 3,027 lines of code in units (49.7% of code).
    • 2 very long units (270 lines of code)
    • 6 long units (340 lines of code)
    • 41 medium size units (1,255 lines of code)
    • 37 small units (573 lines of code)
    • 142 very small units (589 lines of code)
8% | 11% | 41% | 18% | 19%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
rs8% | 11% | 41% | 18% | 19%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/flowgger/output19% | 6% | 38% | 22% | 13%
src/flowgger/decoder25% | 12% | 38% | 10% | 13%
src/flowgger/encoder0% | 47% | 43% | 0% | 8%
src/flowgger/input0% | 10% | 36% | 35% | 17%
src/flowgger/splitter0% | 0% | 87% | 12% | 0%
src/flowgger/utils0% | 0% | 45% | 33% | 21%
src/flowgger0% | 0% | 26% | 18% | 55%
src0% | 0% | 0% | 15% | 84%
src/flowgger/merger0% | 0% | 0% | 41% | 58%
ROOT0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
fn config_parse()
in src/flowgger/output/tls_output.rs
140 7 1
fn decode()
in src/flowgger/decoder/ltsv_decoder.rs
130 11 2
fn parse_sd_data()
in src/flowgger/decoder/rfc5424_decoder.rs
65 2 2
fn build_record()
in src/flowgger/encoder/capnp_encoder.rs
64 10 4
fn encode()
in src/flowgger/encoder/ltsv_encoder.rs
55 15 2
fn encode()
in src/flowgger/encoder/gelf_encoder.rs
53 12 2
fn test_should_be_watched()
in src/flowgger/input/file/discovery.rs
52 2 0
fn run()
in src/flowgger/output/tls_output.rs
51 6 1
fn get_pairs()
in src/flowgger/splitter/capnp_splitter.rs
49 6 2
fn test_decode_message()
in src/flowgger/splitter/capnp_splitter.rs
48 1 0
fn run()
in src/flowgger/splitter/capnp_splitter.rs
47 4 5
fn test_rotation_files_size()
in src/flowgger/utils/rotating_file.rs
45 1 0
fn handle_connection()
in src/flowgger/output/tls_output.rs
44 5 2
fn test_rotation_time_files_time()
in src/flowgger/utils/rotating_file.rs
42 1 0
fn open_writer()
in src/flowgger/output/file_output.rs
41 4 1
fn run()
in src/flowgger/splitter/nul_splitter.rs
38 6 5
fn test_ltsv_full_encode_multiple_sd()
in src/flowgger/encoder/ltsv_encoder.rs
36 1 0
fn handle_message()
in src/flowgger/splitter/capnp_splitter.rs
36 5 1
fn test_log_rotate_nobuf()
in src/flowgger/output/file_output.rs
33 1 0
fn test_rfc5424()
in src/flowgger/decoder/rfc5424_decoder.rs
33 5 0