Showing 36 of 58 total issues
Function Connection
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
function Connection(req, res, next) {
var response = '';
var headers = {};
var status = 200;
- Read upRead up
- Create a ticketCreate a ticket
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 Connection
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Connection(req, res, next) {
var response = '';
var headers = {};
var status = 200;
- Create a ticketCreate a ticket
Function legacy
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
router.legacy = function() {
var action = require('./action');
var fs = require('fs-extra');
var name, path, route, routes, verb, expressVerb;
- Read upRead up
- Create a ticketCreate a ticket
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 MemoryModel
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
function MemoryModel() {
var storage = [];
var lastID = 0;
console.warn("WARNING: You are using MemoryModel as the base for " + this.constructor.name);
- Create a ticketCreate a ticket
Function EndpointController
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
function EndpointController(connection) {
var application = require('./../../../index').application;
this.connection = connection;
this.view = this.name = this.constructor.name;
- Create a ticketCreate a ticket
Function AccessControl
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
var AccessControl = (function() {
var rules = {};
return {
addRules: function (controller, imported) {
- Create a ticketCreate a ticket
Function editForm
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
WebEndpointController.prototype.editForm = function(params, readyCallback) {
var item;
if (this.model) {
item = {};
- Create a ticketCreate a ticket
Function checkAccess
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
checkAccess: function (action, connection, callback) {
action = action_helpers.parse(action);
if (typeof(action) === 'string') {
action = {
- Create a ticketCreate a ticket
Function edit
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
ResourceEndpointController.prototype.edit = function(item, readyCallback) {
if (this.model){
async.waterfall([
function(next) {
var modelField;
- Read upRead up
- Create a ticketCreate a ticket
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 create_view
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
function create_view(options, skeletons) {
var Model;
var Controller;
var current_dir = process.cwd();
- Create a ticketCreate a ticket
Function processWrangler
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function processWrangler(minProcs, maxSpares, respawnDelay, cb) {
var crashing = false;
minProcs = minProcs || require('os').cpus().length;
maxSpares = maxSpares || Math.ceil(minProcs / 2); //Still not
respawnDelay = respawnDelay || 1000;
- Create a ticketCreate a ticket
Function edit
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
RestEndpointController.prototype.edit = function(params, readyCallback) {
if (this.model){
async.waterfall([
function(next) {
var item = {};
- Create a ticketCreate a ticket
Function ModelBase
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ModelBase() {
//Item constructor.
//Returns an empty Item as stored by this model.
this.Item = this.Item || function() {
this._id = undefined;
- Create a ticketCreate a ticket
Function drive
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function drive() {
require(process.cwd() + '/application/init.js');
if (cluster.isMaster && !config.testing) {
driver.fork(function(err, workers) {
- Create a ticketCreate a ticket
Function MemoryModel
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function MemoryModel() {
var storage = [];
var lastID = 0;
console.warn("WARNING: You are using MemoryModel as the base for " + this.constructor.name);
- Read upRead up
- Create a ticketCreate a ticket
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 ModelBase
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function ModelBase() {
//Item constructor.
//Returns an empty Item as stored by this model.
this.Item = this.Item || function() {
this._id = undefined;
- Read upRead up
- Create a ticketCreate a ticket
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 edit
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
ResourceEndpointController.prototype.edit = function(item, readyCallback) {
if (this.model){
async.waterfall([
function(next) {
var modelField;
- Create a ticketCreate a ticket
Function create
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
RestEndpointController.prototype.create = function(params, readyCallback) {
if (this.model) {
async.waterfall([
function(next) {
this.model.create(next);
- Create a ticketCreate a ticket
Function create
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
ResourceEndpointController.prototype.create = function(readyCallback) {
if (this.model) {
async.waterfall([
function(next) {
this.model.create(next);
- Create a ticketCreate a ticket
Function AccessControl
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
var AccessControl = (function() {
var rules = {};
return {
addRules: function (controller, imported) {
- Read upRead up
- Create a ticketCreate a ticket
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"