awslabs / flowgger
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 228 units with 3,027 lines of code in units (49.7% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 3 medium complex units (238 lines of code)
    • 8 simple units (402 lines of code)
    • 217 very simple units (2,387 lines of code)
0% | 0% | 7% | 13% | 78%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
rs0% | 0% | 7% | 13% | 78%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/flowgger/decoder0% | 0% | 25% | 0% | 74%
src/flowgger/encoder0% | 0% | 30% | 17% | 52%
src/flowgger/output0% | 0% | 0% | 26% | 73%
src/flowgger/splitter0% | 0% | 0% | 27% | 72%
src/flowgger/input0% | 0% | 0% | 9% | 90%
src/flowgger/utils0% | 0% | 0% | 5% | 94%
src/flowgger0% | 0% | 0% | 0% | 100%
src0% | 0% | 0% | 0% | 100%
src/flowgger/merger0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
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 decode()
in src/flowgger/decoder/ltsv_decoder.rs
130 11 2
fn handle_record_maybe_compressed()
in src/flowgger/input/udp_input.rs
24 10 4
fn build_record()
in src/flowgger/encoder/capnp_encoder.rs
64 10 4
fn config_parse()
in src/flowgger/output/tls_output.rs
140 7 1
fn accept()
in src/flowgger/input/redis_input.rs
25 6 4
fn check_rotation_trigger()
in src/flowgger/utils/rotating_file.rs
11 6 2
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 run()
in src/flowgger/splitter/nul_splitter.rs
38 6 5
fn run()
in src/flowgger/input/redis_input.rs
27 5 1
fn handle_connection()
in src/flowgger/output/tls_output.rs
44 5 2
fn test_rfc5424()
in src/flowgger/decoder/rfc5424_decoder.rs
33 5 0
fn test_rfc5424_multiple_sd()
in src/flowgger/decoder/rfc5424_decoder.rs
33 5 0
fn handle_message()
in src/flowgger/splitter/capnp_splitter.rs
36 5 1
fn run()
in src/flowgger/splitter/line_splitter.rs
32 5 5
fn accept()
in src/flowgger/input/tls/tls_input.rs
19 4 4
fn add_initial_watches()
in src/flowgger/input/file/discovery.rs
15 4 2
fn accept()
in src/flowgger/input/tcp/tcp_input.rs
19 4 4