api/payments.js
Function getPathFind
has 137 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getPathFind(source_account, destination_account,
destination_amount_string, source_currency_strings, callback) {
var self = this;
var destination_amount = renameCounterpartyToIssuer(
Function getPathFind
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
Open
function getPathFind(source_account, destination_account,
destination_amount_string, source_currency_strings, callback) {
var self = this;
var destination_amount = renameCounterpartyToIssuer(
- 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
File payments.js
has 292 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* eslint-disable valid-jsdoc */
'use strict';
var _ = require('lodash');
var async = require('async');
Function getAccountPayments
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getAccountPayments(account, source_account, destination_account,
direction, options, callback) {
var self = this;
function getTransactions(_callback) {
Function submitPayment
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function submitPayment(account, payment, clientResourceID, secret,
urlBase, options, callback) {
function formatTransactionResponse(message, meta) {
if (meta.state === 'validated') {
Function submitPayment
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function submitPayment(account, payment, clientResourceID, secret,
urlBase, options, callback) {
Function submitPayment
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
function submitPayment(account, payment, clientResourceID, secret,
urlBase, options, callback) {
function formatTransactionResponse(message, meta) {
if (meta.state === 'validated') {
- 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 getAccountPayments
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function getAccountPayments(account, source_account, destination_account,
direction, options, callback) {
Function getPathFind
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function getPathFind(source_account, destination_account,
destination_amount_string, source_currency_strings, callback) {