facebookresearch / deepfloat
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 226 units with 1,857 lines of code in units (5.2% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (154 lines of code)
    • 0 medium complex units (0 lines of code)
    • 19 simple units (419 lines of code)
    • 206 very simple units (1,284 lines of code)
0% | 8% | 0% | 22% | 69%
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% | 60% | 0% | 24% | 14%
py0% | 0% | 0% | 31% | 68%
h0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
cpp/utils0% | 28% | 0% | 0% | 71%
rtl/log0% | 0% | 0% | 39% | 60%
py0% | 0% | 0% | 22% | 77%
cpp/ops0% | 0% | 0% | 36% | 63%
bitstream0% | 0% | 0% | 0% | 100%
cpp0% | 0% | 0% | 0% | 100%
cpp/layers0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
std::string oclErrorToString()
in cpp/utils/OpenCLUtils.cpp
154 49 1
void validatePointwiseArgs()
in cpp/ops/TensorMath.cpp
24 9 3
def toDecimalString()
in rtl/log/luts/FixedPoint.py
25 9 3
def get_fpga_mods()
in py/run_fpga_resnet.py
25 8 1
def gather_act()
in py/fpga_resnet.py
18 8 3
def validate()
in py/validate.py
59 8 4
def get_pow2_expansion()
in rtl/log/luts/gen_tables.py
24 8 4
def get_log2_expansion()
in rtl/log/luts/gen_tables.py
23 8 4
OpType compareOpToDeviceOp()
in cpp/ops/TensorMath.cpp
19 7 1
OpType mathOpToDeviceOp()
in cpp/ops/TensorMath.cpp
19 7 1
def toBinaryString()
in rtl/log/luts/FixedPoint.py
15 7 3
def atan()
in rtl/log/luts/FixedPoint.py
22 7 1
def _toTwosComplement()
in rtl/log/luts/FixedPoint.py
18 6 2
def intpower()
in rtl/log/luts/FixedPoint.py
18 6 2
def sqrt()
in rtl/log/luts/FixedPoint.py
16 6 1
def sin()
in rtl/log/luts/FixedPoint.py
10 6 1
def sincos()
in rtl/log/luts/FixedPoint.py
12 6 1
def _rawQsine()
in rtl/log/luts/FixedPoint.py
16 6 3
def get_pow2_delta_expansion()
in rtl/log/luts/gen_tables.py
28 6 4
def get_log2_delta_expansion()
in rtl/log/luts/gen_tables.py
28 6 4