microsoft / ai4eutils
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 180 units with 2,343 lines of code in units (73.1% of code).
    • 1 very long units (102 lines of code)
    • 5 long units (276 lines of code)
    • 24 medium size units (737 lines of code)
    • 48 small units (697 lines of code)
    • 102 very small units (531 lines of code)
4% | 11% | 31% | 29% | 22%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py4% | 11% | 31% | 29% | 22%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT7% | 14% | 24% | 27% | 25%
geospatial/data0% | 27% | 33% | 36% | 2%
geospatial/visualization0% | 0% | 46% | 38% | 14%
azure-metrics-calc-storage-size0% | 0% | 62% | 17% | 20%
geospatial/preprocessing0% | 0% | 65% | 25% | 9%
azure-sdk-calc-storage-size0% | 0% | 25% | 31% | 42%
geospatial/model_scoring0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def write_html_image_list()
in write_html_image_list.py
102 20 3
def stream_chips()
in geospatial/data/StreamingDatasets.py
61 8 1
def traverse_and_create_index()
in directory_listing.py
57 20 5
def create_plain_index()
in directory_listing.py
56 13 4
def PrepareFolderDownload()
in gDrive_download.py
51 18 3
def enumerate_prefix()
in parallel_enumerate_blobs.py
51 12 5
def get_storage_size()
in azure-sdk-calc-storage-size/azure-data.py
50 11 2
def set_access_tier()
in parallel_change_blob_access_tier.py
50 12 3
def list_blobs_in_container()
in parallel_enumerate_containers.py
47 12 5
def main()
in geospatial/preprocessing/create_label_masks.py
41 7 0
def plot_colortable()
in geospatial/visualization/raster_label_visualizer.py
41 5 4
def get_metric_data_capacity()
in azure-metrics-calc-storage-size/metrics-data.py
38 8 4
def show_patch()
in geospatial/visualization/imagery_visualizer.py
38 19 12
def walk_container()
in ai4e_azure_utils.py
37 12 6
def get_used_avg_blob_capacity()
in azure-metrics-calc-storage-size/metrics-data.py
29 4 2
def stream_tile_fns()
in geospatial/data/StreamingDatasets.py
29 9 1
def get_landsat8_ndvi()
in geospatial/visualization/imagery_visualizer.py
27 11 4
def download_url()
in url_utils.py
27 8 4
def human_readable_to_bytes()
in ai4e_string_utils.py
26 9 1
def producer_func()
in parallel_change_blob_access_tier.py
26 10 2