awslabs / aws-fpga-app-notes
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 499 units with 11,781 lines of code in units (55.2% of code).
    • 15 very long units (1,884 lines of code)
    • 49 long units (3,170 lines of code)
    • 122 medium size units (3,778 lines of code)
    • 96 small units (1,524 lines of code)
    • 217 very small units (1,425 lines of code)
15% | 26% | 32% | 12% | 12%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp18% | 31% | 27% | 12% | 10%
h0% | 0% | 72% | 2% | 24%
c0% | 0% | 52% | 40% | 7%
hpp0% | 0% | 0% | 13% | 86%
py0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
reInvent19_Developer_Workshop/modules12% | 31% | 29% | 13% | 12%
NYC_Summit18_Developer_Workshop/idct60% | 0% | 21% | 12% | 5%
NYC_Summit18_Developer_Workshop/workspace60% | 0% | 21% | 12% | 5%
reInvent18_Developer_Workshop/filter2D8% | 8% | 56% | 11% | 15%
reInvent18_Developer_Workshop/hostcode_opt0% | 72% | 10% | 7% | 9%
reInvent18_Developer_Workshop/helloworld_c0% | 31% | 36% | 10% | 20%
reInvent18_Developer_Workshop/helloworld_ocl0% | 100% | 0% | 0% | 0%
NYC_Summit18_Developer_Workshop/helloworld_ocl0% | 100% | 0% | 0% | 0%
Using-PCIe-Write-Combining0% | 0% | 78% | 15% | 6%
Using-PCIM-Port0% | 0% | 57% | 30% | 12%
Using-PCIe-Interrupts0% | 0% | 61% | 27% | 11%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
int main()
in reInvent19_Developer_Workshop/modules/module_01/idct/src/idct.cpp
148 21 2
int main()
in NYC_Summit18_Developer_Workshop/idct/src/idct.cpp
143 19 2
int main()
in NYC_Summit18_Developer_Workshop/workspace/IDCT/src/idct.cpp
143 19 2
int main()
in reInvent18_Developer_Workshop/filter2D/src/host/host.cpp
135 14 2
void runOnFPGA()
in reInvent19_Developer_Workshop/modules/module_02/reference_files/run_sw_overlap.cpp
132 11 8
void runOnFPGA()
in reInvent19_Developer_Workshop/modules/module_02/src/generic_buffer/run_fpga.cpp
130 7 8
void runOnFPGA()
in reInvent19_Developer_Workshop/modules/module_02/reference_files/run_split_buffer.cpp
129 7 8
void runOnFPGA()
in reInvent19_Developer_Workshop/modules/module_02/src/sw_overlap/run_fpga.cpp
128 11 8
void runOnFPGA()
in reInvent19_Developer_Workshop/modules/module_02/reference_files/run_generic_buffer.cpp
127 11 8
void idct()
in NYC_Summit18_Developer_Workshop/idct/src/krnl_idct.cpp
112 12 4
void idct()
in NYC_Summit18_Developer_Workshop/workspace/IDCT/src/krnl_idct.cpp
112 12 4
void idct()
in reInvent19_Developer_Workshop/modules/module_01/idct/src/krnl_idct.cpp
112 12 4
void idctSoft()
in NYC_Summit18_Developer_Workshop/idct/src/idct.cpp
111 12 4
void idctSoft()
in NYC_Summit18_Developer_Workshop/workspace/IDCT/src/idct.cpp
111 12 4
void idctSoft()
in reInvent19_Developer_Workshop/modules/module_01/idct/src/idct.cpp
111 12 4
void convolve()
in reInvent19_Developer_Workshop/modules/module_03/design/reference-files/addi_k/convolve.cpp
94 7 5
void runOnFPGA()
in reInvent19_Developer_Workshop/modules/module_02/reference_files/run_single_buffer.cpp
92 7 8
void runOnFPGA()
in reInvent19_Developer_Workshop/modules/module_02/src/split_buffer/run_fpga.cpp
92 7 8
void runOnFPGA()
in reInvent19_Developer_Workshop/modules/module_02/src/single_buffer/run_fpga.cpp
92 7 8
void convolve()
in reInvent19_Developer_Workshop/modules/module_03/design/reference-files/multicu/convolve.cpp
88 8 5