microsoft / lagscope
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 41 units with 1,160 lines of code in units (75.2% of code).
    • 3 very long units (424 lines of code)
    • 3 long units (219 lines of code)
    • 6 medium size units (209 lines of code)
    • 13 small units (209 lines of code)
    • 16 very small units (99 lines of code)
36% | 18% | 18% | 18% | 8%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c37% | 19% | 18% | 16% | 8%
h0% | 0% | 0% | 100% | 0%
py0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src36% | 18% | 18% | 18% | 8%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
218 34 1
105 13 1
101 17 1
86 27 3
int verify_args()
in src/util.c
73 30 1
int main()
in src/main.c
60 11 2
void print_flags()
in src/util.c
49 16 1
int show_histogram()
in src/latencies_stats.c
41 10 4
void print_usage()
in src/util.c
40 1 0
28 1 1
void create_freq_table_json()
in src/latencies_stats.c
26 5 2
int getopt2()
in src/util.c
25 10 3
int n_read()
in src/tcpstream.c
19 6 3
int n_write()
in src/tcpstream.c
19 6 3
void create_latencies_csv()
in src/latencies_stats.c
18 3 1
18 4 3
static int get_percentile_latency()
in src/latencies_stats.c
17 3 3
17 3 1
int process_latencies()
in src/latencies_stats.c
16 4 1
void run_test_timer()
in src/lin_utils.c
16 3 1