aws-solutions / operations-conductor
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 84 units with 2,966 lines of code in units (33.1% of code).
    • 3 very long units (774 lines of code)
    • 9 long units (608 lines of code)
    • 37 medium size units (1,215 lines of code)
    • 15 small units (247 lines of code)
    • 20 very small units (122 lines of code)
26% | 20% | 40% | 8% | 4%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
tsx58% | 6% | 20% | 9% | 6%
ts0% | 32% | 57% | 7% | 2%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
console/src58% | 6% | 20% | 9% | 6%
services/tasks0% | 50% | 47% | 2% | 0%
services/resource-selector0% | 43% | 50% | 5% | 0%
services/users0% | 0% | 86% | 8% | 4%
services/queue-consumer0% | 0% | 81% | 14% | 3%
services/custom-resource0% | 0% | 65% | 16% | 17%
services/actions0% | 0% | 59% | 32% | 8%
services/common0% | 0% | 100% | 0% | 0%
services/metrics0% | 0% | 0% | 82% | 17%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
render()
in source/console/src/views/AutomationExecutionDetail.tsx
527 38 0
constructor()
in source/console/src/views/TaskCreate.tsx
142 7 1
render()
in source/console/src/views/Actions.tsx
105 6 0
async buildTaskItem()
in source/services/tasks/tasks.ts
97 22 2
render()
in source/console/src/views/TaskCreate.tsx
81 6 0
async generateCloudFormationTemplate()
in source/services/tasks/tasks.ts
73 3 1
constructor()
in source/services/resource-selector/index.ts
71 27 1
async getAutomationExecutions()
in source/services/tasks/tasks.ts
61 10 4
async putCloudWatchEventRule()
in source/services/tasks/tasks.ts
61 7 1
async function sendMessagesToResourceQueue()
in source/services/resource-selector/index.ts
59 8 3
async createTask()
in source/services/tasks/tasks.ts
53 8 1
async deleteCloudWatchEventRule()
in source/services/tasks/tasks.ts
52 6 1
async getAutomationExecution()
in source/services/tasks/tasks.ts
50 6 3
async editKmsPolicy()
in source/services/tasks/tasks.ts
49 3 2
async function getResourcesForTagName()
in source/services/resource-selector/index.ts
48 6 1
async function verifyTagExistsOnResources()
in source/services/resource-selector/index.ts
47 7 1
showComponent()
in source/console/src/components/CustomForgotPassword.tsx
44 3 0
showComponent()
in source/console/src/components/CustomVerifyContact.tsx
44 3 0
async getTaskExecutions()
in source/services/tasks/tasks.ts
44 8 4
async createUser()
in source/services/users/users.ts
44 5 1