awslabs / aws-embedded-metrics-node
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 567 lines of code in units (50.0% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 4 medium size units (118 lines of code)
    • 8 small units (125 lines of code)
    • 64 very small units (324 lines of code)
0% | 0% | 20% | 22% | 57%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts0% | 0% | 20% | 22% | 57%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/serializers0% | 0% | 100% | 0% | 0%
src/sinks/connections0% | 0% | 32% | 21% | 46%
src/logger0% | 0% | 14% | 21% | 63%
src/environment0% | 0% | 10% | 12% | 76%
src/sinks0% | 0% | 0% | 60% | 40%
src/config0% | 0% | 0% | 58% | 41%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public serialize()
in src/serializers/LogSerializer.ts
45 6 1
private async establishConnection()
in src/sinks/connections/TcpClient.ts
31 4 0
public async probe()
in src/environment/ECSEnvironment.ts
21 6 0
public putDimensions()
in src/logger/MetricsContext.ts
21 6 1
public async sendMessage()
in src/sinks/connections/TcpClient.ts
20 3 1
private constructor()
in src/logger/MetricsContext.ts
18 6 6
port: Number()
in src/sinks/AgentSink.ts
17 3 1
public async accept()
in src/sinks/AgentSink.ts
16 4 1
public configureContext()
in src/environment/ECSEnvironment.ts
14 4 1
public getConfiguration()
in src/config/EnvironmentConfigurationProvider.ts
14 4 0
public getDimensions()
in src/logger/MetricsContext.ts
14 4 0
public async probe()
in src/environment/EC2Environment.ts
12 3 0
public configureContext()
in src/environment/LambdaEnvironment.ts
10 2 1
public createCopyWithContext()
in src/logger/MetricsContext.ts
10 1 0
constructor()
in src/sinks/connections/TcpClient.ts
10 1 1
public async sendMessage()
in src/sinks/connections/UdpClient.ts
10 2 1
public configureContext()
in src/environment/EC2Environment.ts
9 2 1
private static resolveMetaTimestamp()
in src/logger/MetricsContext.ts
9 3 1
public putMetric()
in src/logger/MetricsContext.ts
8 2 3
constructor()
in src/sinks/AgentSink.ts
8 2 3