awslabs / game-analytics-pipeline
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 79 units with 1,394 lines of code in units (56.3% of code).
    • 2 very long units (316 lines of code)
    • 1 long units (52 lines of code)
    • 21 medium size units (608 lines of code)
    • 10 small units (158 lines of code)
    • 45 very small units (260 lines of code)
22% | 3% | 43% | 11% | 18%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js22% | 3% | 43% | 11% | 18%
py0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
resources/solution-helper/lib40% | 0% | 42% | 7% | 9%
services/events-processing/lib67% | 0% | 17% | 11% | 3%
services/api/admin0% | 12% | 71% | 7% | 8%
services/api/lambda-authorizer0% | 0% | 62% | 13% | 23%
services/analytics-processing/lib0% | 0% | 0% | 78% | 21%
services/events-processing0% | 0% | 0% | 100% | 0%
services/analytics-processing0% | 0% | 0% | 100% | 0%
resources/solution-helper0% | 0% | 0% | 0% | 100%
services/data-lake/glue-scripts0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
createDashboard()
in source/resources/solution-helper/lib/cloudwatch-helper.js
200 3 1
async processEvent()
in source/services/events-processing/lib/event.js
116 22 3
async _listApplicationAuthorizations()
in source/services/api/admin/lib/admin.js
52 4 2
startKinesisAnalyticsApp()
in source/resources/solution-helper/lib/kinesis-helper.js
43 5 1
async listApplications()
in source/services/api/admin/lib/admin.js
40 3 0
async getAuthorizationDetail()
in source/services/api/admin/lib/admin.js
40 4 2
async createAuthorization()
in source/services/api/admin/lib/admin.js
39 2 5
async modifyAuthorization()
in source/services/api/admin/lib/admin.js
37 2 3
async getApplicationDetail()
in source/services/api/admin/lib/admin.js
36 4 1
async createApplication()
in source/services/api/admin/lib/admin.js
33 3 1
async getApplication()
in source/services/events-processing/lib/event.js
30 5 1
putDataCatalogEncryptionSettings()
in source/resources/solution-helper/lib/glue-helper.js
29 5 2
async _deleteApplicationAuthorizations()
in source/services/api/admin/lib/admin.js
29 6 1
saveItem()
in source/resources/solution-helper/lib/dynamodb-helper.js
27 3 2
async sendAnonymousMetric()
in source/resources/solution-helper/lib/metrics-helper.js
24 1 1
getObject()
in source/resources/solution-helper/lib/s3-helper.js
24 3 2
function addMethod()
in source/services/api/lambda-authorizer/index.js
24 7 4
invokeFunctionSync()
in source/resources/solution-helper/lib/lambda-helper.js
23 3 1
function AuthPolicy()
in source/services/api/lambda-authorizer/index.js
23 7 3
async _deleteAuthorization()
in source/services/api/admin/lib/admin.js
22 3 2