aws-samples / amazon-sagemaker-built-in-algorithms-mlops-pipeline-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 56 units with 892 lines of code in units (81.8% of code).
    • 1 very long units (125 lines of code)
    • 1 long units (56 lines of code)
    • 7 medium size units (191 lines of code)
    • 23 small units (354 lines of code)
    • 24 very small units (166 lines of code)
14% | 6% | 21% | 39% | 18%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts15% | 7% | 18% | 39% | 19%
py0% | 0% | 50% | 39% | 9%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
infra/stack/mlops41% | 18% | 15% | 21% | 2%
lib/template/pattern0% | 0% | 22% | 67% | 9%
codes/lambda/mlops-trigger-statemachine0% | 0% | 47% | 35% | 16%
lib/template0% | 0% | 29% | 40% | 30%
codes/lambda/mlops-query-accuracy0% | 0% | 100% | 0% | 0%
codes/lambda/mlops-query-endpoint0% | 0% | 0% | 100% | 0%
lib/template/stack0% | 0% | 0% | 0% | 100%
lib/template/construct0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
private createStateMachine()
in infra/stack/mlops/mlops-pipeline-stack.ts
125 5 1
private createStateMachineRole()
in infra/stack/mlops/mlops-pipeline-stack.ts
56 1 1
constructor()
in lib/template/pattern/glue-job-construct.ts
41 1 3
private createLambda()
in lib/template/pattern/lambda-construct.ts
33 11 4
def handle()
in codes/lambda/mlops-trigger-statemachine/src/handler.py
25 3 2
private updateContextArgs()
in lib/template/app-context.ts
24 7 3
constructor()
in infra/stack/mlops/mlops-pipeline-stack.ts
24 2 2
def handle()
in codes/lambda/mlops-query-accuracy/src/handler.py
22 5 2
private createTriggerStateMachineLambda()
in infra/stack/mlops/mlops-pipeline-stack.ts
22 1 3
private loadConfig()
in lib/template/app-context.ts
20 5 3
def get_request_template()
in codes/lambda/mlops-trigger-statemachine/src/handler.py
19 1 0
def handle()
in codes/lambda/mlops-query-endpoint/src/handler.py
18 4 2
public createEndpointInstanceMetrics()
in lib/template/pattern/cloudwatch-dashboard-construct.ts
18 2 4
public createEndpointInvocationMetrics()
in lib/template/pattern/cloudwatch-dashboard-construct.ts
18 2 4
private createSageMakerTrainingRole()
in infra/stack/mlops/mlops-pipeline-stack.ts
17 1 1
private createQueryEndpointLambda()
in infra/stack/mlops/mlops-pipeline-stack.ts
17 1 1
private createQueryAccuracyLambda()
in infra/stack/mlops/mlops-pipeline-stack.ts
17 1 1
public createDynamoDBMetric()
in lib/template/pattern/cloudwatch-dashboard-construct.ts
16 3 4
public createEsDomainMetric()
in lib/template/pattern/cloudwatch-dashboard-construct.ts
16 2 4
public createEsDomainMetric2()
in lib/template/pattern/cloudwatch-dashboard-construct.ts
16 2 4