JonAbrams/synth

View on GitHub

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');
Severity: Major
Found in synth.js - About 3 hrs to fix

    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':
    Severity: Major
    Found in lib/help.js - About 3 hrs to fix

      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);
      
      
      Severity: Minor
      Found in lib/frontendRenderer.js - About 1 hr to fix

        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;
        Severity: Minor
        Found in lib/commands.js - About 1 hr to fix

          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 = [];
          Severity: Minor
          Found in lib/bowerSupport.js - About 1 hr to fix

          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);
          
          
          Severity: Minor
          Found in lib/commands.js - About 1 hr to fix

            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);
            Severity: Minor
            Found in lib/commands.js - About 1 hr to fix

              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
              Severity: Minor
              Found in lib/commands.js - About 1 hr to fix

                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;
                Severity: Minor
                Found in lib/assets.js - About 1 hr to fix

                  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;
                  Severity: Minor
                  Found in lib/commands.js - About 45 mins to fix

                  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');
                  Severity: Minor
                  Found in synth.js - About 25 mins to fix

                  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

                  Severity
                  Category
                  Status
                  Source
                  Language