Showing 151 of 151 total issues
Function getNotifications
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getNotifications(account, urlBase, options, callback) {
validate.address(account);
var self = this;
File routes.js
has 271 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
var _ = require('lodash');
var api = require('./api');
var respond = require('./response-handler');
var config = require('./config');
Function getAccountTransactions
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getAccountTransactions(api, options, callback) {
try {
validate.address(options.account);
} catch(err) {
return callback(err);
Function parseOrderFromTx
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
function parseOrderFromTx(tx, options) {
if (!options.account) {
throw new Error('Internal Error. must supply options.account');
}
if (tx.TransactionType !== 'OfferCreate'
Function getAccountTransactions
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
function getAccountTransactions(api, options, callback) {
try {
validate.address(options.account);
} catch(err) {
return callback(err);
- 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 getNotificationHelper
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getNotificationHelper(api, account, identifier, urlBase, topCallback) {
function getTransaction(callback) {
try {
transactions.getTransaction(api, account, identifier, {}, callback);
Function parse
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
NotificationParser.prototype.parse = function(notification_details, urlBase) {
var transaction = notification_details.transaction;
var account = notification_details.account;
var previous_transaction_identifier =
notification_details.previous_transaction_identifier;
- 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 setTransactionFields
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
function setTransactionFields(transaction, input, fieldSchema) {
for (var fieldName in fieldSchema) {
var field = fieldSchema[fieldName];
var value = input[field.name];
- 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 getAccountLines
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getAccountLines(prevResult) {
var isAggregate = options.limit === 'all';
if (prevResult && (!isAggregate || !prevResult.marker)) {
return Promise.resolve(prevResult);
}
Function attachPreviousAndNextTransactionIdentifiers
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
function attachPreviousAndNextTransactionIdentifiers(api,
notificationDetails, topCallback) {
// Get all of the transactions affecting the specified
// account in the given ledger. This is done so that
- 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 parsePaymentFromTx
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
function parsePaymentFromTx(account, message, meta) {
if (!account) {
throw new Error('Internal Error. must supply options.account');
}
- 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 validateSettings
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
function validateSettings(settings) {
if (typeof settings !== 'object') {
throw error('Invalid parameter: settings');
}
if (!/(undefined|string)/.test(typeof settings.domain)) {
File orders.js
has 252 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* globals Promise: true */
/* eslint-disable valid-jsdoc */
'use strict';
var _ = require('lodash');
var asyncify = require('simple-asyncify');
Function getLineBalances
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getLineBalances(prevResult) {
var isAggregate = options.limit === 'all';
if (prevResult && (!isAggregate || !prevResult.marker)) {
return Promise.resolve(prevResult);
}
Function promise
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
var promise = new Promise(function(resolve, reject) {
var accountLinesRequest;
var marker;
var ledger;
var limit;
Function getOrders
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function getOrders(account, options, callback) {
var self = this;
validate.address(account);
validate.options(options);
- 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 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getAccountPayments(account, source_account, destination_account,
direction, options, callback) {
var self = this;
function getTransactions(_callback) {
Function createRemote
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createRemote(options) {
var remote = new ripple.Remote(options);
if (options.mock) {
return remote;
}
Function parsePaymentFromTx
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function parsePaymentFromTx(account, message, meta) {
if (!account) {
throw new Error('Internal Error. must supply options.account');
}
Function promise
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
var promise = new Promise(function(resolve, reject) {
var accountLinesRequest;
var marker;
var ledger;
var limit;