aws-samples / sitewise-data-ingestion-demo
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 26 units with 796 lines of code in units (53.5% of code).
    • 1 very long units (187 lines of code)
    • 3 long units (249 lines of code)
    • 7 medium size units (239 lines of code)
    • 4 small units (60 lines of code)
    • 11 very small units (61 lines of code)
23% | 31% | 30% | 7% | 7%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts24% | 32% | 31% | 4% | 6%
js0% | 0% | 0% | 74% | 25%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib/asset-models64% | 33% | 0% | 0% | 2%
lib/stacks0% | 76% | 17% | 0% | 5%
lib/lambda0% | 42% | 33% | 18% | 6%
lib/assets0% | 0% | 100% | 0% | 0%
lib/kinesis0% | 0% | 85% | 0% | 14%
lib/iot-rules0% | 0% | 100% | 0% | 0%
misc/data-generator0% | 0% | 39% | 24% | 36%
lib/timestream0% | 0% | 0% | 100% | 0%
lib/util0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in lib/asset-models/turbine-asset-model-construct.ts
187 1 3
constructor()
in lib/asset-models/wind-farm-asset-model-construct.ts
97 1 3
constructor()
in lib/stacks/data-lake-stack.ts
91 3 3
constructor()
in lib/lambda/data-lake-ingestion-fork-lambda-construct.ts
61 3 3
constructor()
in lib/lambda/asset-mapper-lambda-construct.ts
48 1 3
constructor()
in lib/kinesis/firehose-to-s3-delivery-stream-construct.ts
42 1 3
constructor()
in lib/iot-rules/send-to-data-lake-rule-construct.ts
38 1 3
constructor()
in lib/assets/turbine-asset-construct.ts
35 1 3
constructor()
in misc/data-generator/src/turbine.ts
31 1 1
constructor()
in lib/assets/wind-farm-asset.ts
24 2 3
constructor()
in lib/stacks/wind-farm-stack.ts
21 1 2
public nextValue()
in misc/data-generator/src/data-generator.ts
19 5 0
constructor()
in lib/timestream/timestream-asset-data-target-construct.ts
15 1 3
const successPayload = function()
in lib/lambda/functions/asset-mapper/index.js
14 1 1
const failPayload = function()
in lib/lambda/functions/asset-mapper/index.js
12 1 2
async function getMapping()
in lib/lambda/functions/data-lake-ingestion-fork-lambda/index.js
9 2 0
public nextValue()
in misc/data-generator/src/turbine.ts
8 1 0
constructor()
in misc/data-generator/src/data-generator.ts
8 1 1
constructor()
in lib/kinesis/data-lake-ingestion-stream-construct.ts
7 1 3
constructor()
in lib/stacks/asset-model-stack.ts
7 1 3