aws-samples / aws-iot-greengrass-v2-using-aws-cdk
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 76 units with 1,197 lines of code in units (81.1% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (155 lines of code)
    • 14 medium size units (413 lines of code)
    • 26 small units (391 lines of code)
    • 34 very small units (238 lines of code)
0% | 12% | 34% | 32% | 19%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts0% | 16% | 42% | 19% | 21%
py0% | 0% | 0% | 86% | 13%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
infra/stack/data0% | 78% | 12% | 0% | 8%
infra/stack/iot0% | 0% | 62% | 23% | 14%
infra/stack/greengrass0% | 0% | 58% | 19% | 21%
infra/stack/ops0% | 0% | 55% | 45% | 0%
lib/template/pattern0% | 0% | 50% | 23% | 26%
lib/template0% | 0% | 29% | 40% | 30%
codes/lambda/custom_iot_event_msg0% | 0% | 0% | 100% | 0%
codes/lambda/custom_gg_comp_deploy0% | 0% | 0% | 100% | 0%
codes/lambda/custom_iot_role_alias0% | 0% | 0% | 100% | 0%
codes/lambda/custom_iot_thing_group0% | 0% | 0% | 100% | 0%
codes/component/logger_sample0% | 0% | 0% | 49% | 50%
lib/template/construct0% | 0% | 0% | 0% | 100%
lib/template/stack0% | 0% | 0% | 0% | 100%
script/thing0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
private createElasticsearch()
in infra/stack/data/data-pipeline-stack.ts
92 4 0
private createFirehose2ES()
in infra/stack/data/data-pipeline-stack.ts
63 2 1
private createRecipe()
in infra/stack/greengrass/components/sample-logger-componet-construct.ts
43 1 3
private createThingInstallerGroup()
in infra/stack/iot/thing-installer-stack.ts
36 1 1
private createIotRule()
in infra/stack/iot/thing-monitor-stack.ts
34 1 3
private createLambda()
in lib/template/pattern/lambda-construct.ts
33 11 4
private createCustomResourceProvider()
in infra/stack/iot/thing-installer-stack.ts
33 1 1
private createIoTRoleAlias()
in infra/stack/iot/thing-installer-stack.ts
30 1 2
private createComponentDeploymnetProvider()
in infra/stack/greengrass/component-deployment-stack.ts
29 1 1
constructor()
in infra/stack/ops/cicd-pipeline-stack.ts
29 4 2
private createThingInstallerProvisionPolicy()
in infra/stack/iot/thing-installer-stack.ts
27 1 0
private createBuildDeployStageAction()
in infra/stack/ops/cicd-pipeline-stack.ts
26 1 2
private createIoTRuleToFirehose()
in infra/stack/data/data-pipeline-stack.ts
25 1 2
private updateContextArgs()
in lib/template/app-context.ts
24 7 3
private addAccessControl()
in infra/stack/greengrass/components/sample-logger-componet-construct.ts
23 1 3
constructor()
in infra/stack/iot/thing-monitor-stack.ts
21 1 2
private loadConfig()
in lib/template/app-context.ts
20 5 3
private createThingInstallerDevEnvPolicy()
in infra/stack/iot/thing-installer-stack.ts
20 1 0
private createGreengrassV2TokenExchangeRoleAccessPolicy()
in infra/stack/iot/thing-installer-stack.ts
19 1 0
def update_thing_event()
in codes/lambda/custom_iot_event_msg/src/handler.py
18 3 1