awslabs / aws-fpga-app-notes
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 499 units with 11,781 lines of code in units (55.2% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 29 medium complex units (2,453 lines of code)
    • 109 simple units (4,838 lines of code)
    • 361 very simple units (4,490 lines of code)
0% | 0% | 20% | 41% | 38%
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
cpp0% | 0% | 22% | 40% | 37%
h0% | 0% | 14% | 52% | 32%
c0% | 0% | 0% | 44% | 55%
hpp0% | 0% | 0% | 0% | 100%
py0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
reInvent19_Developer_Workshop/modules0% | 0% | 19% | 41% | 39%
NYC_Summit18_Developer_Workshop/idct0% | 0% | 60% | 6% | 33%
NYC_Summit18_Developer_Workshop/workspace0% | 0% | 60% | 6% | 33%
reInvent18_Developer_Workshop/filter2D0% | 0% | 13% | 45% | 40%
reInvent18_Developer_Workshop/hostcode_opt0% | 0% | 0% | 72% | 27%
Using-PCIe-Write-Combining0% | 0% | 0% | 78% | 21%
reInvent18_Developer_Workshop/helloworld_c0% | 0% | 0% | 54% | 45%
reInvent18_Developer_Workshop/helloworld_ocl0% | 0% | 0% | 100% | 0%
NYC_Summit18_Developer_Workshop/helloworld_ocl0% | 0% | 0% | 100% | 0%
Using-PCIe-Interrupts0% | 0% | 0% | 61% | 38%
Using-PCIM-Port0% | 0% | 0% | 32% | 67%
Most Complex Units
Top 20 most complex 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
void compute_dataflow()
in reInvent19_Developer_Workshop/modules/module_03/design/src/multicu/convolve_fpga.cpp
60 18 6
void compute_dataflow()
in reInvent19_Developer_Workshop/modules/module_03/design/reference-files/dataflow/convolve_fpga.cpp
60 18 6
int CmdLineParser::parse()
in reInvent18_Developer_Workshop/filter2D/src/host/cmdlineparser.cpp
67 17 2
void compute_dataflow()
in reInvent19_Developer_Workshop/modules/module_03/design/src/addi_k/convolve_fpga.cpp
55 16 6
void compute_dataflow()
in reInvent19_Developer_Workshop/modules/module_03/design/reference-files/addi_k/convolve_fpga.cpp
55 16 6
void compute_dataflow()
in reInvent19_Developer_Workshop/modules/module_03/design/reference-files/multicu/convolve_fpga.cpp
55 16 6
void convolve_fpga()
in reInvent19_Developer_Workshop/modules/module_03/design/src/dataflow/convolve_fpga.cpp
73 15 6
void convolve_fpga()
in reInvent19_Developer_Workshop/modules/module_03/design/reference-files/fixedpoint/convolve_fpga.cpp
73 15 6
int main()
in reInvent18_Developer_Workshop/filter2D/src/host/host.cpp
135 14 2
void convolve_fpga()
in reInvent19_Developer_Workshop/modules/module_03/design/src/fixedpoint/convolve_fpga.cpp
70 14 6
void convolve_fpga()
in reInvent19_Developer_Workshop/modules/module_03/design/reference-files/localbuf/convolve_fpga.cpp
70 14 6
void idctSoft()
in NYC_Summit18_Developer_Workshop/idct/src/idct.cpp
111 12 4
void idct()
in NYC_Summit18_Developer_Workshop/idct/src/krnl_idct.cpp
112 12 4
void idctSoft()
in NYC_Summit18_Developer_Workshop/workspace/IDCT/src/idct.cpp
111 12 4
void idct()
in NYC_Summit18_Developer_Workshop/workspace/IDCT/src/krnl_idct.cpp
112 12 4
void idctSoft()
in reInvent19_Developer_Workshop/modules/module_01/idct/src/idct.cpp
111 12 4
void idct()
in reInvent19_Developer_Workshop/modules/module_01/idct/src/krnl_idct.cpp
112 12 4