aws-solutions / amazon-virtual-andon
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 432 units with 9,580 lines of code in units (63.0% of code).
    • 13 very long units (2,164 lines of code)
    • 14 long units (943 lines of code)
    • 130 medium size units (4,042 lines of code)
    • 89 small units (1,342 lines of code)
    • 186 very small units (1,089 lines of code)
22% | 9% | 42% | 14% | 11%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts50% | 13% | 23% | 8% | 4%
tsx10% | 9% | 50% | 16% | 12%
py62% | 0% | 17% | 10% | 8%
js0% | 0% | 46% | 12% | 40%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
cdk-infrastructure/lib75% | 12% | 10% | <1% | <1%
console/src9% | 8% | 50% | 16% | 14%
solution-helper41% | 18% | 8% | 22% | 8%
glue-job-scripts62% | 0% | 17% | 10% | 8%
appsync-lambda-resolver0% | 47% | 41% | 10% | 0%
external-integrations-handler0% | 0% | 78% | 12% | 9%
ava-issue-handler0% | 0% | 47% | 41% | 10%
solution-utils0% | 0% | 34% | 23% | 42%
cdk-infrastructure/utils0% | 0% | 0% | 100% | 0%
cognito-trigger0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in source/cdk-infrastructure/lib/front-end/front-end-construct.ts
297 3 3
constructor()
in source/cdk-infrastructure/lib/back-end/appsync-api/appsync-api-construct.ts
282 2 3
constructor()
in source/cdk-infrastructure/lib/back-end/data-analysis/data-analysis-construct.ts
248 3 3
constructor()
in source/cdk-infrastructure/lib/amazon-virtual-andon-stack.ts
163 1 3
render()
in source/console/src/views/IssuesReport.tsx
151 7 0
render()
in source/console/src/views/Event.tsx
149 6 0
render()
in source/console/src/views/Client.tsx
148 11 0
constructor()
in source/cdk-infrastructure/lib/back-end/back-end-construct.ts
145 1 3
export async function handler()
in source/solution-helper/index.ts
127 24 2
constructor()
in source/cdk-infrastructure/lib/back-end/external-integrations/external-integrations-construct.ts
121 1 3
def main()
in source/glue-job-scripts/etl-data-export.py
115 3 0
toggleUserPermission()
in source/console/src/views/PermissionSetting.tsx
114 13 4
async configureSubscription()
in source/console/src/views/Client.tsx
104 24 2
render()
in source/console/src/views/Observer.tsx
98 8 0
render()
in source/console/src/components/DataTable.tsx
89 10 0
constructor()
in source/cdk-infrastructure/lib/common-resources/solution-helper/solution-helper-construct.ts
76 1 3
constructor()
in source/console/src/views/AddEditEvent.tsx
73 1 1
private getDataExportJob()
in source/cdk-infrastructure/lib/back-end/data-analysis/data-analysis-construct.ts
72 1 0
async handleEventClick()
in source/console/src/views/Client.tsx
66 8 1
export async function handler()
in source/appsync-lambda-resolver/index.ts
66 14 1