aws-solutions / amazon-cloudwatch-monitoring-framework
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 24 units with 1,305 lines of code in units (47.4% of code).
    • 3 very long units (648 lines of code)
    • 4 long units (315 lines of code)
    • 9 medium size units (280 lines of code)
    • 1 small units (18 lines of code)
    • 7 very small units (44 lines of code)
49% | 24% | 21% | 1% | 3%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts51% | 24% | 19% | 1% | 2%
rb0% | 0% | 78% | 0% | 21%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
resources/lib100% | 0% | 0% | 0% | 0%
resources/lib/puma0% | 71% | 22% | 0% | 6%
services/tagHandler/lib0% | 40% | 50% | 9% | 0%
resources/lib/apache0% | 100% | 0% | 0% | 0%
resources/lib/nginx0% | 100% | 0% | 0% | 0%
services/dashboardHandler/lib0% | 0% | 100% | 0% | 0%
services/utils/metrics0% | 0% | 0% | 0% | 100%
services/utils/logger0% | 0% | 0% | 0% | 100%
services/utils/error0% | 0% | 0% | 0% | 100%
services/helper0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in source/resources/lib/workload.infra.ts
348 3 3
constructor()
in source/resources/lib/framework.infra.ts
176 2 2
constructor()
in source/resources/lib/demo.infra.ts
124 1 2
constructor()
in source/resources/lib/puma/puma.demo.ts
91 2 3
static async getInstances()
in source/services/tagHandler/lib/EC2Helper.ts
78 5 2
constructor()
in source/resources/lib/apache/apache.demo.ts
77 2 3
constructor()
in source/resources/lib/nginx/nginx.demo.ts
69 2 3
async putDashboard()
in source/services/dashboardHandler/lib/CWHelperAbstract.ts
39 4 2
static async getParameter()
in source/services/tagHandler/lib/SSMHelper.ts
35 5 1
static async getParameter()
in source/services/dashboardHandler/lib/SSMHelper.ts
35 5 1
static isTagValid()
in source/services/tagHandler/lib/EC2Helper.ts
32 8 1
static async putParameter()
in source/services/tagHandler/lib/SSMHelper.ts
30 3 2
static async putParameter()
in source/services/dashboardHandler/lib/SSMHelper.ts
30 3 2
generate_cloudwatch_log_json
in source/resources/lib/puma/puma.config/application_controller.rb
29 1 0
private createFilterPattern()
in source/services/dashboardHandler/lib/CWWidgetFactory.ts
27 3 1
async deleteDashboard()
in source/services/dashboardHandler/lib/CWHelperAbstract.ts
23 2 1
static compareArrays()
in source/services/tagHandler/lib/EC2Helper.ts
18 6 2
format: combine()
in source/services/utils/logger/index.ts
9 1 1
await got()
in source/services/utils/metrics/index.ts
9 1 5
static async sendAnonymousMetric()
in source/services/utils/metrics/index.ts
8 1 0