Showing 26 of 40 total issues
Function prepareQueryValues
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
function prepareQueryValues(resultSet) {
//
// Prepare parametrized query
//
Function upsertRegionStats
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function upsertRegionStats(resultSet, callback) {
var queryValues = prepareQueryValues(resultSet);
// Get connection from pool
Function upsertRegionStatHistory
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function upsertRegionStatHistory(resultSet, callback) {
var queryValues = prepareQueryValues(resultSet);
// Get connection from pool
Function handleResponse
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function handleResponse(task, callback, error, response, body) {
//
// Parse response, filter and store it
//
- 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 prepareQueryValues
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function prepareQueryValues(resultSet) {
//
// Prepare parametrized query for history upsert
//
Function getOrderObjects
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function getOrderObjects(marketData) {
//
// Takes parsed UUDIF messages and converts them into sanitized JS objects
//
- 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 prepareQueryValues
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
function prepareQueryValues(resultSet) {
//
// Prepare parametrized query
//
Function handleResponse
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
function handleResponse(task, callback, error, response, body) {
//
// Parse response, filter and store it
//
Function getStatisticalInformation
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getStatisticalInformation(regionID, typeID, callback) {
//
// Return statistical properties of given region/type pair
//
Function exports
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports = module.exports = function(resultSet, callback) {
//
// Reduces dataset to neccessary datapoints missing in DB
//
Function calculateSums
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function calculateSums(metrics, data) {
//
// Summarizes ask/bid prices and volumes
//
- 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 processOrder
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function processOrder(order) {
//
// Calculate whether order is suspicious which is an arbitrary definition.
// Any orders that are outside config.stdDevRejectionMultiplier standard deviations
// of the mean AND where there are more than 5 orders of like type in the region will be flagged.
- 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 performCalculations
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function performCalculations(data, prices, callback) {
//
// Calculates statistical properties of prices
//
Function composeQuery
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function composeQuery(objects) {
// Concatenate upsert query
var query = 'INSERT INTO market_data_orders AS orders (generated_at, ' +
'price, ' +
Function prepareQueryValues
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function prepareQueryValues(resultSet) {
//
// Prepare parametrized query
//
Function exports
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports = module.exports = function(message, callback) {
//
// Inflates and parses the message
//
Avoid deeply nested control flow statements. Open
if (!error.severity === 0) {
error.module = 'crestHistoryAgentRequest';
// Log Errors
console.error(error);
Function deactivateSelected
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function deactivateSelected(resultSet, callback) {
//
// Deactivate selected orders of region/type pairs in resultSet
//
- 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 handleResponse
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function handleResponse(task, callback, error, response, body) {
Function exports
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
exports = module.exports = function(resultSet, callback) {
//
// Splits multi region/type messages into multiple individual resultSets
//
- 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"