awslabs / aws-security-automation
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 40 units with 850 lines of code in units (41.5% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 3 medium complex units (143 lines of code)
    • 3 simple units (78 lines of code)
    • 34 very simple units (629 lines of code)
0% | 0% | 16% | 9% | 74%
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% | 16% | 9% | 74%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
IAM Access Denied Responder/generate-security-messages0% | 0% | 62% | 20% | 16%
force_user_mfa0% | 0% | 16% | 14% | 68%
EC2 Auto Clean Room Forensics/Lambda-Functions0% | 0% | 0% | <1% | 99%
CloudTrailRemediation0% | 0% | 0% | 0% | 100%
IAM Access Denied Responder/publish-security-messages0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def lambda_handler()
in force_user_mfa/ForceUserMFA.py
50 14 2
def publish_user_history()
in IAM Access Denied Responder/generate-security-messages/index.py
46 12 2
def publish_iam_user_history()
in IAM Access Denied Responder/generate-security-messages/index.py
47 12 2
def access_denied_handler()
in IAM Access Denied Responder/generate-security-messages/index.py
31 10 2
def enable_mfa()
in force_user_mfa/ForceUserMFA.py
45 8 3
def lambda_handler()
in EC2 Auto Clean Room Forensics/Lambda-Functions/generateSupportTicket.py
2 6 2
def lambda_handler()
in EC2 Auto Clean Room Forensics/Lambda-Functions/isolateInstance.py
17 5 2
def publish_to_slack_handler()
in IAM Access Denied Responder/publish-security-messages/index.py
19 4 2
def verifyLogTable()
in CloudTrailRemediation/CloudTrailRemediation.py
26 4 0
def forensic()
in CloudTrailRemediation/CloudTrailRemediation.py
16 4 2
def create_virtual_mfa()
in force_user_mfa/ForceUserMFA.py
24 4 2
def check_approved()
in force_user_mfa/ForceUserMFA.py
4 4 2
def send_seed()
in force_user_mfa/ForceUserMFA.py
3 4 1
def lambda_handler()
in EC2 Auto Clean Room Forensics/Lambda-Functions/sendIsolationNotification.py
14 3 2
def lambda_handler()
in EC2 Auto Clean Room Forensics/Lambda-Functions/sendForensicReport.py
22 3 2
def lambda_handler()
in EC2 Auto Clean Room Forensics/Lambda-Functions/SendErrorNotification.py
22 3 2
def lambda_handler()
in EC2 Auto Clean Room Forensics/Lambda-Functions/isSSMInstalled.py
10 3 2
def startTrail()
in CloudTrailRemediation/CloudTrailRemediation.py
14 3 1
def lambda_handler()
in EC2 Auto Clean Room Forensics/Lambda-Functions/attachVolume.py
30 2 2
def lambda_handler()
in EC2 Auto Clean Room Forensics/Lambda-Functions/createForensicInstance.py
46 2 2