Showing 162 of 258 total issues
Function http
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
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 setup
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.setup = function(app) {
//main entry point
app.get('/ip', function(req, res) {
res.setHeader('Content-Type', 'application/javascript');
Function https
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
self.https = https.createServer(secureOptions, app).listen(self.options.secureport, self.options.bind || '0.0.0.0', function(err) {
/* istanbul ignore if */
if (err)
return callback(err);
Function parseDimension
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
Open
manager.parseDimension = function(context, d, callback) {
var col;
var dimension = {};
if (!d)
- 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 run
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
run: function (context, workspace, collection, callback) {
if (typeof collection === 'function') {
callback = collection;
collection = null;
}
Function run
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
run: function (context, workspace, collection, callback) {
if (typeof collection === 'function') {
callback = collection;
collection = null;
}
Function init
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
datastore.init = function(callback) {
//find out what datastores we have in config
var stores = joola.config.get('store:datastore');
if (!stores)
return callback(null);
Function checkRateLimits
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
auth.checkRateLimits = function (req, res, callback) {
var limitKey;
if (!req.user) {
limitKey = req.connection.remoteAddress;
req.limits = {
Function validateAction
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
auth.validateAction = function (action, req, res, callback) {
if (req.method == 'OPTIONS')
return process.nextTick(function () {
return callback(null, true);
});
Function processRequest
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
dispatch.processRequest = function (message, headers) {
message = message[0];
message = JSON.parse(message).message;
var _result;
Function once
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
Open
dispatch.once = function (channel, callback, next) {
callback = callback || function () {
};
var exists = _.find(dispatch.listeners, function (listener) {
- 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 run
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
run: function(context, workspace, collection, documents, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
Function ZKDiscoveryProvider
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function ZKDiscoveryProvider(options, helpers, callback) {
if (!(this instanceof ZKDiscoveryProvider)) return new ZKDiscoveryProvider(options, helpers, callback);
callback = callback || function () {
};
var self = this;
Function generateToken
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
auth.generateToken = function (req, user, callback) {
/* istanbul ignore if */
if (!callback) {
callback = user;
user = req;
File index.js
has 258 lines of code (exceeds 250 allowed). Consider refactoring. Open
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 parseDimension
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
manager.parseDimension = function(context, d, callback) {
var col;
var dimension = {};
if (!d)
Function load
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
etl.load = function(context, workspace, collection, documents, options, callback) {
joola.dispatch.collections.metadata(context, workspace, collection, ce.clone(documents[0]), function(err, meta, _collection) {
if (err)
return callback(err);
Function nodeState
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
joola.nodeState = function () {
var hostname = joola.hostname = os.hostname();
var osDetails = {
type: os.type(),
platform: os.platform(),
Function run
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
run: function(context, options, callback) {
callback = callback || function() {};
var wasArray = true;
if (!Array.isArray(options)) {
options = [options];
Function getUserByToken
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
auth.getUserByToken = function (token, callback) {
callback = callback || function () {
};
if (!token)
return process.nextTick(function () {