CleverStack/cleverstack-cli

View on GitHub

Showing 84 of 84 total issues

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

      Similar blocks of code found in 4 locations. Consider refactoring.
      Open

        Services.prototype.outputTable = function() {
          console.log(this.table.toString());
          return local.displayPrompt();
        };
      Severity: Major
      Found in lib/repl/commands/services.js and 3 other locations - About 50 mins to fix
      lib/repl/commands/commands.js on lines 40..43
      lib/repl/commands/models.js on lines 79..82
      lib/repl/commands/modules.js on lines 42..45

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 52.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 4 locations. Consider refactoring.
      Open

        Commands.prototype.outputTable = function() {
          console.log(this.table.toString());
          return local.displayPrompt();
        };
      Severity: Major
      Found in lib/repl/commands/commands.js and 3 other locations - About 50 mins to fix
      lib/repl/commands/models.js on lines 79..82
      lib/repl/commands/modules.js on lines 42..45
      lib/repl/commands/services.js on lines 69..72

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 52.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 4 locations. Consider refactoring.
      Open

        Models.prototype.outputTable = function() {
          console.log(this.table.toString());
          return local.displayPrompt();
        };
      Severity: Major
      Found in lib/repl/commands/models.js and 3 other locations - About 50 mins to fix
      lib/repl/commands/commands.js on lines 40..43
      lib/repl/commands/modules.js on lines 42..45
      lib/repl/commands/services.js on lines 69..72

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 52.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 4 locations. Consider refactoring.
      Open

        Modules.prototype.outputTable = function() {
          console.log(this.table.toString());
          return local.displayPrompt();
        };
      Severity: Major
      Found in lib/repl/commands/modules.js and 3 other locations - About 50 mins to fix
      lib/repl/commands/commands.js on lines 40..43
      lib/repl/commands/models.js on lines 79..82
      lib/repl/commands/services.js on lines 69..72

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 52.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      exports.expandProgress = function(amount) {
        if (undefined !== barItems.progress) {
          barItems.progress.max += amount;
        }
        return this;
      Severity: Minor
      Found in lib/utils.js and 1 other location - About 45 mins to fix
      lib/utils.js on lines 127..132

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 50.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      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

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      exports.installing = function(name) {
        if (undefined !== barItems.installing) {
          barItems.installing.text = name;
        }
        return this;
      Severity: Minor
      Found in lib/utils.js and 1 other location - About 45 mins to fix
      lib/utils.js on lines 149..154

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 50.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

              searchNPMRegistry(rows)
                .then(function(response) {
                  resolve(response);
                })
                .catch(function (err) {
      Severity: Minor
      Found in lib/search.js and 1 other location - About 40 mins to fix
      lib/search.js on lines 130..136

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 49.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

            searchNPMRegistry(queries)
              .then(function(res) {
                resolve(res);
              })
              .catch(function(err) {
      Severity: Minor
      Found in lib/search.js and 1 other location - About 40 mins to fix
      lib/search.js on lines 96..102

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 49.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      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

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                      var hasSubFolder    = tmpls.indexOf(dir.split(path.sep).splice(-2)[ 0 ]) > -1
                Severity: Minor
                Found in lib/generate/fs.js and 1 other location - About 30 mins to fix
                lib/generate/fs.js on lines 49..49

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 45.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Severity
                Category
                Status
                Source
                Language