facebookresearch / Ad-Library-API-Script-Repository
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 16 units with 244 lines of code in units (63.4% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 2 medium complex units (66 lines of code)
    • 1 simple units (18 lines of code)
    • 13 very simple units (160 lines of code)
0% | 0% | 27% | 7% | 65%
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% | 27% | 7% | 65%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
python0% | 0% | 27% | 7% | 65%
Most Complex Units
Top 16 most complex units
Unit# linesMcCabe index# params
def save_to_csv()
in python/fb_ads_library_api_operators.py
30 11 4
def main()
in python/fb_ads_library_api_cli.py
36 11 0
def validate_country_param()
in python/fb_ads_library_api_cli.py
18 6 1
def save_to_file()
in python/fb_ads_library_api_operators.py
13 5 3
def count_start_time_trending()
in python/fb_ads_library_api_operators.py
24 5 3
def get_country_code()
in python/fb_ads_library_api_utils.py
9 4 1
def validate_fields_param()
in python/fb_ads_library_api_cli.py
15 4 1
def count_ads()
in python/fb_ads_library_api_operators.py
7 3 3
def get_ad_archive_id()
in python/fb_ads_library_api.py
2 1 1
def __init__()
in python/fb_ads_library_api.py
12 1 0
def generate_ad_archives()
in python/fb_ads_library_api.py
14 1 1
def _get_ad_archives_from_url()
in python/fb_ads_library_api.py
2 1 0
def generate_ad_archives_from_url()
in python/fb_ads_library_api.py
2 1 3
def get_operators()
in python/fb_ads_library_api_operators.py
7 1 0
def is_valid_fields()
in python/fb_ads_library_api_utils.py
3 1 1
def get_parser()
in python/fb_ads_library_api_cli.py
50 1 0