Showing 60 of 84 total issues
Function find
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
Open
var find = exports.find = function() {
return new Promise( function( resolve, reject ) {
var cwd = process.cwd();
lib.utils.running( 'Finding seeds to target...' );
- 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 find
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var find = exports.find = function() {
return new Promise( function( resolve, reject ) {
var cwd = process.cwd();
lib.utils.running( 'Finding seeds to target...' );
Function installModule
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
Open
exports.installModule = function(project, modulePath) {
return new Promise(function(resolve, reject) {
var projectFolder = project.moduleDir
, moduleDir = path.join(project.moduleDir, project.modulePath)
, jsonPath = path.resolve(path.join(modulePath, 'package.json'))
- 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 installModule
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.installModule = function(project, modulePath) {
return new Promise(function(resolve, reject) {
var projectFolder = project.moduleDir
, moduleDir = path.join(project.moduleDir, project.modulePath)
, jsonPath = path.resolve(path.join(modulePath, 'package.json'))
Function exports
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(Table, env, lib, repl, local, util, _) {
var ormFuncs = [
'all', 'find', 'create', 'update', 'describe', 'findAll', 'findOrCreate',
'findAndCountAll', 'findAllJoin', 'findOrInitialize', 'findOrBuild', 'bulkCreate',
'destroy', 'aggregate', 'build', 'count', 'min', 'max'
Function exports
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(Table, env, lib, repl, local, util, _) {
var serviceFuncs = ['find', 'findAll', 'create', 'update', 'destroy'];
function Services() {
this.help = 'Lists all of the services within this project';
Function runTasks
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.runTasks = function(projectFolder, modulePath) {
return new Promise(function(resolve, reject) {
var originalCwd = process.cwd();
process.chdir(projectFolder);
Function installBackendModules
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function installBackendModules(backendPath, npm) {
return new Promise(function(resolve, reject) {
npm = npm.map(function(n) {
return n.name;
});
Function installBowerComponents
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.installBowerComponents = function(projectFolder) {
return new Promise(function(resolve, reject) {
var bowerRC = path.join(projectFolder.moduleDir, '.bowerrc')
, _bowerRC = fs.readFileSync(bowerRC);
Function template
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.template = function(dirs, names, tmpls, project, fn) {
var files = [];
async.each(
names,
Function install
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.install = function(modulePath, options, fn) {
var additionalOptions = [ ]
, params = { cwd: modulePath };
if (typeof options === 'function') {
Function reverseMatchIfStillNotFound
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function reverseMatchIfStillNotFound( list, callback ) {
var behind = cwd.split( path.sep )
, found = false
, newList = [];
Function findConfigAndVersionForModule
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.findConfigAndVersionForModule = function( locations, moduleName, moduleVersion, check ) {
return new Promise( function( resolve ) {
var _module = {};
Function install
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function install(repos) {
return new Promise(function(resolve, reject) {
util.locations
.findAvailableCommands()
.spread(function(locations) {
Function exports
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(env, lib, repl, local) {
function ReplHistory() {
this.help = 'Shows command history';
var maxSize = 10240
Function exports
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(Table, env, lib, repl, local) {
function Modules() {
this.help = 'Lists all of the modules within this project';
this.table = new Table({
head: [
Function Models
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Models() {
this.help = 'Lists all of the models within this project';
this.models = {};
this.table = new Table({
head: [
Function npmRegistry
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var searchNPMRegistry = exports.npmRegistry = function(queries) {
return new Promise(function(resolve, reject) {
var repos = [];
async.each(
Function exports
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (thePath, program, cmd, args) {
if (arguments.length < 4) {
args = cmd;
cmd = program;
program = require(path.join(__dirname, 'program'));
Function aggregate
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.aggregate = function(args) {
return new Promise(function(resolve, reject) {
var all = [];
utils.info(' Searching for modules...');