Showing 28 of 38 total issues
Function onRetrieval
has a Cognitive Complexity of 107 (exceeds 5 allowed). Consider refactoring. Open
exports.onRetrieval = function(err, data, settings, time) {
var id = settings.id;
// Overwrite log function to additionally log to file
- 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 simplifiedAskCollection
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
exports.simplifiedAskCollection = function(obj, settings) {
var result = [];
var index = 0;
var transformSettings = settings.transformers.simplifiedAskCollection;
- 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 onRetrieval
has 125 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.onRetrieval = function(err, data, settings, time) {
var id = settings.id;
// Overwrite log function to additionally log to file
File fetch.js
has 364 lines of code (exceeds 250 allowed). Consider refactoring. Open
//////////////////////////////////////////
// REQUIREMENTS //
//////////////////////////////////////////
var _ = require('lodash');
Function registerRoutes
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.registerRoutes = function() {
var ws = exports.webserver;
var ds = exports.dataStore;
Function read
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
exports.read = function(dir) {
var fileList = fs.readdirSync(dir);
var returnObj = {
- 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 objDiff
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
exports.objDiff = function(settings, oldData, newData) {
var diff = {
startTime: settings.startTime,
lastChange: settings.statistics.lastChange || null,
- 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 exports
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(grunt) {
// Show elapsed time at the end
require('time-grunt')(grunt);
// Load all grunt tasks
Function objDiff
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.objDiff = function(settings, oldData, newData) {
var diff = {
startTime: settings.startTime,
lastChange: settings.statistics.lastChange || null,
Function simplifiedAsk
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
exports.simplifiedAsk = function(obj, settings) {
var result = {};
var transformSettings = settings.transformers.simplifiedAsk;
- 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 fetchAskQuery
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.fetchAskQuery = function(settings, callback) {
var id = settings.id;
// Overwrite log function to additionally log to file
Function simplifiedAskCollection
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.simplifiedAskCollection = function(obj, settings) {
var result = [];
var index = 0;
var transformSettings = settings.transformers.simplifiedAskCollection;
Function getCacheInfo
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.getCacheInfo = function(id, host) {
var ds = exports.dataStore;
var r = exports.requestSettings[id];
Function getCacheInfo
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
exports.getCacheInfo = function(id, host) {
var ds = exports.dataStore;
var r = exports.requestSettings[id];
- 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 processRequests
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
exports.processRequests = function(requestSettings) {
// Iterate over all requests, calculate their settings and run them in the defined intervals
for (var requestName in requestSettings) {
- 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 read
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.read = function(dir) {
var fileList = fs.readdirSync(dir);
var returnObj = {
Function processRequests
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.processRequests = function(requestSettings) {
// Iterate over all requests, calculate their settings and run them in the defined intervals
for (var requestName in requestSettings) {
Function sync
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.sync = function(settings, diff) {
var i;
var id;
var bulkJobs = '';
Function fetchGeneric
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.fetchGeneric = function(settings, callback) {
// Overwrite log function to additionally log to file
log = function(msg) {
semlog.log(msg);
Function init
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.init = function(settings, callback) {
var indexId = 'cacheur_' + settings.id.toLowerCase();
var elSettings = {