aws-quickstart / quickstart-ribbon-sbc
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 3,024 units with 26,870 lines of code in units (67.7% of code).
    • 1 very complex units (128 lines of code)
    • 15 complex units (1,713 lines of code)
    • 75 medium complex units (3,976 lines of code)
    • 234 simple units (5,443 lines of code)
    • 2,699 very simple units (15,610 lines of code)
<1% | 6% | 14% | 20% | 58%
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
py<1% | 6% | 14% | 20% | 58%
h0% | 0% | 27% | 28% | 43%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
functions/source/KeyGen/pycparser2% | 8% | 27% | 11% | 50%
functions/source/KeyGen/cffi0% | 13% | 14% | 26% | 44%
functions/source/KeyGen/asn1crypto0% | 8% | 12% | 33% | 45%
functions/source/KeyGen/cryptography0% | 0% | 6% | 15% | 77%
scripts/ansible/scripts0% | 0% | 61% | 13% | 25%
functions/source/KeyGen0% | 0% | 14% | 7% | 78%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def lex()
in functions/source/KeyGen/pycparser/ply/lex.py
128 54 6
def _build()
in functions/source/KeyGen/asn1crypto/core.py
156 46 9
def lr_parse_table()
in functions/source/KeyGen/pycparser/ply/yacc.py
139 41 1
def __init__()
in functions/source/KeyGen/asn1crypto/core.py
116 41 10
def _parse_children()
in functions/source/KeyGen/asn1crypto/core.py
105 40 2
def parsegen()
in functions/source/KeyGen/pycparser/ply/cpp.py
107 38 3
def new_primitive_type()
in functions/source/KeyGen/cffi/backend_ctypes.py
137 36 2
def _generate_cpy_function_decl()
in functions/source/KeyGen/cffi/recompiler.py
132 35 3
def new_array_type()
in functions/source/KeyGen/cffi/backend_ctypes.py
106 29 3
def _parse_children()
in functions/source/KeyGen/asn1crypto/core.py
81 29 2
def _parse_constant()
in functions/source/KeyGen/cffi/cparser.py
49 28 3
def _struct_ctx()
in functions/source/KeyGen/cffi/recompiler.py
84 26 5
def new_pointer_type()
in functions/source/KeyGen/cffi/backend_ctypes.py
84 26 2
def complete_struct_or_union()
in functions/source/KeyGen/cffi/backend_ctypes.py
103 26 8
def _make_ffi_library()
in functions/source/KeyGen/cffi/api.py
110 26 3
def yacc()
in functions/source/KeyGen/pycparser/ply/yacc.py
204 26 13
def add_production()
in functions/source/KeyGen/pycparser/ply/yacc.py
60 25 6
def validate_pfunctions()
in functions/source/KeyGen/pycparser/ply/yacc.py
49 25 1
def define()
in functions/source/KeyGen/pycparser/ply/cpp.py
58 25 2
def validate_rules()
in functions/source/KeyGen/pycparser/ply/lex.py
78 24 1