Showing 11 of 15 total issues
Function exports
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports = module.exports = function (options) {
options = options || {};
var defaultResourceDir = path.join(process.cwd(), 'back/resources');
var defaultServiceDir = path.join(process.cwd(), 'back/services');
var viewDir = options.viewDir || path.join(process.cwd(), 'front');
Function show
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.show = function (command) {
var helpMsg = ['synth version ' + pkg.version, ''];
switch (command) {
case 'new':
Function index
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.index = function (req, res) {
var handler = req.handler,
dataPromise = Promise.cast(null),
htmlPromise = Promise.cast(null);
Function startServer
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.startServer = function (mode, port) {
var server;
var restarted = false;
var connections = [];
var serverRunning = false;
Function getComponentFiles
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
var getComponentFiles = exports.getComponentFiles = function (installed) {
var componentLists = {}, jsFiles, cssFiles;
var rootPath = '../bower_components/';
componentLists.jsFiles = jsFiles = [];
- 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 uninstall
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.uninstall = function (command, args) {
var nodeModuleIndex = args.indexOf('-b') + 1;
var bowerComponentIndex = args.indexOf('-f') + 1;
var both = !!(nodeModuleIndex && bowerComponentIndex);
Function applyTemplate
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function applyTemplate ( direction, template, dest ) {
var destDirection = (direction == 'root') ? '' : direction;
var appName = dest.replace(/.*\//g, '');
var templatePath = path.join(__dirname, '../templates', direction, template);
var destPath = path.join(dest, destDirection);
Function createNewApp
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.createNewApp = function (dirName) {
var args = nopt({
'front': String,
'back': String,
'root': String
Function init
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
var init = function (type) {
var filesRaw;
var relPath = path.join(cwd, 'front', type, type + 'Files');
if (initialized[type]) return;
Function startServer
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
exports.startServer = function (mode, port) {
var server;
var restarted = false;
var connections = [];
var serverRunning = false;
- 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 exports
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
exports = module.exports = function (options) {
options = options || {};
var defaultResourceDir = path.join(process.cwd(), 'back/resources');
var defaultServiceDir = path.join(process.cwd(), 'back/services');
var viewDir = options.viewDir || path.join(process.cwd(), 'front');
- 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"