aws-samples / aws-security-hub-findings-account-data-enrichment
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 46 units with 367 lines of code in units (59.0% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 3 medium complex units (71 lines of code)
    • 4 simple units (108 lines of code)
    • 39 very simple units (188 lines of code)
0% | 0% | 19% | 29% | 51%
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
py0% | 0% | 19% | 29% | 51%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
enrichment_function/schema/aws/securityhub/securityhubfindingsimported0% | 0% | 31% | 20% | 47%
enrichment_function/import_findings0% | 0% | 0% | 43% | 56%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def __unmarshall_model()
in enrichment_function/schema/aws/securityhub/securityhubfindingsimported/marshaller.py
24 15 3
def marshall()
in enrichment_function/schema/aws/securityhub/securityhubfindingsimported/marshaller.py
21 12 2
def unmarshall()
in enrichment_function/schema/aws/securityhub/securityhubfindingsimported/marshaller.py
26 12 3
def get_account_details()
in enrichment_function/import_findings/helper.py
38 9 2
def to_dict()
in enrichment_function/schema/aws/securityhub/securityhubfindingsimported/SecurityHubFindingsImported.py
23 9 1
def to_dict()
in enrichment_function/schema/aws/securityhub/securityhubfindingsimported/AWSEvent.py
23 9 1
def enrich_finding()
in enrichment_function/import_findings/app.py
24 6 2
def __unmarshall_primitive()
in enrichment_function/schema/aws/securityhub/securityhubfindingsimported/marshaller.py
7 3 3
def get_client()
in enrichment_function/import_findings/helper.py
11 2 3
def get_resource()
in enrichment_function/import_findings/helper.py
10 2 3
def __eq__()
in enrichment_function/schema/aws/securityhub/securityhubfindingsimported/SecurityHubFindingsImported.py
4 2 2
def __eq__()
in enrichment_function/schema/aws/securityhub/securityhubfindingsimported/AWSEvent.py
4 2 2
def __unmarshall_date()
in enrichment_function/schema/aws/securityhub/securityhubfindingsimported/marshaller.py
6 2 2
def __unmarshall_datatime()
in enrichment_function/schema/aws/securityhub/securityhubfindingsimported/marshaller.py
6 2 2
def lambda_handler()
in enrichment_function/import_findings/app.py
50 1 2
def get_session_for_role()
in enrichment_function/import_findings/helper.py
10 1 2
def __init__()
in enrichment_function/schema/aws/securityhub/securityhubfindingsimported/SecurityHubFindingsImported.py
4 1 2
def findings()
in enrichment_function/schema/aws/securityhub/securityhubfindingsimported/SecurityHubFindingsImported.py
2 1 1
def findings()
in enrichment_function/schema/aws/securityhub/securityhubfindingsimported/SecurityHubFindingsImported.py
2 1 2
def to_str()
in enrichment_function/schema/aws/securityhub/securityhubfindingsimported/SecurityHubFindingsImported.py
2 1 1