awslabs / serverless-fixity-for-digital-preservation-compliance
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 143 units with 1,269 lines of code in units (41.5% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (75 lines of code)
    • 9 simple units (272 lines of code)
    • 133 very simple units (922 lines of code)
0% | 0% | 5% | 21% | 72%
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% | 5% | 21% | 72%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
source/checksum/lib/api0% | 0% | 32% | 15% | 52%
source/checksum/lib/algorithm0% | 0% | 0% | 54% | 45%
source/checksum/lib/validation0% | 0% | 0% | 29% | 70%
source/checksum/lib/restore0% | 0% | 0% | 19% | 80%
source/checksum/lib/shared0% | 0% | 0% | 16% | 84%
source/custom-resources/lib/shared0% | 0% | 0% | 0% | 100%
source/custom-resources/lib/sns0% | 0% | 0% | 0% | 100%
source/custom-resources/lib/solution0% | 0% | 0% | 0% | 100%
source/checksum/lib/metrics0% | 0% | 0% | 0% | 100%
source/checksum/lib/sns0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
async onPOST()
in source/checksum/lib/api/index.js
75 24 0
async checkStatus()
in source/checksum/lib/restore/index.js
26 8 0
async onGET()
in source/checksum/lib/api/index.js
36 8 0
async bestGuessMD5()
in source/checksum/lib/validation/index.js
33 8 0
constructor()
in source/checksum/lib/shared/baseStateData.js
24 8 2
constructor()
in source/checksum/lib/validation/index.js
16 7 1
async compute()
in source/checksum/lib/algorithm/md5.js
50 7 0
async compute()
in source/checksum/lib/algorithm/sha1.js
60 7 0
constructor()
in source/checksum/lib/algorithm/base.js
10 7 2
async run()
in source/checksum/lib/validation/index.js
17 6 0
static async sendAnonymousData()
in source/custom-resources/lib/solution/metrics.js
38 5 2
async send()
in source/custom-resources/lib/shared/cfResponse.js
57 5 2
reverseLookup()
in source/checksum/lib/restore/index.js
21 5 1
getCORS()
in source/checksum/lib/api/index.js
11 5 0
static isValidBucket()
in source/checksum/lib/api/index.js
9 5 1
async request()
in source/checksum/lib/api/index.js
22 5 0
async initLib()
in source/checksum/lib/algorithm/base.js
25 5 0
static async sendAnonymousData()
in source/checksum/lib/metrics/index.js
38 5 2
storeResponseData()
in source/custom-resources/lib/shared/mxBaseResponse.js
10 4 2
constructor()
in source/checksum/lib/restore/index.js
14 4 1