aws-samples / data-lake-as-code
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 37 units with 1,122 lines of code in units (73.6% of code).
    • 2 very long units (305 lines of code)
    • 4 long units (281 lines of code)
    • 11 medium size units (386 lines of code)
    • 5 small units (76 lines of code)
    • 15 very small units (74 lines of code)
27% | 25% | 34% | 6% | 6%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts28% | 26% | 33% | 5% | 6%
py0% | 0% | 63% | 36% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib/constructs35% | 21% | 35% | 4% | 3%
lib/stacks0% | 61% | 0% | 11% | 27%
lib0% | 0% | 100% | 0% | 0%
scripts0% | 0% | 63% | 36% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public createCoarseIamPolicy()
in lib/constructs/data-lake-enrollment.ts
183 1 0
constructor()
in lib/constructs/data-set-enrollment.ts
122 3 3
constructor()
in lib/stacks/datalake-stack.ts
94 1 3
constructor()
in lib/constructs/data-set-enrollment.ts
78 5 3
constructor()
in lib/constructs/s3-data-set-enrollment.ts
56 3 3
public grantDataLocationPermissions()
in lib/constructs/data-lake-enrollment.ts
53 11 3
public grantDatabasePermission()
in lib/constructs/data-lake-enrollment.ts
49 9 3
constructor()
in lib/constructs/rds-data-set-enrollment.ts
45 2 3
constructor()
in lib/constructs/data-set-enrollment.ts
44 2 3
constructor()
in lib/constructs/data-set-enrollment.ts
42 3 3
public grantTableWithColumnPermissions()
in lib/constructs/data-lake-enrollment.ts
40 4 2
35 6 3
def main()
in scripts/lambda.updateprimaryworkgroup.py
30 5 2
public grantCoarseIamRead()
in lib/constructs/data-lake-enrollment.ts
28 6 1
constructor()
in lib/ExampleS3DataSet-stack.ts
26 1 3
constructor()
in lib/ExamplePgRdsDataSet-stack.ts
25 1 3
setupGlueRoleLakeFormationPermissions()
in lib/constructs/s3-data-set-enrollment.ts
22 2 5
public grantAthenaResultsBucketPermission()
in lib/stacks/datalake-stack.ts
18 6 1
def main()
in scripts/lambda.activategluetigger.py
17 4 2
private setupCrawler()
in lib/constructs/data-set-enrollment.ts
15 2 4