awslabs / amazon-s3-glacier-refreezer
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 134 units with 3,202 lines of code in units (80.8% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (50 lines of code)
    • 2 medium complex units (168 lines of code)
    • 4 simple units (113 lines of code)
    • 127 very simple units (2,871 lines of code)
0% | 1% | 5% | 3% | 89%
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% | 2% | 9% | 6% | 80%
ts0% | 0% | 0% | 0% | 100%
py0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
source/lambda/postMetrics0% | 52% | 0% | 0% | 47%
source/lambda/requestArchives0% | 0% | 41% | 8% | 50%
source/lambda/requestInventory0% | 0% | 34% | 0% | 65%
source/lambda/copyToDestinationBucket0% | 0% | 0% | 19% | 80%
source/lambda/calculateTreehash0% | 0% | 0% | 8% | 91%
source/lambda/calculateMetrics0% | 0% | 0% | 36% | 64%
source/lib0% | 0% | 0% | 0% | 100%
source/lambda/copyChunk0% | 0% | 0% | 0% | 100%
source/lambda/splitArchive0% | 0% | 0% | 0% | 100%
source/lambda/sendAnonymousStats0% | 0% | 0% | 0% | 100%
source/lambda/deployGlueJobScript0% | 0% | 0% | 0% | 100%
source/lambda/downloadInventory0% | 0% | 0% | 0% | 100%
source/lambda/toLowercase0% | 0% | 0% | 0% | 100%
source/lambda/generateUuid0% | 0% | 0% | 0% | 100%
source/lambda/downloadInventoryPart0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
async function handler()
in source/lambda/postMetrics/index.js
50 40 0
async function handler()
in source/lambda/requestInventory/index.js
67 13 2
async function handler()
in source/lambda/requestArchives/index.js
101 11 1
async function handler()
in source/lambda/calculateTreehash/index.js
32 9 1
async function handler()
in source/lambda/calculateMetrics/index.js
27 7 1
function detectAndParseDescription()
in source/lambda/requestArchives/lib/filenameparser.js
20 7 1
async function copyMultiPart()
in source/lambda/copyToDestinationBucket/lib/copy.js
34 6 6
async function multiChunkCopy()
in source/lambda/copyChunk/index.js
34 5 9
for await()
in source/lambda/calculateTreehash/lib/treehash.js
31 5 1
function computeSHA256TreeHash()
in source/lambda/calculateTreehash/lib/treehash.js
20 5 1
async function validateTreehash()
in source/lambda/calculateTreehash/index.js
25 5 2
async function handler()
in source/lambda/copyChunk/index.js
24 4 3
function checkField()
in source/lambda/calculateMetrics/lib/dynamo.js
7 4 2
function getIncrementBytes()
in source/lambda/calculateMetrics/lib/dynamo.js
7 4 2
async function getPartitionMaxProcessedFileNumber()
in source/lambda/requestArchives/lib/db.js
26 4 1
function parseFileName()
in source/lambda/requestArchives/lib/filenameparser.js
12 4 2
async function publishMetric()
in source/lambda/postMetrics/lib/metrics.js
27 4 1
async function getItem()
in source/lambda/postMetrics/lib/dynamo.js
19 4 1
async function copyKeyToDestinationBucket()
in source/lambda/copyToDestinationBucket/lib/copy.js
22 4 6
constructor()
in source/lib/stage-two-orchestrator.ts
222 3 3