aws-solutions / machine-downtime-monitor-on-aws
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 144 units with 3,372 lines of code in units (63.8% of code).
    • 5 very long units (924 lines of code)
    • 6 long units (415 lines of code)
    • 34 medium size units (1,059 lines of code)
    • 39 small units (599 lines of code)
    • 60 very small units (375 lines of code)
27% | 12% | 31% | 17% | 11%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts37% | 13% | 23% | 16% | 8%
tsx13% | 5% | 43% | 20% | 17%
py0% | 21% | 49% | 16% | 12%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
cdk-infrastructure/lib57% | 27% | 11% | 3% | <1%
lambda/solution-helper31% | 0% | 16% | 31% | 19%
web-ui/src13% | 5% | 43% | 20% | 17%
glue-job-scripts0% | 21% | 49% | 16% | 12%
lambda/filter-kinesis-stream0% | 0% | 62% | 23% | 13%
lambda/data-sources0% | 0% | 61% | 38% | 0%
lambda/util0% | 0% | 37% | 49% | 13%
lambda/update-filter-function0% | 0% | 0% | 61% | 38%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in source/cdk-infrastructure/lib/bi-reporting/etl/etl-construct.ts
349 11 3
export async function handleQuickSightResourceCreation()
in source/lambda/solution-helper/create-quicksight.ts
168 6 1
constructor()
in source/cdk-infrastructure/lib/machine-downtime-monitor-on-aws-stack.ts
143 1 3
constructor()
in source/cdk-infrastructure/lib/front-end/appsync-api/appsync-api-construct.ts
139 1 3
showModalBody()
in source/web-ui/src/views/machines/MachineStatusCard.tsx
125 4 0
constructor()
in source/cdk-infrastructure/lib/real-time-processing/real-time-processing-construct.ts
95 1 3
constructor()
in source/cdk-infrastructure/lib/solution-helper/solution-helper-construct.ts
68 1 3
constructor()
in source/cdk-infrastructure/lib/bi-reporting/quicksight/quicksight-construct.ts
68 1 3
constructor()
in source/cdk-infrastructure/lib/front-end/authentication/authentication-construct.ts
67 2 3
def main()
in source/glue-job-scripts/configuration.py
60 6 0
showModalBody()
in source/web-ui/src/views/overview/Overview.tsx
57 3 0
def main()
in source/glue-job-scripts/convert_parquet.py
50 4 0
async loadMachineData()
in source/web-ui/src/views/machines/MachineDetail.tsx
49 7 2
async onClickConfigModalSaveBtn()
in source/web-ui/src/views/machines/MachineStatusCard.tsx
45 10 1
constructor()
in source/cdk-infrastructure/lib/bi-reporting/bi-reporting-construct.ts
45 1 3
async function createAllDataSources()
in source/lambda/solution-helper/create-quicksight.ts
43 1 2
private validateConfigItem()
in source/lambda/filter-kinesis-stream/machine-data-parser.ts
42 10 1
showMachines()
in source/web-ui/src/views/overview/Overview.tsx
37 9 0
onChangeUIReferenceMapping()
in source/web-ui/src/views/overview/Overview.tsx
36 8 1
public parseData()
in source/lambda/filter-kinesis-stream/machine-data-parser.ts
36 7 1