aws-samples / aws-dataexchange-api-samples
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 30 units with 415 lines of code in units (37.6% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (55 lines of code)
    • 7 medium size units (181 lines of code)
    • 8 small units (107 lines of code)
    • 14 very small units (72 lines of code)
0% | 13% | 43% | 25% | 17%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 18% | 42% | 17% | 21%
ts0% | 0% | 58% | 22% | 18%
cpp0% | 0% | 100% | 0% | 0%
go0% | 0% | 0% | 100% | 0%
cs0% | 0% | 0% | 100% | 0%
java0% | 0% | 0% | 100% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
subscribers/python/tf-auto-export-to-s30% | 90% | 0% | 0% | 9%
subscribers/python/export-data-sets0% | 0% | 79% | 20% | 0%
subscribers/python/download-entitled-assets0% | 0% | 44% | 33% | 22%
subscribers/javascript/auto-export-to-s30% | 0% | 66% | 26% | 7%
subscribers/cpp/all-entitled-datasets0% | 0% | 100% | 0% | 0%
subscribers/python/pandas-describe-csv0% | 0% | 40% | 0% | 59%
subscribers/go/all-entitled-datasets0% | 0% | 0% | 100% | 0%
subscribers/dotnet/all-entitled-datasets0% | 0% | 0% | 100% | 0%
subscribers/java/all-entitled-datasets0% | 0% | 0% | 100% | 0%
subscribers/javascript/all-entitled-datasets0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def handler()
in subscribers/python/tf-auto-export-to-s3/index.py
55 12 2
def export_revisions()
in subscribers/python/export-data-sets/export-data-sets.py
29 8 4
constructor()
in subscribers/javascript/auto-export-to-s3/cfn/lambda.ts
28 1 2
def main()
in subscribers/python/export-data-sets/export-data-sets.py
28 11 4
int main()
in subscribers/cpp/all-entitled-datasets/main.cpp
27 3 2
def export_assets()
in subscribers/python/download-entitled-assets/download-entitled-assets.py
25 5 2
def export_asset()
in subscribers/python/pandas-describe-csv/pandas-describe-csv.py
23 4 2
def main()
in subscribers/python/download-entitled-assets/download-entitled-assets.py
21 6 1
func main()
in subscribers/go/all-entitled-datasets/all-entitled-datasets.go
16 3 0
static void Main()
in subscribers/dotnet/all-entitled-datasets/Program.cs
16 2 1
def get_revisions()
in subscribers/python/export-data-sets/export-data-sets.py
15 4 1
public static void main()
in subscribers/java/all-entitled-datasets/src/main/java/com/amazonaws/dataexchange/App.java
14 2 1
def get_all_assets()
in subscribers/python/download-entitled-assets/download-entitled-assets.py
13 2 2
async function waitForJobCompletion()
in subscribers/javascript/auto-export-to-s3/lambda/exportToS3.ts
11 4 2
def get_all_revisions()
in subscribers/python/download-entitled-assets/download-entitled-assets.py
11 2 1
def get_entitled_data_sets()
in subscribers/python/download-entitled-assets/download-entitled-assets.py
11 2 0
def download_assets()
in subscribers/python/download-entitled-assets/download-entitled-assets.py
10 3 3
def dx_csv_to_data_frame()
in subscribers/python/pandas-describe-csv/pandas-describe-csv.py
8 1 1
def parse_asset_arn()
in subscribers/python/pandas-describe-csv/pandas-describe-csv.py
7 1 1
void async function()
in subscribers/javascript/all-entitled-datasets/index.ts
6 1 0