awslabs / aws-api-gateway-developer-portal
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 304 units with 3,022 lines of code in units (28.9% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 6 medium complex units (323 lines of code)
    • 30 simple units (546 lines of code)
    • 268 very simple units (2,153 lines of code)
0% | 0% | 10% | 18% | 71%
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% | 0% | 10% | 18% | 71%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
lambdas/static-asset-uploader0% | 0% | 12% | 17% | 69%
dev-portal/public0% | 0% | 14% | 19% | 65%
scripts/internal0% | 0% | 35% | 17% | 47%
scripts0% | 0% | 14% | 0% | 85%
lambdas/catalog-updater0% | 0% | 0% | 59% | 40%
lambdas0% | 0% | 0% | 51% | 48%
lambdas/user-group-importer0% | 0% | 0% | 30% | 69%
lambdas/user-group-exporter-v30% | 0% | 0% | 39% | 60%
dev-portal/src0% | 0% | 0% | 5% | 94%
lambdas/backend0% | 0% | 0% | 0% | 100%
lambdas/listener0% | 0% | 0% | 0% | 100%
lambdas/cfn-cognito-user-pools-domain0% | 0% | 0% | 0% | 100%
lambdas/cloudfront-security0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
function supportsColor()
in scripts/internal/supports-color.js
52 22 1
awsSigV4Client.makeRequest = function()
in dev-portal/public/apigateway-js-sdk/lib/apiGatewayCore/sigV4Client.js
59 14 1
awsSigV4Client.makeRequest = function()
in lambdas/static-asset-uploader/build/apigateway-js-sdk/lib/apiGatewayCore/sigV4Client.js
59 14 1
apigClientFactory.newClient = function()
in dev-portal/public/apigateway-js-sdk/apigClient.js
59 13 1
apigClientFactory.newClient = function()
in lambdas/static-asset-uploader/build/apigateway-js-sdk/apigClient.js
59 13 1
35 13 2
apiGatewayClient.makeRequest = function()
in dev-portal/public/apigateway-js-sdk/lib/apiGatewayCore/apiGatewayClient.js
16 10 4
apiGatewayClient.makeRequest = function()
in lambdas/static-asset-uploader/build/apigateway-js-sdk/lib/apiGatewayCore/apiGatewayClient.js
16 10 4
Expression.build = function()
in dev-portal/public/apigateway-js-sdk/lib/url-template/url-template.js
15 9 2
mergeInto: function()
in dev-portal/public/apigateway-js-sdk/lib/apiGatewayCore/utils.js
12 9 2
Expression.build = function()
in lambdas/static-asset-uploader/build/apigateway-js-sdk/lib/url-template/url-template.js
15 9 2
mergeInto: function()
in lambdas/static-asset-uploader/build/apigateway-js-sdk/lib/apiGatewayCore/utils.js
12 9 2
function copyAnyMethod()
in lambdas/catalog-updater/index.js
15 9 1
async function run()
in scripts/internal/util.js
14 9 5
async function processUser()
in lambdas/user-group-exporter-v3/index.js
29 8 1
function bindMock()
in lambdas/setup-jest.js
26 8 0
function makeColor()
in scripts/internal/color.js
11 8 1
export function getApi()
in dev-portal/src/services/api-catalog.js
19 7 4
function addLabeled()
in dev-portal/public/apigateway-js-sdk/lib/url-template/url-template.js
8 7 4
simpleHttpClient.makeRequest = function()
in dev-portal/public/apigateway-js-sdk/lib/apiGatewayCore/simpleHttpClient.js
35 7 1