Showing 51 of 158 total issues
File index.js
has 1082 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint no-console: 0, max-len: 0 */
/* global _ */
// server-side startup
import grpc from '@grpc/grpc-js'
File address.js
has 931 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint no-console: 0 */
/* ^^^ remove once testing complete
*/
import JSONFormatter from 'json-formatter-js'
import qrlAddressValidator from '@theqrl/validate-qrl-address'
`` has 55 functions (exceeds 20 allowed). Consider refactoring. Open
Template.address.helpers({
bech32() {
return Session.equals('addressFormat', 'bech32')
},
address() {
File tx.js
has 486 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint no-console: 0 */
import JSONFormatter from 'json-formatter-js'
import './tx.html'
import CryptoJS from 'crypto-js'
import sha256 from 'sha256'
Function addressTransactions
has 168 lines of code (exceeds 25 allowed). Consider refactoring. Open
addressTransactions(request) {
check(request, Object)
console.log(`addressTransactions method called for ${request.tx.length} transactions`)
const targets = request.tx
const result = []
`` has 43 functions (exceeds 20 allowed). Consider refactoring. Open
Template.tx.helpers({
hasMessage() {
try {
if (this.tx.transfer.message_data.length > 0) {
return true
File cron.js
has 355 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint max-len: 0 */
/* global _ */
import { HTTP } from 'meteor/http'
import { JsonRoutes } from 'meteor/simple:json-routes'
import { SHA512 } from 'jscrypto/es6'
Function block
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
block(blockId) {
check(blockId, Number)
console.log(`block Method called for: ${blockId}`)
if (!(Match.test(blockId, Number)) || (Number.isNaN(blockId))) {
const errorCode = 400
Function helpersaddressTransactions
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
const helpersaddressTransactions = (response) => {
const output = []
// console.log(response)
_.each(response.transactions_detail, (tx) => {
const txEdited = tx
Function renderAddressBlock
has 80 lines of code (exceeds 25 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 }
Function renderChart
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function renderChart() {
// Get Chart data from Mongo
const chartLineData = homechart.findOne()
// Only render chart if we get valid data back
Function getTokenBalances
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
const getTokenBalances = (getAddress, callback) => {
const request = {
address: anyAddressToRaw(getAddress),
}
`` has 26 functions (exceeds 20 allowed). Consider refactoring. Open
Template.lasttx.helpers({
lasttx() {
const res = lasttx.findOne()
return res
},
Function refreshBlocks
has 68 lines of code (exceeds 25 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
Function refreshStats
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
function refreshStats() {
const res = Meteor.wrapAsync(getStats)({ include_timeseries: true })
// Save status object
status.remove({})
Function submit #notariseVerificationForm
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
'submit #notariseVerificationForm': (event) => {
event.preventDefault()
event.stopPropagation()
$('#documentVerified').hide()
Function getMultiSigAddressState
has a Cognitive Complexity of 16 (exceeds 5 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** ')
- 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 connectToNode
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
const connectToNode = (endpoint, callback) => {
// First check if there is an existing object to store the gRPC connection
if (qrlClient.hasOwnProperty(endpoint) === true) { // eslint-disable-line
console.log('Existing connection found for ', endpoint, ' - attempting getNodeState')
// There is already a gRPC object for this server stored.
Function submit #notariseVerificationForm
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
'submit #notariseVerificationForm': (event) => {
event.preventDefault()
event.stopPropagation()
$('#documentVerified').hide()
- 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 connectToNode
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
const connectToNode = (endpoint, callback) => {
// First check if there is an existing object to store the gRPC connection
if (qrlClient.hasOwnProperty(endpoint) === true) { // eslint-disable-line
console.log('Existing connection found for ', endpoint, ' - attempting getNodeState')
// There is already a gRPC object for this server stored.
- 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"