Showing 36 of 58 total issues
Function turnpikeSession
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
SessionWrapper.turnpikeSession = function() {
var settings = { secret: GlobalConfig.session_secret };
var engine = function(req, res, next) {console.log('no session engine');next();};
var session = require('express-session');
var express_session;
- Create a ticketCreate a ticket
Function ViewBuilder
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ViewBuilder(files) {
//list contents of path, and for each .jade file add an available mode.
var modes = {};
var i;
- Create a ticketCreate a ticket
Function do_project
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
TurnpikeCreate.prototype.do_project = function(subcmd, opts, name, cb) {
var project = {};
var pkg = {};
var turnpike_pkg = fs.readJsonSync(path.join(moddir, 'package.json'));
var config = {};
- Create a ticketCreate a ticket
Function legacy
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
router.legacy = function() {
var action = require('./action');
var fs = require('fs-extra');
var name, path, route, routes, verb, expressVerb;
- Create a ticketCreate a ticket
Function index
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
RestEndpointController.prototype.index = function(params, readyCallback) {
if (this.model){
var skip = this.connection.req.query.index || 0;
var search = {};
- Create a ticketCreate a ticket
Function domain_wrapper
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function domain_wrapper(server) {
return function(req, res, next) {
req.domain = domain.create();
req.domain.on('error', function(er) {
- Create a ticketCreate a ticket
Function create_view
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function create_view(options, skeletons) {
var Model;
var Controller;
var current_dir = process.cwd();
- 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
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
RestEndpointController.prototype.create = function(params, readyCallback) {
if (this.model) {
async.waterfall([
function(next) {
this.model.create(next);
- 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
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
ResourceEndpointController.prototype.create = function(readyCallback) {
if (this.model) {
async.waterfall([
function(next) {
this.model.create(next);
- 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
Avoid deeply nested control flow statements. Open
for (verb in route) if (route.hasOwnProperty(verb)) {
if (verb === 'DEL') expressVerb = 'delete';
else expressVerb = verb.toLowerCase();
path[expressVerb](action.accessChecked(route[verb]));
- Create a ticketCreate a ticket
Function index
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
ResourceEndpointController.prototype.index = function(readyCallback) {
if (this.model){
var skip = this.connection.req.query.index || 0;
var params = {};
- 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 ViewBuilder
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function ViewBuilder(files) {
//list contents of path, and for each .jade file add an available mode.
var modes = {};
var i;
- 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 index
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
RestEndpointController.prototype.index = function(params, readyCallback) {
if (this.model){
var skip = this.connection.req.query.index || 0;
var search = {};
- 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 EndpointController
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function EndpointController(connection) {
var application = require('./../../../index').application;
this.connection = connection;
this.view = this.name = 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 remove
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
ResourceEndpointController.prototype.remove = function(item, readyCallback) {
if (this.model){
this.model.remove(item, function(err, removed) {
if (err) {
this.connection.die(500);
- 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 initialize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
config.initialize = _.once(function() {
var path = require('path');
var fs = require('fs-extra');
var moddir = path.resolve(path.dirname(module.filename), '..');
var cwd = process.cwd();
- 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"