aws-samples / non-profit-blockchain
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 214 units with 2,995 lines of code in units (21.7% of code).
    • 0 very complex units (0 lines of code)
    • 3 complex units (558 lines of code)
    • 4 medium complex units (303 lines of code)
    • 8 simple units (172 lines of code)
    • 199 very simple units (1,962 lines of code)
0% | 18% | 10% | 5% | 65%
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% | 26% | 14% | 1% | 57%
ts0% | 0% | 0% | 15% | 84%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ngo-identity/chaincode0% | 33% | 10% | 0% | 56%
ngo-events/chaincode0% | 35% | 10% | 0% | 53%
ngo-chaincode/src0% | 36% | 11% | 0% | 52%
ngo-lambda/src0% | 0% | 43% | 10% | 46%
ngo-ui/src0% | 0% | 0% | 15% | 84%
ngo-events/listener0% | 0% | 0% | 0% | 100%
ngo-rest-api0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
async function allocateSpend()
in ngo-identity/chaincode/src/ngo.js
186 38 2
async function allocateSpend()
in ngo-events/chaincode/src/ngo.js
186 38 2
async function allocateSpend()
in ngo-chaincode/src/ngo.js
186 38 2
async function invokeChaincode()
in ngo-lambda/src/invoke.js
129 15 1
async function queryByString()
in ngo-identity/chaincode/src/ngo.js
58 14 2
async function queryByString()
in ngo-events/chaincode/src/ngo.js
58 14 2
async function queryByString()
in ngo-chaincode/src/ngo.js
58 14 2
async function handler()
in ngo-lambda/src/index.js
31 9 3
populate()
in ngo-ui/src/app/services/shared/donor.service.ts
29 7 0
getNGOFundsDetails()
in ngo-ui/src/app/ui/ngos-list/ngos-list.component.ts
27 6 1
getNGOFundsDetails()
in ngo-ui/src/app/ui/ngo-details/ngo-details.component.ts
27 6 1
private static parentElement()
in ngo-ui/src/app/ui/components/blockchain-progress/blockchain-progress.component.ts
15 6 2
private static getTranslateValue()
in ngo-ui/src/app/ui/components/blockchain-progress/blockchain-progress.component.ts
17 6 1
private static minLapse()
in ngo-ui/src/app/ui/components/blockchain-progress/blockchain-progress.component.ts
11 6 1
private initView()
in ngo-ui/src/app/ui/components/blockchain-progress/blockchain-progress.component.ts
15 6 0
async createDonation()
in ngo-identity/chaincode/src/ngo.js
35 5 2
setRatings()
in ngo-ui/src/app/ui/ngos-list/ngos-list.component.ts
18 5 1
setRatings()
in ngo-ui/src/app/ui/ngo-details/ngo-details.component.ts
23 5 1
updateData()
in ngo-ui/src/app/ui/shared/blockchain/blockchain.component.ts
14 5 1
userDonationsJsonAdopter()
in ngo-ui/src/app/services/dashboard.service.ts
23 5 1