aws / aws-xray-sdk-node
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 185 units with 2,171 lines of code in units (54.7% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (100 lines of code)
    • 5 medium complex units (208 lines of code)
    • 25 simple units (560 lines of code)
    • 154 very simple units (1,303 lines of code)
0% | 4% | 9% | 25% | 60%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
js0% | 4% | 10% | 26% | 58%
ts0% | 0% | 0% | 12% | 87%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
packages/core/lib0% | 6% | 5% | 25% | 63%
packages/postgres/lib0% | 0% | 57% | 0% | 42%
packages/restify/lib0% | 0% | 100% | 0% | 0%
packages/mysql/lib0% | 0% | 16% | 36% | 47%
sdk_contrib/koa/lib0% | 0% | 0% | 100% | 0%
sdk_contrib/hapi/lib0% | 0% | 0% | 74% | 25%
packages/core/test-d0% | 0% | 0% | 0% | 100%
packages/postgres/test-d0% | 0% | 0% | 0% | 100%
packages/core0% | 0% | 0% | 0% | 100%
packages/full_sdk/lib0% | 0% | 0% | 0% | 100%
packages/mysql/test-d0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex 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 resolveArguments()
in packages/mysql/lib/mysql_p.js
30 18 1
function captureQuery()
in packages/postgres/lib/postgres_p.js
47 15 0
var completeListener = function()
in packages/core/lib/patchers/aws_p.js
30 12 1
enable: function enable()
in packages/restify/lib/restify_mw.js
44 12 2
16 10 1
shouldSample: function shouldSample()
in packages/core/lib/middleware/sampling/local_sampler.js
24 10 1
openSegment: function openSegment()
in sdk_contrib/koa/lib/koa_mw.js
49 10 1
function patchObject()
in packages/mysql/lib/mysql_p.js
17 9 1
function captureOperation()
in packages/mysql/lib/mysql_p.js
52 9 1
populateTraceData: function()
in packages/core/lib/utils.js
26 9 2
26 9 1
(function()()
in packages/core/lib/aws-xray.js
18 8 1
function captureDescriptors()
in packages/core/lib/patchers/call_capturer.js
19 8 3
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
Segment.prototype.addMetadata = function()
in packages/core/lib/segments/segment.js
17 7 3
static FromString()
in packages/core/lib/segments/attributes/trace_id.js
28 7 1
Subsegment.prototype.addAnnotation = function()
in packages/core/lib/segments/attributes/subsegment.js
13 7 2