Showing 162 of 258 total issues
File query.js
has 877 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 start
has 424 lines of code (exceeds 25 allowed). Consider refactoring. Open
webserver.start = function(options, callback) {
var self = webserver;
if (options.webserver_app) {
joola.logger.warn('Using an external WebServer application.');
Function _route
has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring. Open
_route: function(req, res) {
var _token = req.token;
var lastQueryEndDate;
var timestampDimension;
var _params = {
- 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 start
has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring. Open
webserver.start = function(options, callback) {
var self = webserver;
if (options.webserver_app) {
joola.logger.warn('Using an external WebServer application.');
- 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 auth.js
has 544 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* @title joola/lib/common/auth
* @overview Provides authentication functionality across the framework.
* @description
* The `auth` module and middleware manages the entire flow relating to authentication, for example: login and token validation.
File index.js
has 540 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 init
has 194 lines of code (exceeds 25 allowed). Consider refactoring. Open
dispatch.init = function (callback) {
try {
var self = dispatch;
self.namespace = 'dispatch';
File index.js
has 474 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 translateTimeframe
has 178 lines of code (exceeds 25 allowed). Consider refactoring. Open
manager.translateTimeframe = function(timeframe, interval) {
var _enddate = new Date();
//_enddate.setMilliseconds(0);
//_enddate.setSeconds(_enddate.getSeconds() - 1);
var _startdate = new Date(_enddate);
Function run
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
run: function (context, workspace, collection, document, callback) {
callback = callback || function () {
};
if (context.user.workspace !== workspace && context.user.permissions.indexOf('superuser') === -1) {
- 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 _route
has 152 lines of code (exceeds 25 allowed). Consider refactoring. Open
_route: function(req, res) {
var _token = req.token;
var lastQueryEndDate;
var timestampDimension;
var _params = {
Function verify
has 145 lines of code (exceeds 25 allowed). Consider refactoring. Open
etl.verify = function(context, workspace, collection, documents, callback) {
var _document;
if (!Array.isArray(documents))
documents = [documents];
Function init
has 126 lines of code (exceeds 25 allowed). Consider refactoring. Open
joola.init = function (options, callback) {
/* istanbul ignore if */
if (typeof callback !== 'function')
callback = function () {
};
File beacon.js
has 370 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 formatResults
has 118 lines of code (exceeds 25 allowed). Consider refactoring. Open
manager.formatResults = function(results, callback) {
var query = results.queryplan.query;
results.documents = results.documents || [];
results.dimensions = results.dimensions || query.dimensions;
File collections.js
has 361 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* @title joola.collections
* @description
* joola uses the concept of `collections` to organize documents into logical sections.
* [[Collections]] include definitions on metrics, dimensions and other attributes. that instruct joola on how to
Function run
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
run: function (context, workspace, collection, document, callback) {
callback = callback || function () {
};
if (context.user.workspace !== workspace && context.user.permissions.indexOf('superuser') === -1) {
Function startHTTPS
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
var startHTTPS = function(callback) {
var secureOptions;
joola.logger.debug('Loading SSL certificates: ' + self.options.keyfile + ', ' + self.options.certfile);
/* istanbul ignore if */
File users.js
has 347 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* @title joola/lib/dispatch/users
* @overview Provides user management functionality across the framework.
* @description
* The `users` dispatch manages the entire flow relating to users, for example: listing or adding a user.
Function middleware
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
auth.middleware = function (req, res, next) {
var debug = {};
var parts = url.parse(req.url);
//TODO: Add header to SDK