aws-solutions / iot-device-simulator
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 123 units with 3,180 lines of code in units (54.7% of code).
    • 5 very long units (877 lines of code)
    • 9 long units (760 lines of code)
    • 29 medium size units (903 lines of code)
    • 25 small units (360 lines of code)
    • 55 very small units (280 lines of code)
27% | 23% | 28% | 11% | 8%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts46% | 19% | 22% | 6% | 4%
tsx31% | 51% | 7% | 6% | 2%
js10% | 13% | 42% | 17% | 15%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
infrastructure/lib62% | 26% | 11% | 0% | 0%
console/src24% | 40% | 21% | 7% | 5%
microservices/lib28% | 0% | 56% | 14% | <1%
simulator/lib0% | 22% | 35% | 17% | 24%
custom-resource0% | 0% | 28% | 62% | 9%
microservices/metrics0% | 0% | 0% | 100% | 0%
infrastructure/utils0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
export default function SimulationCreate()
in source/console/src/views/SimulationCreate.tsx
209 25 1
constructor()
in source/infrastructure/lib/simulator.ts
186 1 3
constructor()
in source/infrastructure/lib/console.ts
180 1 3
constructor()
in source/infrastructure/lib/iot-device-simulator-stack.ts
153 1 3
static async _processRequest()
in source/microservices/lib/responseManager.js
149 32 1
_processSpecAttribute()
in source/simulator/lib/device/generators/random/generator.js
99 24 1
export default function TableData()
in source/console/src/components/Simulations/TableData.tsx
98 3 1
export default function ModalForm()
in source/console/src/components/DeviceTypeCreate/ModalForm.tsx
97 19 1
iterate()
in source/simulator/lib/device/generators/vehicle/dynamics/route-calc.js
96 22 1
constructor()
in source/infrastructure/lib/api.ts
91 1 3
export default function DeviceTypeCreate()
in source/console/src/views/DeviceTypeCreate.tsx
87 9 1
public setupUi()
in source/infrastructure/lib/custom-resource.ts
74 1 1
export default function PageTitleBar()
in source/console/src/components/Shared/PageTitleBar.tsx
64 3 1
constructor()
in source/infrastructure/lib/custom-resource.ts
54 1 3
async createSimulation()
in source/microservices/lib/simulationManager.js
50 8 1
async getDeviceType()
in source/microservices/lib/simulationManager.js
47 9 2
export function validatePayload()
in source/console/src/util/Utils.ts
47 13 1
async updateSimulation()
in source/microservices/lib/simulationManager.js
45 8 2
async _initializeData()
in source/simulator/lib/device/generators/vehicle/dynamics/dynamics-model.js
44 9 1
async createDeviceType()
in source/microservices/lib/deviceTypeManager.js
40 8 1