withdraw
26 console.log('Database Connected');
27})
28
29async function withdraw() { 30
31 let data
32
getWeb3
1const Web3 = require('web3')
2const { oracleRpcUrl, httpRpcUrl, wsRpcUrl } = require('./config')
3const getWeb3 = (type = 'http') => { 4 let url
5 switch (type) {
6 case 'oracle':
withdraw
122 attempts += 1;
123}
124
125async function withdraw(req, res) {126
127 let data
128
updateData
102 }
103}
104
105async function updateData(res, response, txBlockNumber) {106
107 const currentBlockNumber = await web3.eth.getBlockNumber()
108 const confirmations = currentBlockNumber - txBlockNumber
It is recommended to have documentation comments above, or right inside a function/class declaration. This helps developers, users and even the author understand the purpose of a code snippet or API function in the future.
NOTE: If you want to stop this issue from getting raised on certain constructs (arrow functions, class expressions, methods etc.), consider using the skipdoccoverage option under the analyzers.meta
property in your .deepsource.toml
file.
For example, the following configuration will silence this issue for class expressions and method definitions:
[analyzers.meta]
skip_doc_coverage = ["class-expression", "method-definition"]
function sum(a, b) {
return a + b;
}
/**
* Function to add two numbers
* @param a The first number to add
* @param b The second number to add
* @returns The sum of two numbers
*/
function sum(a, b) {
return a + b;
}