aws / libfabric
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 5,648 units with 128,801 lines of code in units (65.4% of code).
    • 119 very long units (17,791 lines of code)
    • 430 long units (28,997 lines of code)
    • 1,511 medium size units (46,538 lines of code)
    • 1,503 small units (22,421 lines of code)
    • 2,085 very small units (13,054 lines of code)
13% | 22% | 36% | 17% | 10%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c13% | 23% | 37% | 17% | 8%
h17% | 14% | 18% | 15% | 34%
cpp0% | 35% | 44% | 10% | 9%
py0% | 0% | 20% | 49% | 29%
pl0% | 0% | 55% | 26% | 18%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
prov/gni23% | 22% | 30% | 13% | 10%
prov/psm238% | 18% | 27% | 8% | 6%
prov/bgq27% | 29% | 24% | 10% | 8%
prov/psm35% | 18% | 27% | 12% | 7%
prov/sockets11% | 26% | 35% | 20% | 5%
prov/efa9% | 29% | 33% | 18% | 8%
prov/verbs12% | 28% | 37% | 15% | 6%
prov/netdir9% | 28% | 41% | 13% | 7%
fabtests/ubertest16% | 20% | 39% | 20% | 3%
include/windows53% | 0% | 0% | 9% | 36%
prov/shm8% | 24% | 33% | 21% | 12%
fabtests/functional3% | 24% | 53% | 15% | 2%
fabtests/unit61% | 0% | 19% | 19% | 0%
fabtests/common4% | 13% | 54% | 18% | 9%
prov/util1% | 24% | 44% | 20% | 8%
prov/rxm0% | 28% | 41% | 22% | 7%
prov/usnic0% | 21% | 37% | 26% | 14%
util0% | 30% | 46% | 18% | 4%
prov/rxd0% | 17% | 41% | 26% | 13%
prov/mrail0% | 27% | 43% | 17% | 12%
src0% | 12% | 37% | 24% | 25%
prov/tcp0% | 12% | 60% | 23% | 2%
fabtests/multinode0% | 25% | 53% | 14% | 6%
util/windows0% | 35% | 44% | 10% | 9%
prov/rstream0% | 12% | 43% | 31% | 12%
src/windows0% | 31% | 49% | 9% | 9%
fabtests/benchmarks0% | 16% | 75% | 4% | 3%
src/unix0% | 37% | 25% | 32% | 4%
prov/hook0% | 3% | 27% | 37% | 31%
prov/udp0% | 0% | 58% | 29% | 11%
src/linux0% | 0% | 50% | 25% | 23%
config0% | 0% | 55% | 26% | 18%
include0% | 0% | 8% | 29% | 62%
contrib/intel0% | 0% | 15% | 51% | 33%
contrib/cray0% | 0% | 46% | 37% | 15%
fabtests/scripts0% | 0% | 31% | 54% | 14%
src/shared0% | 0% | 56% | 0% | 43%
include/linux0% | 0% | 0% | 27% | 72%
fabtests/include0% | 0% | 0% | 8% | 91%
include/rdma0% | 0% | 0% | 0% | 100%
include/unix0% | 0% | 0% | 0% | 100%
include/freebsd0% | 0% | 0% | 0% | 100%
include/osx0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
int psmx2_cq_poll_mq()
in prov/psm2/src/psmx2_cq.c
466 120 5
static int psmx_getinfo()
in prov/psm/src/psmx_init.c
429 87 6
static int fi_bgq_ep_tx_init()
in prov/bgq/src/fi_bgq_ep.c
392 3 2
static int __gnix_rndzv_iov_req_build()
in prov/gni/src/gnix_msg.c
326 40 1
static unsigned char winerr2bsderr()
in include/windows/osd.h
324 3 1
int gnix_nic_alloc()
in prov/gni/src/gnix_nic.c
323 47 3
static int fi_bgq_ep_rx_init()
in prov/bgq/src/fi_bgq_ep.c
304 5 1
int psmx2_am_rma_handler()
in prov/psm2/src/psmx2_rma.c
292 54 6
int process_mfifo_context()
in prov/bgq/include/rdma/bgq/fi_bgq_rx.h
267 44 7
int psmx_am_rma_handler()
in prov/psm/src/psmx_rma.c
228 48 6
void complete_receive_operation()
in prov/bgq/include/rdma/bgq/fi_bgq_rx.h
211 14 7
DIRECT_FN int gnix_ep_bind()
in prov/gni/src/gnix_ep.c
210 51 3
int psmx2_am_atomic_handler()
in prov/psm2/src/psmx2_atomic.c
205 44 6
int _gnix_ep_alloc()
in prov/gni/src/gnix_ep.c
204 46 5
ssize_t _gnix_rma()
in prov/gni/src/gnix_rma.c
190 57 11
int psmx_am_atomic_handler()
in prov/psm/src/psmx_atomic.c
189 41 6
static int __gnix_vc_hndl_conn_req()
in prov/gni/src/gnix_vc.c
183 20 3
int psmx_cq_poll_mq()
in prov/psm/src/psmx_cq.c
182 55 5
static int _gnix_ep_getinfo()
in prov/gni/src/gnix_fabric.c
181 48 7
ssize_t psmx2_writev_generic()
in prov/psm2/src/psmx2_rma.c
178 24 10