aws-samples / amazon-codeguru-reviewer-python-detectors
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 146 units with 972 lines of code in units (94.4% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 0 medium complex units (0 lines of code)
    • 2 simple units (38 lines of code)
    • 144 very simple units (934 lines of code)
0% | 0% | 0% | 3% | 96%
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% | 0% | 3% | 96%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
aws_polling_instead_of_waiter0% | 0% | 0% | 71% | 28%
code_readability0% | 0% | 0% | 40% | 60%
mutually_exclusive_calls_found0% | 0% | 0% | 0% | 100%
multiprocessing_garbage_collection_prevention0% | 0% | 0% | 0% | 100%
sns_unauthenticated_unsubscribe0% | 0% | 0% | 0% | 100%
missing_pagination0% | 0% | 0% | 0% | 100%
incorrect_usage_of_process_terminate_api0% | 0% | 0% | 0% | 100%
improper_certificate_validation0% | 0% | 0% | 0% | 100%
semaphore_overflow_prevention0% | 0% | 0% | 0% | 100%
sns_no_bind_subscribe_publish_rule0% | 0% | 0% | 0% | 100%
not_recommended_apis0% | 0% | 0% | 0% | 100%
ldap_injection0% | 0% | 0% | 0% | 100%
aws_logged_credentials0% | 0% | 0% | 0% | 100%
aws_kms_reencryption0% | 0% | 0% | 0% | 100%
leaky_subprocess_timeout0% | 0% | 0% | 0% | 100%
sql_injection0% | 0% | 0% | 0% | 100%
catch_and_rethrow_exception0% | 0% | 0% | 0% | 100%
xpath_injection0% | 0% | 0% | 0% | 100%
s3_verify_bucket_owner0% | 0% | 0% | 0% | 100%
improper_error_handling0% | 0% | 0% | 0% | 100%
os_command_injection0% | 0% | 0% | 0% | 100%
socket_close_platform_compatibility0% | 0% | 0% | 0% | 100%
sns_set_return_subscription_arn0% | 0% | 0% | 0% | 100%
untrusted_ami_images0% | 0% | 0% | 0% | 100%
unrestricted_file_upload0% | 0% | 0% | 0% | 100%
aws_unchecked_batch_failures0% | 0% | 0% | 0% | 100%
missing_none_check0% | 0% | 0% | 0% | 100%
use_of_inefficient_api0% | 0% | 0% | 0% | 100%
string_concatenation0% | 0% | 0% | 0% | 100%
socket_connection_timeout0% | 0% | 0% | 0% | 100%
improper_input_validation0% | 0% | 0% | 0% | 100%
dict_get_method0% | 0% | 0% | 0% | 100%
resource_leak0% | 0% | 0% | 0% | 100%
insecure_cookie0% | 0% | 0% | 0% | 100%
hashlib_constructor0% | 0% | 0% | 0% | 100%
swallow_exceptions0% | 0% | 0% | 0% | 100%
ldap_authentication0% | 0% | 0% | 0% | 100%
path_traversal0% | 0% | 0% | 0% | 100%
insecure_temp_file0% | 0% | 0% | 0% | 100%
insecure_hashing0% | 0% | 0% | 0% | 100%
multiprocessing_deadlock_prevention0% | 0% | 0% | 0% | 100%
iterating_sequence_modification0% | 0% | 0% | 0% | 100%
insecure_cryptography0% | 0% | 0% | 0% | 100%
cross_site_request_forgery0% | 0% | 0% | 0% | 100%
unnecessary_iteration0% | 0% | 0% | 0% | 100%
hardcoded_credentials0% | 0% | 0% | 0% | 100%
weak_obfuscation_of_request0% | 0% | 0% | 0% | 100%
cross_site_scripting0% | 0% | 0% | 0% | 100%
subprocess_correct_api0% | 0% | 0% | 0% | 100%
equality_vs_identity0% | 0% | 0% | 0% | 100%
code_injection0% | 0% | 0% | 0% | 100%
xml_external_entity0% | 0% | 0% | 0% | 100%
object_dict_modification0% | 0% | 0% | 0% | 100%
loose_file_permissions0% | 0% | 0% | 0% | 100%
improper_privilege_management0% | 0% | 0% | 0% | 100%
log_injection0% | 0% | 0% | 0% | 100%
default_argument_mutable_objects0% | 0% | 0% | 0% | 100%
lambda_override_reserved0% | 0% | 0% | 0% | 100%
insecure_connection0% | 0% | 0% | 0% | 100%
naive_datatime_time_zone_issues0% | 0% | 0% | 0% | 100%
deprecated_method0% | 0% | 0% | 0% | 100%
dangerous_global_variables0% | 0% | 0% | 0% | 100%
bad_exception_handling_practices0% | 0% | 0% | 0% | 100%
pep8_recommendations0% | 0% | 0% | 0% | 100%
lambda_client_reuse0% | 0% | 0% | 0% | 100%
multidimension_list_using_replication0% | 0% | 0% | 0% | 100%
multiple_values_in_return0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def polling_vs_waiters_noncompliant()
in src/python/detectors/aws_polling_instead_of_waiter/aws_polling_instead_of_waiter.py
32 9 1
def avoid_complex_comprehension_noncompliant()
in src/python/detectors/code_readability/code_readability.py
6 6 0
def authenticate_on_subscribe_noncompliant()
in src/python/detectors/sns_unauthenticated_unsubscribe/sns_unauthenticated_unsubscribe.py
15 5 2
def authenticate_on_subscribe_compliant()
in src/python/detectors/sns_unauthenticated_unsubscribe/sns_unauthenticated_unsubscribe.py
17 5 2
def avoid_complex_comprehension_compliant()
in src/python/detectors/code_readability/code_readability.py
9 5 0
def modifying_list_noncompliant()
in src/python/detectors/iterating_sequence_modification/iterating_sequence_modification.py
5 4 0
def swallow_noncompliant()
in src/python/detectors/swallow_exceptions/swallow_exceptions.py
6 4 0
def swallow_compliant()
in src/python/detectors/swallow_exceptions/swallow_exceptions.py
6 4 0
def notequals_operator_noncompliant()
in src/python/detectors/equality_vs_identity/equality_vs_identity.py
4 3 0
def isnot_operator_compliant()
in src/python/detectors/equality_vs_identity/equality_vs_identity.py
4 3 0
def find_string_noncompliant()
in src/python/detectors/unnecessary_iteration/unnecessary_iteration.py
5 3 0
def nested_noncompliant()
in src/python/detectors/catch_and_rethrow_exception/catch_and_rethrow_exception.py
9 3 0
def nested_compliant()
in src/python/detectors/catch_and_rethrow_exception/catch_and_rethrow_exception.py
10 3 0
def post_tasks_noncompliant()
in src/python/detectors/semaphore_overflow_prevention/semaphore_overflow_prevention.py
12 3 2
def post_tasks_compliant()
in src/python/detectors/semaphore_overflow_prevention/semaphore_overflow_prevention.py
12 3 2
def file_upload_compliant()
in src/python/detectors/unrestricted_file_upload/unrestricted_file_upload.py
9 3 0
def deadlock_prevention_noncompliant()
in src/python/detectors/multiprocessing_deadlock_prevention/multiprocessing_deadlock_prevention.py
5 3 0
def none_check_compliant()
in src/python/detectors/missing_none_check/missing_none_check.py
9 3 2
def error_prone_multidimensional_list_compliant()
in src/python/detectors/multidimension_list_using_replication/multidimension_list_using_replication.py
2 3 0
def s3_loop_noncompliant()
in src/python/detectors/missing_pagination/missing_pagination.py
14 3 2