Showing 162 of 258 total issues
Function handleSocketIOConnection
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
var handleSocketIOConnection = function(socket) {
joola.connectCounter++;
socket.on('error', function(err) {
joola.events.emit('event_end');
Function _route
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
_route: function(req, res) {
var _params = {}; //req.parsed;
var context = {};
context.user = req.user;
_params.workspace = context.user.workspace;
- 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 parse
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
manager.parse = function(context, options, callback) {
var query = joola.common.extend({}, options);
if (!query.dimensions)
query.dimensions = [];
- 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 onevent
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
socket.onevent = function(packet) {
var d = domain.create();
var req = {};
var res = {};
Function startHTTP
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
var startHTTP = function(callback) {
self.http = http.createServer(app).listen(self.options.port, self.options.bind || '0.0.0.0', function(err) {
/* istanbul ignore if */
if (err)
return callback(err);
Function init
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
config.init = function(callback) {
var self = this;
config.initialized = false;
//base config object, following the require config has been parsed and available for the local node. May differ from central.
config._config = require('config');
Function init
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
dispatch.init = function (callback) {
try {
var self = dispatch;
self.namespace = 'dispatch';
- 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 request
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
var request = function(firstRun, callback) {
//_params.options.timeframe.end.setMilliseconds(0);
if (!firstRun && lastQueryEndDate && timestampDimension) {
_params.options[0].timeframe_force_start = lastQueryEndDate;
Function parse
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
manager.parse = function(context, options, callback) {
var query = joola.common.extend({}, options);
if (!query.dimensions)
query.dimensions = [];
Function sanitize
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
common.sanitize = function (obj, proto, leavePrivate) {
var cleanup = function (elem) {
var result = {};
Object.keys(elem).forEach(function (key) {
if (!leavePrivate) {
- 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 system.js
has 294 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* @title joola
* @overview the open-source data analytics framework
* @copyright Joola Smart Solutions, Ltd. <info@joo.la>
* @license GPL-3.0+ <http://spdx.org/licenses/GPL-3.0+>
Function router
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.router = function(req, res, next) {
//check the request should be terminated, signaled by prior middleware
/* istanbul ignore if */
if (req.terminate)
return res.end();
Function walkObject
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
var walkObject = function (_shadow, obj) {
try {
Object.keys(obj).forEach(function (key) {
var elem = obj[key];
Function stompConnect
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
var stompConnect = function () {
var stompArgs = {
host: stompSettings.host,
port: stompSettings.port,
login: stompSettings.user,
Function validateToken
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
auth.validateToken = function (req, token, APIToken, callback) {
if (!callback) {
callback = APIToken;
APIToken = token;
token = req;
- 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 parseMetric
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
manager.parseMetric = function(context, m, callback) {
var col;
var metric = {};
var metricIndex = m.index;
- 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 validateToken
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
auth.validateToken = function (req, token, APIToken, callback) {
if (!callback) {
callback = APIToken;
APIToken = token;
token = req;
Function parseMetric
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
manager.parseMetric = function(context, m, callback) {
var col;
var metric = {};
var metricIndex = m.index;
Function middleware
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
auth.middleware = function (req, res, next) {
var debug = {};
var parts = url.parse(req.url);
//TODO: Add header to SDK
- 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 flatGetSet
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
common.flatGetSet = function (obj, is, value) {
if (typeof is == 'string') {
return common.flatGetSet(obj, is.split('.'), value);
}
else if (is.length == 1 && value !== undefined) {
- 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"