aws / aws-xray-sdk-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 185 units with 2,171 lines of code in units (54.7% of code).
    • 0 very long units (0 lines of code)
    • 3 long units (209 lines of code)
    • 28 medium size units (822 lines of code)
    • 36 small units (532 lines of code)
    • 118 very small units (608 lines of code)
0% | 9% | 37% | 24% | 28%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 10% | 36% | 25% | 28%
ts0% | 0% | 68% | 12% | 18%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
packages/core/lib0% | 9% | 32% | 26% | 31%
packages/mysql/lib0% | 27% | 27% | 32% | 12%
sdk_contrib/koa/lib0% | 0% | 100% | 0% | 0%
packages/postgres/lib0% | 0% | 57% | 17% | 25%
packages/restify/lib0% | 0% | 100% | 0% | 0%
packages/postgres/test-d0% | 0% | 100% | 0% | 0%
packages/core/test-d0% | 0% | 68% | 0% | 31%
sdk_contrib/hapi/lib0% | 0% | 74% | 0% | 25%
packages/core0% | 0% | 0% | 100% | 0%
packages/full_sdk/lib0% | 0% | 0% | 0% | 100%
packages/mysql/test-d0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
function captureOutgoingHTTPs()
in packages/core/lib/patchers/http_p.js
100 35 2
wildcardMatch: function wildcardMatch()
in packages/core/lib/utils.js
57 22 2
function captureOperation()
in packages/mysql/lib/mysql_p.js
52 9 1
openSegment: function openSegment()
in sdk_contrib/koa/lib/koa_mw.js
49 10 1
function captureQuery()
in packages/postgres/lib/postgres_p.js
47 15 0
enable: function enable()
in packages/restify/lib/restify_mw.js
44 12 2
function testQuery()
in packages/postgres/test-d/index.test-d.ts
39 1 1
fetchTargets: function fetchTargets()
in packages/core/lib/middleware/sampling/service_connector.js
35 5 2
fetchSamplingRules: function fetchSamplingRules()
in packages/core/lib/middleware/sampling/service_connector.js
34 4 1
function testSegmentLike()
in packages/core/test-d/index.test-d.ts
32 1 1
function resolveArguments()
in packages/mysql/lib/mysql_p.js
30 18 1
function getToken()
in packages/core/lib/segments/plugins/ec2_plugin.js
30 4 1
var completeListener = function()
in packages/core/lib/patchers/aws_p.js
30 12 1
static FromString()
in packages/core/lib/segments/attributes/trace_id.js
28 7 1
function captureAWSRequest()
in packages/core/lib/patchers/aws_p.js
28 6 1
27 6 1
send: function send()
in packages/core/lib/segment_emitter.js
27 6 1
resolveSampling: function resolveSampling()
in packages/core/lib/middleware/mw_utils.js
26 8 3
TTL: dateToEpoch()
in packages/core/lib/middleware/sampling/service_connector.js
26 8 1
localSampler: require()
in packages/core/lib/middleware/sampling/default_sampler.js
26 5 1