Showing 51 of 158 total issues
Function txhash
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
txhash(txId) {
check(txId, String)
console.log(`txhash method called for: ${txId}`)
// avoid blocking other method calls from same client - *may need to remove for production*
this.unblock()
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function refreshBlocks
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const refreshBlocks = () => {
const request = { filter: 'BLOCKHEADERS', offset: 0, quantity: 10 }
const response = Meteor.wrapAsync(getLatestData)(request)
// identify miner and calculate total transacted in block
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function refreshLasttx
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function refreshLasttx() {
// First get confirmed transactions
const confirmed = Meteor.wrapAsync(getLatestData)({ filter: 'TRANSACTIONS', offset: 0, quantity: 10 })
// Now get unconfirmed transactions
Function getMultiSigAddressState
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
const getMultiSigAddressState = (request, callback) => {
try {
qrlApi('GetMultiSigAddressState', request, (error, response) => {
if (error) {
const myError = errorCallback(error, 'Cannot access API/GetMultiSigAddressState', '**ERROR/getMultiSigAddressState** ')
Function addressTransactions
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
addressTransactions() {
try {
const transactions = []
const thisAddress = rawAddressToB32Address(
Session.get('address').state.address
Function loadGrpcClient
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
const loadGrpcClient = (endpoint, callback) => {
// Load qrlbase.proto and fetch current qrl.proto from node
const options = {
keepCase: true,
longs: String,
Function click .themeToggle
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
'click .themeToggle': () => {
try {
const x = LocalStore.get('theme')
if (x === 'dark') {
LocalStore.set('theme', 'light')
Function renderTxBlock
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderTxBlock = () => {
const txId = FlowRouter.getParam('txId')
if (txId) {
Meteor.call('txhash', txId, (err, res) => {
if (err) {
Function txhash
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
txhash(txId) {
check(txId, String)
console.log(`txhash method called for: ${txId}`)
// avoid blocking other method calls from same client - *may need to remove for production*
this.unblock()
Function click .pagination
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
'click .pagination': (event) => {
let b = 0
Session.set('addressTransactions', {})
if (parseInt(event.target.text, 10)) {
b = parseInt(event.target.text, 10)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function click .pagination
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
'click .pagination': (event) => {
let b = 0
Session.set('addressTransactions', {})
if (parseInt(event.target.text, 10)) {
b = parseInt(event.target.text, 10)
Function loadAddressTransactions
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function loadAddressTransactions(aId, page) {
Session.set('addressTransactions', [])
$('#loadingTransactions').show()
// console.log('Getting transactions for page ', page)
const addresstx = anyAddressToRaw(aId)
Avoid deeply nested control flow statements. Open
if (!(res.state.address)) {
res.state.address = aId
}
Avoid deeply nested control flow statements. Open
if (parseInt(res.state.txcount, 10) === 0 && parseInt(res.state.nonce, 10) === 0) {
res.state.empty_warning = true
} else {
res.state.empty_warning = false
}
Avoid deeply nested control flow statements. Open
if (symbol.slice(0, 8) === '00ff00ff') {
const nftBytes = Buffer.concat([
Buffer.from(tokenDetails.symbol),
Buffer.from(tokenDetails.name),
])
Avoid deeply nested control flow statements. Open
while (pages.length !== numPages) {
pages.push({
number: pages.length + 1,
from: ((pages.length + 1) * 10) + 1,
to: ((pages.length + 1) * 10) + 10,
Function pages
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
pages() {
let ret = []
const active = Session.get('active')
if (Session.get('pages').length > 0) {
ret = Session.get('pages')
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function getAddressState
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const getAddressState = (request, callback) => {
try {
qrlApi('GetOptimizedAddressState', request, (error, response) => {
if (error || response.state === null) {
const myError = errorCallback(
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function makeTxHumanReadable
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const makeTxHumanReadable = (item) => {
if (item.found !== false) {
let output
if (item.transaction.tx.transactionType === 'transfer_token') {
try {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function renderAddressBlock
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const renderAddressBlock = () => {
const aId = upperCaseFirst(FlowRouter.getParam('aId'))
let tPage = FlowRouter.getParam('tPage')
tPage = parseInt(tPage, 10)
if (!tPage) { tPage = 1 }
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"