microsoft / ApplicationInsights-node.js
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 362 units with 5,232 lines of code in units (67.2% of code).
    • 1 very long units (171 lines of code)
    • 13 long units (871 lines of code)
    • 69 medium size units (1,893 lines of code)
    • 78 small units (1,196 lines of code)
    • 201 very small units (1,101 lines of code)
3% | 16% | 36% | 22% | 21%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts3% | 16% | 36% | 22% | 21%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Library8% | 13% | 33% | 23% | 21%
AutoCollection0% | 19% | 35% | 23% | 21%
AutoCollection/diagnostic-channel0% | 22% | 59% | 12% | 5%
TelemetryProcessors0% | 60% | 0% | 31% | 7%
Bootstrap0% | 22% | 31% | 20% | 25%
Declarations/Contracts0% | 0% | 83% | 0% | 16%
ROOT0% | 0% | 26% | 36% | 37%
Bootstrap/Helpers0% | 0% | 47% | 35% | 16%
Declarations/Metrics0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public async send()
in Library/Sender.ts
171 41 2
function createDependencyData()
in AutoCollection/diagnostic-channel/SpanParser.ts
96 30 1
public static trackRequest()
in AutoCollection/HttpDependencies.ts
85 32 2
private _loadJsonFile()
in Library/JsonConfig.ts
80 15 0
public static makeRequest()
in Library/Util.ts
68 22 4
public static startOperation()
in AutoCollection/CorrelationContextManager.ts
65 25 1
private _initialize()
in AutoCollection/HttpRequests.ts
65 13 0
public static queryCorrelationId()
in Library/CorrelationIdManager.ts
64 12 2
export function preAggregatedMetricsTelemetryProcessor()
in TelemetryProcessors/PreAggregatedMetricsTelemetryProcessor.ts
64 6 2
constructor()
in Library/Traceparent.ts
63 16 2
private static _getUrlFromRequestOptions()
in AutoCollection/HttpDependencyParser.ts
59 28 2
private _initialize()
in AutoCollection/HttpDependencies.ts
54 10 0
public getDependencyTelemetry()
in AutoCollection/HttpDependencyParser.ts
54 15 2
export function setupAndStart()
in Bootstrap/Default.ts
54 9 2
public static getAzureComputeMetadata()
in Library/AzureVirtualMachine.ts
46 10 2
private _trackCpu()
in AutoCollection/Performance.ts
45 18 0
private parseHeaders()
in AutoCollection/HttpRequestParser.ts
43 23 2
public enable()
in AutoCollection/Exceptions.ts
41 9 1
private static parseStack()
in Library/EnvelopeFactory.ts
40 7 1
public enable()
in AutoCollection/Performance.ts
37 8 2