CleverStack/cleverstack-cli

View on GitHub

Showing 60 of 84 total issues

Function eachFile has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            function eachFile(dir, __next) {
              var _files        = []
                , templateHome  = paths.getTemplatePath(project, tmpl)
                , finder        = require('findit')(templateHome);

Severity: Minor
Found in lib/generate/render.js - About 1 hr to fix

    Function scaffold has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports.scaffold = function(name, filterOut, fn) {
      name      = Array.isArray(name) ? name : [ name ];
      filterOut = Array.isArray(filterOut) ? filterOut : [];
    
      // Just for easability, we'll add an 's' to the end of the filters to cover a quasi-plural form
    Severity: Minor
    Found in lib/generator.js - About 1 hr to fix

      Function findAvailableCommands has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

      exports.findAvailableCommands = function ( ) {
        return new Promise( function( resolve, reject ) {
          get()
            .then( function( locations ) {
              var useNPM    = false
      Severity: Minor
      Found in lib/util/locations.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 exports has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

      module.exports = function(Table, env, lib, repl, local) {
        function Commands() {
          this.help    = 'Lists all of the REPL commands';
          this.aliases = ['h', 'help'];
          this.table   = new Table({
      Severity: Minor
      Found in lib/repl/commands/commands.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 exports has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

      module.exports = function (thePath, program, cmd, args) {
        if (arguments.length < 4) {
          args    = cmd;
          cmd     = program;
          program = require(path.join(__dirname, 'program'));
      Severity: Minor
      Found in lib/command.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 install has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      exports.install = function(modulePath, options, fn) {
        var additionalOptions = [ ]
          , params = { cwd: modulePath };
      
        if (typeof options === 'function') {
      Severity: Minor
      Found in lib/util/bower.js - About 55 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 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      module.exports = function(Table, env, lib, repl, local, util, _) {
      Severity: Major
      Found in lib/repl/commands/models.js - About 50 mins to fix

        Function exports has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        module.exports = function(Table, env, lib, repl, local, util, _) {
        Severity: Major
        Found in lib/repl/commands/services.js - About 50 mins to fix

          Function generate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          exports.generate = function(project, tmpls, names, fn) {
            if (arguments.length < 4) {
              fn        = names;
              names     = tmpls;
              tmpls     = project;
          Severity: Minor
          Found in lib/generator.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 display has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          module.exports.display = function(repo) {
            var title = [ repo.name ];
            if (repo.version !== undefined) {
              title.push(colors.darkGray('@ ' + repo.version));
            }
          Severity: Minor
          Found in lib/repos.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 8 (exceeds 5 allowed). Consider refactoring.
          Open

          module.exports = function(env, lib, repl, local) {
            function ReplHistory() {
              this.help    = 'Shows command history';
          
              var maxSize  = 10240
          Severity: Minor
          Found in lib/repl/commands/history.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 get has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          var get = exports.get = function(pkg, url, dir) {
            if (arguments.length < 3) {
              var name = pkg.name.split('@')[ 0 ];
              dir = url;
              url = 'https://github.com/' + pkg.owner + '/' + name + '/archive/master.tar.gz';
          Severity: Minor
          Found in lib/packages.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

          Consider simplifying this complex logical expression.
          Open

                          if ( !!stats.isDirectory() ) {
                            var packageJson = fs.readdirSync( thePath ).indexOf( 'package.json' ) !== -1 ? require( path.resolve( [ thePath, 'package.json' ].join( path.sep ) ) ) : false
                              , isCleverStack = !!packageJson && !!packageJson.author && !!packageJson.author.name &&  packageJson.author.name.toLowerCase() === 'cleverstack'
                              , isNodeSeed = isCleverStack && packageJson.name === 'node-seed'
                              , isAngularSeed = isCleverStack && packageJson.name === 'angular-seed';
          Severity: Major
          Found in lib/util/locations.js - About 40 mins to fix

            Consider simplifying this complex logical expression.
            Open

                          if ( !!stats.isDirectory() ) {
                            var packageJson = fs.readdirSync( thePath ).indexOf( 'package.json' ) !== -1 ? require( path.resolve( [ thePath, 'package.json' ].join( path.sep ) ) ) : false
                              , isCleverStack = !!packageJson && !!packageJson.author && !!packageJson.author.name &&  packageJson.author.name.toLowerCase() === 'cleverstack'
                              , isNodeSeed = isCleverStack && packageJson.name === 'node-seed'
                              , isAngularSeed = isCleverStack && packageJson.name === 'angular-seed';
            Severity: Major
            Found in lib/util/locations.js - About 40 mins to fix

              Function exports has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              module.exports = function(Table, env, lib, repl, local) {
              Severity: Minor
              Found in lib/repl/commands/commands.js - About 35 mins to fix

                Function template has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                exports.template = function(dirs, names, tmpls, project, fn) {
                Severity: Minor
                Found in lib/generate/render.js - About 35 mins to fix

                  Function exports has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  module.exports = function(Table, env, lib, repl, local) {
                  Severity: Minor
                  Found in lib/repl/commands/modules.js - About 35 mins to fix

                    Function installFrontendModules has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                    var installFrontendModules = exports.installFrontendModules = function(location, packages) {
                      return new Promise(function(resolve, reject) {
                        async.eachSeries(
                          packages,
                          function(pkg, next) {
                    Severity: Minor
                    Found in lib/packages.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

                    Function installWithNpm has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                    exports.installWithNpm = function(location, packages) {
                      return new Promise(function(resolve, reject) {
                        async.each(
                          packages,
                          function(pkg, next) {
                    Severity: Minor
                    Found in lib/packages.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

                    Function exports has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    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';
                    Severity: Minor
                    Found in lib/repl/commands/services.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