facebookresearch / Ad-Library-API-Script-Repository
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 16 units with 244 lines of code in units (63.4% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 4 medium size units (140 lines of code)
    • 5 small units (72 lines of code)
    • 7 very small units (32 lines of code)
0% | 0% | 57% | 29% | 13%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 0% | 57% | 29% | 13%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
python0% | 0% | 57% | 29% | 13%
Alternative Visuals
Longest Units
Top 16 longest units
Unit# linesMcCabe index# params
def get_parser()
in python/fb_ads_library_api_cli.py
50 1 0
def main()
in python/fb_ads_library_api_cli.py
36 11 0
def save_to_csv()
in python/fb_ads_library_api_operators.py
30 11 4
def count_start_time_trending()
in python/fb_ads_library_api_operators.py
24 5 3
def validate_country_param()
in python/fb_ads_library_api_cli.py
18 6 1
def validate_fields_param()
in python/fb_ads_library_api_cli.py
15 4 1
def generate_ad_archives()
in python/fb_ads_library_api.py
14 1 1
def save_to_file()
in python/fb_ads_library_api_operators.py
13 5 3
def __init__()
in python/fb_ads_library_api.py
12 1 0
def get_country_code()
in python/fb_ads_library_api_utils.py
9 4 1
def get_operators()
in python/fb_ads_library_api_operators.py
7 1 0
def count_ads()
in python/fb_ads_library_api_operators.py
7 3 3
def is_valid_fields()
in python/fb_ads_library_api_utils.py
3 1 1
def get_ad_archive_id()
in python/fb_ads_library_api.py
2 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